From 8087d8e3ee6de9c75a38c1ac41decb6f38684600 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 30 Nov 2023 16:55:17 +0000 Subject: [PATCH] CodeGen from PR 26531 in Azure/azure-rest-api-specs Merge 66462905173b76ec80763dfaf538de2f12e5902f into 6556dd83e0f2fd5b690010b15270eb9982ca6ca9 --- common/config/rush/pnpm-lock.yaml | 14 +- sdk/sphere/arm-sphere/CHANGELOG.md | 15 -- sdk/sphere/arm-sphere/_meta.json | 8 +- sdk/sphere/arm-sphere/assets.json | 6 - sdk/sphere/arm-sphere/package.json | 24 ++- .../samples-dev/catalogsCountDevicesSample.ts | 43 ----- .../catalogsCreateOrUpdateSample.ts | 45 ------ .../samples-dev/catalogsDeleteSample.ts | 43 ----- .../samples-dev/catalogsGetSample.ts | 40 ----- .../catalogsListByResourceGroupSample.ts | 44 ------ .../catalogsListBySubscriptionSample.ts | 40 ----- .../catalogsListDeploymentsSample.ts | 46 ------ .../catalogsListDeviceGroupsSample.ts | 53 ------- .../catalogsListDeviceInsightsSample.ts | 52 ------ .../samples-dev/catalogsListDevicesSample.ts | 46 ------ .../samples-dev/catalogsUpdateSample.ts | 45 ------ .../samples-dev/certificatesGetSample.ts | 45 ------ .../certificatesListByCatalogSample.ts | 46 ------ .../certificatesRetrieveCertChainSample.ts | 45 ------ ...tesRetrieveProofOfPossessionNonceSample.ts | 52 ------ .../deploymentsCreateOrUpdateSample.ts | 51 ------ .../samples-dev/deploymentsDeleteSample.ts | 49 ------ .../samples-dev/deploymentsGetSample.ts | 49 ------ .../deploymentsListByDeviceGroupSample.ts | 50 ------ .../deviceGroupsClaimDevicesSample.ts | 56 ------- .../deviceGroupsCountDevicesSample.ts | 47 ------ .../deviceGroupsCreateOrUpdateSample.ts | 53 ------- .../samples-dev/deviceGroupsDeleteSample.ts | 47 ------ .../samples-dev/deviceGroupsGetSample.ts | 47 ------ .../deviceGroupsListByProductSample.ts | 48 ------ .../samples-dev/deviceGroupsUpdateSample.ts | 52 ------ .../devicesCreateOrUpdateSample.ts | 52 ------ .../samples-dev/devicesDeleteSample.ts | 50 ------ .../devicesGenerateCapabilityImageSample.ts | 57 ------- .../samples-dev/devicesGetSample.ts | 50 ------ .../devicesListByDeviceGroupSample.ts | 50 ------ .../samples-dev/devicesUpdateSample.ts | 52 ------ .../samples-dev/imagesCreateOrUpdateSample.ts | 47 ------ .../samples-dev/imagesDeleteSample.ts | 45 ------ .../arm-sphere/samples-dev/imagesGetSample.ts | 45 ------ .../samples-dev/imagesListByCatalogSample.ts | 46 ------ .../samples-dev/operationsListSample.ts | 40 ----- .../samples-dev/productsCountDevicesSample.ts | 45 ------ .../productsCreateOrUpdateSample.ts | 47 ------ .../samples-dev/productsDeleteSample.ts | 45 ------ ...oductsGenerateDefaultDeviceGroupsSample.ts | 48 ------ .../samples-dev/productsGetSample.ts | 45 ------ .../productsListByCatalogSample.ts | 46 ------ .../samples-dev/productsUpdateSample.ts | 47 ------ .../samples/v1-beta/javascript/README.md | 136 ---------------- .../javascript/catalogsCountDevicesSample.js | 36 ----- .../catalogsCreateOrUpdateSample.js | 41 ----- .../javascript/catalogsDeleteSample.js | 36 ----- .../v1-beta/javascript/catalogsGetSample.js | 36 ----- .../catalogsListByResourceGroupSample.js | 38 ----- .../catalogsListBySubscriptionSample.js | 37 ----- .../catalogsListDeploymentsSample.js | 39 ----- .../catalogsListDeviceGroupsSample.js | 46 ------ .../catalogsListDeviceInsightsSample.js | 45 ------ .../javascript/catalogsListDevicesSample.js | 39 ----- .../javascript/catalogsUpdateSample.js | 37 ----- .../javascript/certificatesGetSample.js | 37 ----- .../certificatesListByCatalogSample.js | 39 ----- .../certificatesRetrieveCertChainSample.js | 41 ----- ...tesRetrieveProofOfPossessionNonceSample.js | 45 ------ .../deploymentsCreateOrUpdateSample.js | 47 ------ .../javascript/deploymentsDeleteSample.js | 45 ------ .../javascript/deploymentsGetSample.js | 45 ------ .../deploymentsListByDeviceGroupSample.js | 46 ------ .../deviceGroupsClaimDevicesSample.js | 49 ------ .../deviceGroupsCountDevicesSample.js | 43 ----- .../deviceGroupsCreateOrUpdateSample.js | 49 ------ .../javascript/deviceGroupsDeleteSample.js | 43 ----- .../javascript/deviceGroupsGetSample.js | 43 ----- .../deviceGroupsListByProductSample.js | 44 ------ .../javascript/deviceGroupsUpdateSample.js | 45 ------ .../javascript/devicesCreateOrUpdateSample.js | 48 ------ .../v1-beta/javascript/devicesDeleteSample.js | 46 ------ .../devicesGenerateCapabilityImageSample.js | 50 ------ .../v1-beta/javascript/devicesGetSample.js | 46 ------ .../devicesListByDeviceGroupSample.js | 46 ------ .../v1-beta/javascript/devicesUpdateSample.js | 48 ------ .../javascript/imagesCreateOrUpdateSample.js | 43 ----- .../v1-beta/javascript/imagesDeleteSample.js | 37 ----- .../v1-beta/javascript/imagesGetSample.js | 37 ----- .../javascript/imagesListByCatalogSample.js | 39 ----- .../javascript/operationsListSample.js | 37 ----- .../samples/v1-beta/javascript/package.json | 32 ---- .../javascript/productsCountDevicesSample.js | 37 ----- .../productsCreateOrUpdateSample.js | 43 ----- .../javascript/productsDeleteSample.js | 41 ----- ...oductsGenerateDefaultDeviceGroupsSample.js | 44 ------ .../v1-beta/javascript/productsGetSample.js | 37 ----- .../javascript/productsListByCatalogSample.js | 39 ----- .../javascript/productsUpdateSample.js | 43 ----- .../samples/v1-beta/javascript/sample.env | 4 - .../samples/v1-beta/typescript/README.md | 149 ------------------ .../samples/v1-beta/typescript/package.json | 41 ----- .../samples/v1-beta/typescript/sample.env | 4 - .../src/catalogsCountDevicesSample.ts | 43 ----- .../src/catalogsCreateOrUpdateSample.ts | 45 ------ .../typescript/src/catalogsDeleteSample.ts | 43 ----- .../typescript/src/catalogsGetSample.ts | 40 ----- .../src/catalogsListByResourceGroupSample.ts | 44 ------ .../src/catalogsListBySubscriptionSample.ts | 40 ----- .../src/catalogsListDeploymentsSample.ts | 46 ------ .../src/catalogsListDeviceGroupsSample.ts | 53 ------- .../src/catalogsListDeviceInsightsSample.ts | 52 ------ .../src/catalogsListDevicesSample.ts | 46 ------ .../typescript/src/catalogsUpdateSample.ts | 45 ------ .../typescript/src/certificatesGetSample.ts | 45 ------ .../src/certificatesListByCatalogSample.ts | 46 ------ .../certificatesRetrieveCertChainSample.ts | 45 ------ ...tesRetrieveProofOfPossessionNonceSample.ts | 52 ------ .../src/deploymentsCreateOrUpdateSample.ts | 51 ------ .../typescript/src/deploymentsDeleteSample.ts | 49 ------ .../typescript/src/deploymentsGetSample.ts | 49 ------ .../src/deploymentsListByDeviceGroupSample.ts | 50 ------ .../src/deviceGroupsClaimDevicesSample.ts | 56 ------- .../src/deviceGroupsCountDevicesSample.ts | 47 ------ .../src/deviceGroupsCreateOrUpdateSample.ts | 53 ------- .../src/deviceGroupsDeleteSample.ts | 47 ------ .../typescript/src/deviceGroupsGetSample.ts | 47 ------ .../src/deviceGroupsListByProductSample.ts | 48 ------ .../src/deviceGroupsUpdateSample.ts | 52 ------ .../src/devicesCreateOrUpdateSample.ts | 52 ------ .../typescript/src/devicesDeleteSample.ts | 50 ------ .../devicesGenerateCapabilityImageSample.ts | 57 ------- .../typescript/src/devicesGetSample.ts | 50 ------ .../src/devicesListByDeviceGroupSample.ts | 50 ------ .../typescript/src/devicesUpdateSample.ts | 52 ------ .../src/imagesCreateOrUpdateSample.ts | 47 ------ .../typescript/src/imagesDeleteSample.ts | 45 ------ .../v1-beta/typescript/src/imagesGetSample.ts | 45 ------ .../src/imagesListByCatalogSample.ts | 46 ------ .../typescript/src/operationsListSample.ts | 40 ----- .../src/productsCountDevicesSample.ts | 45 ------ .../src/productsCreateOrUpdateSample.ts | 47 ------ .../typescript/src/productsDeleteSample.ts | 45 ------ ...oductsGenerateDefaultDeviceGroupsSample.ts | 48 ------ .../typescript/src/productsGetSample.ts | 45 ------ .../src/productsListByCatalogSample.ts | 46 ------ .../typescript/src/productsUpdateSample.ts | 47 ------ .../samples/v1-beta/typescript/tsconfig.json | 17 -- .../arm-sphere/src/operations/images.ts | 10 +- .../src/operationsInterfaces/images.ts | 10 +- sdk/sphere/arm-sphere/test/sampleTest.ts | 43 +++++ .../test/sphere_operations_test.spec.ts | 101 ------------ sdk/sphere/arm-sphere/tsconfig.json | 10 +- 149 files changed, 76 insertions(+), 6582 deletions(-) delete mode 100644 sdk/sphere/arm-sphere/CHANGELOG.md delete mode 100644 sdk/sphere/arm-sphere/assets.json delete mode 100644 sdk/sphere/arm-sphere/samples-dev/catalogsCountDevicesSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/catalogsCreateOrUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/catalogsDeleteSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/catalogsGetSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/catalogsListByResourceGroupSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/catalogsListBySubscriptionSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/catalogsListDeploymentsSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/catalogsListDeviceGroupsSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/catalogsListDeviceInsightsSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/catalogsListDevicesSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/catalogsUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/certificatesGetSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/certificatesListByCatalogSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/certificatesRetrieveCertChainSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/certificatesRetrieveProofOfPossessionNonceSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/deploymentsCreateOrUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/deploymentsDeleteSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/deploymentsGetSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/deploymentsListByDeviceGroupSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/deviceGroupsClaimDevicesSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/deviceGroupsCountDevicesSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/deviceGroupsCreateOrUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/deviceGroupsDeleteSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/deviceGroupsGetSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/deviceGroupsListByProductSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/deviceGroupsUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/devicesCreateOrUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/devicesDeleteSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/devicesGenerateCapabilityImageSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/devicesGetSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/devicesListByDeviceGroupSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/devicesUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/imagesCreateOrUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/imagesDeleteSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/imagesGetSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/imagesListByCatalogSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/operationsListSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/productsCountDevicesSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/productsCreateOrUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/productsDeleteSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/productsGenerateDefaultDeviceGroupsSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/productsGetSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/productsListByCatalogSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples-dev/productsUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/README.md delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsCountDevicesSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsCreateOrUpdateSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsDeleteSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsGetSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListByResourceGroupSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListBySubscriptionSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDeploymentsSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDeviceGroupsSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDeviceInsightsSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDevicesSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsUpdateSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesGetSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesListByCatalogSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesRetrieveCertChainSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesRetrieveProofOfPossessionNonceSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsCreateOrUpdateSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsDeleteSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsGetSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsListByDeviceGroupSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsClaimDevicesSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsCountDevicesSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsCreateOrUpdateSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsDeleteSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsGetSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsListByProductSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsUpdateSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesCreateOrUpdateSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesDeleteSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesGenerateCapabilityImageSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesGetSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesListByDeviceGroupSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesUpdateSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesCreateOrUpdateSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesDeleteSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesGetSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesListByCatalogSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/operationsListSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/package.json delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsCountDevicesSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsCreateOrUpdateSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsDeleteSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsGenerateDefaultDeviceGroupsSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsGetSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsListByCatalogSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsUpdateSample.js delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/javascript/sample.env delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/README.md delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/package.json delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/sample.env delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsCountDevicesSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsCreateOrUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsDeleteSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsGetSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListByResourceGroupSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListBySubscriptionSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDeploymentsSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDeviceGroupsSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDeviceInsightsSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDevicesSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesGetSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesListByCatalogSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesRetrieveCertChainSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesRetrieveProofOfPossessionNonceSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsCreateOrUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsDeleteSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsGetSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsListByDeviceGroupSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsClaimDevicesSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsCountDevicesSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsCreateOrUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsDeleteSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsGetSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsListByProductSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesCreateOrUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesDeleteSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesGenerateCapabilityImageSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesGetSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesListByDeviceGroupSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesCreateOrUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesDeleteSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesGetSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesListByCatalogSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/operationsListSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsCountDevicesSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsCreateOrUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsDeleteSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsGenerateDefaultDeviceGroupsSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsGetSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsListByCatalogSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsUpdateSample.ts delete mode 100644 sdk/sphere/arm-sphere/samples/v1-beta/typescript/tsconfig.json create mode 100644 sdk/sphere/arm-sphere/test/sampleTest.ts delete mode 100644 sdk/sphere/arm-sphere/test/sphere_operations_test.spec.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 4f4b36db239c..68ae334190b7 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -4529,7 +4529,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.4.0-dev.20231129 + typescript: 5.4.0-dev.20231130 dev: false /downlevel-dts@0.11.0: @@ -4538,7 +4538,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.4.0-dev.20231129 + typescript: 5.4.0-dev.20231130 dev: false /eastasianwidth@0.2.0: @@ -9324,8 +9324,8 @@ packages: hasBin: true dev: false - /typescript@5.4.0-dev.20231129: - resolution: {integrity: sha512-ff8qrYy50SbFp5yGxTKA4xnG/lyUm73GPKWNMYvigDEcwHbOq0ArkvGaHn4EIk6ina1ggsrLVIbBtyhhy2szVA==} + /typescript@5.4.0-dev.20231130: + resolution: {integrity: sha512-YDc4V66/MiOKq3LZh7onu6+VNKqQZrvzQEKAbWCjSmlVeK8TYEPYlbTmYFJvKbqDHwrxGBayl3egTG/IzyxZMQ==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -15733,7 +15733,7 @@ packages: dev: false file:projects/arm-sphere.tgz: - resolution: {integrity: sha512-fRlA4jVRlu3pQ7HkwWVRTYCd0msB20m8xc7HWe8YB2VDC3dppNRoh2Jo0PDA4Lw7afxchBQA+oj/NoOu0+amOw==, tarball: file:projects/arm-sphere.tgz} + resolution: {integrity: sha512-zKYG0MIcLmbIPLpMQUg/IGHkqmkgVWFxRGHPLCXLkUbUyrTTBxw1ZFGvGAjfia3yIjV5Pr4uM8kkhVvB5OziqA==, tarball: file:projects/arm-sphere.tgz} name: '@rush-temp/arm-sphere' version: 0.0.0 dependencies: @@ -15741,13 +15741,15 @@ packages: '@azure/identity': 3.4.1 '@microsoft/api-extractor': 7.38.3(@types/node@18.18.9) '@types/chai': 4.3.10 + '@types/mocha': 10.0.4 '@types/node': 18.18.9 chai: 4.3.10 cross-env: 7.0.3 dotenv: 16.3.1 + esm: 3.2.25 mkdirp: 2.1.6 mocha: 10.2.0 - rimraf: 3.0.2 + rimraf: 5.0.5 ts-node: 10.9.1(@types/node@18.18.9)(typescript@5.2.2) tslib: 2.6.2 typescript: 5.2.2 diff --git a/sdk/sphere/arm-sphere/CHANGELOG.md b/sdk/sphere/arm-sphere/CHANGELOG.md deleted file mode 100644 index 6828f71b6541..000000000000 --- a/sdk/sphere/arm-sphere/CHANGELOG.md +++ /dev/null @@ -1,15 +0,0 @@ -# Release History - -## 1.0.0-beta.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - -## 1.0.0-beta.1 (2023-07-28) - -The package of @azure/arm-sphere is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart ). diff --git a/sdk/sphere/arm-sphere/_meta.json b/sdk/sphere/arm-sphere/_meta.json index 410d205f4241..772e2eaba3c1 100644 --- a/sdk/sphere/arm-sphere/_meta.json +++ b/sdk/sphere/arm-sphere/_meta.json @@ -1,8 +1,8 @@ { - "commit": "f7a4b3be4d6f953d4048f672a24046cbac1ecad9", + "commit": "6e02f374f022d60f4716230683bf28eb86ca3e74", "readme": "specification/sphere/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\sphere\\resource-manager\\readme.md --use=@autorest/typescript@6.0.5 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/sphere/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.0", - "use": "@autorest/typescript@6.0.5" + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.4", + "use": "@autorest/typescript@^6.0.12" } \ No newline at end of file diff --git a/sdk/sphere/arm-sphere/assets.json b/sdk/sphere/arm-sphere/assets.json deleted file mode 100644 index 648686d37799..000000000000 --- a/sdk/sphere/arm-sphere/assets.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "AssetsRepo": "Azure/azure-sdk-assets", - "AssetsRepoPrefixPath": "js", - "TagPrefix": "js/sphere/arm-sphere", - "Tag": "js/sphere/arm-sphere_ee61f000b6" -} diff --git a/sdk/sphere/arm-sphere/package.json b/sdk/sphere/arm-sphere/package.json index 30ff3e07f856..2eec2cb2d9cf 100644 --- a/sdk/sphere/arm-sphere/package.json +++ b/sdk/sphere/arm-sphere/package.json @@ -8,12 +8,12 @@ "node": ">=18.0.0" }, "dependencies": { - "@azure/core-lro": "^2.5.3", + "@azure/core-lro": "^2.5.4", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", "@azure/core-client": "^1.7.0", "@azure/core-auth": "^1.3.0", - "@azure/core-rest-pipeline": "^1.8.0", + "@azure/core-rest-pipeline": "^1.12.0", "tslib": "^2.2.0" }, "keywords": [ @@ -32,17 +32,19 @@ "mkdirp": "^2.1.2", "typescript": "~5.2.0", "uglify-js": "^3.4.9", - "rimraf": "^3.0.0", + "rimraf": "^5.0.0", "dotenv": "^16.0.0", + "@azure/dev-tool": "^1.0.0", "@azure/identity": "^3.3.0", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", "mocha": "^10.0.0", + "@types/mocha": "^10.0.0", + "esm": "^3.2.18", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", "@types/node": "^18.0.0", - "@azure/dev-tool": "^1.0.0", "ts-node": "^10.0.0" }, "repository": { @@ -77,7 +79,7 @@ "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", + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", "build:browser": "echo skipped", "build:test": "echo skipped", @@ -105,13 +107,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/sphere/arm-sphere", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-sphere?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/sphere/arm-sphere" +} \ No newline at end of file diff --git a/sdk/sphere/arm-sphere/samples-dev/catalogsCountDevicesSample.ts b/sdk/sphere/arm-sphere/samples-dev/catalogsCountDevicesSample.ts deleted file mode 100644 index 6d6704d34802..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/catalogsCountDevicesSample.ts +++ /dev/null @@ -1,43 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Counts devices in catalog. - * - * @summary Counts devices in catalog. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesCatalog.json - */ -async function catalogsCountDevices() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.catalogs.countDevices( - resourceGroupName, - catalogName - ); - console.log(result); -} - -async function main() { - catalogsCountDevices(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/catalogsCreateOrUpdateSample.ts b/sdk/sphere/arm-sphere/samples-dev/catalogsCreateOrUpdateSample.ts deleted file mode 100644 index 1a7d185f7ba5..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/catalogsCreateOrUpdateSample.ts +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Catalog, AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a Catalog - * - * @summary Create a Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutCatalog.json - */ -async function catalogsCreateOrUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const resource: Catalog = { location: "global" }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.catalogs.beginCreateOrUpdateAndWait( - resourceGroupName, - catalogName, - resource - ); - console.log(result); -} - -async function main() { - catalogsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/catalogsDeleteSample.ts b/sdk/sphere/arm-sphere/samples-dev/catalogsDeleteSample.ts deleted file mode 100644 index 1b5640eabbe4..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/catalogsDeleteSample.ts +++ /dev/null @@ -1,43 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a Catalog - * - * @summary Delete a Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteCatalog.json - */ -async function catalogsDelete() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.catalogs.beginDeleteAndWait( - resourceGroupName, - catalogName - ); - console.log(result); -} - -async function main() { - catalogsDelete(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/catalogsGetSample.ts b/sdk/sphere/arm-sphere/samples-dev/catalogsGetSample.ts deleted file mode 100644 index 3eb9cfd92640..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/catalogsGetSample.ts +++ /dev/null @@ -1,40 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a Catalog - * - * @summary Get a Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalog.json - */ -async function catalogsGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.catalogs.get(resourceGroupName, catalogName); - console.log(result); -} - -async function main() { - catalogsGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/catalogsListByResourceGroupSample.ts b/sdk/sphere/arm-sphere/samples-dev/catalogsListByResourceGroupSample.ts deleted file mode 100644 index f8267ed12248..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/catalogsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Catalog resources by resource group - * - * @summary List Catalog resources by resource group - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalogsRG.json - */ -async function catalogsListByResourceGroup() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.catalogs.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - catalogsListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/catalogsListBySubscriptionSample.ts b/sdk/sphere/arm-sphere/samples-dev/catalogsListBySubscriptionSample.ts deleted file mode 100644 index 7356f838c590..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/catalogsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Catalog resources by subscription ID - * - * @summary List Catalog resources by subscription ID - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalogsSub.json - */ -async function catalogsListBySubscription() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.catalogs.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - catalogsListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/catalogsListDeploymentsSample.ts b/sdk/sphere/arm-sphere/samples-dev/catalogsListDeploymentsSample.ts deleted file mode 100644 index 68848dfe97be..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/catalogsListDeploymentsSample.ts +++ /dev/null @@ -1,46 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists deployments for catalog. - * - * @summary Lists deployments for catalog. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeploymentsByCatalog.json - */ -async function catalogsListDeployments() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.catalogs.listDeployments( - resourceGroupName, - catalogName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - catalogsListDeployments(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/catalogsListDeviceGroupsSample.ts b/sdk/sphere/arm-sphere/samples-dev/catalogsListDeviceGroupsSample.ts deleted file mode 100644 index 918a1c11d442..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/catalogsListDeviceGroupsSample.ts +++ /dev/null @@ -1,53 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ListDeviceGroupsRequest, - AzureSphereManagementClient -} from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the device groups for the catalog. - * - * @summary List the device groups for the catalog. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeviceGroupsCatalog.json - */ -async function catalogsListDeviceGroups() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const listDeviceGroupsRequest: ListDeviceGroupsRequest = { - deviceGroupName: "MyDeviceGroup1" - }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.catalogs.listDeviceGroups( - resourceGroupName, - catalogName, - listDeviceGroupsRequest - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - catalogsListDeviceGroups(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/catalogsListDeviceInsightsSample.ts b/sdk/sphere/arm-sphere/samples-dev/catalogsListDeviceInsightsSample.ts deleted file mode 100644 index b11b70d1b0bb..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/catalogsListDeviceInsightsSample.ts +++ /dev/null @@ -1,52 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CatalogsListDeviceInsightsOptionalParams, - AzureSphereManagementClient -} from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists device insights for catalog. - * - * @summary Lists device insights for catalog. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeviceInsightsCatalog.json - */ -async function catalogsListDeviceInsights() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const top = 10; - const options: CatalogsListDeviceInsightsOptionalParams = { top }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.catalogs.listDeviceInsights( - resourceGroupName, - catalogName, - options - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - catalogsListDeviceInsights(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/catalogsListDevicesSample.ts b/sdk/sphere/arm-sphere/samples-dev/catalogsListDevicesSample.ts deleted file mode 100644 index 88cbfdcf8a0b..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/catalogsListDevicesSample.ts +++ /dev/null @@ -1,46 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists devices for catalog. - * - * @summary Lists devices for catalog. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDevicesByCatalog.json - */ -async function catalogsListDevices() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.catalogs.listDevices( - resourceGroupName, - catalogName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - catalogsListDevices(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/catalogsUpdateSample.ts b/sdk/sphere/arm-sphere/samples-dev/catalogsUpdateSample.ts deleted file mode 100644 index b01df2c97d51..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/catalogsUpdateSample.ts +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { CatalogUpdate, AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a Catalog - * - * @summary Update a Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchCatalog.json - */ -async function catalogsUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const properties: CatalogUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.catalogs.update( - resourceGroupName, - catalogName, - properties - ); - console.log(result); -} - -async function main() { - catalogsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/certificatesGetSample.ts b/sdk/sphere/arm-sphere/samples-dev/certificatesGetSample.ts deleted file mode 100644 index 3fe0a7109e10..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/certificatesGetSample.ts +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a Certificate - * - * @summary Get a Certificate - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCertificate.json - */ -async function certificatesGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const serialNumber = "default"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.certificates.get( - resourceGroupName, - catalogName, - serialNumber - ); - console.log(result); -} - -async function main() { - certificatesGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/certificatesListByCatalogSample.ts b/sdk/sphere/arm-sphere/samples-dev/certificatesListByCatalogSample.ts deleted file mode 100644 index 603c0717d598..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/certificatesListByCatalogSample.ts +++ /dev/null @@ -1,46 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Certificate resources by Catalog - * - * @summary List Certificate resources by Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCertificates.json - */ -async function certificatesListByCatalog() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.certificates.listByCatalog( - resourceGroupName, - catalogName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - certificatesListByCatalog(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/certificatesRetrieveCertChainSample.ts b/sdk/sphere/arm-sphere/samples-dev/certificatesRetrieveCertChainSample.ts deleted file mode 100644 index e73101213102..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/certificatesRetrieveCertChainSample.ts +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieves cert chain. - * - * @summary Retrieves cert chain. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostRetrieveCatalogCertChain.json - */ -async function certificatesRetrieveCertChain() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const serialNumber = "active"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.certificates.retrieveCertChain( - resourceGroupName, - catalogName, - serialNumber - ); - console.log(result); -} - -async function main() { - certificatesRetrieveCertChain(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/certificatesRetrieveProofOfPossessionNonceSample.ts b/sdk/sphere/arm-sphere/samples-dev/certificatesRetrieveProofOfPossessionNonceSample.ts deleted file mode 100644 index 62e9702c962c..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/certificatesRetrieveProofOfPossessionNonceSample.ts +++ /dev/null @@ -1,52 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ProofOfPossessionNonceRequest, - AzureSphereManagementClient -} from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the proof of possession nonce. - * - * @summary Gets the proof of possession nonce. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostRetrieveProofOfPossessionNonce.json - */ -async function certificatesRetrieveProofOfPossessionNonce() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const serialNumber = "active"; - const proofOfPossessionNonceRequest: ProofOfPossessionNonceRequest = { - proofOfPossessionNonce: "proofOfPossessionNonce" - }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.certificates.retrieveProofOfPossessionNonce( - resourceGroupName, - catalogName, - serialNumber, - proofOfPossessionNonceRequest - ); - console.log(result); -} - -async function main() { - certificatesRetrieveProofOfPossessionNonce(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/deploymentsCreateOrUpdateSample.ts b/sdk/sphere/arm-sphere/samples-dev/deploymentsCreateOrUpdateSample.ts deleted file mode 100644 index 56162580d32b..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/deploymentsCreateOrUpdateSample.ts +++ /dev/null @@ -1,51 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Deployment, AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDeployment.json - */ -async function deploymentsCreateOrUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const deploymentName = "MyDeployment1"; - const resource: Deployment = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deploymentName, - resource - ); - console.log(result); -} - -async function main() { - deploymentsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/deploymentsDeleteSample.ts b/sdk/sphere/arm-sphere/samples-dev/deploymentsDeleteSample.ts deleted file mode 100644 index a03340eb1dee..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/deploymentsDeleteSample.ts +++ /dev/null @@ -1,49 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDeployment.json - */ -async function deploymentsDelete() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProductName1"; - const deviceGroupName = "DeviceGroupName1"; - const deploymentName = "MyDeploymentName1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deployments.beginDeleteAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deploymentName - ); - console.log(result); -} - -async function main() { - deploymentsDelete(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/deploymentsGetSample.ts b/sdk/sphere/arm-sphere/samples-dev/deploymentsGetSample.ts deleted file mode 100644 index 239da35d24bb..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/deploymentsGetSample.ts +++ /dev/null @@ -1,49 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeployment.json - */ -async function deploymentsGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const deploymentName = "MyDeployment1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deployments.get( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deploymentName - ); - console.log(result); -} - -async function main() { - deploymentsGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/deploymentsListByDeviceGroupSample.ts b/sdk/sphere/arm-sphere/samples-dev/deploymentsListByDeviceGroupSample.ts deleted file mode 100644 index 6fe255df070b..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/deploymentsListByDeviceGroupSample.ts +++ /dev/null @@ -1,50 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeployments.json - */ -async function deploymentsListByDeviceGroup() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.deployments.listByDeviceGroup( - resourceGroupName, - catalogName, - productName, - deviceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - deploymentsListByDeviceGroup(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/deviceGroupsClaimDevicesSample.ts b/sdk/sphere/arm-sphere/samples-dev/deviceGroupsClaimDevicesSample.ts deleted file mode 100644 index ea044100279c..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/deviceGroupsClaimDevicesSample.ts +++ /dev/null @@ -1,56 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ClaimDevicesRequest, - AzureSphereManagementClient -} from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk claiming devices to a catalog only. - * - * @summary Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk claiming devices to a catalog only. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostClaimDevices.json - */ -async function deviceGroupsClaimDevices() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const claimDevicesRequest: ClaimDevicesRequest = { - deviceIdentifiers: [ - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - ] - }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deviceGroups.beginClaimDevicesAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - claimDevicesRequest - ); - console.log(result); -} - -async function main() { - deviceGroupsClaimDevices(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/deviceGroupsCountDevicesSample.ts b/sdk/sphere/arm-sphere/samples-dev/deviceGroupsCountDevicesSample.ts deleted file mode 100644 index 9a35456c540e..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/deviceGroupsCountDevicesSample.ts +++ /dev/null @@ -1,47 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesDeviceGroup.json - */ -async function deviceGroupsCountDevices() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deviceGroups.countDevices( - resourceGroupName, - catalogName, - productName, - deviceGroupName - ); - console.log(result); -} - -async function main() { - deviceGroupsCountDevices(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/deviceGroupsCreateOrUpdateSample.ts b/sdk/sphere/arm-sphere/samples-dev/deviceGroupsCreateOrUpdateSample.ts deleted file mode 100644 index 917004d39bbd..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/deviceGroupsCreateOrUpdateSample.ts +++ /dev/null @@ -1,53 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DeviceGroup, AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDeviceGroup.json - */ -async function deviceGroupsCreateOrUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const resource: DeviceGroup = { - description: "Description for MyDeviceGroup1", - osFeedType: "Retail", - updatePolicy: "UpdateAll" - }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deviceGroups.beginCreateOrUpdateAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - resource - ); - console.log(result); -} - -async function main() { - deviceGroupsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/deviceGroupsDeleteSample.ts b/sdk/sphere/arm-sphere/samples-dev/deviceGroupsDeleteSample.ts deleted file mode 100644 index 88da85c31cfd..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/deviceGroupsDeleteSample.ts +++ /dev/null @@ -1,47 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDeviceGroup.json - */ -async function deviceGroupsDelete() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deviceGroups.beginDeleteAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName - ); - console.log(result); -} - -async function main() { - deviceGroupsDelete(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/deviceGroupsGetSample.ts b/sdk/sphere/arm-sphere/samples-dev/deviceGroupsGetSample.ts deleted file mode 100644 index 4bd2dbf1fb69..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/deviceGroupsGetSample.ts +++ /dev/null @@ -1,47 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeviceGroup.json - */ -async function deviceGroupsGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deviceGroups.get( - resourceGroupName, - catalogName, - productName, - deviceGroupName - ); - console.log(result); -} - -async function main() { - deviceGroupsGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/deviceGroupsListByProductSample.ts b/sdk/sphere/arm-sphere/samples-dev/deviceGroupsListByProductSample.ts deleted file mode 100644 index f8f98b04ded5..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/deviceGroupsListByProductSample.ts +++ /dev/null @@ -1,48 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @summary List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeviceGroups.json - */ -async function deviceGroupsListByProduct() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.deviceGroups.listByProduct( - resourceGroupName, - catalogName, - productName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - deviceGroupsListByProduct(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/deviceGroupsUpdateSample.ts b/sdk/sphere/arm-sphere/samples-dev/deviceGroupsUpdateSample.ts deleted file mode 100644 index e214c12869f3..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/deviceGroupsUpdateSample.ts +++ /dev/null @@ -1,52 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DeviceGroupUpdate, - AzureSphereManagementClient -} from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchDeviceGroup.json - */ -async function deviceGroupsUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const properties: DeviceGroupUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deviceGroups.beginUpdateAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - properties - ); - console.log(result); -} - -async function main() { - deviceGroupsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/devicesCreateOrUpdateSample.ts b/sdk/sphere/arm-sphere/samples-dev/devicesCreateOrUpdateSample.ts deleted file mode 100644 index 83d7dc418589..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/devicesCreateOrUpdateSample.ts +++ /dev/null @@ -1,52 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Device, AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the catalog only. - * - * @summary Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the catalog only. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDevice.json - */ -async function devicesCreateOrUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const deviceName = - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - const resource: Device = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.devices.beginCreateOrUpdateAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - resource - ); - console.log(result); -} - -async function main() { - devicesCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/devicesDeleteSample.ts b/sdk/sphere/arm-sphere/samples-dev/devicesDeleteSample.ts deleted file mode 100644 index 2cc50057e5a7..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/devicesDeleteSample.ts +++ /dev/null @@ -1,50 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a Device - * - * @summary Delete a Device - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDevice.json - */ -async function devicesDelete() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProductName1"; - const deviceGroupName = "DeviceGroupName1"; - const deviceName = - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.devices.beginDeleteAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName - ); - console.log(result); -} - -async function main() { - devicesDelete(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/devicesGenerateCapabilityImageSample.ts b/sdk/sphere/arm-sphere/samples-dev/devicesGenerateCapabilityImageSample.ts deleted file mode 100644 index 0b8aa2bbf895..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/devicesGenerateCapabilityImageSample.ts +++ /dev/null @@ -1,57 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - GenerateCapabilityImageRequest, - AzureSphereManagementClient -} from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product names to generate the image for a device that does not belong to a specific device group and product. - * - * @summary Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product names to generate the image for a device that does not belong to a specific device group and product. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostGenerateDeviceCapabilityImage.json - */ -async function devicesGenerateCapabilityImage() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const deviceName = - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - const generateDeviceCapabilityRequest: GenerateCapabilityImageRequest = { - capabilities: ["ApplicationDevelopment"] - }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.devices.beginGenerateCapabilityImageAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - generateDeviceCapabilityRequest - ); - console.log(result); -} - -async function main() { - devicesGenerateCapabilityImage(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/devicesGetSample.ts b/sdk/sphere/arm-sphere/samples-dev/devicesGetSample.ts deleted file mode 100644 index a1757df75ce4..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/devicesGetSample.ts +++ /dev/null @@ -1,50 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not belong to a device group and product. - * - * @summary Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not belong to a device group and product. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDevice.json - */ -async function devicesGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const deviceName = - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.devices.get( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName - ); - console.log(result); -} - -async function main() { - devicesGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/devicesListByDeviceGroupSample.ts b/sdk/sphere/arm-sphere/samples-dev/devicesListByDeviceGroupSample.ts deleted file mode 100644 index adf9d00b6d22..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/devicesListByDeviceGroupSample.ts +++ /dev/null @@ -1,50 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDevices.json - */ -async function devicesListByDeviceGroup() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.devices.listByDeviceGroup( - resourceGroupName, - catalogName, - productName, - deviceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - devicesListByDeviceGroup(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/devicesUpdateSample.ts b/sdk/sphere/arm-sphere/samples-dev/devicesUpdateSample.ts deleted file mode 100644 index 9cf38b2c1d13..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/devicesUpdateSample.ts +++ /dev/null @@ -1,52 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DeviceUpdate, AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the catalog level. - * - * @summary Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the catalog level. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchDevice.json - */ -async function devicesUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const deviceName = - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - const properties: DeviceUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.devices.beginUpdateAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - properties - ); - console.log(result); -} - -async function main() { - devicesUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/imagesCreateOrUpdateSample.ts b/sdk/sphere/arm-sphere/samples-dev/imagesCreateOrUpdateSample.ts deleted file mode 100644 index e9e8994ba868..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/imagesCreateOrUpdateSample.ts +++ /dev/null @@ -1,47 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Image, AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a Image - * - * @summary Create a Image - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutImage.json - */ -async function imageCreateOrUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const imageName = "default"; - const resource: Image = { image: "bXliYXNlNjRzdHJpbmc=" }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - catalogName, - imageName, - resource - ); - console.log(result); -} - -async function main() { - imageCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/imagesDeleteSample.ts b/sdk/sphere/arm-sphere/samples-dev/imagesDeleteSample.ts deleted file mode 100644 index 0f718263b451..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/imagesDeleteSample.ts +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a Image - * - * @summary Delete a Image - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteImage.json - */ -async function imagesDelete() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const imageName = "imageID"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.images.beginDeleteAndWait( - resourceGroupName, - catalogName, - imageName - ); - console.log(result); -} - -async function main() { - imagesDelete(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/imagesGetSample.ts b/sdk/sphere/arm-sphere/samples-dev/imagesGetSample.ts deleted file mode 100644 index bcac1b9833f1..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/imagesGetSample.ts +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a Image - * - * @summary Get a Image - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetImage.json - */ -async function imagesGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const imageName = "myImageId"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.images.get( - resourceGroupName, - catalogName, - imageName - ); - console.log(result); -} - -async function main() { - imagesGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/imagesListByCatalogSample.ts b/sdk/sphere/arm-sphere/samples-dev/imagesListByCatalogSample.ts deleted file mode 100644 index a12aa5269f22..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/imagesListByCatalogSample.ts +++ /dev/null @@ -1,46 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Image resources by Catalog - * - * @summary List Image resources by Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetImages.json - */ -async function imagesListByCatalog() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.images.listByCatalog( - resourceGroupName, - catalogName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - imagesListByCatalog(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/operationsListSample.ts b/sdk/sphere/arm-sphere/samples-dev/operationsListSample.ts deleted file mode 100644 index 4d41d77a00ff..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/operationsListSample.ts +++ /dev/null @@ -1,40 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetOperations.json - */ -async function operationsList() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/productsCountDevicesSample.ts b/sdk/sphere/arm-sphere/samples-dev/productsCountDevicesSample.ts deleted file mode 100644 index 51502ed9faec..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/productsCountDevicesSample.ts +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @summary Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesProduct.json - */ -async function productsCountDevices() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.products.countDevices( - resourceGroupName, - catalogName, - productName - ); - console.log(result); -} - -async function main() { - productsCountDevices(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/productsCreateOrUpdateSample.ts b/sdk/sphere/arm-sphere/samples-dev/productsCreateOrUpdateSample.ts deleted file mode 100644 index 81f1c57e5c96..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/productsCreateOrUpdateSample.ts +++ /dev/null @@ -1,47 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Product, AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @summary Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutProduct.json - */ -async function productsCreateOrUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const resource: Product = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.products.beginCreateOrUpdateAndWait( - resourceGroupName, - catalogName, - productName, - resource - ); - console.log(result); -} - -async function main() { - productsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/productsDeleteSample.ts b/sdk/sphere/arm-sphere/samples-dev/productsDeleteSample.ts deleted file mode 100644 index 39be3b6c014b..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/productsDeleteSample.ts +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name' - * - * @summary Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name' - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteProduct.json - */ -async function productsDelete() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProductName1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.products.beginDeleteAndWait( - resourceGroupName, - catalogName, - productName - ); - console.log(result); -} - -async function main() { - productsDelete(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/productsGenerateDefaultDeviceGroupsSample.ts b/sdk/sphere/arm-sphere/samples-dev/productsGenerateDefaultDeviceGroupsSample.ts deleted file mode 100644 index ebf13d8401d4..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/productsGenerateDefaultDeviceGroupsSample.ts +++ /dev/null @@ -1,48 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Generates default device groups for the product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @summary Generates default device groups for the product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostGenerateDefaultDeviceGroups.json - */ -async function productsGenerateDefaultDeviceGroups() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.products.listGenerateDefaultDeviceGroups( - resourceGroupName, - catalogName, - productName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - productsGenerateDefaultDeviceGroups(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/productsGetSample.ts b/sdk/sphere/arm-sphere/samples-dev/productsGetSample.ts deleted file mode 100644 index 01dc87f4cc4b..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/productsGetSample.ts +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @summary Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetProduct.json - */ -async function productsGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.products.get( - resourceGroupName, - catalogName, - productName - ); - console.log(result); -} - -async function main() { - productsGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/productsListByCatalogSample.ts b/sdk/sphere/arm-sphere/samples-dev/productsListByCatalogSample.ts deleted file mode 100644 index 6d3bc15f8a97..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/productsListByCatalogSample.ts +++ /dev/null @@ -1,46 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Product resources by Catalog - * - * @summary List Product resources by Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetProducts.json - */ -async function productsListByCatalog() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.products.listByCatalog( - resourceGroupName, - catalogName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - productsListByCatalog(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples-dev/productsUpdateSample.ts b/sdk/sphere/arm-sphere/samples-dev/productsUpdateSample.ts deleted file mode 100644 index 1bfce89ae874..000000000000 --- a/sdk/sphere/arm-sphere/samples-dev/productsUpdateSample.ts +++ /dev/null @@ -1,47 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ProductUpdate, AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @summary Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchProduct.json - */ -async function productsUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const properties: ProductUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.products.beginUpdateAndWait( - resourceGroupName, - catalogName, - productName, - properties - ); - console.log(result); -} - -async function main() { - productsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/README.md b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/README.md deleted file mode 100644 index f9e5298fda04..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/README.md +++ /dev/null @@ -1,136 +0,0 @@ -# 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** | -| ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [catalogsCountDevicesSample.js][catalogscountdevicessample] | Counts devices in catalog. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesCatalog.json | -| [catalogsCreateOrUpdateSample.js][catalogscreateorupdatesample] | Create a Catalog x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutCatalog.json | -| [catalogsDeleteSample.js][catalogsdeletesample] | Delete a Catalog x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteCatalog.json | -| [catalogsGetSample.js][catalogsgetsample] | Get a Catalog x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalog.json | -| [catalogsListByResourceGroupSample.js][catalogslistbyresourcegroupsample] | List Catalog resources by resource group x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalogsRG.json | -| [catalogsListBySubscriptionSample.js][catalogslistbysubscriptionsample] | List Catalog resources by subscription ID x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalogsSub.json | -| [catalogsListDeploymentsSample.js][catalogslistdeploymentssample] | Lists deployments for catalog. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeploymentsByCatalog.json | -| [catalogsListDeviceGroupsSample.js][catalogslistdevicegroupssample] | List the device groups for the catalog. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeviceGroupsCatalog.json | -| [catalogsListDeviceInsightsSample.js][catalogslistdeviceinsightssample] | Lists device insights for catalog. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeviceInsightsCatalog.json | -| [catalogsListDevicesSample.js][catalogslistdevicessample] | Lists devices for catalog. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDevicesByCatalog.json | -| [catalogsUpdateSample.js][catalogsupdatesample] | Update a Catalog x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchCatalog.json | -| [certificatesGetSample.js][certificatesgetsample] | Get a Certificate x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCertificate.json | -| [certificatesListByCatalogSample.js][certificateslistbycatalogsample] | List Certificate resources by Catalog x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCertificates.json | -| [certificatesRetrieveCertChainSample.js][certificatesretrievecertchainsample] | Retrieves cert chain. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostRetrieveCatalogCertChain.json | -| [certificatesRetrieveProofOfPossessionNonceSample.js][certificatesretrieveproofofpossessionnoncesample] | Gets the proof of possession nonce. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostRetrieveProofOfPossessionNonce.json | -| [deploymentsCreateOrUpdateSample.js][deploymentscreateorupdatesample] | Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDeployment.json | -| [deploymentsDeleteSample.js][deploymentsdeletesample] | Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDeployment.json | -| [deploymentsGetSample.js][deploymentsgetsample] | Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeployment.json | -| [deploymentsListByDeviceGroupSample.js][deploymentslistbydevicegroupsample] | List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeployments.json | -| [deviceGroupsClaimDevicesSample.js][devicegroupsclaimdevicessample] | Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk claiming devices to a catalog only. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostClaimDevices.json | -| [deviceGroupsCountDevicesSample.js][devicegroupscountdevicessample] | Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesDeviceGroup.json | -| [deviceGroupsCreateOrUpdateSample.js][devicegroupscreateorupdatesample] | Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDeviceGroup.json | -| [deviceGroupsDeleteSample.js][devicegroupsdeletesample] | Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDeviceGroup.json | -| [deviceGroupsGetSample.js][devicegroupsgetsample] | Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeviceGroup.json | -| [deviceGroupsListByProductSample.js][devicegroupslistbyproductsample] | List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeviceGroups.json | -| [deviceGroupsUpdateSample.js][devicegroupsupdatesample] | Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchDeviceGroup.json | -| [devicesCreateOrUpdateSample.js][devicescreateorupdatesample] | Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the catalog only. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDevice.json | -| [devicesDeleteSample.js][devicesdeletesample] | Delete a Device x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDevice.json | -| [devicesGenerateCapabilityImageSample.js][devicesgeneratecapabilityimagesample] | Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product names to generate the image for a device that does not belong to a specific device group and product. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostGenerateDeviceCapabilityImage.json | -| [devicesGetSample.js][devicesgetsample] | Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not belong to a device group and product. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDevice.json | -| [devicesListByDeviceGroupSample.js][deviceslistbydevicegroupsample] | List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDevices.json | -| [devicesUpdateSample.js][devicesupdatesample] | Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the catalog level. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchDevice.json | -| [imagesCreateOrUpdateSample.js][imagescreateorupdatesample] | Create a Image x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutImage.json | -| [imagesDeleteSample.js][imagesdeletesample] | Delete a Image x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteImage.json | -| [imagesGetSample.js][imagesgetsample] | Get a Image x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetImage.json | -| [imagesListByCatalogSample.js][imageslistbycatalogsample] | List Image resources by Catalog x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetImages.json | -| [operationsListSample.js][operationslistsample] | List the operations for the provider x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetOperations.json | -| [productsCountDevicesSample.js][productscountdevicessample] | Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesProduct.json | -| [productsCreateOrUpdateSample.js][productscreateorupdatesample] | Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutProduct.json | -| [productsDeleteSample.js][productsdeletesample] | Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name' x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteProduct.json | -| [productsGenerateDefaultDeviceGroupsSample.js][productsgeneratedefaultdevicegroupssample] | Generates default device groups for the product. '.default' and '.unassigned' are system defined values and cannot be used for product name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostGenerateDefaultDeviceGroups.json | -| [productsGetSample.js][productsgetsample] | Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetProduct.json | -| [productsListByCatalogSample.js][productslistbycatalogsample] | List Product resources by Catalog x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetProducts.json | -| [productsUpdateSample.js][productsupdatesample] | Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchProduct.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -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 catalogsCountDevicesSample.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 SPHERE_SUBSCRIPTION_ID="" SPHERE_RESOURCE_GROUP="" node catalogsCountDevicesSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[catalogscountdevicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsCountDevicesSample.js -[catalogscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsCreateOrUpdateSample.js -[catalogsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsDeleteSample.js -[catalogsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsGetSample.js -[catalogslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListByResourceGroupSample.js -[catalogslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListBySubscriptionSample.js -[catalogslistdeploymentssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDeploymentsSample.js -[catalogslistdevicegroupssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDeviceGroupsSample.js -[catalogslistdeviceinsightssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDeviceInsightsSample.js -[catalogslistdevicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDevicesSample.js -[catalogsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsUpdateSample.js -[certificatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesGetSample.js -[certificateslistbycatalogsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesListByCatalogSample.js -[certificatesretrievecertchainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesRetrieveCertChainSample.js -[certificatesretrieveproofofpossessionnoncesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesRetrieveProofOfPossessionNonceSample.js -[deploymentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsCreateOrUpdateSample.js -[deploymentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsDeleteSample.js -[deploymentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsGetSample.js -[deploymentslistbydevicegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsListByDeviceGroupSample.js -[devicegroupsclaimdevicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsClaimDevicesSample.js -[devicegroupscountdevicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsCountDevicesSample.js -[devicegroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsCreateOrUpdateSample.js -[devicegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsDeleteSample.js -[devicegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsGetSample.js -[devicegroupslistbyproductsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsListByProductSample.js -[devicegroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsUpdateSample.js -[devicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesCreateOrUpdateSample.js -[devicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesDeleteSample.js -[devicesgeneratecapabilityimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesGenerateCapabilityImageSample.js -[devicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesGetSample.js -[deviceslistbydevicegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesListByDeviceGroupSample.js -[devicesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesUpdateSample.js -[imagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesCreateOrUpdateSample.js -[imagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesDeleteSample.js -[imagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesGetSample.js -[imageslistbycatalogsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesListByCatalogSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/operationsListSample.js -[productscountdevicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsCountDevicesSample.js -[productscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsCreateOrUpdateSample.js -[productsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsDeleteSample.js -[productsgeneratedefaultdevicegroupssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsGenerateDefaultDeviceGroupsSample.js -[productsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsGetSample.js -[productslistbycatalogsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsListByCatalogSample.js -[productsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsUpdateSample.js -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-sphere?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/sphere/arm-sphere/README.md diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsCountDevicesSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsCountDevicesSample.js deleted file mode 100644 index 66ff5200e01e..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsCountDevicesSample.js +++ /dev/null @@ -1,36 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Counts devices in catalog. - * - * @summary Counts devices in catalog. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesCatalog.json - */ -async function catalogsCountDevices() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.catalogs.countDevices(resourceGroupName, catalogName); - console.log(result); -} - -async function main() { - catalogsCountDevices(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsCreateOrUpdateSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsCreateOrUpdateSample.js deleted file mode 100644 index d17691485062..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsCreateOrUpdateSample.js +++ /dev/null @@ -1,41 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a Catalog - * - * @summary Create a Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutCatalog.json - */ -async function catalogsCreateOrUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const resource = { location: "global" }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.catalogs.beginCreateOrUpdateAndWait( - resourceGroupName, - catalogName, - resource - ); - console.log(result); -} - -async function main() { - catalogsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsDeleteSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsDeleteSample.js deleted file mode 100644 index 292cc5b9ce1a..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsDeleteSample.js +++ /dev/null @@ -1,36 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete a Catalog - * - * @summary Delete a Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteCatalog.json - */ -async function catalogsDelete() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.catalogs.beginDeleteAndWait(resourceGroupName, catalogName); - console.log(result); -} - -async function main() { - catalogsDelete(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsGetSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsGetSample.js deleted file mode 100644 index b07e236715ac..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsGetSample.js +++ /dev/null @@ -1,36 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a Catalog - * - * @summary Get a Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalog.json - */ -async function catalogsGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.catalogs.get(resourceGroupName, catalogName); - console.log(result); -} - -async function main() { - catalogsGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListByResourceGroupSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListByResourceGroupSample.js deleted file mode 100644 index a23ce9cb45ff..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListByResourceGroupSample.js +++ /dev/null @@ -1,38 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List Catalog resources by resource group - * - * @summary List Catalog resources by resource group - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalogsRG.json - */ -async function catalogsListByResourceGroup() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.catalogs.listByResourceGroup(resourceGroupName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - catalogsListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListBySubscriptionSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListBySubscriptionSample.js deleted file mode 100644 index b9ea1b041f3a..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListBySubscriptionSample.js +++ /dev/null @@ -1,37 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List Catalog resources by subscription ID - * - * @summary List Catalog resources by subscription ID - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalogsSub.json - */ -async function catalogsListBySubscription() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.catalogs.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - catalogsListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDeploymentsSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDeploymentsSample.js deleted file mode 100644 index 165948f3f456..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDeploymentsSample.js +++ /dev/null @@ -1,39 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists deployments for catalog. - * - * @summary Lists deployments for catalog. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeploymentsByCatalog.json - */ -async function catalogsListDeployments() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.catalogs.listDeployments(resourceGroupName, catalogName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - catalogsListDeployments(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDeviceGroupsSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDeviceGroupsSample.js deleted file mode 100644 index 10feee222cad..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDeviceGroupsSample.js +++ /dev/null @@ -1,46 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List the device groups for the catalog. - * - * @summary List the device groups for the catalog. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeviceGroupsCatalog.json - */ -async function catalogsListDeviceGroups() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const listDeviceGroupsRequest = { - deviceGroupName: "MyDeviceGroup1", - }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.catalogs.listDeviceGroups( - resourceGroupName, - catalogName, - listDeviceGroupsRequest - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - catalogsListDeviceGroups(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDeviceInsightsSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDeviceInsightsSample.js deleted file mode 100644 index 308728fe6731..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDeviceInsightsSample.js +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists device insights for catalog. - * - * @summary Lists device insights for catalog. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeviceInsightsCatalog.json - */ -async function catalogsListDeviceInsights() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const top = 10; - const options = { top }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.catalogs.listDeviceInsights( - resourceGroupName, - catalogName, - options - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - catalogsListDeviceInsights(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDevicesSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDevicesSample.js deleted file mode 100644 index bba4082b386a..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsListDevicesSample.js +++ /dev/null @@ -1,39 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Lists devices for catalog. - * - * @summary Lists devices for catalog. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDevicesByCatalog.json - */ -async function catalogsListDevices() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.catalogs.listDevices(resourceGroupName, catalogName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - catalogsListDevices(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsUpdateSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsUpdateSample.js deleted file mode 100644 index 7eac1bacbcd0..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/catalogsUpdateSample.js +++ /dev/null @@ -1,37 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update a Catalog - * - * @summary Update a Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchCatalog.json - */ -async function catalogsUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.catalogs.update(resourceGroupName, catalogName, properties); - console.log(result); -} - -async function main() { - catalogsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesGetSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesGetSample.js deleted file mode 100644 index 156dcaca0fe8..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesGetSample.js +++ /dev/null @@ -1,37 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a Certificate - * - * @summary Get a Certificate - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCertificate.json - */ -async function certificatesGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const serialNumber = "default"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.certificates.get(resourceGroupName, catalogName, serialNumber); - console.log(result); -} - -async function main() { - certificatesGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesListByCatalogSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesListByCatalogSample.js deleted file mode 100644 index 96c55128cee1..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesListByCatalogSample.js +++ /dev/null @@ -1,39 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List Certificate resources by Catalog - * - * @summary List Certificate resources by Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCertificates.json - */ -async function certificatesListByCatalog() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.certificates.listByCatalog(resourceGroupName, catalogName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - certificatesListByCatalog(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesRetrieveCertChainSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesRetrieveCertChainSample.js deleted file mode 100644 index 072c332148e2..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesRetrieveCertChainSample.js +++ /dev/null @@ -1,41 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Retrieves cert chain. - * - * @summary Retrieves cert chain. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostRetrieveCatalogCertChain.json - */ -async function certificatesRetrieveCertChain() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const serialNumber = "active"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.certificates.retrieveCertChain( - resourceGroupName, - catalogName, - serialNumber - ); - console.log(result); -} - -async function main() { - certificatesRetrieveCertChain(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesRetrieveProofOfPossessionNonceSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesRetrieveProofOfPossessionNonceSample.js deleted file mode 100644 index c607c8d3890b..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/certificatesRetrieveProofOfPossessionNonceSample.js +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Gets the proof of possession nonce. - * - * @summary Gets the proof of possession nonce. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostRetrieveProofOfPossessionNonce.json - */ -async function certificatesRetrieveProofOfPossessionNonce() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const serialNumber = "active"; - const proofOfPossessionNonceRequest = { - proofOfPossessionNonce: "proofOfPossessionNonce", - }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.certificates.retrieveProofOfPossessionNonce( - resourceGroupName, - catalogName, - serialNumber, - proofOfPossessionNonceRequest - ); - console.log(result); -} - -async function main() { - certificatesRetrieveProofOfPossessionNonce(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsCreateOrUpdateSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsCreateOrUpdateSample.js deleted file mode 100644 index f583ada226a4..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsCreateOrUpdateSample.js +++ /dev/null @@ -1,47 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDeployment.json - */ -async function deploymentsCreateOrUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const deploymentName = "MyDeployment1"; - const resource = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deploymentName, - resource - ); - console.log(result); -} - -async function main() { - deploymentsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsDeleteSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsDeleteSample.js deleted file mode 100644 index 4ac40d425584..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsDeleteSample.js +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDeployment.json - */ -async function deploymentsDelete() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProductName1"; - const deviceGroupName = "DeviceGroupName1"; - const deploymentName = "MyDeploymentName1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deployments.beginDeleteAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deploymentName - ); - console.log(result); -} - -async function main() { - deploymentsDelete(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsGetSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsGetSample.js deleted file mode 100644 index a4e8a6f22639..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsGetSample.js +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeployment.json - */ -async function deploymentsGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const deploymentName = "MyDeployment1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deployments.get( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deploymentName - ); - console.log(result); -} - -async function main() { - deploymentsGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsListByDeviceGroupSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsListByDeviceGroupSample.js deleted file mode 100644 index 8751a717fed9..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deploymentsListByDeviceGroupSample.js +++ /dev/null @@ -1,46 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeployments.json - */ -async function deploymentsListByDeviceGroup() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.deployments.listByDeviceGroup( - resourceGroupName, - catalogName, - productName, - deviceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - deploymentsListByDeviceGroup(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsClaimDevicesSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsClaimDevicesSample.js deleted file mode 100644 index ae4d1ef630fe..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsClaimDevicesSample.js +++ /dev/null @@ -1,49 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk claiming devices to a catalog only. - * - * @summary Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk claiming devices to a catalog only. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostClaimDevices.json - */ -async function deviceGroupsClaimDevices() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const claimDevicesRequest = { - deviceIdentifiers: [ - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - ], - }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deviceGroups.beginClaimDevicesAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - claimDevicesRequest - ); - console.log(result); -} - -async function main() { - deviceGroupsClaimDevices(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsCountDevicesSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsCountDevicesSample.js deleted file mode 100644 index c6bb0ab91ee2..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsCountDevicesSample.js +++ /dev/null @@ -1,43 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesDeviceGroup.json - */ -async function deviceGroupsCountDevices() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deviceGroups.countDevices( - resourceGroupName, - catalogName, - productName, - deviceGroupName - ); - console.log(result); -} - -async function main() { - deviceGroupsCountDevices(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsCreateOrUpdateSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsCreateOrUpdateSample.js deleted file mode 100644 index 51551a1aa391..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsCreateOrUpdateSample.js +++ /dev/null @@ -1,49 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDeviceGroup.json - */ -async function deviceGroupsCreateOrUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const resource = { - description: "Description for MyDeviceGroup1", - osFeedType: "Retail", - updatePolicy: "UpdateAll", - }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deviceGroups.beginCreateOrUpdateAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - resource - ); - console.log(result); -} - -async function main() { - deviceGroupsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsDeleteSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsDeleteSample.js deleted file mode 100644 index d0bc66a80e39..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsDeleteSample.js +++ /dev/null @@ -1,43 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDeviceGroup.json - */ -async function deviceGroupsDelete() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deviceGroups.beginDeleteAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName - ); - console.log(result); -} - -async function main() { - deviceGroupsDelete(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsGetSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsGetSample.js deleted file mode 100644 index ab07dd6cde91..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsGetSample.js +++ /dev/null @@ -1,43 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeviceGroup.json - */ -async function deviceGroupsGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deviceGroups.get( - resourceGroupName, - catalogName, - productName, - deviceGroupName - ); - console.log(result); -} - -async function main() { - deviceGroupsGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsListByProductSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsListByProductSample.js deleted file mode 100644 index a28c80607329..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsListByProductSample.js +++ /dev/null @@ -1,44 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @summary List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeviceGroups.json - */ -async function deviceGroupsListByProduct() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.deviceGroups.listByProduct( - resourceGroupName, - catalogName, - productName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - deviceGroupsListByProduct(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsUpdateSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsUpdateSample.js deleted file mode 100644 index 6d69fe306403..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/deviceGroupsUpdateSample.js +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchDeviceGroup.json - */ -async function deviceGroupsUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deviceGroups.beginUpdateAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - properties - ); - console.log(result); -} - -async function main() { - deviceGroupsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesCreateOrUpdateSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesCreateOrUpdateSample.js deleted file mode 100644 index 848368b57f51..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesCreateOrUpdateSample.js +++ /dev/null @@ -1,48 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the catalog only. - * - * @summary Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the catalog only. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDevice.json - */ -async function devicesCreateOrUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const deviceName = - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - const resource = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.devices.beginCreateOrUpdateAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - resource - ); - console.log(result); -} - -async function main() { - devicesCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesDeleteSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesDeleteSample.js deleted file mode 100644 index e8b0b70e0546..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesDeleteSample.js +++ /dev/null @@ -1,46 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete a Device - * - * @summary Delete a Device - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDevice.json - */ -async function devicesDelete() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProductName1"; - const deviceGroupName = "DeviceGroupName1"; - const deviceName = - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.devices.beginDeleteAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName - ); - console.log(result); -} - -async function main() { - devicesDelete(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesGenerateCapabilityImageSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesGenerateCapabilityImageSample.js deleted file mode 100644 index 39475bfe011a..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesGenerateCapabilityImageSample.js +++ /dev/null @@ -1,50 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product names to generate the image for a device that does not belong to a specific device group and product. - * - * @summary Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product names to generate the image for a device that does not belong to a specific device group and product. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostGenerateDeviceCapabilityImage.json - */ -async function devicesGenerateCapabilityImage() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const deviceName = - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - const generateDeviceCapabilityRequest = { - capabilities: ["ApplicationDevelopment"], - }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.devices.beginGenerateCapabilityImageAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - generateDeviceCapabilityRequest - ); - console.log(result); -} - -async function main() { - devicesGenerateCapabilityImage(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesGetSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesGetSample.js deleted file mode 100644 index 186dc84b6224..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesGetSample.js +++ /dev/null @@ -1,46 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not belong to a device group and product. - * - * @summary Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not belong to a device group and product. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDevice.json - */ -async function devicesGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const deviceName = - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.devices.get( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName - ); - console.log(result); -} - -async function main() { - devicesGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesListByDeviceGroupSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesListByDeviceGroupSample.js deleted file mode 100644 index 0bb979f3134d..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesListByDeviceGroupSample.js +++ /dev/null @@ -1,46 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDevices.json - */ -async function devicesListByDeviceGroup() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.devices.listByDeviceGroup( - resourceGroupName, - catalogName, - productName, - deviceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - devicesListByDeviceGroup(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesUpdateSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesUpdateSample.js deleted file mode 100644 index ca9666878084..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/devicesUpdateSample.js +++ /dev/null @@ -1,48 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the catalog level. - * - * @summary Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the catalog level. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchDevice.json - */ -async function devicesUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const deviceName = - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.devices.beginUpdateAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - properties - ); - console.log(result); -} - -async function main() { - devicesUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesCreateOrUpdateSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesCreateOrUpdateSample.js deleted file mode 100644 index d1b0d9eaeb50..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesCreateOrUpdateSample.js +++ /dev/null @@ -1,43 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a Image - * - * @summary Create a Image - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutImage.json - */ -async function imageCreateOrUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const imageName = "default"; - const resource = { image: "bXliYXNlNjRzdHJpbmc=" }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - catalogName, - imageName, - resource - ); - console.log(result); -} - -async function main() { - imageCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesDeleteSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesDeleteSample.js deleted file mode 100644 index db5cd80b9246..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesDeleteSample.js +++ /dev/null @@ -1,37 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete a Image - * - * @summary Delete a Image - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteImage.json - */ -async function imagesDelete() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const imageName = "imageID"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.images.beginDeleteAndWait(resourceGroupName, catalogName, imageName); - console.log(result); -} - -async function main() { - imagesDelete(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesGetSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesGetSample.js deleted file mode 100644 index 6b387be8dac7..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesGetSample.js +++ /dev/null @@ -1,37 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a Image - * - * @summary Get a Image - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetImage.json - */ -async function imagesGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const imageName = "myImageId"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.images.get(resourceGroupName, catalogName, imageName); - console.log(result); -} - -async function main() { - imagesGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesListByCatalogSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesListByCatalogSample.js deleted file mode 100644 index 345090f65610..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/imagesListByCatalogSample.js +++ /dev/null @@ -1,39 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List Image resources by Catalog - * - * @summary List Image resources by Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetImages.json - */ -async function imagesListByCatalog() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.images.listByCatalog(resourceGroupName, catalogName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - imagesListByCatalog(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/operationsListSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/operationsListSample.js deleted file mode 100644 index 9addabaa7695..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/operationsListSample.js +++ /dev/null @@ -1,37 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetOperations.json - */ -async function operationsList() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/package.json b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/package.json deleted file mode 100644 index 3dfff57c95e5..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@azure-samples/arm-sphere-js-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for JavaScript (Beta)", - "engines": { - "node": ">=18.0.0" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/sphere/arm-sphere" - }, - "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/sphere/arm-sphere", - "dependencies": { - "@azure/arm-sphere": "next", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - } -} diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsCountDevicesSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsCountDevicesSample.js deleted file mode 100644 index 1c606a413709..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsCountDevicesSample.js +++ /dev/null @@ -1,37 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @summary Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesProduct.json - */ -async function productsCountDevices() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.products.countDevices(resourceGroupName, catalogName, productName); - console.log(result); -} - -async function main() { - productsCountDevices(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsCreateOrUpdateSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsCreateOrUpdateSample.js deleted file mode 100644 index 117eb72fbbcf..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsCreateOrUpdateSample.js +++ /dev/null @@ -1,43 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @summary Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutProduct.json - */ -async function productsCreateOrUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const resource = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.products.beginCreateOrUpdateAndWait( - resourceGroupName, - catalogName, - productName, - resource - ); - console.log(result); -} - -async function main() { - productsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsDeleteSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsDeleteSample.js deleted file mode 100644 index fb5be116d810..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsDeleteSample.js +++ /dev/null @@ -1,41 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name' - * - * @summary Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name' - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteProduct.json - */ -async function productsDelete() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProductName1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.products.beginDeleteAndWait( - resourceGroupName, - catalogName, - productName - ); - console.log(result); -} - -async function main() { - productsDelete(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsGenerateDefaultDeviceGroupsSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsGenerateDefaultDeviceGroupsSample.js deleted file mode 100644 index da4d506708b4..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsGenerateDefaultDeviceGroupsSample.js +++ /dev/null @@ -1,44 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Generates default device groups for the product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @summary Generates default device groups for the product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostGenerateDefaultDeviceGroups.json - */ -async function productsGenerateDefaultDeviceGroups() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.products.listGenerateDefaultDeviceGroups( - resourceGroupName, - catalogName, - productName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - productsGenerateDefaultDeviceGroups(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsGetSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsGetSample.js deleted file mode 100644 index 26f81560c290..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsGetSample.js +++ /dev/null @@ -1,37 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @summary Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetProduct.json - */ -async function productsGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.products.get(resourceGroupName, catalogName, productName); - console.log(result); -} - -async function main() { - productsGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsListByCatalogSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsListByCatalogSample.js deleted file mode 100644 index 4fd9ee6057ed..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsListByCatalogSample.js +++ /dev/null @@ -1,39 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to List Product resources by Catalog - * - * @summary List Product resources by Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetProducts.json - */ -async function productsListByCatalog() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.products.listByCatalog(resourceGroupName, catalogName)) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - productsListByCatalog(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsUpdateSample.js b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsUpdateSample.js deleted file mode 100644 index 5700dd57df72..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/productsUpdateSample.js +++ /dev/null @@ -1,43 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -const { AzureSphereManagementClient } = require("@azure/arm-sphere"); -const { DefaultAzureCredential } = require("@azure/identity"); -require("dotenv").config(); - -/** - * This sample demonstrates how to Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @summary Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchProduct.json - */ -async function productsUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const properties = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.products.beginUpdateAndWait( - resourceGroupName, - catalogName, - productName, - properties - ); - console.log(result); -} - -async function main() { - productsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/sample.env b/sdk/sphere/arm-sphere/samples/v1-beta/javascript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/javascript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# 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/sphere/arm-sphere/samples/v1-beta/typescript/README.md b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/README.md deleted file mode 100644 index 958081a4155d..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/README.md +++ /dev/null @@ -1,149 +0,0 @@ -# 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** | -| ------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [catalogsCountDevicesSample.ts][catalogscountdevicessample] | Counts devices in catalog. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesCatalog.json | -| [catalogsCreateOrUpdateSample.ts][catalogscreateorupdatesample] | Create a Catalog x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutCatalog.json | -| [catalogsDeleteSample.ts][catalogsdeletesample] | Delete a Catalog x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteCatalog.json | -| [catalogsGetSample.ts][catalogsgetsample] | Get a Catalog x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalog.json | -| [catalogsListByResourceGroupSample.ts][catalogslistbyresourcegroupsample] | List Catalog resources by resource group x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalogsRG.json | -| [catalogsListBySubscriptionSample.ts][catalogslistbysubscriptionsample] | List Catalog resources by subscription ID x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalogsSub.json | -| [catalogsListDeploymentsSample.ts][catalogslistdeploymentssample] | Lists deployments for catalog. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeploymentsByCatalog.json | -| [catalogsListDeviceGroupsSample.ts][catalogslistdevicegroupssample] | List the device groups for the catalog. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeviceGroupsCatalog.json | -| [catalogsListDeviceInsightsSample.ts][catalogslistdeviceinsightssample] | Lists device insights for catalog. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeviceInsightsCatalog.json | -| [catalogsListDevicesSample.ts][catalogslistdevicessample] | Lists devices for catalog. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDevicesByCatalog.json | -| [catalogsUpdateSample.ts][catalogsupdatesample] | Update a Catalog x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchCatalog.json | -| [certificatesGetSample.ts][certificatesgetsample] | Get a Certificate x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCertificate.json | -| [certificatesListByCatalogSample.ts][certificateslistbycatalogsample] | List Certificate resources by Catalog x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCertificates.json | -| [certificatesRetrieveCertChainSample.ts][certificatesretrievecertchainsample] | Retrieves cert chain. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostRetrieveCatalogCertChain.json | -| [certificatesRetrieveProofOfPossessionNonceSample.ts][certificatesretrieveproofofpossessionnoncesample] | Gets the proof of possession nonce. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostRetrieveProofOfPossessionNonce.json | -| [deploymentsCreateOrUpdateSample.ts][deploymentscreateorupdatesample] | Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDeployment.json | -| [deploymentsDeleteSample.ts][deploymentsdeletesample] | Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDeployment.json | -| [deploymentsGetSample.ts][deploymentsgetsample] | Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeployment.json | -| [deploymentsListByDeviceGroupSample.ts][deploymentslistbydevicegroupsample] | List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeployments.json | -| [deviceGroupsClaimDevicesSample.ts][devicegroupsclaimdevicessample] | Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk claiming devices to a catalog only. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostClaimDevices.json | -| [deviceGroupsCountDevicesSample.ts][devicegroupscountdevicessample] | Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesDeviceGroup.json | -| [deviceGroupsCreateOrUpdateSample.ts][devicegroupscreateorupdatesample] | Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDeviceGroup.json | -| [deviceGroupsDeleteSample.ts][devicegroupsdeletesample] | Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDeviceGroup.json | -| [deviceGroupsGetSample.ts][devicegroupsgetsample] | Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeviceGroup.json | -| [deviceGroupsListByProductSample.ts][devicegroupslistbyproductsample] | List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeviceGroups.json | -| [deviceGroupsUpdateSample.ts][devicegroupsupdatesample] | Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchDeviceGroup.json | -| [devicesCreateOrUpdateSample.ts][devicescreateorupdatesample] | Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the catalog only. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDevice.json | -| [devicesDeleteSample.ts][devicesdeletesample] | Delete a Device x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDevice.json | -| [devicesGenerateCapabilityImageSample.ts][devicesgeneratecapabilityimagesample] | Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product names to generate the image for a device that does not belong to a specific device group and product. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostGenerateDeviceCapabilityImage.json | -| [devicesGetSample.ts][devicesgetsample] | Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not belong to a device group and product. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDevice.json | -| [devicesListByDeviceGroupSample.ts][deviceslistbydevicegroupsample] | List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDevices.json | -| [devicesUpdateSample.ts][devicesupdatesample] | Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the catalog level. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchDevice.json | -| [imagesCreateOrUpdateSample.ts][imagescreateorupdatesample] | Create a Image x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutImage.json | -| [imagesDeleteSample.ts][imagesdeletesample] | Delete a Image x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteImage.json | -| [imagesGetSample.ts][imagesgetsample] | Get a Image x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetImage.json | -| [imagesListByCatalogSample.ts][imageslistbycatalogsample] | List Image resources by Catalog x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetImages.json | -| [operationsListSample.ts][operationslistsample] | List the operations for the provider x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetOperations.json | -| [productsCountDevicesSample.ts][productscountdevicessample] | Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesProduct.json | -| [productsCreateOrUpdateSample.ts][productscreateorupdatesample] | Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutProduct.json | -| [productsDeleteSample.ts][productsdeletesample] | Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name' x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteProduct.json | -| [productsGenerateDefaultDeviceGroupsSample.ts][productsgeneratedefaultdevicegroupssample] | Generates default device groups for the product. '.default' and '.unassigned' are system defined values and cannot be used for product name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostGenerateDefaultDeviceGroups.json | -| [productsGetSample.ts][productsgetsample] | Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetProduct.json | -| [productsListByCatalogSample.ts][productslistbycatalogsample] | List Product resources by Catalog x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetProducts.json | -| [productsUpdateSample.ts][productsupdatesample] | Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchProduct.json | - -## Prerequisites - -The sample programs are compatible with [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule). - -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/catalogsCountDevicesSample.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 SPHERE_SUBSCRIPTION_ID="" SPHERE_RESOURCE_GROUP="" node dist/catalogsCountDevicesSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[catalogscountdevicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsCountDevicesSample.ts -[catalogscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsCreateOrUpdateSample.ts -[catalogsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsDeleteSample.ts -[catalogsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsGetSample.ts -[catalogslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListByResourceGroupSample.ts -[catalogslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListBySubscriptionSample.ts -[catalogslistdeploymentssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDeploymentsSample.ts -[catalogslistdevicegroupssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDeviceGroupsSample.ts -[catalogslistdeviceinsightssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDeviceInsightsSample.ts -[catalogslistdevicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDevicesSample.ts -[catalogsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsUpdateSample.ts -[certificatesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesGetSample.ts -[certificateslistbycatalogsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesListByCatalogSample.ts -[certificatesretrievecertchainsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesRetrieveCertChainSample.ts -[certificatesretrieveproofofpossessionnoncesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesRetrieveProofOfPossessionNonceSample.ts -[deploymentscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsCreateOrUpdateSample.ts -[deploymentsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsDeleteSample.ts -[deploymentsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsGetSample.ts -[deploymentslistbydevicegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsListByDeviceGroupSample.ts -[devicegroupsclaimdevicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsClaimDevicesSample.ts -[devicegroupscountdevicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsCountDevicesSample.ts -[devicegroupscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsCreateOrUpdateSample.ts -[devicegroupsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsDeleteSample.ts -[devicegroupsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsGetSample.ts -[devicegroupslistbyproductsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsListByProductSample.ts -[devicegroupsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsUpdateSample.ts -[devicescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesCreateOrUpdateSample.ts -[devicesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesDeleteSample.ts -[devicesgeneratecapabilityimagesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesGenerateCapabilityImageSample.ts -[devicesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesGetSample.ts -[deviceslistbydevicegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesListByDeviceGroupSample.ts -[devicesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesUpdateSample.ts -[imagescreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesCreateOrUpdateSample.ts -[imagesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesDeleteSample.ts -[imagesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesGetSample.ts -[imageslistbycatalogsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesListByCatalogSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/operationsListSample.ts -[productscountdevicessample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsCountDevicesSample.ts -[productscreateorupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsCreateOrUpdateSample.ts -[productsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsDeleteSample.ts -[productsgeneratedefaultdevicegroupssample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsGenerateDefaultDeviceGroupsSample.ts -[productsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsGetSample.ts -[productslistbycatalogsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsListByCatalogSample.ts -[productsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsUpdateSample.ts -[apiref]: https://docs.microsoft.com/javascript/api/@azure/arm-sphere?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/sphere/arm-sphere/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/package.json b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/package.json deleted file mode 100644 index 8c4e8bd39cb8..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/package.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "name": "@azure-samples/arm-sphere-ts-beta", - "private": true, - "version": "1.0.0", - "description": " client library samples for TypeScript (Beta)", - "engines": { - "node": ">=18.0.0" - }, - "scripts": { - "build": "tsc", - "prebuild": "rimraf dist/" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/Azure/azure-sdk-for-js.git", - "directory": "sdk/sphere/arm-sphere" - }, - "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/sphere/arm-sphere", - "dependencies": { - "@azure/arm-sphere": "next", - "dotenv": "latest", - "@azure/identity": "^2.0.1" - }, - "devDependencies": { - "@types/node": "^18.0.0", - "typescript": "~5.2.0", - "rimraf": "latest" - } -} diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/sample.env b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/sample.env deleted file mode 100644 index 672847a3fea0..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/sample.env +++ /dev/null @@ -1,4 +0,0 @@ -# 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/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsCountDevicesSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsCountDevicesSample.ts deleted file mode 100644 index 6d6704d34802..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsCountDevicesSample.ts +++ /dev/null @@ -1,43 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Counts devices in catalog. - * - * @summary Counts devices in catalog. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesCatalog.json - */ -async function catalogsCountDevices() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.catalogs.countDevices( - resourceGroupName, - catalogName - ); - console.log(result); -} - -async function main() { - catalogsCountDevices(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsCreateOrUpdateSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsCreateOrUpdateSample.ts deleted file mode 100644 index 1a7d185f7ba5..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsCreateOrUpdateSample.ts +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Catalog, AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a Catalog - * - * @summary Create a Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutCatalog.json - */ -async function catalogsCreateOrUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const resource: Catalog = { location: "global" }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.catalogs.beginCreateOrUpdateAndWait( - resourceGroupName, - catalogName, - resource - ); - console.log(result); -} - -async function main() { - catalogsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsDeleteSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsDeleteSample.ts deleted file mode 100644 index 1b5640eabbe4..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsDeleteSample.ts +++ /dev/null @@ -1,43 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a Catalog - * - * @summary Delete a Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteCatalog.json - */ -async function catalogsDelete() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.catalogs.beginDeleteAndWait( - resourceGroupName, - catalogName - ); - console.log(result); -} - -async function main() { - catalogsDelete(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsGetSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsGetSample.ts deleted file mode 100644 index 3eb9cfd92640..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsGetSample.ts +++ /dev/null @@ -1,40 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a Catalog - * - * @summary Get a Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalog.json - */ -async function catalogsGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.catalogs.get(resourceGroupName, catalogName); - console.log(result); -} - -async function main() { - catalogsGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListByResourceGroupSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListByResourceGroupSample.ts deleted file mode 100644 index f8267ed12248..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListByResourceGroupSample.ts +++ /dev/null @@ -1,44 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Catalog resources by resource group - * - * @summary List Catalog resources by resource group - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalogsRG.json - */ -async function catalogsListByResourceGroup() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.catalogs.listByResourceGroup( - resourceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - catalogsListByResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListBySubscriptionSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListBySubscriptionSample.ts deleted file mode 100644 index 7356f838c590..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListBySubscriptionSample.ts +++ /dev/null @@ -1,40 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Catalog resources by subscription ID - * - * @summary List Catalog resources by subscription ID - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCatalogsSub.json - */ -async function catalogsListBySubscription() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.catalogs.listBySubscription()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - catalogsListBySubscription(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDeploymentsSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDeploymentsSample.ts deleted file mode 100644 index 68848dfe97be..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDeploymentsSample.ts +++ /dev/null @@ -1,46 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists deployments for catalog. - * - * @summary Lists deployments for catalog. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeploymentsByCatalog.json - */ -async function catalogsListDeployments() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.catalogs.listDeployments( - resourceGroupName, - catalogName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - catalogsListDeployments(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDeviceGroupsSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDeviceGroupsSample.ts deleted file mode 100644 index 918a1c11d442..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDeviceGroupsSample.ts +++ /dev/null @@ -1,53 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ListDeviceGroupsRequest, - AzureSphereManagementClient -} from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the device groups for the catalog. - * - * @summary List the device groups for the catalog. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeviceGroupsCatalog.json - */ -async function catalogsListDeviceGroups() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const listDeviceGroupsRequest: ListDeviceGroupsRequest = { - deviceGroupName: "MyDeviceGroup1" - }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.catalogs.listDeviceGroups( - resourceGroupName, - catalogName, - listDeviceGroupsRequest - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - catalogsListDeviceGroups(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDeviceInsightsSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDeviceInsightsSample.ts deleted file mode 100644 index b11b70d1b0bb..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDeviceInsightsSample.ts +++ /dev/null @@ -1,52 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - CatalogsListDeviceInsightsOptionalParams, - AzureSphereManagementClient -} from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists device insights for catalog. - * - * @summary Lists device insights for catalog. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDeviceInsightsCatalog.json - */ -async function catalogsListDeviceInsights() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const top = 10; - const options: CatalogsListDeviceInsightsOptionalParams = { top }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.catalogs.listDeviceInsights( - resourceGroupName, - catalogName, - options - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - catalogsListDeviceInsights(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDevicesSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDevicesSample.ts deleted file mode 100644 index 88cbfdcf8a0b..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsListDevicesSample.ts +++ /dev/null @@ -1,46 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Lists devices for catalog. - * - * @summary Lists devices for catalog. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostListDevicesByCatalog.json - */ -async function catalogsListDevices() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.catalogs.listDevices( - resourceGroupName, - catalogName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - catalogsListDevices(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsUpdateSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsUpdateSample.ts deleted file mode 100644 index b01df2c97d51..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/catalogsUpdateSample.ts +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { CatalogUpdate, AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a Catalog - * - * @summary Update a Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchCatalog.json - */ -async function catalogsUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const properties: CatalogUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.catalogs.update( - resourceGroupName, - catalogName, - properties - ); - console.log(result); -} - -async function main() { - catalogsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesGetSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesGetSample.ts deleted file mode 100644 index 3fe0a7109e10..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesGetSample.ts +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a Certificate - * - * @summary Get a Certificate - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCertificate.json - */ -async function certificatesGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const serialNumber = "default"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.certificates.get( - resourceGroupName, - catalogName, - serialNumber - ); - console.log(result); -} - -async function main() { - certificatesGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesListByCatalogSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesListByCatalogSample.ts deleted file mode 100644 index 603c0717d598..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesListByCatalogSample.ts +++ /dev/null @@ -1,46 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Certificate resources by Catalog - * - * @summary List Certificate resources by Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetCertificates.json - */ -async function certificatesListByCatalog() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.certificates.listByCatalog( - resourceGroupName, - catalogName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - certificatesListByCatalog(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesRetrieveCertChainSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesRetrieveCertChainSample.ts deleted file mode 100644 index e73101213102..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesRetrieveCertChainSample.ts +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Retrieves cert chain. - * - * @summary Retrieves cert chain. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostRetrieveCatalogCertChain.json - */ -async function certificatesRetrieveCertChain() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const serialNumber = "active"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.certificates.retrieveCertChain( - resourceGroupName, - catalogName, - serialNumber - ); - console.log(result); -} - -async function main() { - certificatesRetrieveCertChain(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesRetrieveProofOfPossessionNonceSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesRetrieveProofOfPossessionNonceSample.ts deleted file mode 100644 index 62e9702c962c..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/certificatesRetrieveProofOfPossessionNonceSample.ts +++ /dev/null @@ -1,52 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ProofOfPossessionNonceRequest, - AzureSphereManagementClient -} from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Gets the proof of possession nonce. - * - * @summary Gets the proof of possession nonce. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostRetrieveProofOfPossessionNonce.json - */ -async function certificatesRetrieveProofOfPossessionNonce() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const serialNumber = "active"; - const proofOfPossessionNonceRequest: ProofOfPossessionNonceRequest = { - proofOfPossessionNonce: "proofOfPossessionNonce" - }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.certificates.retrieveProofOfPossessionNonce( - resourceGroupName, - catalogName, - serialNumber, - proofOfPossessionNonceRequest - ); - console.log(result); -} - -async function main() { - certificatesRetrieveProofOfPossessionNonce(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsCreateOrUpdateSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsCreateOrUpdateSample.ts deleted file mode 100644 index 56162580d32b..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsCreateOrUpdateSample.ts +++ /dev/null @@ -1,51 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Deployment, AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Create a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDeployment.json - */ -async function deploymentsCreateOrUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const deploymentName = "MyDeployment1"; - const resource: Deployment = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deployments.beginCreateOrUpdateAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deploymentName, - resource - ); - console.log(result); -} - -async function main() { - deploymentsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsDeleteSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsDeleteSample.ts deleted file mode 100644 index a03340eb1dee..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsDeleteSample.ts +++ /dev/null @@ -1,49 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Delete a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDeployment.json - */ -async function deploymentsDelete() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProductName1"; - const deviceGroupName = "DeviceGroupName1"; - const deploymentName = "MyDeploymentName1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deployments.beginDeleteAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deploymentName - ); - console.log(result); -} - -async function main() { - deploymentsDelete(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsGetSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsGetSample.ts deleted file mode 100644 index 239da35d24bb..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsGetSample.ts +++ /dev/null @@ -1,49 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Get a Deployment. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeployment.json - */ -async function deploymentsGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const deploymentName = "MyDeployment1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deployments.get( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deploymentName - ); - console.log(result); -} - -async function main() { - deploymentsGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsListByDeviceGroupSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsListByDeviceGroupSample.ts deleted file mode 100644 index 6fe255df070b..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deploymentsListByDeviceGroupSample.ts +++ /dev/null @@ -1,50 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary List Deployment resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeployments.json - */ -async function deploymentsListByDeviceGroup() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.deployments.listByDeviceGroup( - resourceGroupName, - catalogName, - productName, - deviceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - deploymentsListByDeviceGroup(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsClaimDevicesSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsClaimDevicesSample.ts deleted file mode 100644 index ea044100279c..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsClaimDevicesSample.ts +++ /dev/null @@ -1,56 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - ClaimDevicesRequest, - AzureSphereManagementClient -} from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk claiming devices to a catalog only. - * - * @summary Bulk claims the devices. Use '.unassigned' or '.default' for the device group and product names when bulk claiming devices to a catalog only. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostClaimDevices.json - */ -async function deviceGroupsClaimDevices() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const claimDevicesRequest: ClaimDevicesRequest = { - deviceIdentifiers: [ - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000" - ] - }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deviceGroups.beginClaimDevicesAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - claimDevicesRequest - ); - console.log(result); -} - -async function main() { - deviceGroupsClaimDevices(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsCountDevicesSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsCountDevicesSample.ts deleted file mode 100644 index 9a35456c540e..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsCountDevicesSample.ts +++ /dev/null @@ -1,47 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Counts devices in device group. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesDeviceGroup.json - */ -async function deviceGroupsCountDevices() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deviceGroups.countDevices( - resourceGroupName, - catalogName, - productName, - deviceGroupName - ); - console.log(result); -} - -async function main() { - deviceGroupsCountDevices(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsCreateOrUpdateSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsCreateOrUpdateSample.ts deleted file mode 100644 index 917004d39bbd..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsCreateOrUpdateSample.ts +++ /dev/null @@ -1,53 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DeviceGroup, AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Create a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDeviceGroup.json - */ -async function deviceGroupsCreateOrUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const resource: DeviceGroup = { - description: "Description for MyDeviceGroup1", - osFeedType: "Retail", - updatePolicy: "UpdateAll" - }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deviceGroups.beginCreateOrUpdateAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - resource - ); - console.log(result); -} - -async function main() { - deviceGroupsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsDeleteSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsDeleteSample.ts deleted file mode 100644 index 88da85c31cfd..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsDeleteSample.ts +++ /dev/null @@ -1,47 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Delete a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDeviceGroup.json - */ -async function deviceGroupsDelete() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deviceGroups.beginDeleteAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName - ); - console.log(result); -} - -async function main() { - deviceGroupsDelete(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsGetSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsGetSample.ts deleted file mode 100644 index 4bd2dbf1fb69..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsGetSample.ts +++ /dev/null @@ -1,47 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Get a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeviceGroup.json - */ -async function deviceGroupsGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deviceGroups.get( - resourceGroupName, - catalogName, - productName, - deviceGroupName - ); - console.log(result); -} - -async function main() { - deviceGroupsGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsListByProductSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsListByProductSample.ts deleted file mode 100644 index f8f98b04ded5..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsListByProductSample.ts +++ /dev/null @@ -1,48 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @summary List DeviceGroup resources by Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDeviceGroups.json - */ -async function deviceGroupsListByProduct() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.deviceGroups.listByProduct( - resourceGroupName, - catalogName, - productName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - deviceGroupsListByProduct(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsUpdateSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsUpdateSample.ts deleted file mode 100644 index e214c12869f3..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/deviceGroupsUpdateSample.ts +++ /dev/null @@ -1,52 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - DeviceGroupUpdate, - AzureSphereManagementClient -} from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary Update a DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchDeviceGroup.json - */ -async function deviceGroupsUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const properties: DeviceGroupUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.deviceGroups.beginUpdateAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - properties - ); - console.log(result); -} - -async function main() { - deviceGroupsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesCreateOrUpdateSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesCreateOrUpdateSample.ts deleted file mode 100644 index 83d7dc418589..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesCreateOrUpdateSample.ts +++ /dev/null @@ -1,52 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Device, AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the catalog only. - * - * @summary Create a Device. Use '.unassigned' or '.default' for the device group and product names to claim a device to the catalog only. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutDevice.json - */ -async function devicesCreateOrUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const deviceName = - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - const resource: Device = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.devices.beginCreateOrUpdateAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - resource - ); - console.log(result); -} - -async function main() { - devicesCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesDeleteSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesDeleteSample.ts deleted file mode 100644 index 2cc50057e5a7..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesDeleteSample.ts +++ /dev/null @@ -1,50 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a Device - * - * @summary Delete a Device - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteDevice.json - */ -async function devicesDelete() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProductName1"; - const deviceGroupName = "DeviceGroupName1"; - const deviceName = - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.devices.beginDeleteAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName - ); - console.log(result); -} - -async function main() { - devicesDelete(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesGenerateCapabilityImageSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesGenerateCapabilityImageSample.ts deleted file mode 100644 index 0b8aa2bbf895..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesGenerateCapabilityImageSample.ts +++ /dev/null @@ -1,57 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { - GenerateCapabilityImageRequest, - AzureSphereManagementClient -} from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product names to generate the image for a device that does not belong to a specific device group and product. - * - * @summary Generates the capability image for the device. Use '.unassigned' or '.default' for the device group and product names to generate the image for a device that does not belong to a specific device group and product. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostGenerateDeviceCapabilityImage.json - */ -async function devicesGenerateCapabilityImage() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const deviceName = - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - const generateDeviceCapabilityRequest: GenerateCapabilityImageRequest = { - capabilities: ["ApplicationDevelopment"] - }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.devices.beginGenerateCapabilityImageAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - generateDeviceCapabilityRequest - ); - console.log(result); -} - -async function main() { - devicesGenerateCapabilityImage(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesGetSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesGetSample.ts deleted file mode 100644 index a1757df75ce4..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesGetSample.ts +++ /dev/null @@ -1,50 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not belong to a device group and product. - * - * @summary Get a Device. Use '.unassigned' or '.default' for the device group and product names when a device does not belong to a device group and product. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDevice.json - */ -async function devicesGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const deviceName = - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.devices.get( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName - ); - console.log(result); -} - -async function main() { - devicesGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesListByDeviceGroupSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesListByDeviceGroupSample.ts deleted file mode 100644 index adf9d00b6d22..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesListByDeviceGroupSample.ts +++ /dev/null @@ -1,50 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * - * @summary List Device resources by DeviceGroup. '.default' and '.unassigned' are system defined values and cannot be used for product or device group name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetDevices.json - */ -async function devicesListByDeviceGroup() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "myDeviceGroup1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.devices.listByDeviceGroup( - resourceGroupName, - catalogName, - productName, - deviceGroupName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - devicesListByDeviceGroup(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesUpdateSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesUpdateSample.ts deleted file mode 100644 index 9cf38b2c1d13..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/devicesUpdateSample.ts +++ /dev/null @@ -1,52 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { DeviceUpdate, AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the catalog level. - * - * @summary Update a Device. Use '.unassigned' or '.default' for the device group and product names to move a device to the catalog level. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchDevice.json - */ -async function devicesUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const deviceGroupName = "MyDeviceGroup1"; - const deviceName = - "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"; - const properties: DeviceUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.devices.beginUpdateAndWait( - resourceGroupName, - catalogName, - productName, - deviceGroupName, - deviceName, - properties - ); - console.log(result); -} - -async function main() { - devicesUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesCreateOrUpdateSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesCreateOrUpdateSample.ts deleted file mode 100644 index e9e8994ba868..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesCreateOrUpdateSample.ts +++ /dev/null @@ -1,47 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Image, AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a Image - * - * @summary Create a Image - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutImage.json - */ -async function imageCreateOrUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const imageName = "default"; - const resource: Image = { image: "bXliYXNlNjRzdHJpbmc=" }; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.images.beginCreateOrUpdateAndWait( - resourceGroupName, - catalogName, - imageName, - resource - ); - console.log(result); -} - -async function main() { - imageCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesDeleteSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesDeleteSample.ts deleted file mode 100644 index 0f718263b451..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesDeleteSample.ts +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a Image - * - * @summary Delete a Image - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteImage.json - */ -async function imagesDelete() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const imageName = "imageID"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.images.beginDeleteAndWait( - resourceGroupName, - catalogName, - imageName - ); - console.log(result); -} - -async function main() { - imagesDelete(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesGetSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesGetSample.ts deleted file mode 100644 index bcac1b9833f1..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesGetSample.ts +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a Image - * - * @summary Get a Image - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetImage.json - */ -async function imagesGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const imageName = "myImageId"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.images.get( - resourceGroupName, - catalogName, - imageName - ); - console.log(result); -} - -async function main() { - imagesGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesListByCatalogSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesListByCatalogSample.ts deleted file mode 100644 index a12aa5269f22..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/imagesListByCatalogSample.ts +++ /dev/null @@ -1,46 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Image resources by Catalog - * - * @summary List Image resources by Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetImages.json - */ -async function imagesListByCatalog() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.images.listByCatalog( - resourceGroupName, - catalogName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - imagesListByCatalog(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/operationsListSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/operationsListSample.ts deleted file mode 100644 index 4d41d77a00ff..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/operationsListSample.ts +++ /dev/null @@ -1,40 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List the operations for the provider - * - * @summary List the operations for the provider - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetOperations.json - */ -async function operationsList() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - operationsList(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsCountDevicesSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsCountDevicesSample.ts deleted file mode 100644 index 51502ed9faec..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsCountDevicesSample.ts +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @summary Counts devices in product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostCountDevicesProduct.json - */ -async function productsCountDevices() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.products.countDevices( - resourceGroupName, - catalogName, - productName - ); - console.log(result); -} - -async function main() { - productsCountDevices(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsCreateOrUpdateSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsCreateOrUpdateSample.ts deleted file mode 100644 index 81f1c57e5c96..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsCreateOrUpdateSample.ts +++ /dev/null @@ -1,47 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { Product, AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @summary Create a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PutProduct.json - */ -async function productsCreateOrUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const resource: Product = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.products.beginCreateOrUpdateAndWait( - resourceGroupName, - catalogName, - productName, - resource - ); - console.log(result); -} - -async function main() { - productsCreateOrUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsDeleteSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsDeleteSample.ts deleted file mode 100644 index 39be3b6c014b..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsDeleteSample.ts +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name' - * - * @summary Delete a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name' - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/DeleteProduct.json - */ -async function productsDelete() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProductName1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.products.beginDeleteAndWait( - resourceGroupName, - catalogName, - productName - ); - console.log(result); -} - -async function main() { - productsDelete(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsGenerateDefaultDeviceGroupsSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsGenerateDefaultDeviceGroupsSample.ts deleted file mode 100644 index ebf13d8401d4..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsGenerateDefaultDeviceGroupsSample.ts +++ /dev/null @@ -1,48 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Generates default device groups for the product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @summary Generates default device groups for the product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PostGenerateDefaultDeviceGroups.json - */ -async function productsGenerateDefaultDeviceGroups() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.products.listGenerateDefaultDeviceGroups( - resourceGroupName, - catalogName, - productName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - productsGenerateDefaultDeviceGroups(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsGetSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsGetSample.ts deleted file mode 100644 index 01dc87f4cc4b..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsGetSample.ts +++ /dev/null @@ -1,45 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @summary Get a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetProduct.json - */ -async function productsGet() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.products.get( - resourceGroupName, - catalogName, - productName - ); - console.log(result); -} - -async function main() { - productsGet(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsListByCatalogSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsListByCatalogSample.ts deleted file mode 100644 index 6d3bc15f8a97..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsListByCatalogSample.ts +++ /dev/null @@ -1,46 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to List Product resources by Catalog - * - * @summary List Product resources by Catalog - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/GetProducts.json - */ -async function productsListByCatalog() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.products.listByCatalog( - resourceGroupName, - catalogName - )) { - resArray.push(item); - } - console.log(resArray); -} - -async function main() { - productsListByCatalog(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsUpdateSample.ts b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsUpdateSample.ts deleted file mode 100644 index 1bfce89ae874..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/src/productsUpdateSample.ts +++ /dev/null @@ -1,47 +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. - */ - -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. -import { ProductUpdate, AzureSphereManagementClient } from "@azure/arm-sphere"; -import { DefaultAzureCredential } from "@azure/identity"; -import * as dotenv from "dotenv"; - -dotenv.config(); - -/** - * This sample demonstrates how to Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * - * @summary Update a Product. '.default' and '.unassigned' are system defined values and cannot be used for product name. - * x-ms-original-file: specification/sphere/resource-manager/Microsoft.AzureSphere/preview/2022-09-01-preview/examples/PatchProduct.json - */ -async function productsUpdate() { - const subscriptionId = - process.env["SPHERE_SUBSCRIPTION_ID"] || - "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = - process.env["SPHERE_RESOURCE_GROUP"] || "MyResourceGroup1"; - const catalogName = "MyCatalog1"; - const productName = "MyProduct1"; - const properties: ProductUpdate = {}; - const credential = new DefaultAzureCredential(); - const client = new AzureSphereManagementClient(credential, subscriptionId); - const result = await client.products.beginUpdateAndWait( - resourceGroupName, - catalogName, - productName, - properties - ); - console.log(result); -} - -async function main() { - productsUpdate(); -} - -main().catch(console.error); diff --git a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/tsconfig.json b/sdk/sphere/arm-sphere/samples/v1-beta/typescript/tsconfig.json deleted file mode 100644 index e26ce2a6d8f7..000000000000 --- a/sdk/sphere/arm-sphere/samples/v1-beta/typescript/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "target": "ES2020", - "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/sphere/arm-sphere/src/operations/images.ts b/sdk/sphere/arm-sphere/src/operations/images.ts index ce13fe3874dd..8fafe0e399c6 100644 --- a/sdk/sphere/arm-sphere/src/operations/images.ts +++ b/sdk/sphere/arm-sphere/src/operations/images.ts @@ -150,7 +150,7 @@ export class ImagesImpl implements Images { * Get a Image * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use .default for image creation.. * @param options The options parameters. */ get( @@ -169,7 +169,7 @@ export class ImagesImpl implements Images { * Create a Image * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use .default for image creation.. * @param resource Resource create parameters. * @param options The options parameters. */ @@ -245,7 +245,7 @@ export class ImagesImpl implements Images { * Create a Image * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use .default for image creation.. * @param resource Resource create parameters. * @param options The options parameters. */ @@ -270,7 +270,7 @@ export class ImagesImpl implements Images { * Delete a Image * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use .default for image creation.. * @param options The options parameters. */ async beginDelete( @@ -336,7 +336,7 @@ export class ImagesImpl implements Images { * Delete a Image * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use .default for image creation.. * @param options The options parameters. */ async beginDeleteAndWait( diff --git a/sdk/sphere/arm-sphere/src/operationsInterfaces/images.ts b/sdk/sphere/arm-sphere/src/operationsInterfaces/images.ts index d97d072be78b..0ad67d01524b 100644 --- a/sdk/sphere/arm-sphere/src/operationsInterfaces/images.ts +++ b/sdk/sphere/arm-sphere/src/operationsInterfaces/images.ts @@ -36,7 +36,7 @@ export interface Images { * Get a Image * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use .default for image creation.. * @param options The options parameters. */ get( @@ -49,7 +49,7 @@ export interface Images { * Create a Image * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use .default for image creation.. * @param resource Resource create parameters. * @param options The options parameters. */ @@ -69,7 +69,7 @@ export interface Images { * Create a Image * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use .default for image creation.. * @param resource Resource create parameters. * @param options The options parameters. */ @@ -84,7 +84,7 @@ export interface Images { * Delete a Image * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use .default for image creation.. * @param options The options parameters. */ beginDelete( @@ -97,7 +97,7 @@ export interface Images { * Delete a Image * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param catalogName Name of catalog - * @param imageName Image name. Use .default for image creation. + * @param imageName Image name. Use .default for image creation.. * @param options The options parameters. */ beginDeleteAndWait( diff --git a/sdk/sphere/arm-sphere/test/sampleTest.ts b/sdk/sphere/arm-sphere/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/sphere/arm-sphere/test/sampleTest.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 { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + 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" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/sphere/arm-sphere/test/sphere_operations_test.spec.ts b/sdk/sphere/arm-sphere/test/sphere_operations_test.spec.ts deleted file mode 100644 index d86e4dac7f19..000000000000 --- a/sdk/sphere/arm-sphere/test/sphere_operations_test.spec.ts +++ /dev/null @@ -1,101 +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 { - env, - Recorder, - RecorderStartOptions, - delay, - isPlaybackMode, -} from "@azure-tools/test-recorder"; -import { createTestCredential } from "@azure-tools/test-credential"; -import { assert } from "chai"; -import { Context } from "mocha"; -import { AzureSphereManagementClient } from "../src/azureSphereManagementClient"; - -const replaceableVariables: Record = { - 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" -}; - -const recorderOptions: RecorderStartOptions = { - envSetupForPlayback: replaceableVariables -}; - -export const testPollingOptions = { - updateIntervalInMs: isPlaybackMode() ? 0 : undefined, -}; - -describe("Sphere test", () => { - let recorder: Recorder; - let subscriptionId: string; - let client: AzureSphereManagementClient; - let location: string; - let resourceGroup: string; - let resourcename: string; - - beforeEach(async function (this: Context) { - recorder = new Recorder(this.currentTest); - await recorder.start(recorderOptions); - subscriptionId = env.SUBSCRIPTION_ID || ''; - // This is an example of how the environment variables are used - const credential = createTestCredential(); - client = new AzureSphereManagementClient(credential, subscriptionId, recorder.configureClientOptions({})); - location = "eastus"; - resourceGroup = "myjstest"; - resourcename = "resourcetest"; - - }); - - afterEach(async function () { - await recorder.stop(); - }); - - it.skip("catalogs create test", async function () { - const res = await client.catalogs.beginCreateOrUpdateAndWait( - resourceGroup, - resourcename, - { location: "global" }, - testPollingOptions); - assert.equal(res.name, resourcename); - }); - - it("catalogs get test", async function () { - const res = await client.catalogs.get(resourceGroup, - resourcename); - assert.equal(res.name, resourcename); - }); - - it("catalogs list test", async function () { - const resArray = new Array(); - for await (let item of client.catalogs.listByResourceGroup(resourceGroup)) { - resArray.push(item); - } - assert.equal(resArray.length, 1); - }); - - it("operations list test", async function () { - const resArray = new Array(); - for await (let item of client.operations.list()) { - resArray.push(item); - } - assert.notEqual(resArray.length, 0); - }); - - it.skip("catalogs delete test", async function () { - const res = await client.catalogs.beginDeleteAndWait(resourceGroup, - resourcename, testPollingOptions); - const resArray = new Array(); - for await (let item of client.catalogs.listByResourceGroup(resourceGroup)) { - resArray.push(item); - } - assert.equal(resArray.length, 0); - }); -}) diff --git a/sdk/sphere/arm-sphere/tsconfig.json b/sdk/sphere/arm-sphere/tsconfig.json index 32ac9662cc3f..3e6ae96443f3 100644 --- a/sdk/sphere/arm-sphere/tsconfig.json +++ b/sdk/sphere/arm-sphere/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-sphere": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"