From 7776894900af17339424f3ac07941b4f0ce00ce1 Mon Sep 17 00:00:00 2001 From: ZiWei Chen <98569699+kazrael2119@users.noreply.github.com> Date: Fri, 28 Feb 2025 11:30:05 +0800 Subject: [PATCH] [mgmt] deviceregistry release (#33083) https://github.com/Azure/sdk-release-request/issues/5879 --- common/config/rush/pnpm-lock.yaml | 7 +- .../arm-deviceregistry/CHANGELOG.md | 195 +-- .../arm-deviceregistry/README.md | 2 +- .../arm-deviceregistry/assets.json | 2 +- .../arm-deviceregistry/eslint.config.mjs | 7 +- .../arm-deviceregistry/package.json | 21 +- .../review/arm-deviceregistry-models.api.md | 215 +-- .../review/arm-deviceregistry.api.md | 379 +---- ...tEndpointProfilesCreateOrReplaceSample.ts} | 6 +- ...filesAssetEndpointProfilesDeleteSample.ts} | 2 +- ...ProfilesAssetEndpointProfilesGetSample.ts} | 6 +- ...pointProfilesListByResourceGroupSample.ts} | 4 +- ...dpointProfilesListBySubscriptionSample.ts} | 4 +- ...filesAssetEndpointProfilesUpdateSample.ts} | 6 +- .../assetsAssetsCreateOrReplaceSample.ts} | 26 +- ...eSample.ts => assetsAssetsDeleteSample.ts} | 2 +- .../assetsAssetsGetSample.ts} | 6 +- .../assetsAssetsListByResourceGroupSample.ts} | 4 +- .../assetsAssetsListBySubscriptionSample.ts} | 4 +- ...eSample.ts => assetsAssetsUpdateSample.ts} | 2 +- ...ngContainersBillingContainersGetSample.ts} | 2 +- ...lingContainersListBySubscriptionSample.ts} | 4 +- ...etEndpointProfilesCreateOrReplaceSample.ts | 44 - ...overedAssetEndpointProfilesDeleteSample.ts | 27 - ...iscoveredAssetEndpointProfilesGetSample.ts | 28 - ...dpointProfilesListByResourceGroupSample.ts | 31 - ...ndpointProfilesListBySubscriptionSample.ts | 29 - ...overedAssetEndpointProfilesUpdateSample.ts | 38 - .../discoveredAssetsCreateOrReplaceSample.ts | 88 -- .../discoveredAssetsDeleteSample.ts | 24 - .../samples-dev/discoveredAssetsGetSample.ts | 25 - ...scoveredAssetsListByResourceGroupSample.ts | 29 - ...iscoveredAssetsListBySubscriptionSample.ts | 29 - .../discoveredAssetsUpdateSample.ts | 30 - ...perationStatusOperationStatusGetSample.ts} | 2 +- .../operationsOperationsListSample.ts} | 4 +- .../schemaRegistriesCreateOrReplaceSample.ts | 39 - .../schemaRegistriesDeleteSample.ts | 24 - .../samples-dev/schemaRegistriesGetSample.ts | 25 - ...hemaRegistriesListByResourceGroupSample.ts | 29 - ...chemaRegistriesListBySubscriptionSample.ts | 29 - .../schemaRegistriesUpdateSample.ts | 31 - .../schemaVersionsCreateOrReplaceSample.ts | 37 - .../samples-dev/schemaVersionsDeleteSample.ts | 24 - .../samples-dev/schemaVersionsGetSample.ts | 30 - .../schemaVersionsListBySchemaSample.ts | 33 - .../schemasCreateOrReplaceSample.ts | 38 - .../samples-dev/schemasDeleteSample.ts | 24 - .../samples-dev/schemasGetSample.ts | 25 - .../schemasListBySchemaRegistrySample.ts | 32 - .../samples/v1-beta/javascript/README.md | 132 -- ...etEndpointProfilesCreateOrReplaceSample.js | 44 - ...overedAssetEndpointProfilesDeleteSample.js | 27 - ...iscoveredAssetEndpointProfilesGetSample.js | 28 - ...dpointProfilesListByResourceGroupSample.js | 31 - ...ndpointProfilesListBySubscriptionSample.js | 29 - ...overedAssetEndpointProfilesUpdateSample.js | 38 - .../discoveredAssetsCreateOrReplaceSample.js | 88 -- .../discoveredAssetsDeleteSample.js | 24 - .../javascript/discoveredAssetsGetSample.js | 25 - ...scoveredAssetsListByResourceGroupSample.js | 29 - ...iscoveredAssetsListBySubscriptionSample.js | 29 - .../discoveredAssetsUpdateSample.js | 30 - .../schemaRegistriesCreateOrReplaceSample.js | 39 - .../schemaRegistriesDeleteSample.js | 24 - .../javascript/schemaRegistriesGetSample.js | 25 - ...hemaRegistriesListByResourceGroupSample.js | 29 - ...chemaRegistriesListBySubscriptionSample.js | 29 - .../schemaRegistriesUpdateSample.js | 31 - .../schemaVersionsCreateOrReplaceSample.js | 37 - .../javascript/schemaVersionsDeleteSample.js | 24 - .../javascript/schemaVersionsGetSample.js | 30 - .../schemaVersionsListBySchemaSample.js | 33 - .../schemasCreateOrReplaceSample.js | 38 - .../v1-beta/javascript/schemasDeleteSample.js | 24 - .../v1-beta/javascript/schemasGetSample.js | 25 - .../schemasListBySchemaRegistrySample.js | 32 - .../samples/v1-beta/typescript/README.md | 145 -- ...etEndpointProfilesCreateOrReplaceSample.ts | 44 - ...overedAssetEndpointProfilesDeleteSample.ts | 27 - ...iscoveredAssetEndpointProfilesGetSample.ts | 28 - ...dpointProfilesListByResourceGroupSample.ts | 31 - ...ndpointProfilesListBySubscriptionSample.ts | 29 - ...overedAssetEndpointProfilesUpdateSample.ts | 38 - .../discoveredAssetsCreateOrReplaceSample.ts | 88 -- .../src/discoveredAssetsDeleteSample.ts | 24 - .../src/discoveredAssetsGetSample.ts | 25 - ...scoveredAssetsListByResourceGroupSample.ts | 29 - ...iscoveredAssetsListBySubscriptionSample.ts | 29 - .../src/discoveredAssetsUpdateSample.ts | 30 - .../schemaRegistriesCreateOrReplaceSample.ts | 39 - .../src/schemaRegistriesDeleteSample.ts | 24 - .../src/schemaRegistriesGetSample.ts | 25 - ...hemaRegistriesListByResourceGroupSample.ts | 29 - ...chemaRegistriesListBySubscriptionSample.ts | 29 - .../src/schemaRegistriesUpdateSample.ts | 31 - .../schemaVersionsCreateOrReplaceSample.ts | 37 - .../src/schemaVersionsDeleteSample.ts | 24 - .../typescript/src/schemaVersionsGetSample.ts | 30 - .../src/schemaVersionsListBySchemaSample.ts | 33 - .../src/schemasCreateOrReplaceSample.ts | 38 - .../typescript/src/schemasDeleteSample.ts | 24 - .../typescript/src/schemasGetSample.ts | 25 - .../src/schemasListBySchemaRegistrySample.ts | 32 - .../samples/v1-beta/typescript/tsconfig.json | 17 - .../samples/v1/javascript/README.md | 80 + ...tEndpointProfilesCreateOrReplaceSample.js} | 6 +- ...filesAssetEndpointProfilesDeleteSample.js} | 4 +- ...ProfilesAssetEndpointProfilesGetSample.js} | 6 +- ...pointProfilesListByResourceGroupSample.js} | 4 +- ...dpointProfilesListBySubscriptionSample.js} | 4 +- ...filesAssetEndpointProfilesUpdateSample.js} | 8 +- .../assetsAssetsCreateOrReplaceSample.js} | 26 +- .../javascript/assetsAssetsDeleteSample.js} | 4 +- .../javascript/assetsAssetsGetSample.js} | 6 +- .../assetsAssetsListByResourceGroupSample.js} | 4 +- .../assetsAssetsListBySubscriptionSample.js} | 4 +- .../javascript/assetsAssetsUpdateSample.js} | 4 +- ...ngContainersBillingContainersGetSample.js} | 4 +- ...lingContainersListBySubscriptionSample.js} | 4 +- ...perationStatusOperationStatusGetSample.js} | 4 +- .../operationsOperationsListSample.js} | 4 +- .../{v1-beta => v1}/javascript/package.json | 8 +- .../{v1-beta => v1}/javascript/sample.env | 0 .../samples/v1/typescript/README.md | 93 ++ .../{v1-beta => v1}/typescript/package.json | 8 +- .../{v1-beta => v1}/typescript/sample.env | 0 ...tEndpointProfilesCreateOrReplaceSample.ts} | 6 +- ...filesAssetEndpointProfilesDeleteSample.ts} | 9 +- ...ProfilesAssetEndpointProfilesGetSample.ts} | 6 +- ...pointProfilesListByResourceGroupSample.ts} | 6 +- ...dpointProfilesListBySubscriptionSample.ts} | 4 +- ...filesAssetEndpointProfilesUpdateSample.ts} | 8 +- .../src/assetsAssetsCreateOrReplaceSample.ts} | 28 +- .../src/assetsAssetsDeleteSample.ts} | 4 +- .../typescript/src/assetsAssetsGetSample.ts} | 6 +- .../assetsAssetsListByResourceGroupSample.ts} | 4 +- .../assetsAssetsListBySubscriptionSample.ts} | 4 +- .../src/assetsAssetsUpdateSample.ts} | 4 +- ...ngContainersBillingContainersGetSample.ts} | 4 +- ...lingContainersListBySubscriptionSample.ts} | 4 +- ...perationStatusOperationStatusGetSample.ts} | 4 +- .../src/operationsOperationsListSample.ts} | 4 +- .../samples/v1/typescript/tsconfig.json | 20 + .../src/api/assetEndpointProfiles/index.ts | 337 +++-- .../src/api/assets/index.ts | 307 ++-- .../src/api/billingContainers/index.ts | 106 +- .../api/deviceRegistryManagementContext.ts | 21 +- .../discoveredAssetEndpointProfiles/index.ts | 370 ----- .../src/api/discoveredAssets/index.ts | 343 ----- .../arm-deviceregistry/src/api/index.ts | 114 +- .../src/api/operationStatus/index.ts | 31 +- .../src/api/operations/index.ts | 16 +- .../arm-deviceregistry/src/api/options.ts | 138 +- .../src/api/schemaRegistries/index.ts | 343 ----- .../src/api/schemaVersions/index.ts | 251 ---- .../src/api/schemas/index.ts | 231 --- .../classic/assetEndpointProfiles/index.ts | 125 +- .../src/classic/assets/index.ts | 111 +- .../src/classic/billingContainers/index.ts | 28 +- .../discoveredAssetEndpointProfiles/index.ts | 147 -- .../src/classic/discoveredAssets/index.ts | 131 -- .../arm-deviceregistry/src/classic/index.ts | 5 - .../src/classic/operationStatus/index.ts | 12 +- .../src/classic/operations/index.ts | 6 +- .../src/classic/schemaRegistries/index.ts | 131 -- .../src/classic/schemaVersions/index.ts | 135 -- .../src/classic/schemas/index.ts | 120 -- .../src/deviceRegistryManagementClient.ts | 83 +- .../src/helpers/serializerHelpers.ts | 36 - .../arm-deviceregistry/src/index.ts | 106 +- .../arm-deviceregistry/src/models/index.ts | 45 +- .../arm-deviceregistry/src/models/models.ts | 1319 +++-------------- .../src/restorePollerHelpers.ts | 92 +- .../arm-deviceregistry/tsp-location.yaml | 4 +- .../vitest.browser.config.ts | 3 +- .../arm-deviceregistry/vitest.config.ts | 1 + .../arm-deviceregistry/vitest.esm.config.ts | 6 +- 178 files changed, 1289 insertions(+), 8107 deletions(-) rename sdk/deviceregistry/arm-deviceregistry/{samples/v1-beta/typescript/src/assetEndpointProfilesCreateOrReplaceSample.ts => samples-dev/assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.ts} (92%) rename sdk/deviceregistry/arm-deviceregistry/samples-dev/{assetEndpointProfilesDeleteSample.ts => assetEndpointProfilesAssetEndpointProfilesDeleteSample.ts} (91%) rename sdk/deviceregistry/arm-deviceregistry/{samples/v1-beta/typescript/src/assetEndpointProfilesGetSample.ts => samples-dev/assetEndpointProfilesAssetEndpointProfilesGetSample.ts} (87%) rename sdk/deviceregistry/arm-deviceregistry/{samples/v1-beta/typescript/src/assetEndpointProfilesListByResourceGroupSample.ts => samples-dev/assetEndpointProfilesAssetEndpointProfilesListByResourceGroupSample.ts} (87%) rename sdk/deviceregistry/arm-deviceregistry/{samples/v1-beta/typescript/src/assetEndpointProfilesListBySubscriptionSample.ts => samples-dev/assetEndpointProfilesAssetEndpointProfilesListBySubscriptionSample.ts} (87%) rename sdk/deviceregistry/arm-deviceregistry/samples-dev/{assetEndpointProfilesUpdateSample.ts => assetEndpointProfilesAssetEndpointProfilesUpdateSample.ts} (84%) rename sdk/deviceregistry/arm-deviceregistry/{samples/v1-beta/typescript/src/assetsCreateOrReplaceSample.ts => samples-dev/assetsAssetsCreateOrReplaceSample.ts} (97%) rename sdk/deviceregistry/arm-deviceregistry/samples-dev/{assetsDeleteSample.ts => assetsAssetsDeleteSample.ts} (92%) rename sdk/deviceregistry/arm-deviceregistry/{samples/v1-beta/typescript/src/assetsGetSample.ts => samples-dev/assetsAssetsGetSample.ts} (89%) rename sdk/deviceregistry/arm-deviceregistry/{samples/v1-beta/typescript/src/assetsListByResourceGroupSample.ts => samples-dev/assetsAssetsListByResourceGroupSample.ts} (89%) rename sdk/deviceregistry/arm-deviceregistry/{samples/v1-beta/typescript/src/assetsListBySubscriptionSample.ts => samples-dev/assetsAssetsListBySubscriptionSample.ts} (89%) rename sdk/deviceregistry/arm-deviceregistry/samples-dev/{assetsUpdateSample.ts => assetsAssetsUpdateSample.ts} (93%) rename sdk/deviceregistry/arm-deviceregistry/samples-dev/{billingContainersGetSample.ts => billingContainersBillingContainersGetSample.ts} (91%) rename sdk/deviceregistry/arm-deviceregistry/{samples/v1-beta/typescript/src/billingContainersListBySubscriptionSample.ts => samples-dev/billingContainersBillingContainersListBySubscriptionSample.ts} (87%) delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesCreateOrReplaceSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesDeleteSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesGetSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesListByResourceGroupSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesListBySubscriptionSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesUpdateSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsCreateOrReplaceSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsDeleteSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsGetSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsListByResourceGroupSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsListBySubscriptionSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsUpdateSample.ts rename sdk/deviceregistry/arm-deviceregistry/samples-dev/{operationStatusGetSample.ts => operationStatusOperationStatusGetSample.ts} (92%) rename sdk/deviceregistry/arm-deviceregistry/{samples/v1-beta/typescript/src/operationsListSample.ts => samples-dev/operationsOperationsListSample.ts} (90%) delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesCreateOrReplaceSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesDeleteSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesGetSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesListByResourceGroupSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesListBySubscriptionSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesUpdateSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaVersionsCreateOrReplaceSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaVersionsDeleteSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaVersionsGetSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaVersionsListBySchemaSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/schemasCreateOrReplaceSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/schemasDeleteSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/schemasGetSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples-dev/schemasListBySchemaRegistrySample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/README.md delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesCreateOrReplaceSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesDeleteSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesGetSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesListByResourceGroupSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesListBySubscriptionSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesUpdateSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsCreateOrReplaceSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsDeleteSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsGetSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsListByResourceGroupSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsListBySubscriptionSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsUpdateSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesCreateOrReplaceSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesDeleteSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesGetSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesListByResourceGroupSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesListBySubscriptionSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesUpdateSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsCreateOrReplaceSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsDeleteSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsGetSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsListBySchemaSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasCreateOrReplaceSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasDeleteSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasGetSample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasListBySchemaRegistrySample.js delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/README.md delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesCreateOrReplaceSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesDeleteSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesGetSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesListByResourceGroupSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesListBySubscriptionSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesUpdateSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsCreateOrReplaceSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsDeleteSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsGetSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsListByResourceGroupSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsListBySubscriptionSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsUpdateSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesCreateOrReplaceSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesDeleteSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesGetSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesListByResourceGroupSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesListBySubscriptionSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesUpdateSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsCreateOrReplaceSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsDeleteSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsGetSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsListBySchemaSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasCreateOrReplaceSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasDeleteSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasGetSample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasListBySchemaRegistrySample.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/tsconfig.json create mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/README.md rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/javascript/assetEndpointProfilesCreateOrReplaceSample.js => v1/javascript/assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.js} (92%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/javascript/assetEndpointProfilesDeleteSample.js => v1/javascript/assetEndpointProfilesAssetEndpointProfilesDeleteSample.js} (87%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/javascript/assetEndpointProfilesGetSample.js => v1/javascript/assetEndpointProfilesAssetEndpointProfilesGetSample.js} (87%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/javascript/assetEndpointProfilesListByResourceGroupSample.js => v1/javascript/assetEndpointProfilesAssetEndpointProfilesListByResourceGroupSample.js} (87%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/javascript/assetEndpointProfilesListBySubscriptionSample.js => v1/javascript/assetEndpointProfilesAssetEndpointProfilesListBySubscriptionSample.js} (86%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/javascript/assetEndpointProfilesUpdateSample.js => v1/javascript/assetEndpointProfilesAssetEndpointProfilesUpdateSample.js} (79%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/javascript/assetsCreateOrReplaceSample.js => v1/javascript/assetsAssetsCreateOrReplaceSample.js} (97%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/javascript/assetsDeleteSample.js => v1/javascript/assetsAssetsDeleteSample.js} (89%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/javascript/assetsGetSample.js => v1/javascript/assetsAssetsGetSample.js} (88%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/javascript/assetsListByResourceGroupSample.js => v1/javascript/assetsAssetsListByResourceGroupSample.js} (88%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/javascript/assetsListBySubscriptionSample.js => v1/javascript/assetsAssetsListBySubscriptionSample.js} (88%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/javascript/assetsUpdateSample.js => v1/javascript/assetsAssetsUpdateSample.js} (90%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/javascript/billingContainersGetSample.js => v1/javascript/billingContainersBillingContainersGetSample.js} (88%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/javascript/billingContainersListBySubscriptionSample.js => v1/javascript/billingContainersBillingContainersListBySubscriptionSample.js} (87%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/javascript/operationStatusGetSample.js => v1/javascript/operationStatusOperationStatusGetSample.js} (89%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/javascript/operationsListSample.js => v1/javascript/operationsOperationsListSample.js} (90%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta => v1}/javascript/package.json (82%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta => v1}/javascript/sample.env (100%) create mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/README.md rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta => v1}/typescript/package.json (85%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta => v1}/typescript/sample.env (100%) rename sdk/deviceregistry/arm-deviceregistry/{samples-dev/assetEndpointProfilesCreateOrReplaceSample.ts => samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.ts} (91%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/typescript/src/assetEndpointProfilesDeleteSample.ts => v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesDeleteSample.ts} (75%) rename sdk/deviceregistry/arm-deviceregistry/{samples-dev/assetEndpointProfilesGetSample.ts => samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesGetSample.ts} (86%) rename sdk/deviceregistry/arm-deviceregistry/{samples-dev/assetEndpointProfilesListByResourceGroupSample.ts => samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesListByResourceGroupSample.ts} (82%) rename sdk/deviceregistry/arm-deviceregistry/{samples-dev/assetEndpointProfilesListBySubscriptionSample.ts => samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesListBySubscriptionSample.ts} (83%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/typescript/src/assetEndpointProfilesUpdateSample.ts => v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesUpdateSample.ts} (80%) rename sdk/deviceregistry/arm-deviceregistry/{samples-dev/assetsCreateOrReplaceSample.ts => samples/v1/typescript/src/assetsAssetsCreateOrReplaceSample.ts} (96%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/typescript/src/assetsDeleteSample.ts => v1/typescript/src/assetsAssetsDeleteSample.ts} (89%) rename sdk/deviceregistry/arm-deviceregistry/{samples-dev/assetsGetSample.ts => samples/v1/typescript/src/assetsAssetsGetSample.ts} (87%) rename sdk/deviceregistry/arm-deviceregistry/{samples-dev/assetsListByResourceGroupSample.ts => samples/v1/typescript/src/assetsAssetsListByResourceGroupSample.ts} (83%) rename sdk/deviceregistry/arm-deviceregistry/{samples-dev/assetsListBySubscriptionSample.ts => samples/v1/typescript/src/assetsAssetsListBySubscriptionSample.ts} (85%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/typescript/src/assetsUpdateSample.ts => v1/typescript/src/assetsAssetsUpdateSample.ts} (91%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/typescript/src/billingContainersGetSample.ts => v1/typescript/src/billingContainersBillingContainersGetSample.ts} (88%) rename sdk/deviceregistry/arm-deviceregistry/{samples-dev/billingContainersListBySubscriptionSample.ts => samples/v1/typescript/src/billingContainersBillingContainersListBySubscriptionSample.ts} (84%) rename sdk/deviceregistry/arm-deviceregistry/samples/{v1-beta/typescript/src/operationStatusGetSample.ts => v1/typescript/src/operationStatusOperationStatusGetSample.ts} (90%) rename sdk/deviceregistry/arm-deviceregistry/{samples-dev/operationsListSample.ts => samples/v1/typescript/src/operationsOperationsListSample.ts} (86%) create mode 100644 sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/tsconfig.json delete mode 100644 sdk/deviceregistry/arm-deviceregistry/src/api/discoveredAssetEndpointProfiles/index.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/src/api/discoveredAssets/index.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/src/api/schemaRegistries/index.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/src/api/schemaVersions/index.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/src/api/schemas/index.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/src/classic/discoveredAssetEndpointProfiles/index.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/src/classic/discoveredAssets/index.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/src/classic/schemaRegistries/index.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/src/classic/schemaVersions/index.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/src/classic/schemas/index.ts delete mode 100644 sdk/deviceregistry/arm-deviceregistry/src/helpers/serializerHelpers.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index abae50eccb7..de0e57f7e6b 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -2890,7 +2890,7 @@ packages: version: 0.0.0 '@rush-temp/arm-deviceregistry@file:projects/arm-deviceregistry.tgz': - resolution: {integrity: sha512-6MciE8WhOTd75MHBzJJ+eSumcMuecnGFco8XkvsDZwOHQNHuR1luCf/y1ZEuDPSdKHkEs2nGh1gp0EcI1QRPpw==, tarball: file:projects/arm-deviceregistry.tgz} + resolution: {integrity: sha512-nbkGWWxfuZ3frXP7Xxhi7/94xD1sNfJv8sre7K4QScigBkJ0zT/ekOYU+mcijsT1r4BCpsz4b8Kb8b+ksimW+g==, tarball: file:projects/arm-deviceregistry.tgz} version: 0.0.0 '@rush-temp/arm-deviceupdate@file:projects/arm-deviceupdate.tgz': @@ -13070,14 +13070,15 @@ snapshots: '@rush-temp/arm-deviceregistry@file:projects/arm-deviceregistry.tgz(@types/debug@4.1.12)(msw@2.7.2(@types/node@22.7.9)(typescript@5.7.3))(tsx@4.19.3)(vite@6.1.1(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(yaml@2.7.0)': dependencies: + '@microsoft/api-extractor': 7.50.1(@types/node@18.19.76) '@types/node': 18.19.76 - '@vitest/browser': 3.0.6(@types/node@18.19.76)(playwright@1.50.1)(typescript@5.7.3)(vite@6.1.1(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.6) + '@vitest/browser': 3.0.6(@types/node@18.19.76)(playwright@1.50.1)(typescript@5.6.3)(vite@6.1.1(@types/node@22.7.9)(tsx@4.19.3)(yaml@2.7.0))(vitest@3.0.6) '@vitest/coverage-istanbul': 3.0.6(vitest@3.0.6) dotenv: 16.4.7 eslint: 9.21.0 playwright: 1.50.1 tslib: 2.8.1 - typescript: 5.7.3 + typescript: 5.6.3 vitest: 3.0.6(@types/debug@4.1.12)(@types/node@18.19.76)(@vitest/browser@3.0.6)(msw@2.7.2(@types/node@22.7.9)(typescript@5.7.3))(tsx@4.19.3)(yaml@2.7.0) transitivePeerDependencies: - '@edge-runtime/vm' diff --git a/sdk/deviceregistry/arm-deviceregistry/CHANGELOG.md b/sdk/deviceregistry/arm-deviceregistry/CHANGELOG.md index 28f77ed8869..269ca8c2f92 100644 --- a/sdk/deviceregistry/arm-deviceregistry/CHANGELOG.md +++ b/sdk/deviceregistry/arm-deviceregistry/CHANGELOG.md @@ -1,196 +1,7 @@ # Release History -## 1.0.0-beta.2 (2024-12-12) -Compared with version 1.0.0-beta.1 - -### Features Added - - - Added operation group BillingContainersOperations - - Added operation group DiscoveredAssetEndpointProfilesOperations - - Added operation group DiscoveredAssetsOperations - - Added operation group SchemaRegistriesOperations - - Added operation group SchemasOperations - - Added operation group SchemaVersionsOperations - - Added operation AssetEndpointProfilesOperations.createOrReplace - - Added operation AssetEndpointProfilesOperations.delete - - Added operation AssetEndpointProfilesOperations.update - - Added operation AssetsOperations.createOrReplace - - Added operation AssetsOperations.delete - - Added operation AssetsOperations.update - - Added Interface AssetEndpointProfileStatus - - Added Interface AssetEndpointProfileStatusError - - Added Interface AssetStatusDataset - - Added Interface AssetStatusEvent - - Added Interface Authentication - - Added Interface BillingContainer - - Added Interface BillingContainerProperties - - Added Interface BillingContainersGetOptionalParams - - Added Interface BillingContainersListBySubscriptionOptionalParams - - Added Interface DataPointBase - - Added Interface Dataset - - Added Interface DiscoveredAsset - - Added Interface DiscoveredAssetEndpointProfile - - Added Interface DiscoveredAssetEndpointProfileProperties - - Added Interface DiscoveredAssetEndpointProfilesCreateOrReplaceOptionalParams - - Added Interface DiscoveredAssetEndpointProfilesDeleteOptionalParams - - Added Interface DiscoveredAssetEndpointProfilesGetOptionalParams - - Added Interface DiscoveredAssetEndpointProfilesListByResourceGroupOptionalParams - - Added Interface DiscoveredAssetEndpointProfilesListBySubscriptionOptionalParams - - Added Interface DiscoveredAssetEndpointProfilesUpdateOptionalParams - - Added Interface DiscoveredAssetEndpointProfileUpdate - - Added Interface DiscoveredAssetEndpointProfileUpdateProperties - - Added Interface DiscoveredAssetProperties - - Added Interface DiscoveredAssetsCreateOrReplaceOptionalParams - - Added Interface DiscoveredAssetsDeleteOptionalParams - - Added Interface DiscoveredAssetsGetOptionalParams - - Added Interface DiscoveredAssetsListByResourceGroupOptionalParams - - Added Interface DiscoveredAssetsListBySubscriptionOptionalParams - - Added Interface DiscoveredAssetsUpdateOptionalParams - - Added Interface DiscoveredAssetUpdate - - Added Interface DiscoveredAssetUpdateProperties - - Added Interface DiscoveredDataPoint - - Added Interface DiscoveredDataset - - Added Interface DiscoveredEvent - - Added Interface EventBase - - Added Interface MessageSchemaReference - - Added Interface PagedAsyncIterableIterator - - Added Interface PageSettings - - Added Interface ProxyResource - - Added Interface RestorePollerOptions - - Added Interface Schema - - Added Interface SchemaProperties - - Added Interface SchemaRegistriesCreateOrReplaceOptionalParams - - Added Interface SchemaRegistriesDeleteOptionalParams - - Added Interface SchemaRegistriesGetOptionalParams - - Added Interface SchemaRegistriesListByResourceGroupOptionalParams - - Added Interface SchemaRegistriesListBySubscriptionOptionalParams - - Added Interface SchemaRegistriesUpdateOptionalParams - - Added Interface SchemaRegistry - - Added Interface SchemaRegistryProperties - - Added Interface SchemaRegistryUpdate - - Added Interface SchemaRegistryUpdateProperties - - Added Interface SchemasCreateOrReplaceOptionalParams - - Added Interface SchemasDeleteOptionalParams - - Added Interface SchemasGetOptionalParams - - Added Interface SchemasListBySchemaRegistryOptionalParams - - Added Interface SchemaVersion - - Added Interface SchemaVersionProperties - - Added Interface SchemaVersionsCreateOrReplaceOptionalParams - - Added Interface SchemaVersionsDeleteOptionalParams - - Added Interface SchemaVersionsGetOptionalParams - - Added Interface SchemaVersionsListBySchemaOptionalParams - - Added Interface SystemAssignedServiceIdentity - - Added Interface Topic - - Added Type Alias AuthenticationMethod - - Added Type Alias ContinuablePage - - Added Type Alias DataPointObservabilityMode - - Added Type Alias EventObservabilityMode - - Added Type Alias Format - - Added Type Alias SchemaType - - Added Type Alias SystemAssignedServiceIdentityType - - Added Type Alias TopicRetainType - - Interface AssetEndpointProfileProperties has a new optional parameter authentication - - Interface AssetEndpointProfileProperties has a new optional parameter discoveredAssetEndpointProfileRef - - Interface AssetEndpointProfileProperties has a new optional parameter status - - Interface AssetEndpointProfileUpdateProperties has a new optional parameter authentication - - Interface AssetEndpointProfileUpdateProperties has a new optional parameter endpointProfileType - - Interface AssetProperties has a new optional parameter datasets - - Interface AssetProperties has a new optional parameter defaultDatasetsConfiguration - - Interface AssetProperties has a new optional parameter defaultTopic - - Interface AssetProperties has a new optional parameter discoveredAssetRefs - - Interface AssetStatus has a new optional parameter datasets - - Interface AssetStatus has a new optional parameter events - - Interface AssetUpdateProperties has a new optional parameter datasets - - Interface AssetUpdateProperties has a new optional parameter defaultDatasetsConfiguration - - Interface AssetUpdateProperties has a new optional parameter defaultTopic - - Added Enum KnownAuthenticationMethod - - Added Enum KnownDataPointObservabilityMode - - Added Enum KnownEventObservabilityMode - - Added Enum KnownFormat - - Added Enum KnownSchemaType - - Added Enum KnownSystemAssignedServiceIdentityType - - Added Enum KnownTopicRetainType - - Added Enum KnownVersions - - Enum KnownOrigin has a new value "user,system" - - Enum KnownOrigin has a new value system - - Enum KnownOrigin has a new value user - - Enum KnownProvisioningState has a new value Deleting - - Added function restorePoller - -### Breaking Changes +## 1.0.0 (2025-02-27) - - Removed operation AssetEndpointProfiles.beginCreateOrReplace - - Removed operation AssetEndpointProfiles.beginCreateOrReplaceAndWait - - Removed operation AssetEndpointProfiles.beginDelete - - Removed operation AssetEndpointProfiles.beginDeleteAndWait - - Removed operation AssetEndpointProfiles.beginUpdate - - Removed operation AssetEndpointProfiles.beginUpdateAndWait - - Removed operation Assets.beginCreateOrReplace - - Removed operation Assets.beginCreateOrReplaceAndWait - - Removed operation Assets.beginDelete - - Removed operation Assets.beginDeleteAndWait - - Removed operation Assets.beginUpdate - - Removed operation Assets.beginUpdateAndWait - - Class DeviceRegistryManagementClient has a new signature - - Interface AssetEndpointProfileProperties no longer has parameter transportAuthentication - - Interface AssetEndpointProfileProperties no longer has parameter userAuthentication - - Interface AssetEndpointProfilesCreateOrReplaceOptionalParams no longer has parameter resumeFrom - - Interface AssetEndpointProfilesDeleteOptionalParams no longer has parameter resumeFrom - - Interface AssetEndpointProfilesUpdateOptionalParams no longer has parameter resumeFrom - - Interface AssetEndpointProfileUpdateProperties no longer has parameter transportAuthentication - - Interface AssetEndpointProfileUpdateProperties no longer has parameter userAuthentication - - Interface AssetProperties no longer has parameter assetEndpointProfileUri - - Interface AssetProperties no longer has parameter assetType - - Interface AssetProperties no longer has parameter dataPoints - - Interface AssetProperties no longer has parameter defaultDataPointsConfiguration - - Interface AssetsCreateOrReplaceOptionalParams no longer has parameter resumeFrom - - Interface AssetsDeleteOptionalParams no longer has parameter resumeFrom - - Interface AssetsUpdateOptionalParams no longer has parameter resumeFrom - - Interface AssetUpdateProperties no longer has parameter assetType - - Interface AssetUpdateProperties no longer has parameter dataPoints - - Interface AssetUpdateProperties no longer has parameter defaultDataPointsConfiguration - - Interface DataPoint no longer has parameter capabilityId - - Interface DeviceRegistryManagementClientOptionalParams no longer has parameter $host - - Interface DeviceRegistryManagementClientOptionalParams no longer has parameter endpoint - - Interface Event_2 no longer has parameter capabilityId - - Interface UsernamePasswordCredentials no longer has parameter passwordReference - - Interface UsernamePasswordCredentials no longer has parameter usernameReference - - Interface X509Credentials no longer has parameter certificateReference - - Interface AssetEndpointProfileProperties has a new required parameter endpointProfileType - - Interface AssetProperties has a new required parameter assetEndpointProfileRef - - Interface UsernamePasswordCredentials has a new required parameter passwordSecretName - - Interface UsernamePasswordCredentials has a new required parameter usernameSecretName - - Interface X509Credentials has a new required parameter certificateSecretName - - Type of parameter tags of interface AssetEndpointProfileUpdate is changed from { - [propertyName: string]: string; - } to Record - - Type of parameter attributes of interface AssetProperties is changed from { - [propertyName: string]: any; - } to Record - - Type of parameter tags of interface AssetUpdate is changed from { - [propertyName: string]: string; - } to Record - - Type of parameter attributes of interface AssetUpdateProperties is changed from { - [propertyName: string]: any; - } to Record - - Type of parameter observabilityMode of interface DataPoint is changed from DataPointsObservabilityMode to DataPointObservabilityMode - - Type of parameter info of interface ErrorAdditionalInfo is changed from Record to Record - - Type of parameter observabilityMode of interface Event_2 is changed from EventsObservabilityMode to EventObservabilityMode - - Type of parameter tags of interface TrackedResource is changed from { - [propertyName: string]: string; - } to Record - - Class DeviceRegistryManagementClient no longer has parameter $host - - Class DeviceRegistryManagementClient no longer has parameter apiVersion - - Class DeviceRegistryManagementClient no longer has parameter subscriptionId - - Removed Enum KnownDataPointsObservabilityMode - - Removed Enum KnownEventsObservabilityMode - - Removed Enum KnownUserAuthenticationMode - - Enum KnownOrigin no longer has value System - - Enum KnownOrigin no longer has value User - - Enum KnownOrigin no longer has value UserSystem - - Removed function getContinuationToken - - -## 1.0.0-beta.1 (2024-04-15) +### Features Added -The package of @azure/arm-deviceregistry is using our next generation design principles. To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/js/mgmt/quickstart). +This is the first stable version with the package of @azure/arm-deviceregistry. diff --git a/sdk/deviceregistry/arm-deviceregistry/README.md b/sdk/deviceregistry/arm-deviceregistry/README.md index 46af236c547..66491181b45 100644 --- a/sdk/deviceregistry/arm-deviceregistry/README.md +++ b/sdk/deviceregistry/arm-deviceregistry/README.md @@ -8,7 +8,7 @@ Key links: - [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/deviceregistry/arm-deviceregistry) - [Package (NPM)](https://www.npmjs.com/package/@azure/arm-deviceregistry) -- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-deviceregistry?view=azure-node-preview) +- [API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-deviceregistry) - [Samples](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/deviceregistry/arm-deviceregistry/samples) ## Getting started diff --git a/sdk/deviceregistry/arm-deviceregistry/assets.json b/sdk/deviceregistry/arm-deviceregistry/assets.json index 47173e93dfa..38f57be5220 100644 --- a/sdk/deviceregistry/arm-deviceregistry/assets.json +++ b/sdk/deviceregistry/arm-deviceregistry/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "js", "TagPrefix": "js/deviceregistry/arm-deviceregistry", - "Tag": "js/deviceregistry/arm-deviceregistry_efa8d0494f" + "Tag": "js/deviceregistry/arm-deviceregistry_b4c8927950" } diff --git a/sdk/deviceregistry/arm-deviceregistry/eslint.config.mjs b/sdk/deviceregistry/arm-deviceregistry/eslint.config.mjs index e127bbf23da..a9fcfbef11f 100644 --- a/sdk/deviceregistry/arm-deviceregistry/eslint.config.mjs +++ b/sdk/deviceregistry/arm-deviceregistry/eslint.config.mjs @@ -1,15 +1,16 @@ import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; -export default [ - ...azsdkEslint.configs.recommended, +export default azsdkEslint.config([ { rules: { "@azure/azure-sdk/ts-modules-only-named": "warn", + "@azure/azure-sdk/ts-apiextractor-json-types": "warn", "@azure/azure-sdk/ts-package-json-types": "warn", "@azure/azure-sdk/ts-package-json-engine-is-present": "warn", + "@azure/azure-sdk/ts-package-json-module": "off", "@azure/azure-sdk/ts-package-json-files-required": "off", "@azure/azure-sdk/ts-package-json-main-is-cjs": "off", "tsdoc/syntax": "warn", }, }, -]; +]); diff --git a/sdk/deviceregistry/arm-deviceregistry/package.json b/sdk/deviceregistry/arm-deviceregistry/package.json index 92b59320ae6..55e74da4821 100644 --- a/sdk/deviceregistry/arm-deviceregistry/package.json +++ b/sdk/deviceregistry/arm-deviceregistry/package.json @@ -1,6 +1,6 @@ { "name": "@azure/arm-deviceregistry", - "version": "1.0.0-beta.2", + "version": "1.0.0", "description": "A generated SDK for DeviceRegistryClient.", "engines": { "node": ">=18.0.0" @@ -62,7 +62,7 @@ "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.9.0", "@azure/core-lro": "^3.1.0", - "@azure/core-rest-pipeline": "^1.18.2", + "@azure/core-rest-pipeline": "^1.19.0", "@azure/core-util": "^1.11.0", "@azure/logger": "^1.1.4", "tslib": "^2.8.1" @@ -74,14 +74,15 @@ "@azure/dev-tool": "^1.0.0", "@azure/eslint-plugin-azure-sdk": "^3.0.0", "@azure/identity": "^4.6.0", + "@microsoft/api-extractor": "^7.40.3", "@types/node": "^18.0.0", - "@vitest/browser": "^3.0.3", - "@vitest/coverage-istanbul": "^3.0.3", + "@vitest/browser": "^3.0.5", + "@vitest/coverage-istanbul": "^3.0.5", "dotenv": "^16.0.0", "eslint": "^9.9.0", - "playwright": "^1.50.0", - "typescript": "~5.7.2", - "vitest": "^3.0.3" + "playwright": "^1.50.1", + "typescript": "~5.6.2", + "vitest": "^3.0.5" }, "scripts": { "build": "npm run clean && dev-tool run build-package && dev-tool run extract-api", @@ -116,6 +117,8 @@ "disableDocsMs": true, "apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-deviceregistry?view=azure-node-preview" }, + "browser": "./dist/browser/index.js", + "react-native": "./dist/react-native/index.js", "exports": { "./package.json": "./package.json", ".": { @@ -157,7 +160,5 @@ }, "main": "./dist/commonjs/index.js", "types": "./dist/commonjs/index.d.ts", - "module": "./dist/esm/index.js", - "browser": "./dist/browser/index.js", - "react-native": "./dist/react-native/index.js" + "module": "./dist/esm/index.js" } diff --git a/sdk/deviceregistry/arm-deviceregistry/review/arm-deviceregistry-models.api.md b/sdk/deviceregistry/arm-deviceregistry/review/arm-deviceregistry-models.api.md index 29a23986e6f..8b6089a6720 100644 --- a/sdk/deviceregistry/arm-deviceregistry/review/arm-deviceregistry-models.api.md +++ b/sdk/deviceregistry/arm-deviceregistry/review/arm-deviceregistry-models.api.md @@ -184,116 +184,6 @@ export interface Dataset { topic?: Topic; } -// @public -export interface DiscoveredAsset extends TrackedResource { - extendedLocation: ExtendedLocation; - properties?: DiscoveredAssetProperties; -} - -// @public -export interface DiscoveredAssetEndpointProfile extends TrackedResource { - extendedLocation: ExtendedLocation; - properties?: DiscoveredAssetEndpointProfileProperties; -} - -// @public -export interface DiscoveredAssetEndpointProfileProperties { - additionalConfiguration?: string; - discoveryId: string; - endpointProfileType: string; - readonly provisioningState?: ProvisioningState; - supportedAuthenticationMethods?: AuthenticationMethod[]; - targetAddress: string; - version: number; -} - -// @public -export interface DiscoveredAssetEndpointProfileUpdate { - properties?: DiscoveredAssetEndpointProfileUpdateProperties; - tags?: Record; -} - -// @public -export interface DiscoveredAssetEndpointProfileUpdateProperties { - additionalConfiguration?: string; - discoveryId?: string; - endpointProfileType?: string; - supportedAuthenticationMethods?: AuthenticationMethod[]; - targetAddress?: string; - version?: number; -} - -// @public -export interface DiscoveredAssetProperties { - assetEndpointProfileRef: string; - datasets?: DiscoveredDataset[]; - defaultDatasetsConfiguration?: string; - defaultEventsConfiguration?: string; - defaultTopic?: Topic; - discoveryId: string; - documentationUri?: string; - events?: DiscoveredEvent[]; - hardwareRevision?: string; - manufacturer?: string; - manufacturerUri?: string; - model?: string; - productCode?: string; - readonly provisioningState?: ProvisioningState; - serialNumber?: string; - softwareRevision?: string; - version: number; -} - -// @public -export interface DiscoveredAssetUpdate { - properties?: DiscoveredAssetUpdateProperties; - tags?: Record; -} - -// @public -export interface DiscoveredAssetUpdateProperties { - datasets?: DiscoveredDataset[]; - defaultDatasetsConfiguration?: string; - defaultEventsConfiguration?: string; - defaultTopic?: Topic; - discoveryId?: string; - documentationUri?: string; - events?: DiscoveredEvent[]; - hardwareRevision?: string; - manufacturer?: string; - manufacturerUri?: string; - model?: string; - productCode?: string; - serialNumber?: string; - softwareRevision?: string; - version?: number; -} - -// @public -export interface DiscoveredDataPoint { - dataPointConfiguration?: string; - dataSource: string; - lastUpdatedOn?: Date; - name: string; -} - -// @public -export interface DiscoveredDataset { - dataPoints?: DiscoveredDataPoint[]; - datasetConfiguration?: string; - name: string; - topic?: Topic; -} - -// @public -export interface DiscoveredEvent { - eventConfiguration?: string; - eventNotifier: string; - lastUpdatedOn?: Date; - name: string; - topic?: Topic; -} - // @public export interface ErrorAdditionalInfo { readonly info?: Record; @@ -309,6 +199,11 @@ export interface ErrorDetail { readonly target?: string; } +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + // @public interface Event_2 extends EventBase { observabilityMode?: EventObservabilityMode; @@ -332,9 +227,6 @@ export interface ExtendedLocation { type: string; } -// @public -export type Format = string; - // @public export enum KnownActionType { Internal = "Internal" @@ -370,12 +262,6 @@ export enum KnownEventObservabilityMode { None = "None" } -// @public -export enum KnownFormat { - Delta_1_0 = "Delta/1.0", - JsonSchemaDraft7 = "JsonSchema/draft-07" -} - // @public export enum KnownOrigin { System = "system", @@ -392,17 +278,6 @@ export enum KnownProvisioningState { Succeeded = "Succeeded" } -// @public -export enum KnownSchemaType { - MessageSchema = "MessageSchema" -} - -// @public -export enum KnownSystemAssignedServiceIdentityType { - None = "None", - SystemAssigned = "SystemAssigned" -} - // @public export enum KnownTopicRetainType { Keep = "Keep", @@ -411,8 +286,7 @@ export enum KnownTopicRetainType { // @public export enum KnownVersions { - V2023_11_01_Preview = "2023-11-01-preview", - V2024_09_01_Preview = "2024-09-01-preview" + V20241101 = "2024-11-01" } // @public @@ -424,8 +298,8 @@ export interface MessageSchemaReference { // @public export interface Operation { - actionType?: ActionType; - readonly display?: OperationDisplay; + readonly actionType?: ActionType; + display?: OperationDisplay; readonly isDataAction?: boolean; readonly name?: string; readonly origin?: Origin; @@ -447,6 +321,7 @@ export interface OperationStatusResult { name?: string; operations?: OperationStatusResult[]; percentComplete?: number; + readonly resourceId?: string; startTime?: Date; status: string; } @@ -469,78 +344,6 @@ export interface Resource { readonly type?: string; } -// @public -export interface Schema extends ProxyResource { - properties?: SchemaProperties; -} - -// @public -export interface SchemaProperties { - description?: string; - displayName?: string; - format: Format; - readonly provisioningState?: ProvisioningState; - schemaType: SchemaType; - tags?: Record; - readonly uuid?: string; -} - -// @public -export interface SchemaRegistry extends TrackedResource { - identity?: SystemAssignedServiceIdentity; - properties?: SchemaRegistryProperties; -} - -// @public -export interface SchemaRegistryProperties { - description?: string; - displayName?: string; - namespace: string; - readonly provisioningState?: ProvisioningState; - storageAccountContainerUrl: string; - readonly uuid?: string; -} - -// @public -export interface SchemaRegistryUpdate { - identity?: SystemAssignedServiceIdentity; - properties?: SchemaRegistryUpdateProperties; - tags?: Record; -} - -// @public -export interface SchemaRegistryUpdateProperties { - description?: string; - displayName?: string; -} - -// @public -export type SchemaType = string; - -// @public -export interface SchemaVersion extends ProxyResource { - properties?: SchemaVersionProperties; -} - -// @public -export interface SchemaVersionProperties { - description?: string; - readonly hash?: string; - readonly provisioningState?: ProvisioningState; - schemaContent: string; - readonly uuid?: string; -} - -// @public -export interface SystemAssignedServiceIdentity { - readonly principalId?: string; - readonly tenantId?: string; - type: SystemAssignedServiceIdentityType; -} - -// @public -export type SystemAssignedServiceIdentityType = string; - // @public export interface SystemData { createdAt?: Date; diff --git a/sdk/deviceregistry/arm-deviceregistry/review/arm-deviceregistry.api.md b/sdk/deviceregistry/arm-deviceregistry/review/arm-deviceregistry.api.md index 8c452d271d9..02aa71385df 100644 --- a/sdk/deviceregistry/arm-deviceregistry/review/arm-deviceregistry.api.md +++ b/sdk/deviceregistry/arm-deviceregistry/review/arm-deviceregistry.api.md @@ -292,14 +292,9 @@ export class DeviceRegistryManagementClient { readonly assetEndpointProfiles: AssetEndpointProfilesOperations; readonly assets: AssetsOperations; readonly billingContainers: BillingContainersOperations; - readonly discoveredAssetEndpointProfiles: DiscoveredAssetEndpointProfilesOperations; - readonly discoveredAssets: DiscoveredAssetsOperations; readonly operations: OperationsOperations; readonly operationStatus: OperationStatusOperations; readonly pipeline: Pipeline; - readonly schemaRegistries: SchemaRegistriesOperations; - readonly schemas: SchemasOperations; - readonly schemaVersions: SchemaVersionsOperations; } // @public @@ -307,190 +302,6 @@ export interface DeviceRegistryManagementClientOptionalParams extends ClientOpti apiVersion?: string; } -// @public -export interface DiscoveredAsset extends TrackedResource { - extendedLocation: ExtendedLocation; - properties?: DiscoveredAssetProperties; -} - -// @public -export interface DiscoveredAssetEndpointProfile extends TrackedResource { - extendedLocation: ExtendedLocation; - properties?: DiscoveredAssetEndpointProfileProperties; -} - -// @public -export interface DiscoveredAssetEndpointProfileProperties { - additionalConfiguration?: string; - discoveryId: string; - endpointProfileType: string; - readonly provisioningState?: ProvisioningState; - supportedAuthenticationMethods?: AuthenticationMethod[]; - targetAddress: string; - version: number; -} - -// @public -export interface DiscoveredAssetEndpointProfilesCreateOrReplaceOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface DiscoveredAssetEndpointProfilesDeleteOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface DiscoveredAssetEndpointProfilesGetOptionalParams extends OperationOptions { -} - -// @public -export interface DiscoveredAssetEndpointProfilesListByResourceGroupOptionalParams extends OperationOptions { -} - -// @public -export interface DiscoveredAssetEndpointProfilesListBySubscriptionOptionalParams extends OperationOptions { -} - -// @public -export interface DiscoveredAssetEndpointProfilesOperations { - createOrReplace: (resourceGroupName: string, discoveredAssetEndpointProfileName: string, resource: DiscoveredAssetEndpointProfile, options?: DiscoveredAssetEndpointProfilesCreateOrReplaceOptionalParams) => PollerLike, DiscoveredAssetEndpointProfile>; - delete: (resourceGroupName: string, discoveredAssetEndpointProfileName: string, options?: DiscoveredAssetEndpointProfilesDeleteOptionalParams) => PollerLike, void>; - get: (resourceGroupName: string, discoveredAssetEndpointProfileName: string, options?: DiscoveredAssetEndpointProfilesGetOptionalParams) => Promise; - listByResourceGroup: (resourceGroupName: string, options?: DiscoveredAssetEndpointProfilesListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; - listBySubscription: (options?: DiscoveredAssetEndpointProfilesListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; - update: (resourceGroupName: string, discoveredAssetEndpointProfileName: string, properties: DiscoveredAssetEndpointProfileUpdate, options?: DiscoveredAssetEndpointProfilesUpdateOptionalParams) => PollerLike, DiscoveredAssetEndpointProfile>; -} - -// @public -export interface DiscoveredAssetEndpointProfilesUpdateOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface DiscoveredAssetEndpointProfileUpdate { - properties?: DiscoveredAssetEndpointProfileUpdateProperties; - tags?: Record; -} - -// @public -export interface DiscoveredAssetEndpointProfileUpdateProperties { - additionalConfiguration?: string; - discoveryId?: string; - endpointProfileType?: string; - supportedAuthenticationMethods?: AuthenticationMethod[]; - targetAddress?: string; - version?: number; -} - -// @public -export interface DiscoveredAssetProperties { - assetEndpointProfileRef: string; - datasets?: DiscoveredDataset[]; - defaultDatasetsConfiguration?: string; - defaultEventsConfiguration?: string; - defaultTopic?: Topic; - discoveryId: string; - documentationUri?: string; - events?: DiscoveredEvent[]; - hardwareRevision?: string; - manufacturer?: string; - manufacturerUri?: string; - model?: string; - productCode?: string; - readonly provisioningState?: ProvisioningState; - serialNumber?: string; - softwareRevision?: string; - version: number; -} - -// @public -export interface DiscoveredAssetsCreateOrReplaceOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface DiscoveredAssetsDeleteOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface DiscoveredAssetsGetOptionalParams extends OperationOptions { -} - -// @public -export interface DiscoveredAssetsListByResourceGroupOptionalParams extends OperationOptions { -} - -// @public -export interface DiscoveredAssetsListBySubscriptionOptionalParams extends OperationOptions { -} - -// @public -export interface DiscoveredAssetsOperations { - createOrReplace: (resourceGroupName: string, discoveredAssetName: string, resource: DiscoveredAsset, options?: DiscoveredAssetsCreateOrReplaceOptionalParams) => PollerLike, DiscoveredAsset>; - delete: (resourceGroupName: string, discoveredAssetName: string, options?: DiscoveredAssetsDeleteOptionalParams) => PollerLike, void>; - get: (resourceGroupName: string, discoveredAssetName: string, options?: DiscoveredAssetsGetOptionalParams) => Promise; - listByResourceGroup: (resourceGroupName: string, options?: DiscoveredAssetsListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; - listBySubscription: (options?: DiscoveredAssetsListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; - update: (resourceGroupName: string, discoveredAssetName: string, properties: DiscoveredAssetUpdate, options?: DiscoveredAssetsUpdateOptionalParams) => PollerLike, DiscoveredAsset>; -} - -// @public -export interface DiscoveredAssetsUpdateOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface DiscoveredAssetUpdate { - properties?: DiscoveredAssetUpdateProperties; - tags?: Record; -} - -// @public -export interface DiscoveredAssetUpdateProperties { - datasets?: DiscoveredDataset[]; - defaultDatasetsConfiguration?: string; - defaultEventsConfiguration?: string; - defaultTopic?: Topic; - discoveryId?: string; - documentationUri?: string; - events?: DiscoveredEvent[]; - hardwareRevision?: string; - manufacturer?: string; - manufacturerUri?: string; - model?: string; - productCode?: string; - serialNumber?: string; - softwareRevision?: string; - version?: number; -} - -// @public -export interface DiscoveredDataPoint { - dataPointConfiguration?: string; - dataSource: string; - lastUpdatedOn?: Date; - name: string; -} - -// @public -export interface DiscoveredDataset { - dataPoints?: DiscoveredDataPoint[]; - datasetConfiguration?: string; - name: string; - topic?: Topic; -} - -// @public -export interface DiscoveredEvent { - eventConfiguration?: string; - eventNotifier: string; - lastUpdatedOn?: Date; - name: string; - topic?: Topic; -} - // @public export interface ErrorAdditionalInfo { readonly info?: Record; @@ -506,6 +317,11 @@ export interface ErrorDetail { readonly target?: string; } +// @public +export interface ErrorResponse { + error?: ErrorDetail; +} + // @public interface Event_2 extends EventBase { observabilityMode?: EventObservabilityMode; @@ -529,9 +345,6 @@ export interface ExtendedLocation { type: string; } -// @public -export type Format = string; - // @public export enum KnownActionType { Internal = "Internal" @@ -567,12 +380,6 @@ export enum KnownEventObservabilityMode { None = "None" } -// @public -export enum KnownFormat { - Delta_1_0 = "Delta/1.0", - JsonSchemaDraft7 = "JsonSchema/draft-07" -} - // @public export enum KnownOrigin { System = "system", @@ -589,17 +396,6 @@ export enum KnownProvisioningState { Succeeded = "Succeeded" } -// @public -export enum KnownSchemaType { - MessageSchema = "MessageSchema" -} - -// @public -export enum KnownSystemAssignedServiceIdentityType { - None = "None", - SystemAssigned = "SystemAssigned" -} - // @public export enum KnownTopicRetainType { Keep = "Keep", @@ -608,8 +404,7 @@ export enum KnownTopicRetainType { // @public export enum KnownVersions { - V2023_11_01_Preview = "2023-11-01-preview", - V2024_09_01_Preview = "2024-09-01-preview" + V20241101 = "2024-11-01" } // @public @@ -621,8 +416,8 @@ export interface MessageSchemaReference { // @public export interface Operation { - actionType?: ActionType; - readonly display?: OperationDisplay; + readonly actionType?: ActionType; + display?: OperationDisplay; readonly isDataAction?: boolean; readonly name?: string; readonly origin?: Origin; @@ -662,6 +457,7 @@ export interface OperationStatusResult { name?: string; operations?: OperationStatusResult[]; percentComplete?: number; + readonly resourceId?: string; startTime?: Date; status: string; } @@ -706,163 +502,6 @@ export interface RestorePollerOptions; - readonly uuid?: string; -} - -// @public -export interface SchemaRegistriesCreateOrReplaceOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface SchemaRegistriesDeleteOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface SchemaRegistriesGetOptionalParams extends OperationOptions { -} - -// @public -export interface SchemaRegistriesListByResourceGroupOptionalParams extends OperationOptions { -} - -// @public -export interface SchemaRegistriesListBySubscriptionOptionalParams extends OperationOptions { -} - -// @public -export interface SchemaRegistriesOperations { - createOrReplace: (resourceGroupName: string, schemaRegistryName: string, resource: SchemaRegistry, options?: SchemaRegistriesCreateOrReplaceOptionalParams) => PollerLike, SchemaRegistry>; - delete: (resourceGroupName: string, schemaRegistryName: string, options?: SchemaRegistriesDeleteOptionalParams) => PollerLike, void>; - get: (resourceGroupName: string, schemaRegistryName: string, options?: SchemaRegistriesGetOptionalParams) => Promise; - listByResourceGroup: (resourceGroupName: string, options?: SchemaRegistriesListByResourceGroupOptionalParams) => PagedAsyncIterableIterator; - listBySubscription: (options?: SchemaRegistriesListBySubscriptionOptionalParams) => PagedAsyncIterableIterator; - update: (resourceGroupName: string, schemaRegistryName: string, properties: SchemaRegistryUpdate, options?: SchemaRegistriesUpdateOptionalParams) => PollerLike, SchemaRegistry>; -} - -// @public -export interface SchemaRegistriesUpdateOptionalParams extends OperationOptions { - updateIntervalInMs?: number; -} - -// @public -export interface SchemaRegistry extends TrackedResource { - identity?: SystemAssignedServiceIdentity; - properties?: SchemaRegistryProperties; -} - -// @public -export interface SchemaRegistryProperties { - description?: string; - displayName?: string; - namespace: string; - readonly provisioningState?: ProvisioningState; - storageAccountContainerUrl: string; - readonly uuid?: string; -} - -// @public -export interface SchemaRegistryUpdate { - identity?: SystemAssignedServiceIdentity; - properties?: SchemaRegistryUpdateProperties; - tags?: Record; -} - -// @public -export interface SchemaRegistryUpdateProperties { - description?: string; - displayName?: string; -} - -// @public -export interface SchemasCreateOrReplaceOptionalParams extends OperationOptions { -} - -// @public -export interface SchemasDeleteOptionalParams extends OperationOptions { -} - -// @public -export interface SchemasGetOptionalParams extends OperationOptions { -} - -// @public -export interface SchemasListBySchemaRegistryOptionalParams extends OperationOptions { -} - -// @public -export interface SchemasOperations { - createOrReplace: (resourceGroupName: string, schemaRegistryName: string, schemaName: string, resource: Schema, options?: SchemasCreateOrReplaceOptionalParams) => Promise; - delete: (resourceGroupName: string, schemaRegistryName: string, schemaName: string, options?: SchemasDeleteOptionalParams) => Promise; - get: (resourceGroupName: string, schemaRegistryName: string, schemaName: string, options?: SchemasGetOptionalParams) => Promise; - listBySchemaRegistry: (resourceGroupName: string, schemaRegistryName: string, options?: SchemasListBySchemaRegistryOptionalParams) => PagedAsyncIterableIterator; -} - -// @public -export type SchemaType = string; - -// @public -export interface SchemaVersion extends ProxyResource { - properties?: SchemaVersionProperties; -} - -// @public -export interface SchemaVersionProperties { - description?: string; - readonly hash?: string; - readonly provisioningState?: ProvisioningState; - schemaContent: string; - readonly uuid?: string; -} - -// @public -export interface SchemaVersionsCreateOrReplaceOptionalParams extends OperationOptions { -} - -// @public -export interface SchemaVersionsDeleteOptionalParams extends OperationOptions { -} - -// @public -export interface SchemaVersionsGetOptionalParams extends OperationOptions { -} - -// @public -export interface SchemaVersionsListBySchemaOptionalParams extends OperationOptions { -} - -// @public -export interface SchemaVersionsOperations { - createOrReplace: (resourceGroupName: string, schemaRegistryName: string, schemaName: string, schemaVersionName: string, resource: SchemaVersion, options?: SchemaVersionsCreateOrReplaceOptionalParams) => Promise; - delete: (resourceGroupName: string, schemaRegistryName: string, schemaName: string, schemaVersionName: string, options?: SchemaVersionsDeleteOptionalParams) => Promise; - get: (resourceGroupName: string, schemaRegistryName: string, schemaName: string, schemaVersionName: string, options?: SchemaVersionsGetOptionalParams) => Promise; - listBySchema: (resourceGroupName: string, schemaRegistryName: string, schemaName: string, options?: SchemaVersionsListBySchemaOptionalParams) => PagedAsyncIterableIterator; -} - -// @public -export interface SystemAssignedServiceIdentity { - readonly principalId?: string; - readonly tenantId?: string; - type: SystemAssignedServiceIdentityType; -} - -// @public -export type SystemAssignedServiceIdentityType = string; - // @public export interface SystemData { createdAt?: Date; diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesCreateOrReplaceSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.ts similarity index 92% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesCreateOrReplaceSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.ts index c8fdd70a33d..c4be901fb8b 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesCreateOrReplaceSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to create a AssetEndpointProfile * * @summary create a AssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Create_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Create_AssetEndpointProfile.json */ async function createAssetEndpointProfile(): Promise { const credential = new DefaultAzureCredential(); @@ -38,7 +38,7 @@ async function createAssetEndpointProfile(): Promise { * This sample demonstrates how to create a AssetEndpointProfile * * @summary create a AssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Create_AssetEndpointProfile_With_DiscoveredAepRef.json + * x-ms-original-file: 2024-11-01/Create_AssetEndpointProfile_With_DiscoveredAepRef.json */ async function createAssetEndpointProfileWithDiscoveredAepRef(): Promise { const credential = new DefaultAzureCredential(); @@ -66,7 +66,7 @@ async function createAssetEndpointProfileWithDiscoveredAepRef(): Promise { } async function main(): Promise { - createAssetEndpointProfile(); + await createAssetEndpointProfile(); createAssetEndpointProfileWithDiscoveredAepRef(); } diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesDeleteSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesAssetEndpointProfilesDeleteSample.ts similarity index 91% rename from sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesDeleteSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesAssetEndpointProfilesDeleteSample.ts index a160b5b80d7..eef40d961d0 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesDeleteSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesAssetEndpointProfilesDeleteSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to delete a AssetEndpointProfile * * @summary delete a AssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Delete_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Delete_AssetEndpointProfile.json */ async function deleteAssetEndpointProfile(): Promise { const credential = new DefaultAzureCredential(); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesGetSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesAssetEndpointProfilesGetSample.ts similarity index 87% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesGetSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesAssetEndpointProfilesGetSample.ts index 5553082272a..36ea879e1a6 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesGetSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesAssetEndpointProfilesGetSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to get a AssetEndpointProfile * * @summary get a AssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Get_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Get_AssetEndpointProfile.json */ async function getAssetEndpointProfile(): Promise { const credential = new DefaultAzureCredential(); @@ -25,7 +25,7 @@ async function getAssetEndpointProfile(): Promise { * This sample demonstrates how to get a AssetEndpointProfile * * @summary get a AssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Get_AssetEndpointProfile_With_SyncStatus.json + * x-ms-original-file: 2024-11-01/Get_AssetEndpointProfile_With_SyncStatus.json */ async function getAssetEndpointProfileWithSyncStatus(): Promise { const credential = new DefaultAzureCredential(); @@ -39,7 +39,7 @@ async function getAssetEndpointProfileWithSyncStatus(): Promise { } async function main(): Promise { - getAssetEndpointProfile(); + await getAssetEndpointProfile(); getAssetEndpointProfileWithSyncStatus(); } diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesListByResourceGroupSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesAssetEndpointProfilesListByResourceGroupSample.ts similarity index 87% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesListByResourceGroupSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesAssetEndpointProfilesListByResourceGroupSample.ts index 1f771ee3af7..ab1f18a36bf 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesListByResourceGroupSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesAssetEndpointProfilesListByResourceGroupSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to list AssetEndpointProfile resources by resource group * * @summary list AssetEndpointProfile resources by resource group - * x-ms-original-file: 2024-09-01-preview/List_AssetEndpointProfiles_ResourceGroup.json + * x-ms-original-file: 2024-11-01/List_AssetEndpointProfiles_ResourceGroup.json */ async function listAssetEndpointProfilesResourceGroup(): Promise { const credential = new DefaultAzureCredential(); @@ -23,7 +23,7 @@ async function listAssetEndpointProfilesResourceGroup(): Promise { } async function main(): Promise { - listAssetEndpointProfilesResourceGroup(); + await listAssetEndpointProfilesResourceGroup(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesListBySubscriptionSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesAssetEndpointProfilesListBySubscriptionSample.ts similarity index 87% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesListBySubscriptionSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesAssetEndpointProfilesListBySubscriptionSample.ts index 9ca7f789335..61523eb6bde 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesListBySubscriptionSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesAssetEndpointProfilesListBySubscriptionSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to list AssetEndpointProfile resources by subscription ID * * @summary list AssetEndpointProfile resources by subscription ID - * x-ms-original-file: 2024-09-01-preview/List_AssetEndpointProfiles_Subscription.json + * x-ms-original-file: 2024-11-01/List_AssetEndpointProfiles_Subscription.json */ async function listAssetEndpointProfilesSubscription(): Promise { const credential = new DefaultAzureCredential(); @@ -23,7 +23,7 @@ async function listAssetEndpointProfilesSubscription(): Promise { } async function main(): Promise { - listAssetEndpointProfilesSubscription(); + await listAssetEndpointProfilesSubscription(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesUpdateSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesAssetEndpointProfilesUpdateSample.ts similarity index 84% rename from sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesUpdateSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesAssetEndpointProfilesUpdateSample.ts index c68dee9756e..5823361affa 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesUpdateSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesAssetEndpointProfilesUpdateSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to update a AssetEndpointProfile * * @summary update a AssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Update_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Update_AssetEndpointProfile.json */ async function updateAssetEndpointProfile(): Promise { const credential = new DefaultAzureCredential(); @@ -18,7 +18,9 @@ async function updateAssetEndpointProfile(): Promise { "myResourceGroup", "my-assetendpointprofile", { - properties: { targetAddress: "https://www.example.com/myTargetAddress" }, + properties: { + targetAddress: "https://www.example.com/myTargetAddress", + }, }, ); console.log(result); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsCreateOrReplaceSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsAssetsCreateOrReplaceSample.ts similarity index 97% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsCreateOrReplaceSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsAssetsCreateOrReplaceSample.ts index 2004a0ac731..1e1d46b53b5 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsCreateOrReplaceSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsAssetsCreateOrReplaceSample.ts @@ -8,9 +8,9 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to create a Asset * * @summary create a Asset - * x-ms-original-file: 2024-09-01-preview/Create_Asset_Without_DisplayName.json + * x-ms-original-file: 2024-11-01/Create_Asset_With_DiscoveredAssetRef.json */ -async function createAssetWithoutDisplayName(): Promise { +async function createAssetWithDiscoveredAssetRefs(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeviceRegistryManagementClient(credential, subscriptionId); @@ -24,6 +24,7 @@ async function createAssetWithoutDisplayName(): Promise { properties: { enabled: true, externalAssetId: "8ZBA6LRHU0A458969", + displayName: "AssetDisplayName", description: "This is a sample Asset", assetEndpointProfileRef: "myAssetEndpointProfile", manufacturer: "Contoso", @@ -34,6 +35,7 @@ async function createAssetWithoutDisplayName(): Promise { softwareRevision: "2.0", documentationUri: "https://www.example.com/manual", serialNumber: "64-103816-519918-8", + discoveredAssetRefs: ["discoveredAsset1", "discoveredAsset2"], defaultDatasetsConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', defaultEventsConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', @@ -83,9 +85,9 @@ async function createAssetWithoutDisplayName(): Promise { * This sample demonstrates how to create a Asset * * @summary create a Asset - * x-ms-original-file: 2024-09-01-preview/Create_Asset_Without_ExternalAssetId.json + * x-ms-original-file: 2024-11-01/Create_Asset_With_ExternalAssetId.json */ -async function createAssetWithoutExternalAssetId(): Promise { +async function createAssetWithExternalAssetId(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeviceRegistryManagementClient(credential, subscriptionId); @@ -98,6 +100,7 @@ async function createAssetWithoutExternalAssetId(): Promise { tags: { site: "building-1" }, properties: { enabled: true, + externalAssetId: "8ZBA6LRHU0A458969", displayName: "AssetDisplayName", description: "This is a sample Asset", assetEndpointProfileRef: "myAssetEndpointProfile", @@ -158,9 +161,9 @@ async function createAssetWithoutExternalAssetId(): Promise { * This sample demonstrates how to create a Asset * * @summary create a Asset - * x-ms-original-file: 2024-09-01-preview/Create_Asset_With_DiscoveredAssetRef.json + * x-ms-original-file: 2024-11-01/Create_Asset_Without_DisplayName.json */ -async function createAssetWithDiscoveredAssetRefs(): Promise { +async function createAssetWithoutDisplayName(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeviceRegistryManagementClient(credential, subscriptionId); @@ -174,7 +177,6 @@ async function createAssetWithDiscoveredAssetRefs(): Promise { properties: { enabled: true, externalAssetId: "8ZBA6LRHU0A458969", - displayName: "AssetDisplayName", description: "This is a sample Asset", assetEndpointProfileRef: "myAssetEndpointProfile", manufacturer: "Contoso", @@ -185,7 +187,6 @@ async function createAssetWithDiscoveredAssetRefs(): Promise { softwareRevision: "2.0", documentationUri: "https://www.example.com/manual", serialNumber: "64-103816-519918-8", - discoveredAssetRefs: ["discoveredAsset1", "discoveredAsset2"], defaultDatasetsConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', defaultEventsConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', @@ -235,9 +236,9 @@ async function createAssetWithDiscoveredAssetRefs(): Promise { * This sample demonstrates how to create a Asset * * @summary create a Asset - * x-ms-original-file: 2024-09-01-preview/Create_Asset_With_ExternalAssetId.json + * x-ms-original-file: 2024-11-01/Create_Asset_Without_ExternalAssetId.json */ -async function createAssetWithExternalAssetId(): Promise { +async function createAssetWithoutExternalAssetId(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeviceRegistryManagementClient(credential, subscriptionId); @@ -250,7 +251,6 @@ async function createAssetWithExternalAssetId(): Promise { tags: { site: "building-1" }, properties: { enabled: true, - externalAssetId: "8ZBA6LRHU0A458969", displayName: "AssetDisplayName", description: "This is a sample Asset", assetEndpointProfileRef: "myAssetEndpointProfile", @@ -308,10 +308,10 @@ async function createAssetWithExternalAssetId(): Promise { } async function main(): Promise { + await createAssetWithDiscoveredAssetRefs(); + createAssetWithExternalAssetId(); createAssetWithoutDisplayName(); createAssetWithoutExternalAssetId(); - createAssetWithDiscoveredAssetRefs(); - createAssetWithExternalAssetId(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsDeleteSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsAssetsDeleteSample.ts similarity index 92% rename from sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsDeleteSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsAssetsDeleteSample.ts index 00aa9efa887..c0e7a1a030c 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsDeleteSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsAssetsDeleteSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to delete a Asset * * @summary delete a Asset - * x-ms-original-file: 2024-09-01-preview/Delete_Asset.json + * x-ms-original-file: 2024-11-01/Delete_Asset.json */ async function deleteAsset(): Promise { const credential = new DefaultAzureCredential(); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsGetSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsAssetsGetSample.ts similarity index 89% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsGetSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsAssetsGetSample.ts index 23c42a02fbb..32e1d068a83 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsGetSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsAssetsGetSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to get a Asset * * @summary get a Asset - * x-ms-original-file: 2024-09-01-preview/Get_Asset.json + * x-ms-original-file: 2024-11-01/Get_Asset.json */ async function getAsset(): Promise { const credential = new DefaultAzureCredential(); @@ -22,7 +22,7 @@ async function getAsset(): Promise { * This sample demonstrates how to get a Asset * * @summary get a Asset - * x-ms-original-file: 2024-09-01-preview/Get_Asset_With_SyncStatus.json + * x-ms-original-file: 2024-11-01/Get_Asset_With_SyncStatus.json */ async function getAssetWithSyncStatus(): Promise { const credential = new DefaultAzureCredential(); @@ -33,7 +33,7 @@ async function getAssetWithSyncStatus(): Promise { } async function main(): Promise { - getAsset(); + await getAsset(); getAssetWithSyncStatus(); } diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsListByResourceGroupSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsAssetsListByResourceGroupSample.ts similarity index 89% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsListByResourceGroupSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsAssetsListByResourceGroupSample.ts index 8ab8553dc7d..5194b59a429 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsListByResourceGroupSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsAssetsListByResourceGroupSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to list Asset resources by resource group * * @summary list Asset resources by resource group - * x-ms-original-file: 2024-09-01-preview/List_Assets_ResourceGroup.json + * x-ms-original-file: 2024-11-01/List_Assets_ResourceGroup.json */ async function listAssetsResourceGroup(): Promise { const credential = new DefaultAzureCredential(); @@ -23,7 +23,7 @@ async function listAssetsResourceGroup(): Promise { } async function main(): Promise { - listAssetsResourceGroup(); + await listAssetsResourceGroup(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsListBySubscriptionSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsAssetsListBySubscriptionSample.ts similarity index 89% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsListBySubscriptionSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsAssetsListBySubscriptionSample.ts index 0a0ff4a0977..82bd8c5cc48 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsListBySubscriptionSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsAssetsListBySubscriptionSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to list Asset resources by subscription ID * * @summary list Asset resources by subscription ID - * x-ms-original-file: 2024-09-01-preview/List_Assets_Subscription.json + * x-ms-original-file: 2024-11-01/List_Assets_Subscription.json */ async function listAssetsSubscription(): Promise { const credential = new DefaultAzureCredential(); @@ -23,7 +23,7 @@ async function listAssetsSubscription(): Promise { } async function main(): Promise { - listAssetsSubscription(); + await listAssetsSubscription(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsUpdateSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsAssetsUpdateSample.ts similarity index 93% rename from sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsUpdateSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsAssetsUpdateSample.ts index 6ac705ad0e8..10b96cb145c 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsUpdateSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsAssetsUpdateSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to update a Asset * * @summary update a Asset - * x-ms-original-file: 2024-09-01-preview/Update_Asset.json + * x-ms-original-file: 2024-11-01/Update_Asset.json */ async function updateAsset(): Promise { const credential = new DefaultAzureCredential(); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/billingContainersGetSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/billingContainersBillingContainersGetSample.ts similarity index 91% rename from sdk/deviceregistry/arm-deviceregistry/samples-dev/billingContainersGetSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples-dev/billingContainersBillingContainersGetSample.ts index 1b0c704f20b..6ed8e9f72a8 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/billingContainersGetSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples-dev/billingContainersBillingContainersGetSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to get a BillingContainer * * @summary get a BillingContainer - * x-ms-original-file: 2024-09-01-preview/Get_BillingContainer.json + * x-ms-original-file: 2024-11-01/Get_BillingContainer.json */ async function getBillingContainer(): Promise { const credential = new DefaultAzureCredential(); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/billingContainersListBySubscriptionSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/billingContainersBillingContainersListBySubscriptionSample.ts similarity index 87% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/billingContainersListBySubscriptionSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples-dev/billingContainersBillingContainersListBySubscriptionSample.ts index 5835a1dc180..c3c73468812 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/billingContainersListBySubscriptionSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples-dev/billingContainersBillingContainersListBySubscriptionSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to list BillingContainer resources by subscription ID * * @summary list BillingContainer resources by subscription ID - * x-ms-original-file: 2024-09-01-preview/List_BillingContainers_Subscription.json + * x-ms-original-file: 2024-11-01/List_BillingContainers_Subscription.json */ async function listBillingContainersSubscription(): Promise { const credential = new DefaultAzureCredential(); @@ -23,7 +23,7 @@ async function listBillingContainersSubscription(): Promise { } async function main(): Promise { - listBillingContainersSubscription(); + await listBillingContainersSubscription(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesCreateOrReplaceSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesCreateOrReplaceSample.ts deleted file mode 100644 index 2c1c361d565..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesCreateOrReplaceSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to create a DiscoveredAssetEndpointProfile - * - * @summary create a DiscoveredAssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Create_DiscoveredAssetEndpointProfile.json - */ -async function createDiscoveredAssetEndpointProfile(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.discoveredAssetEndpointProfiles.createOrReplace( - "myResourceGroup", - "my-discoveredassetendpointprofile", - { - location: "West Europe", - extendedLocation: { - type: "CustomLocation", - name: "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1", - }, - tags: { site: "building-1" }, - properties: { - targetAddress: "https://www.example.com/myTargetAddress", - additionalConfiguration: '{"foo": "bar"}', - discoveryId: "11111111-1111-1111-1111-111111111111", - version: 73766, - endpointProfileType: "myEndpointProfileType", - supportedAuthenticationMethods: ["Anonymous", "Certificate", "UsernamePassword"], - }, - }, - ); - console.log(result); -} - -async function main(): Promise { - await createDiscoveredAssetEndpointProfile(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesDeleteSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesDeleteSample.ts deleted file mode 100644 index 0f08e609421..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesDeleteSample.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to delete a DiscoveredAssetEndpointProfile - * - * @summary delete a DiscoveredAssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Delete_DiscoveredAssetEndpointProfile.json - */ -async function deleteDiscoveredAssetEndpointProfile(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - await client.discoveredAssetEndpointProfiles.delete( - "myResourceGroup", - "my-discoveredassetendpointprofile", - ); -} - -async function main(): Promise { - await deleteDiscoveredAssetEndpointProfile(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesGetSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesGetSample.ts deleted file mode 100644 index f72316622b8..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesGetSample.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a DiscoveredAssetEndpointProfile - * - * @summary get a DiscoveredAssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Get_DiscoveredAssetEndpointProfile.json - */ -async function getDiscoveredAssetEndpointProfile(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.discoveredAssetEndpointProfiles.get( - "myResourceGroup", - "my-discoveredassetendpointprofile", - ); - console.log(result); -} - -async function main(): Promise { - await getDiscoveredAssetEndpointProfile(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesListByResourceGroupSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesListByResourceGroupSample.ts deleted file mode 100644 index 11752be7999..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesListByResourceGroupSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list DiscoveredAssetEndpointProfile resources by resource group - * - * @summary list DiscoveredAssetEndpointProfile resources by resource group - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssetEndpointProfiles_ResourceGroup.json - */ -async function listDiscoveredAssetEndpointProfilesResourceGroup(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.discoveredAssetEndpointProfiles.listByResourceGroup( - "myResourceGroup", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listDiscoveredAssetEndpointProfilesResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesListBySubscriptionSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesListBySubscriptionSample.ts deleted file mode 100644 index 82e29e560b8..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesListBySubscriptionSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list DiscoveredAssetEndpointProfile resources by subscription ID - * - * @summary list DiscoveredAssetEndpointProfile resources by subscription ID - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssetEndpointProfiles_Subscription.json - */ -async function listDiscoveredAssetEndpointProfilesSubscription(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.discoveredAssetEndpointProfiles.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listDiscoveredAssetEndpointProfilesSubscription(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesUpdateSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesUpdateSample.ts deleted file mode 100644 index 669be3b723a..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetEndpointProfilesUpdateSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update a DiscoveredAssetEndpointProfile - * - * @summary update a DiscoveredAssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Update_DiscoveredAssetEndpointProfile.json - */ -async function updateDiscoveredAssetEndpointProfile(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.discoveredAssetEndpointProfiles.update( - "myResourceGroup", - "my-discoveredassetendpointprofile", - { - properties: { - targetAddress: "https://www.example.com/myTargetAddress", - additionalConfiguration: '{"foo": "bar"}', - discoveryId: "11111111-1111-1111-1111-111111111111", - version: 73766, - endpointProfileType: "myEndpointProfileType", - supportedAuthenticationMethods: ["Anonymous", "Certificate"], - }, - }, - ); - console.log(result); -} - -async function main(): Promise { - await updateDiscoveredAssetEndpointProfile(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsCreateOrReplaceSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsCreateOrReplaceSample.ts deleted file mode 100644 index 70d0636336d..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsCreateOrReplaceSample.ts +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to create a DiscoveredAsset - * - * @summary create a DiscoveredAsset - * x-ms-original-file: 2024-09-01-preview/Create_DiscoveredAsset.json - */ -async function createDiscoveredAsset(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.discoveredAssets.createOrReplace( - "myResourceGroup", - "my-discoveredasset", - { - location: "West Europe", - extendedLocation: { - type: "CustomLocation", - name: "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1", - }, - tags: { site: "building-1" }, - properties: { - assetEndpointProfileRef: "myAssetEndpointProfile", - discoveryId: "11111111-1111-1111-1111-111111111111", - version: 73766, - manufacturer: "Contoso", - manufacturerUri: "https://www.contoso.com/manufacturerUri", - model: "ContosoModel", - productCode: "SA34VDG", - hardwareRevision: "1.0", - softwareRevision: "2.0", - documentationUri: "https://www.example.com/manual", - serialNumber: "64-103816-519918-8", - defaultDatasetsConfiguration: - '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', - defaultEventsConfiguration: - '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', - defaultTopic: { path: "/path/defaultTopic", retain: "Keep" }, - datasets: [ - { - name: "dataset1", - datasetConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', - topic: { path: "/path/dataset1", retain: "Keep" }, - dataPoints: [ - { - name: "dataPoint1", - dataSource: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1", - dataPointConfiguration: - '{"publishingInterval":8,"samplingInterval":8,"queueSize":4}', - }, - { - name: "dataPoint2", - dataSource: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2", - dataPointConfiguration: - '{"publishingInterval":4,"samplingInterval":4,"queueSize":7}', - }, - ], - }, - ], - events: [ - { - name: "event1", - eventNotifier: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3", - eventConfiguration: '{"publishingInterval":7,"samplingInterval":1,"queueSize":8}', - topic: { path: "/path/event1", retain: "Keep" }, - }, - { - name: "event2", - eventNotifier: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4", - eventConfiguration: '{"publishingInterval":7,"samplingInterval":8,"queueSize":4}', - }, - ], - }, - }, - ); - console.log(result); -} - -async function main(): Promise { - await createDiscoveredAsset(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsDeleteSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsDeleteSample.ts deleted file mode 100644 index d1e92aca544..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsDeleteSample.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to delete a DiscoveredAsset - * - * @summary delete a DiscoveredAsset - * x-ms-original-file: 2024-09-01-preview/Delete_DiscoveredAsset.json - */ -async function deleteDiscoveredAsset(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - await client.discoveredAssets.delete("myResourceGroup", "my-discoveredasset"); -} - -async function main(): Promise { - await deleteDiscoveredAsset(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsGetSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsGetSample.ts deleted file mode 100644 index 6bbf244ff0e..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsGetSample.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a DiscoveredAsset - * - * @summary get a DiscoveredAsset - * x-ms-original-file: 2024-09-01-preview/Get_DiscoveredAsset.json - */ -async function getDiscoveredAsset(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.discoveredAssets.get("myResourceGroup", "my-discoveredasset"); - console.log(result); -} - -async function main(): Promise { - await getDiscoveredAsset(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsListByResourceGroupSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsListByResourceGroupSample.ts deleted file mode 100644 index 77589f81479..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsListByResourceGroupSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list DiscoveredAsset resources by resource group - * - * @summary list DiscoveredAsset resources by resource group - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssets_ResourceGroup.json - */ -async function listDiscoveredAssetsResourceGroup(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.discoveredAssets.listByResourceGroup("myResourceGroup")) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listDiscoveredAssetsResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsListBySubscriptionSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsListBySubscriptionSample.ts deleted file mode 100644 index dfae8db2d33..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsListBySubscriptionSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list DiscoveredAsset resources by subscription ID - * - * @summary list DiscoveredAsset resources by subscription ID - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssets_Subscription.json - */ -async function listDiscoveredAssetsSubscription(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.discoveredAssets.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listDiscoveredAssetsSubscription(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsUpdateSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsUpdateSample.ts deleted file mode 100644 index 938d178e435..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/discoveredAssetsUpdateSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update a DiscoveredAsset - * - * @summary update a DiscoveredAsset - * x-ms-original-file: 2024-09-01-preview/Update_DiscoveredAsset.json - */ -async function updateDiscoveredAsset(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.discoveredAssets.update("myResourceGroup", "my-discoveredasset", { - properties: { - documentationUri: "https://www.example.com/manual-2", - defaultTopic: { path: "/path/defaultTopic", retain: "Never" }, - }, - }); - console.log(result); -} - -async function main(): Promise { - await updateDiscoveredAsset(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/operationStatusGetSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/operationStatusOperationStatusGetSample.ts similarity index 92% rename from sdk/deviceregistry/arm-deviceregistry/samples-dev/operationStatusGetSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples-dev/operationStatusOperationStatusGetSample.ts index 7de3b62e452..6e4ea305edc 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/operationStatusGetSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples-dev/operationStatusOperationStatusGetSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to returns the current status of an async operation. * * @summary returns the current status of an async operation. - * x-ms-original-file: 2024-09-01-preview/Get_OperationStatus.json + * x-ms-original-file: 2024-11-01/Get_OperationStatus.json */ async function getOperationStatus(): Promise { const credential = new DefaultAzureCredential(); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/operationsListSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/operationsOperationsListSample.ts similarity index 90% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/operationsListSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples-dev/operationsOperationsListSample.ts index 47cf63804bd..a978b74865b 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/operationsListSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples-dev/operationsOperationsListSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to list the operations for the provider * * @summary list the operations for the provider - * x-ms-original-file: 2024-09-01-preview/List_Operations.json + * x-ms-original-file: 2024-11-01/List_Operations.json */ async function listOperations(): Promise { const credential = new DefaultAzureCredential(); @@ -23,7 +23,7 @@ async function listOperations(): Promise { } async function main(): Promise { - listOperations(); + await listOperations(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesCreateOrReplaceSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesCreateOrReplaceSample.ts deleted file mode 100644 index 8c3795de0a0..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesCreateOrReplaceSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to create a SchemaRegistry - * - * @summary create a SchemaRegistry - * x-ms-original-file: 2024-09-01-preview/Create_SchemaRegistry.json - */ -async function createSchemaRegistry(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemaRegistries.createOrReplace( - "myResourceGroup", - "my-schema-registry", - { - properties: { - namespace: "sr-namespace-001", - displayName: "Schema Registry namespace 001", - description: "This is a sample Schema Registry", - storageAccountContainerUrl: "my-blob-storage.blob.core.windows.net/my-container", - }, - tags: {}, - location: "West Europe", - identity: { type: "None" }, - }, - ); - console.log(result); -} - -async function main(): Promise { - await createSchemaRegistry(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesDeleteSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesDeleteSample.ts deleted file mode 100644 index 35a6823ec96..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesDeleteSample.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to delete a SchemaRegistry - * - * @summary delete a SchemaRegistry - * x-ms-original-file: 2024-09-01-preview/Delete_SchemaRegistry.json - */ -async function deleteSchemaRegistry(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - await client.schemaRegistries.delete("myResourceGroup", "my-schema-registry"); -} - -async function main(): Promise { - await deleteSchemaRegistry(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesGetSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesGetSample.ts deleted file mode 100644 index fde217443ae..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesGetSample.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a SchemaRegistry - * - * @summary get a SchemaRegistry - * x-ms-original-file: 2024-09-01-preview/Get_SchemaRegistry.json - */ -async function getSchemaRegistry(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemaRegistries.get("myResourceGroup", "my-schema-registry"); - console.log(result); -} - -async function main(): Promise { - await getSchemaRegistry(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesListByResourceGroupSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesListByResourceGroupSample.ts deleted file mode 100644 index 2c484e6b989..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesListByResourceGroupSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list SchemaRegistry resources by resource group - * - * @summary list SchemaRegistry resources by resource group - * x-ms-original-file: 2024-09-01-preview/List_SchemaRegistries_ResourceGroup.json - */ -async function listSchemaRegistriesResourceGroup(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.schemaRegistries.listByResourceGroup("myResourceGroup")) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listSchemaRegistriesResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesListBySubscriptionSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesListBySubscriptionSample.ts deleted file mode 100644 index 1798572250b..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesListBySubscriptionSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list SchemaRegistry resources by subscription ID - * - * @summary list SchemaRegistry resources by subscription ID - * x-ms-original-file: 2024-09-01-preview/List_SchemaRegistries_Subscription.json - */ -async function listSchemaRegistriesSubscription(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.schemaRegistries.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listSchemaRegistriesSubscription(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesUpdateSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesUpdateSample.ts deleted file mode 100644 index ecee9c23fe5..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaRegistriesUpdateSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update a SchemaRegistry - * - * @summary update a SchemaRegistry - * x-ms-original-file: 2024-09-01-preview/Update_SchemaRegistry.json - */ -async function updateSchemaRegistry(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemaRegistries.update("myResourceGroup", "my-schema-registry", { - properties: { - displayName: "Schema Registry namespace 001", - description: "This is a sample Schema Registry", - }, - tags: {}, - }); - console.log(result); -} - -async function main(): Promise { - await updateSchemaRegistry(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaVersionsCreateOrReplaceSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaVersionsCreateOrReplaceSample.ts deleted file mode 100644 index 9b96ac22917..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaVersionsCreateOrReplaceSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to create a SchemaVersion - * - * @summary create a SchemaVersion - * x-ms-original-file: 2024-09-01-preview/Create_SchemaVersion.json - */ -async function createSchemaVersion(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemaVersions.createOrReplace( - "myResourceGroup", - "my-schema-registry", - "my-schema", - "1", - { - properties: { - description: "Schema version 1", - schemaContent: - '{"$schema": "http://json-schema.org/draft-07/schema#","type": "object","properties": {"humidity": {"type": "string"},"temperature": {"type":"number"}}}', - }, - }, - ); - console.log(result); -} - -async function main(): Promise { - await createSchemaVersion(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaVersionsDeleteSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaVersionsDeleteSample.ts deleted file mode 100644 index d130f5f4c63..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaVersionsDeleteSample.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to delete a SchemaVersion - * - * @summary delete a SchemaVersion - * x-ms-original-file: 2024-09-01-preview/Delete_SchemaVersion.json - */ -async function deleteSchemaVersion(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - await client.schemaVersions.delete("myResourceGroup", "my-schema-registry", "my-schema", "1"); -} - -async function main(): Promise { - await deleteSchemaVersion(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaVersionsGetSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaVersionsGetSample.ts deleted file mode 100644 index 8e47579b062..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaVersionsGetSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a SchemaVersion - * - * @summary get a SchemaVersion - * x-ms-original-file: 2024-09-01-preview/Get_SchemaVersion.json - */ -async function getSchemaVersion(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemaVersions.get( - "myResourceGroup", - "my-schema-registry", - "my-schema", - "1", - ); - console.log(result); -} - -async function main(): Promise { - await getSchemaVersion(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaVersionsListBySchemaSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaVersionsListBySchemaSample.ts deleted file mode 100644 index 598de2d9078..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemaVersionsListBySchemaSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list SchemaVersion resources by Schema - * - * @summary list SchemaVersion resources by Schema - * x-ms-original-file: 2024-09-01-preview/List_SchemaVersions_Schema.json - */ -async function listSchemaVersionsSchema(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.schemaVersions.listBySchema( - "myResourceGroup", - "my-schema-registry", - "my-schema", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listSchemaVersionsSchema(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemasCreateOrReplaceSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemasCreateOrReplaceSample.ts deleted file mode 100644 index 5844763f032..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemasCreateOrReplaceSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to create a Schema - * - * @summary create a Schema - * x-ms-original-file: 2024-09-01-preview/Create_Schema.json - */ -async function createSchema(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemas.createOrReplace( - "myResourceGroup", - "my-schema-registry", - "my-schema", - { - properties: { - displayName: "My Schema", - description: "This is a sample Schema", - format: "JsonSchema/draft-07", - schemaType: "MessageSchema", - tags: { sampleKey: "sampleValue" }, - }, - }, - ); - console.log(result); -} - -async function main(): Promise { - await createSchema(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemasDeleteSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemasDeleteSample.ts deleted file mode 100644 index 826f10300f2..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemasDeleteSample.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to delete a Schema - * - * @summary delete a Schema - * x-ms-original-file: 2024-09-01-preview/Delete_Schema.json - */ -async function deleteSchema(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - await client.schemas.delete("myResourceGroup", "my-schema-registry", "my-schema"); -} - -async function main(): Promise { - await deleteSchema(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemasGetSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemasGetSample.ts deleted file mode 100644 index f4806cb29a3..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemasGetSample.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a Schema - * - * @summary get a Schema - * x-ms-original-file: 2024-09-01-preview/Get_Schema.json - */ -async function schemasGet(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemas.get("myResourceGroup", "my-schema-registry", "my-schema"); - console.log(result); -} - -async function main(): Promise { - await schemasGet(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemasListBySchemaRegistrySample.ts b/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemasListBySchemaRegistrySample.ts deleted file mode 100644 index 40309d1bbdc..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/schemasListBySchemaRegistrySample.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list Schema resources by SchemaRegistry - * - * @summary list Schema resources by SchemaRegistry - * x-ms-original-file: 2024-09-01-preview/List_Schemas_SchemaRegistry.json - */ -async function listSchemasSchemaRegistry(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (const item of client.schemas.listBySchemaRegistry( - "myResourceGroup", - "my-schema-registry", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - await listSchemasSchemaRegistry(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/README.md b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/README.md deleted file mode 100644 index 48be6d76ae8..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/README.md +++ /dev/null @@ -1,132 +0,0 @@ -# @azure/arm-deviceregistry client library samples for JavaScript (Beta) - -These sample programs show how to use the JavaScript client libraries for @azure/arm-deviceregistry in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [assetEndpointProfilesCreateOrReplaceSample.js][assetendpointprofilescreateorreplacesample] | create a AssetEndpointProfile x-ms-original-file: 2024-09-01-preview/Create_AssetEndpointProfile.json | -| [assetEndpointProfilesDeleteSample.js][assetendpointprofilesdeletesample] | delete a AssetEndpointProfile x-ms-original-file: 2024-09-01-preview/Delete_AssetEndpointProfile.json | -| [assetEndpointProfilesGetSample.js][assetendpointprofilesgetsample] | get a AssetEndpointProfile x-ms-original-file: 2024-09-01-preview/Get_AssetEndpointProfile.json | -| [assetEndpointProfilesListByResourceGroupSample.js][assetendpointprofileslistbyresourcegroupsample] | list AssetEndpointProfile resources by resource group x-ms-original-file: 2024-09-01-preview/List_AssetEndpointProfiles_ResourceGroup.json | -| [assetEndpointProfilesListBySubscriptionSample.js][assetendpointprofileslistbysubscriptionsample] | list AssetEndpointProfile resources by subscription ID x-ms-original-file: 2024-09-01-preview/List_AssetEndpointProfiles_Subscription.json | -| [assetEndpointProfilesUpdateSample.js][assetendpointprofilesupdatesample] | update a AssetEndpointProfile x-ms-original-file: 2024-09-01-preview/Update_AssetEndpointProfile.json | -| [assetsCreateOrReplaceSample.js][assetscreateorreplacesample] | create a Asset x-ms-original-file: 2024-09-01-preview/Create_Asset_Without_DisplayName.json | -| [assetsDeleteSample.js][assetsdeletesample] | delete a Asset x-ms-original-file: 2024-09-01-preview/Delete_Asset.json | -| [assetsGetSample.js][assetsgetsample] | get a Asset x-ms-original-file: 2024-09-01-preview/Get_Asset.json | -| [assetsListByResourceGroupSample.js][assetslistbyresourcegroupsample] | list Asset resources by resource group x-ms-original-file: 2024-09-01-preview/List_Assets_ResourceGroup.json | -| [assetsListBySubscriptionSample.js][assetslistbysubscriptionsample] | list Asset resources by subscription ID x-ms-original-file: 2024-09-01-preview/List_Assets_Subscription.json | -| [assetsUpdateSample.js][assetsupdatesample] | update a Asset x-ms-original-file: 2024-09-01-preview/Update_Asset.json | -| [billingContainersGetSample.js][billingcontainersgetsample] | get a BillingContainer x-ms-original-file: 2024-09-01-preview/Get_BillingContainer.json | -| [billingContainersListBySubscriptionSample.js][billingcontainerslistbysubscriptionsample] | list BillingContainer resources by subscription ID x-ms-original-file: 2024-09-01-preview/List_BillingContainers_Subscription.json | -| [discoveredAssetEndpointProfilesCreateOrReplaceSample.js][discoveredassetendpointprofilescreateorreplacesample] | create a DiscoveredAssetEndpointProfile x-ms-original-file: 2024-09-01-preview/Create_DiscoveredAssetEndpointProfile.json | -| [discoveredAssetEndpointProfilesDeleteSample.js][discoveredassetendpointprofilesdeletesample] | delete a DiscoveredAssetEndpointProfile x-ms-original-file: 2024-09-01-preview/Delete_DiscoveredAssetEndpointProfile.json | -| [discoveredAssetEndpointProfilesGetSample.js][discoveredassetendpointprofilesgetsample] | get a DiscoveredAssetEndpointProfile x-ms-original-file: 2024-09-01-preview/Get_DiscoveredAssetEndpointProfile.json | -| [discoveredAssetEndpointProfilesListByResourceGroupSample.js][discoveredassetendpointprofileslistbyresourcegroupsample] | list DiscoveredAssetEndpointProfile resources by resource group x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssetEndpointProfiles_ResourceGroup.json | -| [discoveredAssetEndpointProfilesListBySubscriptionSample.js][discoveredassetendpointprofileslistbysubscriptionsample] | list DiscoveredAssetEndpointProfile resources by subscription ID x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssetEndpointProfiles_Subscription.json | -| [discoveredAssetEndpointProfilesUpdateSample.js][discoveredassetendpointprofilesupdatesample] | update a DiscoveredAssetEndpointProfile x-ms-original-file: 2024-09-01-preview/Update_DiscoveredAssetEndpointProfile.json | -| [discoveredAssetsCreateOrReplaceSample.js][discoveredassetscreateorreplacesample] | create a DiscoveredAsset x-ms-original-file: 2024-09-01-preview/Create_DiscoveredAsset.json | -| [discoveredAssetsDeleteSample.js][discoveredassetsdeletesample] | delete a DiscoveredAsset x-ms-original-file: 2024-09-01-preview/Delete_DiscoveredAsset.json | -| [discoveredAssetsGetSample.js][discoveredassetsgetsample] | get a DiscoveredAsset x-ms-original-file: 2024-09-01-preview/Get_DiscoveredAsset.json | -| [discoveredAssetsListByResourceGroupSample.js][discoveredassetslistbyresourcegroupsample] | list DiscoveredAsset resources by resource group x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssets_ResourceGroup.json | -| [discoveredAssetsListBySubscriptionSample.js][discoveredassetslistbysubscriptionsample] | list DiscoveredAsset resources by subscription ID x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssets_Subscription.json | -| [discoveredAssetsUpdateSample.js][discoveredassetsupdatesample] | update a DiscoveredAsset x-ms-original-file: 2024-09-01-preview/Update_DiscoveredAsset.json | -| [operationStatusGetSample.js][operationstatusgetsample] | returns the current status of an async operation. x-ms-original-file: 2024-09-01-preview/Get_OperationStatus.json | -| [operationsListSample.js][operationslistsample] | list the operations for the provider x-ms-original-file: 2024-09-01-preview/List_Operations.json | -| [schemaRegistriesCreateOrReplaceSample.js][schemaregistriescreateorreplacesample] | create a SchemaRegistry x-ms-original-file: 2024-09-01-preview/Create_SchemaRegistry.json | -| [schemaRegistriesDeleteSample.js][schemaregistriesdeletesample] | delete a SchemaRegistry x-ms-original-file: 2024-09-01-preview/Delete_SchemaRegistry.json | -| [schemaRegistriesGetSample.js][schemaregistriesgetsample] | get a SchemaRegistry x-ms-original-file: 2024-09-01-preview/Get_SchemaRegistry.json | -| [schemaRegistriesListByResourceGroupSample.js][schemaregistrieslistbyresourcegroupsample] | list SchemaRegistry resources by resource group x-ms-original-file: 2024-09-01-preview/List_SchemaRegistries_ResourceGroup.json | -| [schemaRegistriesListBySubscriptionSample.js][schemaregistrieslistbysubscriptionsample] | list SchemaRegistry resources by subscription ID x-ms-original-file: 2024-09-01-preview/List_SchemaRegistries_Subscription.json | -| [schemaRegistriesUpdateSample.js][schemaregistriesupdatesample] | update a SchemaRegistry x-ms-original-file: 2024-09-01-preview/Update_SchemaRegistry.json | -| [schemaVersionsCreateOrReplaceSample.js][schemaversionscreateorreplacesample] | create a SchemaVersion x-ms-original-file: 2024-09-01-preview/Create_SchemaVersion.json | -| [schemaVersionsDeleteSample.js][schemaversionsdeletesample] | delete a SchemaVersion x-ms-original-file: 2024-09-01-preview/Delete_SchemaVersion.json | -| [schemaVersionsGetSample.js][schemaversionsgetsample] | get a SchemaVersion x-ms-original-file: 2024-09-01-preview/Get_SchemaVersion.json | -| [schemaVersionsListBySchemaSample.js][schemaversionslistbyschemasample] | list SchemaVersion resources by Schema x-ms-original-file: 2024-09-01-preview/List_SchemaVersions_Schema.json | -| [schemasCreateOrReplaceSample.js][schemascreateorreplacesample] | create a Schema x-ms-original-file: 2024-09-01-preview/Create_Schema.json | -| [schemasDeleteSample.js][schemasdeletesample] | delete a Schema x-ms-original-file: 2024-09-01-preview/Delete_Schema.json | -| [schemasGetSample.js][schemasgetsample] | get a Schema x-ms-original-file: 2024-09-01-preview/Get_Schema.json | -| [schemasListBySchemaRegistrySample.js][schemaslistbyschemaregistrysample] | list Schema resources by SchemaRegistry x-ms-original-file: 2024-09-01-preview/List_Schemas_SchemaRegistry.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 assetEndpointProfilesCreateOrReplaceSample.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 dev-tool run vendored cross-env node assetEndpointProfilesCreateOrReplaceSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[assetendpointprofilescreateorreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesCreateOrReplaceSample.js -[assetendpointprofilesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesDeleteSample.js -[assetendpointprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesGetSample.js -[assetendpointprofileslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesListByResourceGroupSample.js -[assetendpointprofileslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesListBySubscriptionSample.js -[assetendpointprofilesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesUpdateSample.js -[assetscreateorreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsCreateOrReplaceSample.js -[assetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsDeleteSample.js -[assetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsGetSample.js -[assetslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsListByResourceGroupSample.js -[assetslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsListBySubscriptionSample.js -[assetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsUpdateSample.js -[billingcontainersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/billingContainersGetSample.js -[billingcontainerslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/billingContainersListBySubscriptionSample.js -[discoveredassetendpointprofilescreateorreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesCreateOrReplaceSample.js -[discoveredassetendpointprofilesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesDeleteSample.js -[discoveredassetendpointprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesGetSample.js -[discoveredassetendpointprofileslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesListByResourceGroupSample.js -[discoveredassetendpointprofileslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesListBySubscriptionSample.js -[discoveredassetendpointprofilesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesUpdateSample.js -[discoveredassetscreateorreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsCreateOrReplaceSample.js -[discoveredassetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsDeleteSample.js -[discoveredassetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsGetSample.js -[discoveredassetslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsListByResourceGroupSample.js -[discoveredassetslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsListBySubscriptionSample.js -[discoveredassetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsUpdateSample.js -[operationstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/operationStatusGetSample.js -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/operationsListSample.js -[schemaregistriescreateorreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesCreateOrReplaceSample.js -[schemaregistriesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesDeleteSample.js -[schemaregistriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesGetSample.js -[schemaregistrieslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesListByResourceGroupSample.js -[schemaregistrieslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesListBySubscriptionSample.js -[schemaregistriesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesUpdateSample.js -[schemaversionscreateorreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsCreateOrReplaceSample.js -[schemaversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsDeleteSample.js -[schemaversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsGetSample.js -[schemaversionslistbyschemasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsListBySchemaSample.js -[schemascreateorreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasCreateOrReplaceSample.js -[schemasdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasDeleteSample.js -[schemasgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasGetSample.js -[schemaslistbyschemaregistrysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasListBySchemaRegistrySample.js -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-deviceregistry?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/deviceregistry/arm-deviceregistry/README.md diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesCreateOrReplaceSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesCreateOrReplaceSample.js deleted file mode 100644 index 180be1cf494..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesCreateOrReplaceSample.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to create a DiscoveredAssetEndpointProfile - * - * @summary create a DiscoveredAssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Create_DiscoveredAssetEndpointProfile.json - */ -async function createDiscoveredAssetEndpointProfile() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.discoveredAssetEndpointProfiles.createOrReplace( - "myResourceGroup", - "my-discoveredassetendpointprofile", - { - location: "West Europe", - extendedLocation: { - type: "CustomLocation", - name: "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1", - }, - tags: { site: "building-1" }, - properties: { - targetAddress: "https://www.example.com/myTargetAddress", - additionalConfiguration: '{"foo": "bar"}', - discoveryId: "11111111-1111-1111-1111-111111111111", - version: 73766, - endpointProfileType: "myEndpointProfileType", - supportedAuthenticationMethods: ["Anonymous", "Certificate", "UsernamePassword"], - }, - }, - ); - console.log(result); -} - -async function main() { - createDiscoveredAssetEndpointProfile(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesDeleteSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesDeleteSample.js deleted file mode 100644 index e5242879e3d..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesDeleteSample.js +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to delete a DiscoveredAssetEndpointProfile - * - * @summary delete a DiscoveredAssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Delete_DiscoveredAssetEndpointProfile.json - */ -async function deleteDiscoveredAssetEndpointProfile() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - await client.discoveredAssetEndpointProfiles.delete( - "myResourceGroup", - "my-discoveredassetendpointprofile", - ); -} - -async function main() { - deleteDiscoveredAssetEndpointProfile(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesGetSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesGetSample.js deleted file mode 100644 index 9eea8afe04c..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesGetSample.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to get a DiscoveredAssetEndpointProfile - * - * @summary get a DiscoveredAssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Get_DiscoveredAssetEndpointProfile.json - */ -async function getDiscoveredAssetEndpointProfile() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.discoveredAssetEndpointProfiles.get( - "myResourceGroup", - "my-discoveredassetendpointprofile", - ); - console.log(result); -} - -async function main() { - getDiscoveredAssetEndpointProfile(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesListByResourceGroupSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesListByResourceGroupSample.js deleted file mode 100644 index 60351227caf..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesListByResourceGroupSample.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list DiscoveredAssetEndpointProfile resources by resource group - * - * @summary list DiscoveredAssetEndpointProfile resources by resource group - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssetEndpointProfiles_ResourceGroup.json - */ -async function listDiscoveredAssetEndpointProfilesResourceGroup() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.discoveredAssetEndpointProfiles.listByResourceGroup( - "myResourceGroup", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - listDiscoveredAssetEndpointProfilesResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesListBySubscriptionSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesListBySubscriptionSample.js deleted file mode 100644 index 3f3d0e6b5e6..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesListBySubscriptionSample.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list DiscoveredAssetEndpointProfile resources by subscription ID - * - * @summary list DiscoveredAssetEndpointProfile resources by subscription ID - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssetEndpointProfiles_Subscription.json - */ -async function listDiscoveredAssetEndpointProfilesSubscription() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.discoveredAssetEndpointProfiles.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - listDiscoveredAssetEndpointProfilesSubscription(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesUpdateSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesUpdateSample.js deleted file mode 100644 index b9b4cf5d950..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetEndpointProfilesUpdateSample.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to update a DiscoveredAssetEndpointProfile - * - * @summary update a DiscoveredAssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Update_DiscoveredAssetEndpointProfile.json - */ -async function updateDiscoveredAssetEndpointProfile() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.discoveredAssetEndpointProfiles.update( - "myResourceGroup", - "my-discoveredassetendpointprofile", - { - properties: { - targetAddress: "https://www.example.com/myTargetAddress", - additionalConfiguration: '{"foo": "bar"}', - discoveryId: "11111111-1111-1111-1111-111111111111", - version: 73766, - endpointProfileType: "myEndpointProfileType", - supportedAuthenticationMethods: ["Anonymous", "Certificate"], - }, - }, - ); - console.log(result); -} - -async function main() { - updateDiscoveredAssetEndpointProfile(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsCreateOrReplaceSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsCreateOrReplaceSample.js deleted file mode 100644 index 16093d8f9bd..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsCreateOrReplaceSample.js +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to create a DiscoveredAsset - * - * @summary create a DiscoveredAsset - * x-ms-original-file: 2024-09-01-preview/Create_DiscoveredAsset.json - */ -async function createDiscoveredAsset() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.discoveredAssets.createOrReplace( - "myResourceGroup", - "my-discoveredasset", - { - location: "West Europe", - extendedLocation: { - type: "CustomLocation", - name: "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1", - }, - tags: { site: "building-1" }, - properties: { - assetEndpointProfileRef: "myAssetEndpointProfile", - discoveryId: "11111111-1111-1111-1111-111111111111", - version: 73766, - manufacturer: "Contoso", - manufacturerUri: "https://www.contoso.com/manufacturerUri", - model: "ContosoModel", - productCode: "SA34VDG", - hardwareRevision: "1.0", - softwareRevision: "2.0", - documentationUri: "https://www.example.com/manual", - serialNumber: "64-103816-519918-8", - defaultDatasetsConfiguration: - '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', - defaultEventsConfiguration: - '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', - defaultTopic: { path: "/path/defaultTopic", retain: "Keep" }, - datasets: [ - { - name: "dataset1", - datasetConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', - topic: { path: "/path/dataset1", retain: "Keep" }, - dataPoints: [ - { - name: "dataPoint1", - dataSource: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1", - dataPointConfiguration: - '{"publishingInterval":8,"samplingInterval":8,"queueSize":4}', - }, - { - name: "dataPoint2", - dataSource: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2", - dataPointConfiguration: - '{"publishingInterval":4,"samplingInterval":4,"queueSize":7}', - }, - ], - }, - ], - events: [ - { - name: "event1", - eventNotifier: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3", - eventConfiguration: '{"publishingInterval":7,"samplingInterval":1,"queueSize":8}', - topic: { path: "/path/event1", retain: "Keep" }, - }, - { - name: "event2", - eventNotifier: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4", - eventConfiguration: '{"publishingInterval":7,"samplingInterval":8,"queueSize":4}', - }, - ], - }, - }, - ); - console.log(result); -} - -async function main() { - createDiscoveredAsset(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsDeleteSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsDeleteSample.js deleted file mode 100644 index 64d3144d00f..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsDeleteSample.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to delete a DiscoveredAsset - * - * @summary delete a DiscoveredAsset - * x-ms-original-file: 2024-09-01-preview/Delete_DiscoveredAsset.json - */ -async function deleteDiscoveredAsset() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - await client.discoveredAssets.delete("myResourceGroup", "my-discoveredasset"); -} - -async function main() { - deleteDiscoveredAsset(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsGetSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsGetSample.js deleted file mode 100644 index fc36e5b5d9f..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsGetSample.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to get a DiscoveredAsset - * - * @summary get a DiscoveredAsset - * x-ms-original-file: 2024-09-01-preview/Get_DiscoveredAsset.json - */ -async function getDiscoveredAsset() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.discoveredAssets.get("myResourceGroup", "my-discoveredasset"); - console.log(result); -} - -async function main() { - getDiscoveredAsset(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsListByResourceGroupSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsListByResourceGroupSample.js deleted file mode 100644 index caaac050dbe..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsListByResourceGroupSample.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list DiscoveredAsset resources by resource group - * - * @summary list DiscoveredAsset resources by resource group - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssets_ResourceGroup.json - */ -async function listDiscoveredAssetsResourceGroup() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.discoveredAssets.listByResourceGroup("myResourceGroup")) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - listDiscoveredAssetsResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsListBySubscriptionSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsListBySubscriptionSample.js deleted file mode 100644 index d33294eda4e..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsListBySubscriptionSample.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list DiscoveredAsset resources by subscription ID - * - * @summary list DiscoveredAsset resources by subscription ID - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssets_Subscription.json - */ -async function listDiscoveredAssetsSubscription() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.discoveredAssets.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - listDiscoveredAssetsSubscription(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsUpdateSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsUpdateSample.js deleted file mode 100644 index 9cee4008918..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/discoveredAssetsUpdateSample.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to update a DiscoveredAsset - * - * @summary update a DiscoveredAsset - * x-ms-original-file: 2024-09-01-preview/Update_DiscoveredAsset.json - */ -async function updateDiscoveredAsset() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.discoveredAssets.update("myResourceGroup", "my-discoveredasset", { - properties: { - documentationUri: "https://www.example.com/manual-2", - defaultTopic: { path: "/path/defaultTopic", retain: "Never" }, - }, - }); - console.log(result); -} - -async function main() { - updateDiscoveredAsset(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesCreateOrReplaceSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesCreateOrReplaceSample.js deleted file mode 100644 index c44a30117d8..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesCreateOrReplaceSample.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to create a SchemaRegistry - * - * @summary create a SchemaRegistry - * x-ms-original-file: 2024-09-01-preview/Create_SchemaRegistry.json - */ -async function createSchemaRegistry() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemaRegistries.createOrReplace( - "myResourceGroup", - "my-schema-registry", - { - properties: { - namespace: "sr-namespace-001", - displayName: "Schema Registry namespace 001", - description: "This is a sample Schema Registry", - storageAccountContainerUrl: "my-blob-storage.blob.core.windows.net/my-container", - }, - tags: {}, - location: "West Europe", - identity: { type: "None" }, - }, - ); - console.log(result); -} - -async function main() { - createSchemaRegistry(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesDeleteSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesDeleteSample.js deleted file mode 100644 index 13aaa83ad97..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesDeleteSample.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to delete a SchemaRegistry - * - * @summary delete a SchemaRegistry - * x-ms-original-file: 2024-09-01-preview/Delete_SchemaRegistry.json - */ -async function deleteSchemaRegistry() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - await client.schemaRegistries.delete("myResourceGroup", "my-schema-registry"); -} - -async function main() { - deleteSchemaRegistry(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesGetSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesGetSample.js deleted file mode 100644 index 5979c48eecf..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesGetSample.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to get a SchemaRegistry - * - * @summary get a SchemaRegistry - * x-ms-original-file: 2024-09-01-preview/Get_SchemaRegistry.json - */ -async function getSchemaRegistry() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemaRegistries.get("myResourceGroup", "my-schema-registry"); - console.log(result); -} - -async function main() { - getSchemaRegistry(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesListByResourceGroupSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesListByResourceGroupSample.js deleted file mode 100644 index 6e0aaf0caad..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesListByResourceGroupSample.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list SchemaRegistry resources by resource group - * - * @summary list SchemaRegistry resources by resource group - * x-ms-original-file: 2024-09-01-preview/List_SchemaRegistries_ResourceGroup.json - */ -async function listSchemaRegistriesResourceGroup() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.schemaRegistries.listByResourceGroup("myResourceGroup")) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - listSchemaRegistriesResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesListBySubscriptionSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesListBySubscriptionSample.js deleted file mode 100644 index d03f9f223a6..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesListBySubscriptionSample.js +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list SchemaRegistry resources by subscription ID - * - * @summary list SchemaRegistry resources by subscription ID - * x-ms-original-file: 2024-09-01-preview/List_SchemaRegistries_Subscription.json - */ -async function listSchemaRegistriesSubscription() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.schemaRegistries.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - listSchemaRegistriesSubscription(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesUpdateSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesUpdateSample.js deleted file mode 100644 index db30bb882af..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaRegistriesUpdateSample.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to update a SchemaRegistry - * - * @summary update a SchemaRegistry - * x-ms-original-file: 2024-09-01-preview/Update_SchemaRegistry.json - */ -async function updateSchemaRegistry() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemaRegistries.update("myResourceGroup", "my-schema-registry", { - properties: { - displayName: "Schema Registry namespace 001", - description: "This is a sample Schema Registry", - }, - tags: {}, - }); - console.log(result); -} - -async function main() { - updateSchemaRegistry(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsCreateOrReplaceSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsCreateOrReplaceSample.js deleted file mode 100644 index 032d3c093e7..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsCreateOrReplaceSample.js +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to create a SchemaVersion - * - * @summary create a SchemaVersion - * x-ms-original-file: 2024-09-01-preview/Create_SchemaVersion.json - */ -async function createSchemaVersion() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemaVersions.createOrReplace( - "myResourceGroup", - "my-schema-registry", - "my-schema", - "1", - { - properties: { - description: "Schema version 1", - schemaContent: - '{"$schema": "http://json-schema.org/draft-07/schema#","type": "object","properties": {"humidity": {"type": "string"},"temperature": {"type":"number"}}}', - }, - }, - ); - console.log(result); -} - -async function main() { - createSchemaVersion(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsDeleteSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsDeleteSample.js deleted file mode 100644 index e87630351b5..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsDeleteSample.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to delete a SchemaVersion - * - * @summary delete a SchemaVersion - * x-ms-original-file: 2024-09-01-preview/Delete_SchemaVersion.json - */ -async function deleteSchemaVersion() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - await client.schemaVersions.delete("myResourceGroup", "my-schema-registry", "my-schema", "1"); -} - -async function main() { - deleteSchemaVersion(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsGetSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsGetSample.js deleted file mode 100644 index 91761d24c83..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsGetSample.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to get a SchemaVersion - * - * @summary get a SchemaVersion - * x-ms-original-file: 2024-09-01-preview/Get_SchemaVersion.json - */ -async function getSchemaVersion() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemaVersions.get( - "myResourceGroup", - "my-schema-registry", - "my-schema", - "1", - ); - console.log(result); -} - -async function main() { - getSchemaVersion(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsListBySchemaSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsListBySchemaSample.js deleted file mode 100644 index 79767d288be..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemaVersionsListBySchemaSample.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list SchemaVersion resources by Schema - * - * @summary list SchemaVersion resources by Schema - * x-ms-original-file: 2024-09-01-preview/List_SchemaVersions_Schema.json - */ -async function listSchemaVersionsSchema() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.schemaVersions.listBySchema( - "myResourceGroup", - "my-schema-registry", - "my-schema", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - listSchemaVersionsSchema(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasCreateOrReplaceSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasCreateOrReplaceSample.js deleted file mode 100644 index 7763f32483f..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasCreateOrReplaceSample.js +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to create a Schema - * - * @summary create a Schema - * x-ms-original-file: 2024-09-01-preview/Create_Schema.json - */ -async function createSchema() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemas.createOrReplace( - "myResourceGroup", - "my-schema-registry", - "my-schema", - { - properties: { - displayName: "My Schema", - description: "This is a sample Schema", - format: "JsonSchema/draft-07", - schemaType: "MessageSchema", - tags: { sampleKey: "sampleValue" }, - }, - }, - ); - console.log(result); -} - -async function main() { - createSchema(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasDeleteSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasDeleteSample.js deleted file mode 100644 index 5daefd70f31..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasDeleteSample.js +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to delete a Schema - * - * @summary delete a Schema - * x-ms-original-file: 2024-09-01-preview/Delete_Schema.json - */ -async function deleteSchema() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - await client.schemas.delete("myResourceGroup", "my-schema-registry", "my-schema"); -} - -async function main() { - deleteSchema(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasGetSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasGetSample.js deleted file mode 100644 index e4bdf2bcc5e..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasGetSample.js +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to get a Schema - * - * @summary get a Schema - * x-ms-original-file: 2024-09-01-preview/Get_Schema.json - */ -async function schemasGet() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemas.get("myResourceGroup", "my-schema-registry", "my-schema"); - console.log(result); -} - -async function main() { - schemasGet(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasListBySchemaRegistrySample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasListBySchemaRegistrySample.js deleted file mode 100644 index a2e435a6aa8..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/schemasListBySchemaRegistrySample.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -const { DeviceRegistryManagementClient } = require("@azure/arm-deviceregistry"); -const { DefaultAzureCredential } = require("@azure/identity"); - -/** - * This sample demonstrates how to list Schema resources by SchemaRegistry - * - * @summary list Schema resources by SchemaRegistry - * x-ms-original-file: 2024-09-01-preview/List_Schemas_SchemaRegistry.json - */ -async function listSchemasSchemaRegistry() { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.schemas.listBySchemaRegistry( - "myResourceGroup", - "my-schema-registry", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main() { - listSchemasSchemaRegistry(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/README.md b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/README.md deleted file mode 100644 index cda794842d3..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/README.md +++ /dev/null @@ -1,145 +0,0 @@ -# @azure/arm-deviceregistry client library samples for TypeScript (Beta) - -These sample programs show how to use the TypeScript client libraries for @azure/arm-deviceregistry in some common scenarios. - -| **File Name** | **Description** | -| ----------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [assetEndpointProfilesCreateOrReplaceSample.ts][assetendpointprofilescreateorreplacesample] | create a AssetEndpointProfile x-ms-original-file: 2024-09-01-preview/Create_AssetEndpointProfile.json | -| [assetEndpointProfilesDeleteSample.ts][assetendpointprofilesdeletesample] | delete a AssetEndpointProfile x-ms-original-file: 2024-09-01-preview/Delete_AssetEndpointProfile.json | -| [assetEndpointProfilesGetSample.ts][assetendpointprofilesgetsample] | get a AssetEndpointProfile x-ms-original-file: 2024-09-01-preview/Get_AssetEndpointProfile.json | -| [assetEndpointProfilesListByResourceGroupSample.ts][assetendpointprofileslistbyresourcegroupsample] | list AssetEndpointProfile resources by resource group x-ms-original-file: 2024-09-01-preview/List_AssetEndpointProfiles_ResourceGroup.json | -| [assetEndpointProfilesListBySubscriptionSample.ts][assetendpointprofileslistbysubscriptionsample] | list AssetEndpointProfile resources by subscription ID x-ms-original-file: 2024-09-01-preview/List_AssetEndpointProfiles_Subscription.json | -| [assetEndpointProfilesUpdateSample.ts][assetendpointprofilesupdatesample] | update a AssetEndpointProfile x-ms-original-file: 2024-09-01-preview/Update_AssetEndpointProfile.json | -| [assetsCreateOrReplaceSample.ts][assetscreateorreplacesample] | create a Asset x-ms-original-file: 2024-09-01-preview/Create_Asset_Without_DisplayName.json | -| [assetsDeleteSample.ts][assetsdeletesample] | delete a Asset x-ms-original-file: 2024-09-01-preview/Delete_Asset.json | -| [assetsGetSample.ts][assetsgetsample] | get a Asset x-ms-original-file: 2024-09-01-preview/Get_Asset.json | -| [assetsListByResourceGroupSample.ts][assetslistbyresourcegroupsample] | list Asset resources by resource group x-ms-original-file: 2024-09-01-preview/List_Assets_ResourceGroup.json | -| [assetsListBySubscriptionSample.ts][assetslistbysubscriptionsample] | list Asset resources by subscription ID x-ms-original-file: 2024-09-01-preview/List_Assets_Subscription.json | -| [assetsUpdateSample.ts][assetsupdatesample] | update a Asset x-ms-original-file: 2024-09-01-preview/Update_Asset.json | -| [billingContainersGetSample.ts][billingcontainersgetsample] | get a BillingContainer x-ms-original-file: 2024-09-01-preview/Get_BillingContainer.json | -| [billingContainersListBySubscriptionSample.ts][billingcontainerslistbysubscriptionsample] | list BillingContainer resources by subscription ID x-ms-original-file: 2024-09-01-preview/List_BillingContainers_Subscription.json | -| [discoveredAssetEndpointProfilesCreateOrReplaceSample.ts][discoveredassetendpointprofilescreateorreplacesample] | create a DiscoveredAssetEndpointProfile x-ms-original-file: 2024-09-01-preview/Create_DiscoveredAssetEndpointProfile.json | -| [discoveredAssetEndpointProfilesDeleteSample.ts][discoveredassetendpointprofilesdeletesample] | delete a DiscoveredAssetEndpointProfile x-ms-original-file: 2024-09-01-preview/Delete_DiscoveredAssetEndpointProfile.json | -| [discoveredAssetEndpointProfilesGetSample.ts][discoveredassetendpointprofilesgetsample] | get a DiscoveredAssetEndpointProfile x-ms-original-file: 2024-09-01-preview/Get_DiscoveredAssetEndpointProfile.json | -| [discoveredAssetEndpointProfilesListByResourceGroupSample.ts][discoveredassetendpointprofileslistbyresourcegroupsample] | list DiscoveredAssetEndpointProfile resources by resource group x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssetEndpointProfiles_ResourceGroup.json | -| [discoveredAssetEndpointProfilesListBySubscriptionSample.ts][discoveredassetendpointprofileslistbysubscriptionsample] | list DiscoveredAssetEndpointProfile resources by subscription ID x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssetEndpointProfiles_Subscription.json | -| [discoveredAssetEndpointProfilesUpdateSample.ts][discoveredassetendpointprofilesupdatesample] | update a DiscoveredAssetEndpointProfile x-ms-original-file: 2024-09-01-preview/Update_DiscoveredAssetEndpointProfile.json | -| [discoveredAssetsCreateOrReplaceSample.ts][discoveredassetscreateorreplacesample] | create a DiscoveredAsset x-ms-original-file: 2024-09-01-preview/Create_DiscoveredAsset.json | -| [discoveredAssetsDeleteSample.ts][discoveredassetsdeletesample] | delete a DiscoveredAsset x-ms-original-file: 2024-09-01-preview/Delete_DiscoveredAsset.json | -| [discoveredAssetsGetSample.ts][discoveredassetsgetsample] | get a DiscoveredAsset x-ms-original-file: 2024-09-01-preview/Get_DiscoveredAsset.json | -| [discoveredAssetsListByResourceGroupSample.ts][discoveredassetslistbyresourcegroupsample] | list DiscoveredAsset resources by resource group x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssets_ResourceGroup.json | -| [discoveredAssetsListBySubscriptionSample.ts][discoveredassetslistbysubscriptionsample] | list DiscoveredAsset resources by subscription ID x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssets_Subscription.json | -| [discoveredAssetsUpdateSample.ts][discoveredassetsupdatesample] | update a DiscoveredAsset x-ms-original-file: 2024-09-01-preview/Update_DiscoveredAsset.json | -| [operationStatusGetSample.ts][operationstatusgetsample] | returns the current status of an async operation. x-ms-original-file: 2024-09-01-preview/Get_OperationStatus.json | -| [operationsListSample.ts][operationslistsample] | list the operations for the provider x-ms-original-file: 2024-09-01-preview/List_Operations.json | -| [schemaRegistriesCreateOrReplaceSample.ts][schemaregistriescreateorreplacesample] | create a SchemaRegistry x-ms-original-file: 2024-09-01-preview/Create_SchemaRegistry.json | -| [schemaRegistriesDeleteSample.ts][schemaregistriesdeletesample] | delete a SchemaRegistry x-ms-original-file: 2024-09-01-preview/Delete_SchemaRegistry.json | -| [schemaRegistriesGetSample.ts][schemaregistriesgetsample] | get a SchemaRegistry x-ms-original-file: 2024-09-01-preview/Get_SchemaRegistry.json | -| [schemaRegistriesListByResourceGroupSample.ts][schemaregistrieslistbyresourcegroupsample] | list SchemaRegistry resources by resource group x-ms-original-file: 2024-09-01-preview/List_SchemaRegistries_ResourceGroup.json | -| [schemaRegistriesListBySubscriptionSample.ts][schemaregistrieslistbysubscriptionsample] | list SchemaRegistry resources by subscription ID x-ms-original-file: 2024-09-01-preview/List_SchemaRegistries_Subscription.json | -| [schemaRegistriesUpdateSample.ts][schemaregistriesupdatesample] | update a SchemaRegistry x-ms-original-file: 2024-09-01-preview/Update_SchemaRegistry.json | -| [schemaVersionsCreateOrReplaceSample.ts][schemaversionscreateorreplacesample] | create a SchemaVersion x-ms-original-file: 2024-09-01-preview/Create_SchemaVersion.json | -| [schemaVersionsDeleteSample.ts][schemaversionsdeletesample] | delete a SchemaVersion x-ms-original-file: 2024-09-01-preview/Delete_SchemaVersion.json | -| [schemaVersionsGetSample.ts][schemaversionsgetsample] | get a SchemaVersion x-ms-original-file: 2024-09-01-preview/Get_SchemaVersion.json | -| [schemaVersionsListBySchemaSample.ts][schemaversionslistbyschemasample] | list SchemaVersion resources by Schema x-ms-original-file: 2024-09-01-preview/List_SchemaVersions_Schema.json | -| [schemasCreateOrReplaceSample.ts][schemascreateorreplacesample] | create a Schema x-ms-original-file: 2024-09-01-preview/Create_Schema.json | -| [schemasDeleteSample.ts][schemasdeletesample] | delete a Schema x-ms-original-file: 2024-09-01-preview/Delete_Schema.json | -| [schemasGetSample.ts][schemasgetsample] | get a Schema x-ms-original-file: 2024-09-01-preview/Get_Schema.json | -| [schemasListBySchemaRegistrySample.ts][schemaslistbyschemaregistrysample] | list Schema resources by SchemaRegistry x-ms-original-file: 2024-09-01-preview/List_Schemas_SchemaRegistry.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/assetEndpointProfilesCreateOrReplaceSample.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 dev-tool run vendored cross-env node dist/assetEndpointProfilesCreateOrReplaceSample.js -``` - -## Next Steps - -Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. - -[assetendpointprofilescreateorreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesCreateOrReplaceSample.ts -[assetendpointprofilesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesDeleteSample.ts -[assetendpointprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesGetSample.ts -[assetendpointprofileslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesListByResourceGroupSample.ts -[assetendpointprofileslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesListBySubscriptionSample.ts -[assetendpointprofilesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesUpdateSample.ts -[assetscreateorreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsCreateOrReplaceSample.ts -[assetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsDeleteSample.ts -[assetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsGetSample.ts -[assetslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsListByResourceGroupSample.ts -[assetslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsListBySubscriptionSample.ts -[assetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsUpdateSample.ts -[billingcontainersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/billingContainersGetSample.ts -[billingcontainerslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/billingContainersListBySubscriptionSample.ts -[discoveredassetendpointprofilescreateorreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesCreateOrReplaceSample.ts -[discoveredassetendpointprofilesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesDeleteSample.ts -[discoveredassetendpointprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesGetSample.ts -[discoveredassetendpointprofileslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesListByResourceGroupSample.ts -[discoveredassetendpointprofileslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesListBySubscriptionSample.ts -[discoveredassetendpointprofilesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesUpdateSample.ts -[discoveredassetscreateorreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsCreateOrReplaceSample.ts -[discoveredassetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsDeleteSample.ts -[discoveredassetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsGetSample.ts -[discoveredassetslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsListByResourceGroupSample.ts -[discoveredassetslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsListBySubscriptionSample.ts -[discoveredassetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsUpdateSample.ts -[operationstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/operationStatusGetSample.ts -[operationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/operationsListSample.ts -[schemaregistriescreateorreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesCreateOrReplaceSample.ts -[schemaregistriesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesDeleteSample.ts -[schemaregistriesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesGetSample.ts -[schemaregistrieslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesListByResourceGroupSample.ts -[schemaregistrieslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesListBySubscriptionSample.ts -[schemaregistriesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesUpdateSample.ts -[schemaversionscreateorreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsCreateOrReplaceSample.ts -[schemaversionsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsDeleteSample.ts -[schemaversionsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsGetSample.ts -[schemaversionslistbyschemasample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsListBySchemaSample.ts -[schemascreateorreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasCreateOrReplaceSample.ts -[schemasdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasDeleteSample.ts -[schemasgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasGetSample.ts -[schemaslistbyschemaregistrysample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasListBySchemaRegistrySample.ts -[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-deviceregistry?view=azure-node-preview -[freesub]: https://azure.microsoft.com/free/ -[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/deviceregistry/arm-deviceregistry/README.md -[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesCreateOrReplaceSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesCreateOrReplaceSample.ts deleted file mode 100644 index abfa098656d..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesCreateOrReplaceSample.ts +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to create a DiscoveredAssetEndpointProfile - * - * @summary create a DiscoveredAssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Create_DiscoveredAssetEndpointProfile.json - */ -async function createDiscoveredAssetEndpointProfile(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.discoveredAssetEndpointProfiles.createOrReplace( - "myResourceGroup", - "my-discoveredassetendpointprofile", - { - location: "West Europe", - extendedLocation: { - type: "CustomLocation", - name: "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1", - }, - tags: { site: "building-1" }, - properties: { - targetAddress: "https://www.example.com/myTargetAddress", - additionalConfiguration: '{"foo": "bar"}', - discoveryId: "11111111-1111-1111-1111-111111111111", - version: 73766, - endpointProfileType: "myEndpointProfileType", - supportedAuthenticationMethods: ["Anonymous", "Certificate", "UsernamePassword"], - }, - }, - ); - console.log(result); -} - -async function main(): Promise { - createDiscoveredAssetEndpointProfile(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesDeleteSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesDeleteSample.ts deleted file mode 100644 index ea9e6407a5f..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesDeleteSample.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to delete a DiscoveredAssetEndpointProfile - * - * @summary delete a DiscoveredAssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Delete_DiscoveredAssetEndpointProfile.json - */ -async function deleteDiscoveredAssetEndpointProfile(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - await client.discoveredAssetEndpointProfiles.delete( - "myResourceGroup", - "my-discoveredassetendpointprofile", - ); -} - -async function main(): Promise { - deleteDiscoveredAssetEndpointProfile(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesGetSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesGetSample.ts deleted file mode 100644 index 0fd5a27248c..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesGetSample.ts +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a DiscoveredAssetEndpointProfile - * - * @summary get a DiscoveredAssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Get_DiscoveredAssetEndpointProfile.json - */ -async function getDiscoveredAssetEndpointProfile(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.discoveredAssetEndpointProfiles.get( - "myResourceGroup", - "my-discoveredassetendpointprofile", - ); - console.log(result); -} - -async function main(): Promise { - getDiscoveredAssetEndpointProfile(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesListByResourceGroupSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesListByResourceGroupSample.ts deleted file mode 100644 index 2006d84117d..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesListByResourceGroupSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list DiscoveredAssetEndpointProfile resources by resource group - * - * @summary list DiscoveredAssetEndpointProfile resources by resource group - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssetEndpointProfiles_ResourceGroup.json - */ -async function listDiscoveredAssetEndpointProfilesResourceGroup(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.discoveredAssetEndpointProfiles.listByResourceGroup( - "myResourceGroup", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - listDiscoveredAssetEndpointProfilesResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesListBySubscriptionSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesListBySubscriptionSample.ts deleted file mode 100644 index db93ff7b2e4..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesListBySubscriptionSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list DiscoveredAssetEndpointProfile resources by subscription ID - * - * @summary list DiscoveredAssetEndpointProfile resources by subscription ID - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssetEndpointProfiles_Subscription.json - */ -async function listDiscoveredAssetEndpointProfilesSubscription(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.discoveredAssetEndpointProfiles.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - listDiscoveredAssetEndpointProfilesSubscription(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesUpdateSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesUpdateSample.ts deleted file mode 100644 index ea5d3cd9649..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetEndpointProfilesUpdateSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update a DiscoveredAssetEndpointProfile - * - * @summary update a DiscoveredAssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Update_DiscoveredAssetEndpointProfile.json - */ -async function updateDiscoveredAssetEndpointProfile(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.discoveredAssetEndpointProfiles.update( - "myResourceGroup", - "my-discoveredassetendpointprofile", - { - properties: { - targetAddress: "https://www.example.com/myTargetAddress", - additionalConfiguration: '{"foo": "bar"}', - discoveryId: "11111111-1111-1111-1111-111111111111", - version: 73766, - endpointProfileType: "myEndpointProfileType", - supportedAuthenticationMethods: ["Anonymous", "Certificate"], - }, - }, - ); - console.log(result); -} - -async function main(): Promise { - updateDiscoveredAssetEndpointProfile(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsCreateOrReplaceSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsCreateOrReplaceSample.ts deleted file mode 100644 index 6d086b033ba..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsCreateOrReplaceSample.ts +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to create a DiscoveredAsset - * - * @summary create a DiscoveredAsset - * x-ms-original-file: 2024-09-01-preview/Create_DiscoveredAsset.json - */ -async function createDiscoveredAsset(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.discoveredAssets.createOrReplace( - "myResourceGroup", - "my-discoveredasset", - { - location: "West Europe", - extendedLocation: { - type: "CustomLocation", - name: "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/myResourceGroup/providers/microsoft.extendedlocation/customlocations/location1", - }, - tags: { site: "building-1" }, - properties: { - assetEndpointProfileRef: "myAssetEndpointProfile", - discoveryId: "11111111-1111-1111-1111-111111111111", - version: 73766, - manufacturer: "Contoso", - manufacturerUri: "https://www.contoso.com/manufacturerUri", - model: "ContosoModel", - productCode: "SA34VDG", - hardwareRevision: "1.0", - softwareRevision: "2.0", - documentationUri: "https://www.example.com/manual", - serialNumber: "64-103816-519918-8", - defaultDatasetsConfiguration: - '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', - defaultEventsConfiguration: - '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', - defaultTopic: { path: "/path/defaultTopic", retain: "Keep" }, - datasets: [ - { - name: "dataset1", - datasetConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', - topic: { path: "/path/dataset1", retain: "Keep" }, - dataPoints: [ - { - name: "dataPoint1", - dataSource: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt1", - dataPointConfiguration: - '{"publishingInterval":8,"samplingInterval":8,"queueSize":4}', - }, - { - name: "dataPoint2", - dataSource: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt2", - dataPointConfiguration: - '{"publishingInterval":4,"samplingInterval":4,"queueSize":7}', - }, - ], - }, - ], - events: [ - { - name: "event1", - eventNotifier: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt3", - eventConfiguration: '{"publishingInterval":7,"samplingInterval":1,"queueSize":8}', - topic: { path: "/path/event1", retain: "Keep" }, - }, - { - name: "event2", - eventNotifier: "nsu=http://microsoft.com/Opc/OpcPlc/;s=FastUInt4", - eventConfiguration: '{"publishingInterval":7,"samplingInterval":8,"queueSize":4}', - }, - ], - }, - }, - ); - console.log(result); -} - -async function main(): Promise { - createDiscoveredAsset(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsDeleteSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsDeleteSample.ts deleted file mode 100644 index 1f5aeaa8caf..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsDeleteSample.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to delete a DiscoveredAsset - * - * @summary delete a DiscoveredAsset - * x-ms-original-file: 2024-09-01-preview/Delete_DiscoveredAsset.json - */ -async function deleteDiscoveredAsset(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - await client.discoveredAssets.delete("myResourceGroup", "my-discoveredasset"); -} - -async function main(): Promise { - deleteDiscoveredAsset(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsGetSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsGetSample.ts deleted file mode 100644 index d0e85dfde8e..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsGetSample.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a DiscoveredAsset - * - * @summary get a DiscoveredAsset - * x-ms-original-file: 2024-09-01-preview/Get_DiscoveredAsset.json - */ -async function getDiscoveredAsset(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.discoveredAssets.get("myResourceGroup", "my-discoveredasset"); - console.log(result); -} - -async function main(): Promise { - getDiscoveredAsset(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsListByResourceGroupSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsListByResourceGroupSample.ts deleted file mode 100644 index 4b97e993668..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsListByResourceGroupSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list DiscoveredAsset resources by resource group - * - * @summary list DiscoveredAsset resources by resource group - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssets_ResourceGroup.json - */ -async function listDiscoveredAssetsResourceGroup(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.discoveredAssets.listByResourceGroup("myResourceGroup")) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - listDiscoveredAssetsResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsListBySubscriptionSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsListBySubscriptionSample.ts deleted file mode 100644 index 96f50ccef56..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsListBySubscriptionSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list DiscoveredAsset resources by subscription ID - * - * @summary list DiscoveredAsset resources by subscription ID - * x-ms-original-file: 2024-09-01-preview/List_DiscoveredAssets_Subscription.json - */ -async function listDiscoveredAssetsSubscription(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.discoveredAssets.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - listDiscoveredAssetsSubscription(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsUpdateSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsUpdateSample.ts deleted file mode 100644 index e921e8bc4d4..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/discoveredAssetsUpdateSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update a DiscoveredAsset - * - * @summary update a DiscoveredAsset - * x-ms-original-file: 2024-09-01-preview/Update_DiscoveredAsset.json - */ -async function updateDiscoveredAsset(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.discoveredAssets.update("myResourceGroup", "my-discoveredasset", { - properties: { - documentationUri: "https://www.example.com/manual-2", - defaultTopic: { path: "/path/defaultTopic", retain: "Never" }, - }, - }); - console.log(result); -} - -async function main(): Promise { - updateDiscoveredAsset(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesCreateOrReplaceSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesCreateOrReplaceSample.ts deleted file mode 100644 index 5b5fc6a63fd..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesCreateOrReplaceSample.ts +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to create a SchemaRegistry - * - * @summary create a SchemaRegistry - * x-ms-original-file: 2024-09-01-preview/Create_SchemaRegistry.json - */ -async function createSchemaRegistry(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemaRegistries.createOrReplace( - "myResourceGroup", - "my-schema-registry", - { - properties: { - namespace: "sr-namespace-001", - displayName: "Schema Registry namespace 001", - description: "This is a sample Schema Registry", - storageAccountContainerUrl: "my-blob-storage.blob.core.windows.net/my-container", - }, - tags: {}, - location: "West Europe", - identity: { type: "None" }, - }, - ); - console.log(result); -} - -async function main(): Promise { - createSchemaRegistry(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesDeleteSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesDeleteSample.ts deleted file mode 100644 index 87867348d96..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesDeleteSample.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to delete a SchemaRegistry - * - * @summary delete a SchemaRegistry - * x-ms-original-file: 2024-09-01-preview/Delete_SchemaRegistry.json - */ -async function deleteSchemaRegistry(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - await client.schemaRegistries.delete("myResourceGroup", "my-schema-registry"); -} - -async function main(): Promise { - deleteSchemaRegistry(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesGetSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesGetSample.ts deleted file mode 100644 index 656c2f8cd31..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesGetSample.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a SchemaRegistry - * - * @summary get a SchemaRegistry - * x-ms-original-file: 2024-09-01-preview/Get_SchemaRegistry.json - */ -async function getSchemaRegistry(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemaRegistries.get("myResourceGroup", "my-schema-registry"); - console.log(result); -} - -async function main(): Promise { - getSchemaRegistry(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesListByResourceGroupSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesListByResourceGroupSample.ts deleted file mode 100644 index 45df427b242..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesListByResourceGroupSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list SchemaRegistry resources by resource group - * - * @summary list SchemaRegistry resources by resource group - * x-ms-original-file: 2024-09-01-preview/List_SchemaRegistries_ResourceGroup.json - */ -async function listSchemaRegistriesResourceGroup(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.schemaRegistries.listByResourceGroup("myResourceGroup")) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - listSchemaRegistriesResourceGroup(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesListBySubscriptionSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesListBySubscriptionSample.ts deleted file mode 100644 index 2aaf8d5eda0..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesListBySubscriptionSample.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list SchemaRegistry resources by subscription ID - * - * @summary list SchemaRegistry resources by subscription ID - * x-ms-original-file: 2024-09-01-preview/List_SchemaRegistries_Subscription.json - */ -async function listSchemaRegistriesSubscription(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.schemaRegistries.listBySubscription()) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - listSchemaRegistriesSubscription(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesUpdateSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesUpdateSample.ts deleted file mode 100644 index e27de241bc6..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaRegistriesUpdateSample.ts +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to update a SchemaRegistry - * - * @summary update a SchemaRegistry - * x-ms-original-file: 2024-09-01-preview/Update_SchemaRegistry.json - */ -async function updateSchemaRegistry(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemaRegistries.update("myResourceGroup", "my-schema-registry", { - properties: { - displayName: "Schema Registry namespace 001", - description: "This is a sample Schema Registry", - }, - tags: {}, - }); - console.log(result); -} - -async function main(): Promise { - updateSchemaRegistry(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsCreateOrReplaceSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsCreateOrReplaceSample.ts deleted file mode 100644 index 84969884a35..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsCreateOrReplaceSample.ts +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to create a SchemaVersion - * - * @summary create a SchemaVersion - * x-ms-original-file: 2024-09-01-preview/Create_SchemaVersion.json - */ -async function createSchemaVersion(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemaVersions.createOrReplace( - "myResourceGroup", - "my-schema-registry", - "my-schema", - "1", - { - properties: { - description: "Schema version 1", - schemaContent: - '{"$schema": "http://json-schema.org/draft-07/schema#","type": "object","properties": {"humidity": {"type": "string"},"temperature": {"type":"number"}}}', - }, - }, - ); - console.log(result); -} - -async function main(): Promise { - createSchemaVersion(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsDeleteSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsDeleteSample.ts deleted file mode 100644 index b625bc3c25a..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsDeleteSample.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to delete a SchemaVersion - * - * @summary delete a SchemaVersion - * x-ms-original-file: 2024-09-01-preview/Delete_SchemaVersion.json - */ -async function deleteSchemaVersion(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - await client.schemaVersions.delete("myResourceGroup", "my-schema-registry", "my-schema", "1"); -} - -async function main(): Promise { - deleteSchemaVersion(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsGetSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsGetSample.ts deleted file mode 100644 index 4f4d4e763d4..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsGetSample.ts +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a SchemaVersion - * - * @summary get a SchemaVersion - * x-ms-original-file: 2024-09-01-preview/Get_SchemaVersion.json - */ -async function getSchemaVersion(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemaVersions.get( - "myResourceGroup", - "my-schema-registry", - "my-schema", - "1", - ); - console.log(result); -} - -async function main(): Promise { - getSchemaVersion(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsListBySchemaSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsListBySchemaSample.ts deleted file mode 100644 index b8447af21a3..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemaVersionsListBySchemaSample.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list SchemaVersion resources by Schema - * - * @summary list SchemaVersion resources by Schema - * x-ms-original-file: 2024-09-01-preview/List_SchemaVersions_Schema.json - */ -async function listSchemaVersionsSchema(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.schemaVersions.listBySchema( - "myResourceGroup", - "my-schema-registry", - "my-schema", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - listSchemaVersionsSchema(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasCreateOrReplaceSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasCreateOrReplaceSample.ts deleted file mode 100644 index 95182f47e41..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasCreateOrReplaceSample.ts +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to create a Schema - * - * @summary create a Schema - * x-ms-original-file: 2024-09-01-preview/Create_Schema.json - */ -async function createSchema(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemas.createOrReplace( - "myResourceGroup", - "my-schema-registry", - "my-schema", - { - properties: { - displayName: "My Schema", - description: "This is a sample Schema", - format: "JsonSchema/draft-07", - schemaType: "MessageSchema", - tags: { sampleKey: "sampleValue" }, - }, - }, - ); - console.log(result); -} - -async function main(): Promise { - createSchema(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasDeleteSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasDeleteSample.ts deleted file mode 100644 index 79a31437870..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasDeleteSample.ts +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to delete a Schema - * - * @summary delete a Schema - * x-ms-original-file: 2024-09-01-preview/Delete_Schema.json - */ -async function deleteSchema(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - await client.schemas.delete("myResourceGroup", "my-schema-registry", "my-schema"); -} - -async function main(): Promise { - deleteSchema(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasGetSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasGetSample.ts deleted file mode 100644 index 99f12a4020b..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasGetSample.ts +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to get a Schema - * - * @summary get a Schema - * x-ms-original-file: 2024-09-01-preview/Get_Schema.json - */ -async function schemasGet(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const result = await client.schemas.get("myResourceGroup", "my-schema-registry", "my-schema"); - console.log(result); -} - -async function main(): Promise { - schemasGet(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasListBySchemaRegistrySample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasListBySchemaRegistrySample.ts deleted file mode 100644 index a812f51d816..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/schemasListBySchemaRegistrySample.ts +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementClient } from "@azure/arm-deviceregistry"; -import { DefaultAzureCredential } from "@azure/identity"; - -/** - * This sample demonstrates how to list Schema resources by SchemaRegistry - * - * @summary list Schema resources by SchemaRegistry - * x-ms-original-file: 2024-09-01-preview/List_Schemas_SchemaRegistry.json - */ -async function listSchemasSchemaRegistry(): Promise { - const credential = new DefaultAzureCredential(); - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const client = new DeviceRegistryManagementClient(credential, subscriptionId); - const resArray = new Array(); - for await (let item of client.schemas.listBySchemaRegistry( - "myResourceGroup", - "my-schema-registry", - )) { - resArray.push(item); - } - - console.log(resArray); -} - -async function main(): Promise { - listSchemasSchemaRegistry(); -} - -main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/tsconfig.json b/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/tsconfig.json deleted file mode 100644 index 984eed535aa..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/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/deviceregistry/arm-deviceregistry/samples/v1/javascript/README.md b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/README.md new file mode 100644 index 00000000000..6b186a0637a --- /dev/null +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/README.md @@ -0,0 +1,80 @@ +# @azure/arm-deviceregistry client library samples for JavaScript + +These sample programs show how to use the JavaScript client libraries for @azure/arm-deviceregistry in some common scenarios. + +| **File Name** | **Description** | +| --------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| [assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.js][assetendpointprofilesassetendpointprofilescreateorreplacesample] | create a AssetEndpointProfile x-ms-original-file: 2024-11-01/Create_AssetEndpointProfile.json | +| [assetEndpointProfilesAssetEndpointProfilesDeleteSample.js][assetendpointprofilesassetendpointprofilesdeletesample] | delete a AssetEndpointProfile x-ms-original-file: 2024-11-01/Delete_AssetEndpointProfile.json | +| [assetEndpointProfilesAssetEndpointProfilesGetSample.js][assetendpointprofilesassetendpointprofilesgetsample] | get a AssetEndpointProfile x-ms-original-file: 2024-11-01/Get_AssetEndpointProfile.json | +| [assetEndpointProfilesAssetEndpointProfilesListByResourceGroupSample.js][assetendpointprofilesassetendpointprofileslistbyresourcegroupsample] | list AssetEndpointProfile resources by resource group x-ms-original-file: 2024-11-01/List_AssetEndpointProfiles_ResourceGroup.json | +| [assetEndpointProfilesAssetEndpointProfilesListBySubscriptionSample.js][assetendpointprofilesassetendpointprofileslistbysubscriptionsample] | list AssetEndpointProfile resources by subscription ID x-ms-original-file: 2024-11-01/List_AssetEndpointProfiles_Subscription.json | +| [assetEndpointProfilesAssetEndpointProfilesUpdateSample.js][assetendpointprofilesassetendpointprofilesupdatesample] | update a AssetEndpointProfile x-ms-original-file: 2024-11-01/Update_AssetEndpointProfile.json | +| [assetsAssetsCreateOrReplaceSample.js][assetsassetscreateorreplacesample] | create a Asset x-ms-original-file: 2024-11-01/Create_Asset_With_DiscoveredAssetRef.json | +| [assetsAssetsDeleteSample.js][assetsassetsdeletesample] | delete a Asset x-ms-original-file: 2024-11-01/Delete_Asset.json | +| [assetsAssetsGetSample.js][assetsassetsgetsample] | get a Asset x-ms-original-file: 2024-11-01/Get_Asset.json | +| [assetsAssetsListByResourceGroupSample.js][assetsassetslistbyresourcegroupsample] | list Asset resources by resource group x-ms-original-file: 2024-11-01/List_Assets_ResourceGroup.json | +| [assetsAssetsListBySubscriptionSample.js][assetsassetslistbysubscriptionsample] | list Asset resources by subscription ID x-ms-original-file: 2024-11-01/List_Assets_Subscription.json | +| [assetsAssetsUpdateSample.js][assetsassetsupdatesample] | update a Asset x-ms-original-file: 2024-11-01/Update_Asset.json | +| [billingContainersBillingContainersGetSample.js][billingcontainersbillingcontainersgetsample] | get a BillingContainer x-ms-original-file: 2024-11-01/Get_BillingContainer.json | +| [billingContainersBillingContainersListBySubscriptionSample.js][billingcontainersbillingcontainerslistbysubscriptionsample] | list BillingContainer resources by subscription ID x-ms-original-file: 2024-11-01/List_BillingContainers_Subscription.json | +| [operationStatusOperationStatusGetSample.js][operationstatusoperationstatusgetsample] | returns the current status of an async operation. x-ms-original-file: 2024-11-01/Get_OperationStatus.json | +| [operationsOperationsListSample.js][operationsoperationslistsample] | list the operations for the provider x-ms-original-file: 2024-11-01/List_Operations.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 assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.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 dev-tool run vendored cross-env node assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[assetendpointprofilesassetendpointprofilescreateorreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.js +[assetendpointprofilesassetendpointprofilesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesDeleteSample.js +[assetendpointprofilesassetendpointprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesGetSample.js +[assetendpointprofilesassetendpointprofileslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesListByResourceGroupSample.js +[assetendpointprofilesassetendpointprofileslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesListBySubscriptionSample.js +[assetendpointprofilesassetendpointprofilesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesUpdateSample.js +[assetsassetscreateorreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsCreateOrReplaceSample.js +[assetsassetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsDeleteSample.js +[assetsassetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsGetSample.js +[assetsassetslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsListByResourceGroupSample.js +[assetsassetslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsListBySubscriptionSample.js +[assetsassetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsUpdateSample.js +[billingcontainersbillingcontainersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/billingContainersBillingContainersGetSample.js +[billingcontainersbillingcontainerslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/billingContainersBillingContainersListBySubscriptionSample.js +[operationstatusoperationstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/operationStatusOperationStatusGetSample.js +[operationsoperationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/operationsOperationsListSample.js +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-deviceregistry?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/deviceregistry/arm-deviceregistry/README.md diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesCreateOrReplaceSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.js similarity index 92% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesCreateOrReplaceSample.js rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.js index 49cc2d4cb45..a428b72f7bb 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesCreateOrReplaceSample.js +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to create a AssetEndpointProfile * * @summary create a AssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Create_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Create_AssetEndpointProfile.json */ async function createAssetEndpointProfile() { const credential = new DefaultAzureCredential(); @@ -38,7 +38,7 @@ async function createAssetEndpointProfile() { * This sample demonstrates how to create a AssetEndpointProfile * * @summary create a AssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Create_AssetEndpointProfile_With_DiscoveredAepRef.json + * x-ms-original-file: 2024-11-01/Create_AssetEndpointProfile_With_DiscoveredAepRef.json */ async function createAssetEndpointProfileWithDiscoveredAepRef() { const credential = new DefaultAzureCredential(); @@ -66,7 +66,7 @@ async function createAssetEndpointProfileWithDiscoveredAepRef() { } async function main() { - createAssetEndpointProfile(); + await createAssetEndpointProfile(); createAssetEndpointProfileWithDiscoveredAepRef(); } diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesDeleteSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesDeleteSample.js similarity index 87% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesDeleteSample.js rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesDeleteSample.js index af9d90ab55b..3eb8e46e036 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesDeleteSample.js +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesDeleteSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to delete a AssetEndpointProfile * * @summary delete a AssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Delete_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Delete_AssetEndpointProfile.json */ async function deleteAssetEndpointProfile() { const credential = new DefaultAzureCredential(); @@ -18,7 +18,7 @@ async function deleteAssetEndpointProfile() { } async function main() { - deleteAssetEndpointProfile(); + await deleteAssetEndpointProfile(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesGetSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesGetSample.js similarity index 87% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesGetSample.js rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesGetSample.js index 667daf23051..8d249b1ada7 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesGetSample.js +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesGetSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to get a AssetEndpointProfile * * @summary get a AssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Get_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Get_AssetEndpointProfile.json */ async function getAssetEndpointProfile() { const credential = new DefaultAzureCredential(); @@ -25,7 +25,7 @@ async function getAssetEndpointProfile() { * This sample demonstrates how to get a AssetEndpointProfile * * @summary get a AssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Get_AssetEndpointProfile_With_SyncStatus.json + * x-ms-original-file: 2024-11-01/Get_AssetEndpointProfile_With_SyncStatus.json */ async function getAssetEndpointProfileWithSyncStatus() { const credential = new DefaultAzureCredential(); @@ -39,7 +39,7 @@ async function getAssetEndpointProfileWithSyncStatus() { } async function main() { - getAssetEndpointProfile(); + await getAssetEndpointProfile(); getAssetEndpointProfileWithSyncStatus(); } diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesListByResourceGroupSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesListByResourceGroupSample.js similarity index 87% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesListByResourceGroupSample.js rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesListByResourceGroupSample.js index 0d77c794229..0436a9b5c64 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesListByResourceGroupSample.js +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesListByResourceGroupSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to list AssetEndpointProfile resources by resource group * * @summary list AssetEndpointProfile resources by resource group - * x-ms-original-file: 2024-09-01-preview/List_AssetEndpointProfiles_ResourceGroup.json + * x-ms-original-file: 2024-11-01/List_AssetEndpointProfiles_ResourceGroup.json */ async function listAssetEndpointProfilesResourceGroup() { const credential = new DefaultAzureCredential(); @@ -23,7 +23,7 @@ async function listAssetEndpointProfilesResourceGroup() { } async function main() { - listAssetEndpointProfilesResourceGroup(); + await listAssetEndpointProfilesResourceGroup(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesListBySubscriptionSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesListBySubscriptionSample.js similarity index 86% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesListBySubscriptionSample.js rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesListBySubscriptionSample.js index ec9ddcd1518..f75ec751d1b 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesListBySubscriptionSample.js +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesListBySubscriptionSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to list AssetEndpointProfile resources by subscription ID * * @summary list AssetEndpointProfile resources by subscription ID - * x-ms-original-file: 2024-09-01-preview/List_AssetEndpointProfiles_Subscription.json + * x-ms-original-file: 2024-11-01/List_AssetEndpointProfiles_Subscription.json */ async function listAssetEndpointProfilesSubscription() { const credential = new DefaultAzureCredential(); @@ -23,7 +23,7 @@ async function listAssetEndpointProfilesSubscription() { } async function main() { - listAssetEndpointProfilesSubscription(); + await listAssetEndpointProfilesSubscription(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesUpdateSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesUpdateSample.js similarity index 79% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesUpdateSample.js rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesUpdateSample.js index 402979e1337..b8d5227baa1 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetEndpointProfilesUpdateSample.js +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetEndpointProfilesAssetEndpointProfilesUpdateSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to update a AssetEndpointProfile * * @summary update a AssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Update_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Update_AssetEndpointProfile.json */ async function updateAssetEndpointProfile() { const credential = new DefaultAzureCredential(); @@ -18,14 +18,16 @@ async function updateAssetEndpointProfile() { "myResourceGroup", "my-assetendpointprofile", { - properties: { targetAddress: "https://www.example.com/myTargetAddress" }, + properties: { + targetAddress: "https://www.example.com/myTargetAddress", + }, }, ); console.log(result); } async function main() { - updateAssetEndpointProfile(); + await updateAssetEndpointProfile(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsCreateOrReplaceSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsCreateOrReplaceSample.js similarity index 97% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsCreateOrReplaceSample.js rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsCreateOrReplaceSample.js index 8aad2b73f37..a7f83e00d3d 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsCreateOrReplaceSample.js +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsCreateOrReplaceSample.js @@ -8,9 +8,9 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to create a Asset * * @summary create a Asset - * x-ms-original-file: 2024-09-01-preview/Create_Asset_Without_DisplayName.json + * x-ms-original-file: 2024-11-01/Create_Asset_With_DiscoveredAssetRef.json */ -async function createAssetWithoutDisplayName() { +async function createAssetWithDiscoveredAssetRefs() { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeviceRegistryManagementClient(credential, subscriptionId); @@ -24,6 +24,7 @@ async function createAssetWithoutDisplayName() { properties: { enabled: true, externalAssetId: "8ZBA6LRHU0A458969", + displayName: "AssetDisplayName", description: "This is a sample Asset", assetEndpointProfileRef: "myAssetEndpointProfile", manufacturer: "Contoso", @@ -34,6 +35,7 @@ async function createAssetWithoutDisplayName() { softwareRevision: "2.0", documentationUri: "https://www.example.com/manual", serialNumber: "64-103816-519918-8", + discoveredAssetRefs: ["discoveredAsset1", "discoveredAsset2"], defaultDatasetsConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', defaultEventsConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', @@ -83,9 +85,9 @@ async function createAssetWithoutDisplayName() { * This sample demonstrates how to create a Asset * * @summary create a Asset - * x-ms-original-file: 2024-09-01-preview/Create_Asset_Without_ExternalAssetId.json + * x-ms-original-file: 2024-11-01/Create_Asset_With_ExternalAssetId.json */ -async function createAssetWithoutExternalAssetId() { +async function createAssetWithExternalAssetId() { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeviceRegistryManagementClient(credential, subscriptionId); @@ -98,6 +100,7 @@ async function createAssetWithoutExternalAssetId() { tags: { site: "building-1" }, properties: { enabled: true, + externalAssetId: "8ZBA6LRHU0A458969", displayName: "AssetDisplayName", description: "This is a sample Asset", assetEndpointProfileRef: "myAssetEndpointProfile", @@ -158,9 +161,9 @@ async function createAssetWithoutExternalAssetId() { * This sample demonstrates how to create a Asset * * @summary create a Asset - * x-ms-original-file: 2024-09-01-preview/Create_Asset_With_DiscoveredAssetRef.json + * x-ms-original-file: 2024-11-01/Create_Asset_Without_DisplayName.json */ -async function createAssetWithDiscoveredAssetRefs() { +async function createAssetWithoutDisplayName() { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeviceRegistryManagementClient(credential, subscriptionId); @@ -174,7 +177,6 @@ async function createAssetWithDiscoveredAssetRefs() { properties: { enabled: true, externalAssetId: "8ZBA6LRHU0A458969", - displayName: "AssetDisplayName", description: "This is a sample Asset", assetEndpointProfileRef: "myAssetEndpointProfile", manufacturer: "Contoso", @@ -185,7 +187,6 @@ async function createAssetWithDiscoveredAssetRefs() { softwareRevision: "2.0", documentationUri: "https://www.example.com/manual", serialNumber: "64-103816-519918-8", - discoveredAssetRefs: ["discoveredAsset1", "discoveredAsset2"], defaultDatasetsConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', defaultEventsConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', @@ -235,9 +236,9 @@ async function createAssetWithDiscoveredAssetRefs() { * This sample demonstrates how to create a Asset * * @summary create a Asset - * x-ms-original-file: 2024-09-01-preview/Create_Asset_With_ExternalAssetId.json + * x-ms-original-file: 2024-11-01/Create_Asset_Without_ExternalAssetId.json */ -async function createAssetWithExternalAssetId() { +async function createAssetWithoutExternalAssetId() { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeviceRegistryManagementClient(credential, subscriptionId); @@ -250,7 +251,6 @@ async function createAssetWithExternalAssetId() { tags: { site: "building-1" }, properties: { enabled: true, - externalAssetId: "8ZBA6LRHU0A458969", displayName: "AssetDisplayName", description: "This is a sample Asset", assetEndpointProfileRef: "myAssetEndpointProfile", @@ -308,10 +308,10 @@ async function createAssetWithExternalAssetId() { } async function main() { + await createAssetWithDiscoveredAssetRefs(); + createAssetWithExternalAssetId(); createAssetWithoutDisplayName(); createAssetWithoutExternalAssetId(); - createAssetWithDiscoveredAssetRefs(); - createAssetWithExternalAssetId(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsDeleteSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsDeleteSample.js similarity index 89% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsDeleteSample.js rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsDeleteSample.js index 2f352e52287..47dd559d88b 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsDeleteSample.js +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsDeleteSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to delete a Asset * * @summary delete a Asset - * x-ms-original-file: 2024-09-01-preview/Delete_Asset.json + * x-ms-original-file: 2024-11-01/Delete_Asset.json */ async function deleteAsset() { const credential = new DefaultAzureCredential(); @@ -18,7 +18,7 @@ async function deleteAsset() { } async function main() { - deleteAsset(); + await deleteAsset(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsGetSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsGetSample.js similarity index 88% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsGetSample.js rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsGetSample.js index cd12248da96..9a0e38d540a 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsGetSample.js +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsGetSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to get a Asset * * @summary get a Asset - * x-ms-original-file: 2024-09-01-preview/Get_Asset.json + * x-ms-original-file: 2024-11-01/Get_Asset.json */ async function getAsset() { const credential = new DefaultAzureCredential(); @@ -22,7 +22,7 @@ async function getAsset() { * This sample demonstrates how to get a Asset * * @summary get a Asset - * x-ms-original-file: 2024-09-01-preview/Get_Asset_With_SyncStatus.json + * x-ms-original-file: 2024-11-01/Get_Asset_With_SyncStatus.json */ async function getAssetWithSyncStatus() { const credential = new DefaultAzureCredential(); @@ -33,7 +33,7 @@ async function getAssetWithSyncStatus() { } async function main() { - getAsset(); + await getAsset(); getAssetWithSyncStatus(); } diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsListByResourceGroupSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsListByResourceGroupSample.js similarity index 88% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsListByResourceGroupSample.js rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsListByResourceGroupSample.js index 6dc75487a3f..92841ff9524 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsListByResourceGroupSample.js +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsListByResourceGroupSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to list Asset resources by resource group * * @summary list Asset resources by resource group - * x-ms-original-file: 2024-09-01-preview/List_Assets_ResourceGroup.json + * x-ms-original-file: 2024-11-01/List_Assets_ResourceGroup.json */ async function listAssetsResourceGroup() { const credential = new DefaultAzureCredential(); @@ -23,7 +23,7 @@ async function listAssetsResourceGroup() { } async function main() { - listAssetsResourceGroup(); + await listAssetsResourceGroup(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsListBySubscriptionSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsListBySubscriptionSample.js similarity index 88% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsListBySubscriptionSample.js rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsListBySubscriptionSample.js index bed170f4a7f..8721e6d38c9 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsListBySubscriptionSample.js +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsListBySubscriptionSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to list Asset resources by subscription ID * * @summary list Asset resources by subscription ID - * x-ms-original-file: 2024-09-01-preview/List_Assets_Subscription.json + * x-ms-original-file: 2024-11-01/List_Assets_Subscription.json */ async function listAssetsSubscription() { const credential = new DefaultAzureCredential(); @@ -23,7 +23,7 @@ async function listAssetsSubscription() { } async function main() { - listAssetsSubscription(); + await listAssetsSubscription(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsUpdateSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsUpdateSample.js similarity index 90% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsUpdateSample.js rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsUpdateSample.js index 765b4df23fa..4c6a7637407 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/assetsUpdateSample.js +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/assetsAssetsUpdateSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to update a Asset * * @summary update a Asset - * x-ms-original-file: 2024-09-01-preview/Update_Asset.json + * x-ms-original-file: 2024-11-01/Update_Asset.json */ async function updateAsset() { const credential = new DefaultAzureCredential(); @@ -21,7 +21,7 @@ async function updateAsset() { } async function main() { - updateAsset(); + await updateAsset(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/billingContainersGetSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/billingContainersBillingContainersGetSample.js similarity index 88% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/billingContainersGetSample.js rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/billingContainersBillingContainersGetSample.js index 5a92ff71dfb..42e6f1e78e2 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/billingContainersGetSample.js +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/billingContainersBillingContainersGetSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to get a BillingContainer * * @summary get a BillingContainer - * x-ms-original-file: 2024-09-01-preview/Get_BillingContainer.json + * x-ms-original-file: 2024-11-01/Get_BillingContainer.json */ async function getBillingContainer() { const credential = new DefaultAzureCredential(); @@ -19,7 +19,7 @@ async function getBillingContainer() { } async function main() { - getBillingContainer(); + await getBillingContainer(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/billingContainersListBySubscriptionSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/billingContainersBillingContainersListBySubscriptionSample.js similarity index 87% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/billingContainersListBySubscriptionSample.js rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/billingContainersBillingContainersListBySubscriptionSample.js index 0226afc800e..fd57e1a3d4e 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/billingContainersListBySubscriptionSample.js +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/billingContainersBillingContainersListBySubscriptionSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to list BillingContainer resources by subscription ID * * @summary list BillingContainer resources by subscription ID - * x-ms-original-file: 2024-09-01-preview/List_BillingContainers_Subscription.json + * x-ms-original-file: 2024-11-01/List_BillingContainers_Subscription.json */ async function listBillingContainersSubscription() { const credential = new DefaultAzureCredential(); @@ -23,7 +23,7 @@ async function listBillingContainersSubscription() { } async function main() { - listBillingContainersSubscription(); + await listBillingContainersSubscription(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/operationStatusGetSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/operationStatusOperationStatusGetSample.js similarity index 89% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/operationStatusGetSample.js rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/operationStatusOperationStatusGetSample.js index 3a2b2b843b1..853768679e2 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/operationStatusGetSample.js +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/operationStatusOperationStatusGetSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to returns the current status of an async operation. * * @summary returns the current status of an async operation. - * x-ms-original-file: 2024-09-01-preview/Get_OperationStatus.json + * x-ms-original-file: 2024-11-01/Get_OperationStatus.json */ async function getOperationStatus() { const credential = new DefaultAzureCredential(); @@ -22,7 +22,7 @@ async function getOperationStatus() { } async function main() { - getOperationStatus(); + await getOperationStatus(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/operationsListSample.js b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/operationsOperationsListSample.js similarity index 90% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/operationsListSample.js rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/operationsOperationsListSample.js index 9b3177c792a..b6fdfe3cf1f 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/operationsListSample.js +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/operationsOperationsListSample.js @@ -8,7 +8,7 @@ const { DefaultAzureCredential } = require("@azure/identity"); * This sample demonstrates how to list the operations for the provider * * @summary list the operations for the provider - * x-ms-original-file: 2024-09-01-preview/List_Operations.json + * x-ms-original-file: 2024-11-01/List_Operations.json */ async function listOperations() { const credential = new DefaultAzureCredential(); @@ -23,7 +23,7 @@ async function listOperations() { } async function main() { - listOperations(); + await listOperations(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/package.json b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/package.json similarity index 82% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/package.json rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/package.json index e8c5480a8aa..721455caec3 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/package.json +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/package.json @@ -1,8 +1,8 @@ { - "name": "@azure-samples/arm-deviceregistry-js-beta", + "name": "@azure-samples/arm-deviceregistry-js", "private": true, "version": "1.0.0", - "description": "@azure/arm-deviceregistry client library samples for JavaScript (Beta)", + "description": "@azure/arm-deviceregistry client library samples for JavaScript", "engines": { "node": ">=18.0.0" }, @@ -26,8 +26,8 @@ }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/deviceregistry/arm-deviceregistry", "dependencies": { - "@azure/arm-deviceregistry": "next", + "@azure/arm-deviceregistry": "latest", "dotenv": "latest", - "@azure/identity": "^4.2.1" + "@azure/identity": "^4.6.0" } } diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/sample.env b/sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/sample.env similarity index 100% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/javascript/sample.env rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/javascript/sample.env diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/README.md b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/README.md new file mode 100644 index 00000000000..1d3a70310b1 --- /dev/null +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/README.md @@ -0,0 +1,93 @@ +# @azure/arm-deviceregistry client library samples for TypeScript + +These sample programs show how to use the TypeScript client libraries for @azure/arm-deviceregistry in some common scenarios. + +| **File Name** | **Description** | +| --------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- | +| [assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.ts][assetendpointprofilesassetendpointprofilescreateorreplacesample] | create a AssetEndpointProfile x-ms-original-file: 2024-11-01/Create_AssetEndpointProfile.json | +| [assetEndpointProfilesAssetEndpointProfilesDeleteSample.ts][assetendpointprofilesassetendpointprofilesdeletesample] | delete a AssetEndpointProfile x-ms-original-file: 2024-11-01/Delete_AssetEndpointProfile.json | +| [assetEndpointProfilesAssetEndpointProfilesGetSample.ts][assetendpointprofilesassetendpointprofilesgetsample] | get a AssetEndpointProfile x-ms-original-file: 2024-11-01/Get_AssetEndpointProfile.json | +| [assetEndpointProfilesAssetEndpointProfilesListByResourceGroupSample.ts][assetendpointprofilesassetendpointprofileslistbyresourcegroupsample] | list AssetEndpointProfile resources by resource group x-ms-original-file: 2024-11-01/List_AssetEndpointProfiles_ResourceGroup.json | +| [assetEndpointProfilesAssetEndpointProfilesListBySubscriptionSample.ts][assetendpointprofilesassetendpointprofileslistbysubscriptionsample] | list AssetEndpointProfile resources by subscription ID x-ms-original-file: 2024-11-01/List_AssetEndpointProfiles_Subscription.json | +| [assetEndpointProfilesAssetEndpointProfilesUpdateSample.ts][assetendpointprofilesassetendpointprofilesupdatesample] | update a AssetEndpointProfile x-ms-original-file: 2024-11-01/Update_AssetEndpointProfile.json | +| [assetsAssetsCreateOrReplaceSample.ts][assetsassetscreateorreplacesample] | create a Asset x-ms-original-file: 2024-11-01/Create_Asset_With_DiscoveredAssetRef.json | +| [assetsAssetsDeleteSample.ts][assetsassetsdeletesample] | delete a Asset x-ms-original-file: 2024-11-01/Delete_Asset.json | +| [assetsAssetsGetSample.ts][assetsassetsgetsample] | get a Asset x-ms-original-file: 2024-11-01/Get_Asset.json | +| [assetsAssetsListByResourceGroupSample.ts][assetsassetslistbyresourcegroupsample] | list Asset resources by resource group x-ms-original-file: 2024-11-01/List_Assets_ResourceGroup.json | +| [assetsAssetsListBySubscriptionSample.ts][assetsassetslistbysubscriptionsample] | list Asset resources by subscription ID x-ms-original-file: 2024-11-01/List_Assets_Subscription.json | +| [assetsAssetsUpdateSample.ts][assetsassetsupdatesample] | update a Asset x-ms-original-file: 2024-11-01/Update_Asset.json | +| [billingContainersBillingContainersGetSample.ts][billingcontainersbillingcontainersgetsample] | get a BillingContainer x-ms-original-file: 2024-11-01/Get_BillingContainer.json | +| [billingContainersBillingContainersListBySubscriptionSample.ts][billingcontainersbillingcontainerslistbysubscriptionsample] | list BillingContainer resources by subscription ID x-ms-original-file: 2024-11-01/List_BillingContainers_Subscription.json | +| [operationStatusOperationStatusGetSample.ts][operationstatusoperationstatusgetsample] | returns the current status of an async operation. x-ms-original-file: 2024-11-01/Get_OperationStatus.json | +| [operationsOperationsListSample.ts][operationsoperationslistsample] | list the operations for the provider x-ms-original-file: 2024-11-01/List_Operations.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/assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.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 dev-tool run vendored cross-env node dist/assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.js +``` + +## Next Steps + +Take a look at our [API Documentation][apiref] for more information about the APIs that are available in the clients. + +[assetendpointprofilesassetendpointprofilescreateorreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.ts +[assetendpointprofilesassetendpointprofilesdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesDeleteSample.ts +[assetendpointprofilesassetendpointprofilesgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesGetSample.ts +[assetendpointprofilesassetendpointprofileslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesListByResourceGroupSample.ts +[assetendpointprofilesassetendpointprofileslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesListBySubscriptionSample.ts +[assetendpointprofilesassetendpointprofilesupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesUpdateSample.ts +[assetsassetscreateorreplacesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsCreateOrReplaceSample.ts +[assetsassetsdeletesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsDeleteSample.ts +[assetsassetsgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsGetSample.ts +[assetsassetslistbyresourcegroupsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsListByResourceGroupSample.ts +[assetsassetslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsListBySubscriptionSample.ts +[assetsassetsupdatesample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsUpdateSample.ts +[billingcontainersbillingcontainersgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/billingContainersBillingContainersGetSample.ts +[billingcontainersbillingcontainerslistbysubscriptionsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/billingContainersBillingContainersListBySubscriptionSample.ts +[operationstatusoperationstatusgetsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/operationStatusOperationStatusGetSample.ts +[operationsoperationslistsample]: https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/operationsOperationsListSample.ts +[apiref]: https://learn.microsoft.com/javascript/api/@azure/arm-deviceregistry?view=azure-node-preview +[freesub]: https://azure.microsoft.com/free/ +[package]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/deviceregistry/arm-deviceregistry/README.md +[typescript]: https://www.typescriptlang.org/docs/home.html diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/package.json b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/package.json similarity index 85% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/package.json rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/package.json index c0f6b5eb574..471505a8ebf 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/package.json +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/package.json @@ -1,8 +1,8 @@ { - "name": "@azure-samples/arm-deviceregistry-ts-beta", + "name": "@azure-samples/arm-deviceregistry-ts", "private": true, "version": "1.0.0", - "description": "@azure/arm-deviceregistry client library samples for TypeScript (Beta)", + "description": "@azure/arm-deviceregistry client library samples for TypeScript", "engines": { "node": ">=18.0.0" }, @@ -30,9 +30,9 @@ }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/deviceregistry/arm-deviceregistry", "dependencies": { - "@azure/arm-deviceregistry": "next", + "@azure/arm-deviceregistry": "latest", "dotenv": "latest", - "@azure/identity": "^4.2.1" + "@azure/identity": "^4.6.0" }, "devDependencies": { "@types/node": "^18.0.0", diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/sample.env b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/sample.env similarity index 100% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/sample.env rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/sample.env diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesCreateOrReplaceSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.ts similarity index 91% rename from sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesCreateOrReplaceSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.ts index a80bdcbcaaf..c4be901fb8b 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesCreateOrReplaceSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesCreateOrReplaceSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to create a AssetEndpointProfile * * @summary create a AssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Create_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Create_AssetEndpointProfile.json */ async function createAssetEndpointProfile(): Promise { const credential = new DefaultAzureCredential(); @@ -38,7 +38,7 @@ async function createAssetEndpointProfile(): Promise { * This sample demonstrates how to create a AssetEndpointProfile * * @summary create a AssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Create_AssetEndpointProfile_With_DiscoveredAepRef.json + * x-ms-original-file: 2024-11-01/Create_AssetEndpointProfile_With_DiscoveredAepRef.json */ async function createAssetEndpointProfileWithDiscoveredAepRef(): Promise { const credential = new DefaultAzureCredential(); @@ -67,7 +67,7 @@ async function createAssetEndpointProfileWithDiscoveredAepRef(): Promise { async function main(): Promise { await createAssetEndpointProfile(); - await createAssetEndpointProfileWithDiscoveredAepRef(); + createAssetEndpointProfileWithDiscoveredAepRef(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesDeleteSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesDeleteSample.ts similarity index 75% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesDeleteSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesDeleteSample.ts index 988feea7f51..cacde1ebdae 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesDeleteSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesDeleteSample.ts @@ -8,17 +8,20 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to delete a AssetEndpointProfile * * @summary delete a AssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Delete_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Delete_AssetEndpointProfile.json */ async function deleteAssetEndpointProfile(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeviceRegistryManagementClient(credential, subscriptionId); - await client.assetEndpointProfiles.delete("myResourceGroup", "my-assetendpointprofile"); + await client.assetEndpointProfiles.delete( + "myResourceGroup", + "my-assetendpointprofile", + ); } async function main(): Promise { - deleteAssetEndpointProfile(); + await deleteAssetEndpointProfile(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesGetSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesGetSample.ts similarity index 86% rename from sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesGetSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesGetSample.ts index 15cc1a1262d..36ea879e1a6 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesGetSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesGetSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to get a AssetEndpointProfile * * @summary get a AssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Get_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Get_AssetEndpointProfile.json */ async function getAssetEndpointProfile(): Promise { const credential = new DefaultAzureCredential(); @@ -25,7 +25,7 @@ async function getAssetEndpointProfile(): Promise { * This sample demonstrates how to get a AssetEndpointProfile * * @summary get a AssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Get_AssetEndpointProfile_With_SyncStatus.json + * x-ms-original-file: 2024-11-01/Get_AssetEndpointProfile_With_SyncStatus.json */ async function getAssetEndpointProfileWithSyncStatus(): Promise { const credential = new DefaultAzureCredential(); @@ -40,7 +40,7 @@ async function getAssetEndpointProfileWithSyncStatus(): Promise { async function main(): Promise { await getAssetEndpointProfile(); - await getAssetEndpointProfileWithSyncStatus(); + getAssetEndpointProfileWithSyncStatus(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesListByResourceGroupSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesListByResourceGroupSample.ts similarity index 82% rename from sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesListByResourceGroupSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesListByResourceGroupSample.ts index 0d5b1f47983..14f895f7ffe 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesListByResourceGroupSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesListByResourceGroupSample.ts @@ -8,14 +8,16 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to list AssetEndpointProfile resources by resource group * * @summary list AssetEndpointProfile resources by resource group - * x-ms-original-file: 2024-09-01-preview/List_AssetEndpointProfiles_ResourceGroup.json + * x-ms-original-file: 2024-11-01/List_AssetEndpointProfiles_ResourceGroup.json */ async function listAssetEndpointProfilesResourceGroup(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeviceRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.assetEndpointProfiles.listByResourceGroup("myResourceGroup")) { + for await (let item of client.assetEndpointProfiles.listByResourceGroup( + "myResourceGroup", + )) { resArray.push(item); } diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesListBySubscriptionSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesListBySubscriptionSample.ts similarity index 83% rename from sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesListBySubscriptionSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesListBySubscriptionSample.ts index e018613d233..61523eb6bde 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetEndpointProfilesListBySubscriptionSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesListBySubscriptionSample.ts @@ -8,14 +8,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to list AssetEndpointProfile resources by subscription ID * * @summary list AssetEndpointProfile resources by subscription ID - * x-ms-original-file: 2024-09-01-preview/List_AssetEndpointProfiles_Subscription.json + * x-ms-original-file: 2024-11-01/List_AssetEndpointProfiles_Subscription.json */ async function listAssetEndpointProfilesSubscription(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeviceRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.assetEndpointProfiles.listBySubscription()) { + for await (let item of client.assetEndpointProfiles.listBySubscription()) { resArray.push(item); } diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesUpdateSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesUpdateSample.ts similarity index 80% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesUpdateSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesUpdateSample.ts index c516317c503..5823361affa 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetEndpointProfilesUpdateSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetEndpointProfilesAssetEndpointProfilesUpdateSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to update a AssetEndpointProfile * * @summary update a AssetEndpointProfile - * x-ms-original-file: 2024-09-01-preview/Update_AssetEndpointProfile.json + * x-ms-original-file: 2024-11-01/Update_AssetEndpointProfile.json */ async function updateAssetEndpointProfile(): Promise { const credential = new DefaultAzureCredential(); @@ -18,14 +18,16 @@ async function updateAssetEndpointProfile(): Promise { "myResourceGroup", "my-assetendpointprofile", { - properties: { targetAddress: "https://www.example.com/myTargetAddress" }, + properties: { + targetAddress: "https://www.example.com/myTargetAddress", + }, }, ); console.log(result); } async function main(): Promise { - updateAssetEndpointProfile(); + await updateAssetEndpointProfile(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsCreateOrReplaceSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsCreateOrReplaceSample.ts similarity index 96% rename from sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsCreateOrReplaceSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsCreateOrReplaceSample.ts index 2ebb83434b2..1e1d46b53b5 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsCreateOrReplaceSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsCreateOrReplaceSample.ts @@ -8,9 +8,9 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to create a Asset * * @summary create a Asset - * x-ms-original-file: 2024-09-01-preview/Create_Asset_Without_DisplayName.json + * x-ms-original-file: 2024-11-01/Create_Asset_With_DiscoveredAssetRef.json */ -async function createAssetWithoutDisplayName(): Promise { +async function createAssetWithDiscoveredAssetRefs(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeviceRegistryManagementClient(credential, subscriptionId); @@ -24,6 +24,7 @@ async function createAssetWithoutDisplayName(): Promise { properties: { enabled: true, externalAssetId: "8ZBA6LRHU0A458969", + displayName: "AssetDisplayName", description: "This is a sample Asset", assetEndpointProfileRef: "myAssetEndpointProfile", manufacturer: "Contoso", @@ -34,6 +35,7 @@ async function createAssetWithoutDisplayName(): Promise { softwareRevision: "2.0", documentationUri: "https://www.example.com/manual", serialNumber: "64-103816-519918-8", + discoveredAssetRefs: ["discoveredAsset1", "discoveredAsset2"], defaultDatasetsConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', defaultEventsConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', @@ -83,9 +85,9 @@ async function createAssetWithoutDisplayName(): Promise { * This sample demonstrates how to create a Asset * * @summary create a Asset - * x-ms-original-file: 2024-09-01-preview/Create_Asset_Without_ExternalAssetId.json + * x-ms-original-file: 2024-11-01/Create_Asset_With_ExternalAssetId.json */ -async function createAssetWithoutExternalAssetId(): Promise { +async function createAssetWithExternalAssetId(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeviceRegistryManagementClient(credential, subscriptionId); @@ -98,6 +100,7 @@ async function createAssetWithoutExternalAssetId(): Promise { tags: { site: "building-1" }, properties: { enabled: true, + externalAssetId: "8ZBA6LRHU0A458969", displayName: "AssetDisplayName", description: "This is a sample Asset", assetEndpointProfileRef: "myAssetEndpointProfile", @@ -158,9 +161,9 @@ async function createAssetWithoutExternalAssetId(): Promise { * This sample demonstrates how to create a Asset * * @summary create a Asset - * x-ms-original-file: 2024-09-01-preview/Create_Asset_With_DiscoveredAssetRef.json + * x-ms-original-file: 2024-11-01/Create_Asset_Without_DisplayName.json */ -async function createAssetWithDiscoveredAssetRefs(): Promise { +async function createAssetWithoutDisplayName(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeviceRegistryManagementClient(credential, subscriptionId); @@ -174,7 +177,6 @@ async function createAssetWithDiscoveredAssetRefs(): Promise { properties: { enabled: true, externalAssetId: "8ZBA6LRHU0A458969", - displayName: "AssetDisplayName", description: "This is a sample Asset", assetEndpointProfileRef: "myAssetEndpointProfile", manufacturer: "Contoso", @@ -185,7 +187,6 @@ async function createAssetWithDiscoveredAssetRefs(): Promise { softwareRevision: "2.0", documentationUri: "https://www.example.com/manual", serialNumber: "64-103816-519918-8", - discoveredAssetRefs: ["discoveredAsset1", "discoveredAsset2"], defaultDatasetsConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', defaultEventsConfiguration: '{"publishingInterval":10,"samplingInterval":15,"queueSize":20}', @@ -235,9 +236,9 @@ async function createAssetWithDiscoveredAssetRefs(): Promise { * This sample demonstrates how to create a Asset * * @summary create a Asset - * x-ms-original-file: 2024-09-01-preview/Create_Asset_With_ExternalAssetId.json + * x-ms-original-file: 2024-11-01/Create_Asset_Without_ExternalAssetId.json */ -async function createAssetWithExternalAssetId(): Promise { +async function createAssetWithoutExternalAssetId(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeviceRegistryManagementClient(credential, subscriptionId); @@ -250,7 +251,6 @@ async function createAssetWithExternalAssetId(): Promise { tags: { site: "building-1" }, properties: { enabled: true, - externalAssetId: "8ZBA6LRHU0A458969", displayName: "AssetDisplayName", description: "This is a sample Asset", assetEndpointProfileRef: "myAssetEndpointProfile", @@ -308,10 +308,10 @@ async function createAssetWithExternalAssetId(): Promise { } async function main(): Promise { - await createAssetWithoutDisplayName(); - await createAssetWithoutExternalAssetId(); await createAssetWithDiscoveredAssetRefs(); - await createAssetWithExternalAssetId(); + createAssetWithExternalAssetId(); + createAssetWithoutDisplayName(); + createAssetWithoutExternalAssetId(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsDeleteSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsDeleteSample.ts similarity index 89% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsDeleteSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsDeleteSample.ts index b009ba5b9e4..c0e7a1a030c 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsDeleteSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsDeleteSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to delete a Asset * * @summary delete a Asset - * x-ms-original-file: 2024-09-01-preview/Delete_Asset.json + * x-ms-original-file: 2024-11-01/Delete_Asset.json */ async function deleteAsset(): Promise { const credential = new DefaultAzureCredential(); @@ -18,7 +18,7 @@ async function deleteAsset(): Promise { } async function main(): Promise { - deleteAsset(); + await deleteAsset(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsGetSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsGetSample.ts similarity index 87% rename from sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsGetSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsGetSample.ts index 0cf3d58920d..32e1d068a83 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsGetSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsGetSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to get a Asset * * @summary get a Asset - * x-ms-original-file: 2024-09-01-preview/Get_Asset.json + * x-ms-original-file: 2024-11-01/Get_Asset.json */ async function getAsset(): Promise { const credential = new DefaultAzureCredential(); @@ -22,7 +22,7 @@ async function getAsset(): Promise { * This sample demonstrates how to get a Asset * * @summary get a Asset - * x-ms-original-file: 2024-09-01-preview/Get_Asset_With_SyncStatus.json + * x-ms-original-file: 2024-11-01/Get_Asset_With_SyncStatus.json */ async function getAssetWithSyncStatus(): Promise { const credential = new DefaultAzureCredential(); @@ -34,7 +34,7 @@ async function getAssetWithSyncStatus(): Promise { async function main(): Promise { await getAsset(); - await getAssetWithSyncStatus(); + getAssetWithSyncStatus(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsListByResourceGroupSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsListByResourceGroupSample.ts similarity index 83% rename from sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsListByResourceGroupSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsListByResourceGroupSample.ts index 7a28dd3794d..5194b59a429 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsListByResourceGroupSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsListByResourceGroupSample.ts @@ -8,14 +8,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to list Asset resources by resource group * * @summary list Asset resources by resource group - * x-ms-original-file: 2024-09-01-preview/List_Assets_ResourceGroup.json + * x-ms-original-file: 2024-11-01/List_Assets_ResourceGroup.json */ async function listAssetsResourceGroup(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeviceRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.assets.listByResourceGroup("myResourceGroup")) { + for await (let item of client.assets.listByResourceGroup("myResourceGroup")) { resArray.push(item); } diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsListBySubscriptionSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsListBySubscriptionSample.ts similarity index 85% rename from sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsListBySubscriptionSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsListBySubscriptionSample.ts index fe7d91568a7..82bd8c5cc48 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/assetsListBySubscriptionSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsListBySubscriptionSample.ts @@ -8,14 +8,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to list Asset resources by subscription ID * * @summary list Asset resources by subscription ID - * x-ms-original-file: 2024-09-01-preview/List_Assets_Subscription.json + * x-ms-original-file: 2024-11-01/List_Assets_Subscription.json */ async function listAssetsSubscription(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeviceRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.assets.listBySubscription()) { + for await (let item of client.assets.listBySubscription()) { resArray.push(item); } diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsUpdateSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsUpdateSample.ts similarity index 91% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsUpdateSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsUpdateSample.ts index 122b14cc2c3..10b96cb145c 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/assetsUpdateSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/assetsAssetsUpdateSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to update a Asset * * @summary update a Asset - * x-ms-original-file: 2024-09-01-preview/Update_Asset.json + * x-ms-original-file: 2024-11-01/Update_Asset.json */ async function updateAsset(): Promise { const credential = new DefaultAzureCredential(); @@ -21,7 +21,7 @@ async function updateAsset(): Promise { } async function main(): Promise { - updateAsset(); + await updateAsset(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/billingContainersGetSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/billingContainersBillingContainersGetSample.ts similarity index 88% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/billingContainersGetSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/billingContainersBillingContainersGetSample.ts index a4fa599c3e2..6ed8e9f72a8 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/billingContainersGetSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/billingContainersBillingContainersGetSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to get a BillingContainer * * @summary get a BillingContainer - * x-ms-original-file: 2024-09-01-preview/Get_BillingContainer.json + * x-ms-original-file: 2024-11-01/Get_BillingContainer.json */ async function getBillingContainer(): Promise { const credential = new DefaultAzureCredential(); @@ -19,7 +19,7 @@ async function getBillingContainer(): Promise { } async function main(): Promise { - getBillingContainer(); + await getBillingContainer(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/billingContainersListBySubscriptionSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/billingContainersBillingContainersListBySubscriptionSample.ts similarity index 84% rename from sdk/deviceregistry/arm-deviceregistry/samples-dev/billingContainersListBySubscriptionSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/billingContainersBillingContainersListBySubscriptionSample.ts index 19f26e34237..c3c73468812 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/billingContainersListBySubscriptionSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/billingContainersBillingContainersListBySubscriptionSample.ts @@ -8,14 +8,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to list BillingContainer resources by subscription ID * * @summary list BillingContainer resources by subscription ID - * x-ms-original-file: 2024-09-01-preview/List_BillingContainers_Subscription.json + * x-ms-original-file: 2024-11-01/List_BillingContainers_Subscription.json */ async function listBillingContainersSubscription(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-000000000000"; const client = new DeviceRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.billingContainers.listBySubscription()) { + for await (let item of client.billingContainers.listBySubscription()) { resArray.push(item); } diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/operationStatusGetSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/operationStatusOperationStatusGetSample.ts similarity index 90% rename from sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/operationStatusGetSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/operationStatusOperationStatusGetSample.ts index 055aafb33bb..6e4ea305edc 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples/v1-beta/typescript/src/operationStatusGetSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/operationStatusOperationStatusGetSample.ts @@ -8,7 +8,7 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to returns the current status of an async operation. * * @summary returns the current status of an async operation. - * x-ms-original-file: 2024-09-01-preview/Get_OperationStatus.json + * x-ms-original-file: 2024-11-01/Get_OperationStatus.json */ async function getOperationStatus(): Promise { const credential = new DefaultAzureCredential(); @@ -22,7 +22,7 @@ async function getOperationStatus(): Promise { } async function main(): Promise { - getOperationStatus(); + await getOperationStatus(); } main().catch(console.error); diff --git a/sdk/deviceregistry/arm-deviceregistry/samples-dev/operationsListSample.ts b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/operationsOperationsListSample.ts similarity index 86% rename from sdk/deviceregistry/arm-deviceregistry/samples-dev/operationsListSample.ts rename to sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/operationsOperationsListSample.ts index 620e421ceca..a978b74865b 100644 --- a/sdk/deviceregistry/arm-deviceregistry/samples-dev/operationsListSample.ts +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/src/operationsOperationsListSample.ts @@ -8,14 +8,14 @@ import { DefaultAzureCredential } from "@azure/identity"; * This sample demonstrates how to list the operations for the provider * * @summary list the operations for the provider - * x-ms-original-file: 2024-09-01-preview/List_Operations.json + * x-ms-original-file: 2024-11-01/List_Operations.json */ async function listOperations(): Promise { const credential = new DefaultAzureCredential(); const subscriptionId = "00000000-0000-0000-0000-00000000000"; const client = new DeviceRegistryManagementClient(credential, subscriptionId); const resArray = new Array(); - for await (const item of client.operations.list()) { + for await (let item of client.operations.list()) { resArray.push(item); } diff --git a/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/tsconfig.json b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/tsconfig.json new file mode 100644 index 00000000000..400db87cf64 --- /dev/null +++ b/sdk/deviceregistry/arm-deviceregistry/samples/v1/typescript/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "target": "ES2023", + "module": "commonjs", + "lib": [], + "importHelpers": true, + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true, + "moduleResolution": "node10", + "esModuleInterop": true, + "outDir": "./dist", + "resolveJsonModule": true + }, + "include": [ + "./src" + ] +} diff --git a/sdk/deviceregistry/arm-deviceregistry/src/api/assetEndpointProfiles/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/api/assetEndpointProfiles/index.ts index d1b0d72e63b..e08053f5819 100644 --- a/sdk/deviceregistry/arm-deviceregistry/src/api/assetEndpointProfiles/index.ts +++ b/sdk/deviceregistry/arm-deviceregistry/src/api/assetEndpointProfiles/index.ts @@ -11,6 +11,7 @@ import { DeviceRegistryManagementContext as Client, } from "../index.js"; import { + errorResponseDeserializer, AssetEndpointProfile, assetEndpointProfileSerializer, assetEndpointProfileDeserializer, @@ -19,11 +20,11 @@ import { _AssetEndpointProfileListResult, _assetEndpointProfileListResultDeserializer, } from "../../models/models.js"; -import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; import { PagedAsyncIterableIterator, buildPagedAsyncIterator, } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; import { StreamableMethod, PathUncheckedResponse, @@ -32,121 +33,173 @@ import { } from "@azure-rest/core-client"; import { PollerLike, OperationState } from "@azure/core-lro"; -export function _assetEndpointProfilesGetSend( +export function _assetEndpointProfilesListBySubscriptionSend( + context: Client, + options: AssetEndpointProfilesListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles", + context.subscriptionId, + ) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + queryParameters: { "api-version": context.apiVersion }, + }); +} + +export async function _assetEndpointProfilesListBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_AssetEndpointProfileListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _assetEndpointProfileListResultDeserializer(result.body); +} + +/** List AssetEndpointProfile resources by subscription ID */ +export function assetEndpointProfilesListBySubscription( + context: Client, + options: AssetEndpointProfilesListBySubscriptionOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _assetEndpointProfilesListBySubscriptionSend(context, options), + _assetEndpointProfilesListBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _assetEndpointProfilesListByResourceGroupSend( context: Client, - subscriptionId: string, resourceGroupName: string, - assetEndpointProfileName: string, - options: AssetEndpointProfilesGetOptionalParams = { requestOptions: {} }, + options: AssetEndpointProfilesListByResourceGroupOptionalParams = { + requestOptions: {}, + }, ): StreamableMethod { return context .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", - subscriptionId, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles", + context.subscriptionId, resourceGroupName, - assetEndpointProfileName, ) - .get({ ...operationOptionsToRequestParameters(options) }); + .get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + queryParameters: { "api-version": context.apiVersion }, + }); } -export async function _assetEndpointProfilesGetDeserialize( +export async function _assetEndpointProfilesListByResourceGroupDeserialize( result: PathUncheckedResponse, -): Promise { +): Promise<_AssetEndpointProfileListResult> { const expectedStatuses = ["200"]; if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; } - return assetEndpointProfileDeserializer(result.body); + return _assetEndpointProfileListResultDeserializer(result.body); } -/** Get a AssetEndpointProfile */ -export async function assetEndpointProfilesGet( +/** List AssetEndpointProfile resources by resource group */ +export function assetEndpointProfilesListByResourceGroup( context: Client, - subscriptionId: string, resourceGroupName: string, - assetEndpointProfileName: string, - options: AssetEndpointProfilesGetOptionalParams = { requestOptions: {} }, -): Promise { - const result = await _assetEndpointProfilesGetSend( + options: AssetEndpointProfilesListByResourceGroupOptionalParams = { + requestOptions: {}, + }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( context, - subscriptionId, - resourceGroupName, - assetEndpointProfileName, - options, + () => _assetEndpointProfilesListByResourceGroupSend(context, resourceGroupName, options), + _assetEndpointProfilesListByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, ); - return _assetEndpointProfilesGetDeserialize(result); } -export function _assetEndpointProfilesCreateOrReplaceSend( +export function _assetEndpointProfilesDeleteSend( context: Client, - subscriptionId: string, resourceGroupName: string, assetEndpointProfileName: string, - resource: AssetEndpointProfile, - options: AssetEndpointProfilesCreateOrReplaceOptionalParams = { - requestOptions: {}, - }, + options: AssetEndpointProfilesDeleteOptionalParams = { requestOptions: {} }, ): StreamableMethod { return context .path( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", - subscriptionId, + context.subscriptionId, resourceGroupName, assetEndpointProfileName, ) - .put({ + .delete({ ...operationOptionsToRequestParameters(options), - body: assetEndpointProfileSerializer(resource), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + queryParameters: { "api-version": context.apiVersion }, }); } -export async function _assetEndpointProfilesCreateOrReplaceDeserialize( +export async function _assetEndpointProfilesDeleteDeserialize( result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["200", "201"]; +): Promise { + const expectedStatuses = ["202", "204", "200"]; if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; } - return assetEndpointProfileDeserializer(result.body); + return; } -/** Create a AssetEndpointProfile */ -export function assetEndpointProfilesCreateOrReplace( +/** Delete a AssetEndpointProfile */ +export function assetEndpointProfilesDelete( context: Client, - subscriptionId: string, resourceGroupName: string, assetEndpointProfileName: string, - resource: AssetEndpointProfile, - options: AssetEndpointProfilesCreateOrReplaceOptionalParams = { - requestOptions: {}, - }, -): PollerLike, AssetEndpointProfile> { + options: AssetEndpointProfilesDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { return getLongRunningPoller( context, - _assetEndpointProfilesCreateOrReplaceDeserialize, - ["200", "201"], + _assetEndpointProfilesDeleteDeserialize, + ["202", "204", "200"], { updateIntervalInMs: options?.updateIntervalInMs, abortSignal: options?.abortSignal, getInitialResponse: () => - _assetEndpointProfilesCreateOrReplaceSend( + _assetEndpointProfilesDeleteSend( context, - subscriptionId, resourceGroupName, assetEndpointProfileName, - resource, options, ), - resourceLocationConfig: "azure-async-operation", + resourceLocationConfig: "location", }, - ) as PollerLike, AssetEndpointProfile>; + ) as PollerLike, void>; } export function _assetEndpointProfilesUpdateSend( context: Client, - subscriptionId: string, resourceGroupName: string, assetEndpointProfileName: string, properties: AssetEndpointProfileUpdate, @@ -155,12 +208,18 @@ export function _assetEndpointProfilesUpdateSend( return context .path( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", - subscriptionId, + context.subscriptionId, resourceGroupName, assetEndpointProfileName, ) .patch({ ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + queryParameters: { "api-version": context.apiVersion }, body: assetEndpointProfileUpdateSerializer(properties), }); } @@ -170,7 +229,9 @@ export async function _assetEndpointProfilesUpdateDeserialize( ): Promise { const expectedStatuses = ["200", "202"]; if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; } return assetEndpointProfileDeserializer(result.body); @@ -179,7 +240,6 @@ export async function _assetEndpointProfilesUpdateDeserialize( /** Update a AssetEndpointProfile */ export function assetEndpointProfilesUpdate( context: Client, - subscriptionId: string, resourceGroupName: string, assetEndpointProfileName: string, properties: AssetEndpointProfileUpdate, @@ -191,7 +251,6 @@ export function assetEndpointProfilesUpdate( getInitialResponse: () => _assetEndpointProfilesUpdateSend( context, - subscriptionId, resourceGroupName, assetEndpointProfileName, properties, @@ -201,153 +260,125 @@ export function assetEndpointProfilesUpdate( }) as PollerLike, AssetEndpointProfile>; } -export function _assetEndpointProfilesDeleteSend( +export function _assetEndpointProfilesCreateOrReplaceSend( context: Client, - subscriptionId: string, resourceGroupName: string, assetEndpointProfileName: string, - options: AssetEndpointProfilesDeleteOptionalParams = { requestOptions: {} }, + resource: AssetEndpointProfile, + options: AssetEndpointProfilesCreateOrReplaceOptionalParams = { + requestOptions: {}, + }, ): StreamableMethod { return context .path( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", - subscriptionId, + context.subscriptionId, resourceGroupName, assetEndpointProfileName, ) - .delete({ ...operationOptionsToRequestParameters(options) }); + .put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + queryParameters: { "api-version": context.apiVersion }, + body: assetEndpointProfileSerializer(resource), + }); } -export async function _assetEndpointProfilesDeleteDeserialize( +export async function _assetEndpointProfilesCreateOrReplaceDeserialize( result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["202", "204", "200"]; +): Promise { + const expectedStatuses = ["200", "201"]; if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; } - return; + return assetEndpointProfileDeserializer(result.body); } -/** Delete a AssetEndpointProfile */ -export function assetEndpointProfilesDelete( +/** Create a AssetEndpointProfile */ +export function assetEndpointProfilesCreateOrReplace( context: Client, - subscriptionId: string, resourceGroupName: string, assetEndpointProfileName: string, - options: AssetEndpointProfilesDeleteOptionalParams = { requestOptions: {} }, -): PollerLike, void> { + resource: AssetEndpointProfile, + options: AssetEndpointProfilesCreateOrReplaceOptionalParams = { + requestOptions: {}, + }, +): PollerLike, AssetEndpointProfile> { return getLongRunningPoller( context, - _assetEndpointProfilesDeleteDeserialize, - ["202", "204", "200"], + _assetEndpointProfilesCreateOrReplaceDeserialize, + ["200", "201"], { updateIntervalInMs: options?.updateIntervalInMs, abortSignal: options?.abortSignal, getInitialResponse: () => - _assetEndpointProfilesDeleteSend( + _assetEndpointProfilesCreateOrReplaceSend( context, - subscriptionId, resourceGroupName, assetEndpointProfileName, + resource, options, ), - resourceLocationConfig: "location", + resourceLocationConfig: "azure-async-operation", }, - ) as PollerLike, void>; + ) as PollerLike, AssetEndpointProfile>; } -export function _assetEndpointProfilesListByResourceGroupSend( +export function _assetEndpointProfilesGetSend( context: Client, - subscriptionId: string, resourceGroupName: string, - options: AssetEndpointProfilesListByResourceGroupOptionalParams = { - requestOptions: {}, - }, + assetEndpointProfileName: string, + options: AssetEndpointProfilesGetOptionalParams = { requestOptions: {} }, ): StreamableMethod { return context .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles", - subscriptionId, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}", + context.subscriptionId, resourceGroupName, + assetEndpointProfileName, ) - .get({ ...operationOptionsToRequestParameters(options) }); + .get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + queryParameters: { "api-version": context.apiVersion }, + }); } -export async function _assetEndpointProfilesListByResourceGroupDeserialize( +export async function _assetEndpointProfilesGetDeserialize( result: PathUncheckedResponse, -): Promise<_AssetEndpointProfileListResult> { +): Promise { const expectedStatuses = ["200"]; if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; } - return _assetEndpointProfileListResultDeserializer(result.body); + return assetEndpointProfileDeserializer(result.body); } -/** List AssetEndpointProfile resources by resource group */ -export function assetEndpointProfilesListByResourceGroup( +/** Get a AssetEndpointProfile */ +export async function assetEndpointProfilesGet( context: Client, - subscriptionId: string, resourceGroupName: string, - options: AssetEndpointProfilesListByResourceGroupOptionalParams = { - requestOptions: {}, - }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( - context, - () => - _assetEndpointProfilesListByResourceGroupSend( - context, - subscriptionId, - resourceGroupName, - options, - ), - _assetEndpointProfilesListByResourceGroupDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, - ); -} - -export function _assetEndpointProfilesListBySubscriptionSend( - context: Client, - subscriptionId: string, - options: AssetEndpointProfilesListBySubscriptionOptionalParams = { - requestOptions: {}, - }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles", - subscriptionId, - ) - .get({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _assetEndpointProfilesListBySubscriptionDeserialize( - result: PathUncheckedResponse, -): Promise<_AssetEndpointProfileListResult> { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return _assetEndpointProfileListResultDeserializer(result.body); -} - -/** List AssetEndpointProfile resources by subscription ID */ -export function assetEndpointProfilesListBySubscription( - context: Client, - subscriptionId: string, - options: AssetEndpointProfilesListBySubscriptionOptionalParams = { - requestOptions: {}, - }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( + assetEndpointProfileName: string, + options: AssetEndpointProfilesGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _assetEndpointProfilesGetSend( context, - () => _assetEndpointProfilesListBySubscriptionSend(context, subscriptionId, options), - _assetEndpointProfilesListBySubscriptionDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, + resourceGroupName, + assetEndpointProfileName, + options, ); + return _assetEndpointProfilesGetDeserialize(result); } diff --git a/sdk/deviceregistry/arm-deviceregistry/src/api/assets/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/api/assets/index.ts index 1b4505957ea..994bcf7d6ba 100644 --- a/sdk/deviceregistry/arm-deviceregistry/src/api/assets/index.ts +++ b/sdk/deviceregistry/arm-deviceregistry/src/api/assets/index.ts @@ -11,6 +11,7 @@ import { DeviceRegistryManagementContext as Client, } from "../index.js"; import { + errorResponseDeserializer, Asset, assetSerializer, assetDeserializer, @@ -19,11 +20,11 @@ import { _AssetListResult, _assetListResultDeserializer, } from "../../models/models.js"; -import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; import { PagedAsyncIterableIterator, buildPagedAsyncIterator, } from "../../static-helpers/pagingHelpers.js"; +import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; import { StreamableMethod, PathUncheckedResponse, @@ -32,110 +33,152 @@ import { } from "@azure-rest/core-client"; import { PollerLike, OperationState } from "@azure/core-lro"; -export function _assetsGetSend( +export function _assetsListBySubscriptionSend( + context: Client, + options: AssetsListBySubscriptionOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assets", + context.subscriptionId, + ) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + queryParameters: { "api-version": context.apiVersion }, + }); +} + +export async function _assetsListBySubscriptionDeserialize( + result: PathUncheckedResponse, +): Promise<_AssetListResult> { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return _assetListResultDeserializer(result.body); +} + +/** List Asset resources by subscription ID */ +export function assetsListBySubscription( + context: Client, + options: AssetsListBySubscriptionOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( + context, + () => _assetsListBySubscriptionSend(context, options), + _assetsListBySubscriptionDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, + ); +} + +export function _assetsListByResourceGroupSend( context: Client, - subscriptionId: string, resourceGroupName: string, - assetName: string, - options: AssetsGetOptionalParams = { requestOptions: {} }, + options: AssetsListByResourceGroupOptionalParams = { requestOptions: {} }, ): StreamableMethod { return context .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", - subscriptionId, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets", + context.subscriptionId, resourceGroupName, - assetName, ) - .get({ ...operationOptionsToRequestParameters(options) }); + .get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + queryParameters: { "api-version": context.apiVersion }, + }); } -export async function _assetsGetDeserialize(result: PathUncheckedResponse): Promise { +export async function _assetsListByResourceGroupDeserialize( + result: PathUncheckedResponse, +): Promise<_AssetListResult> { const expectedStatuses = ["200"]; if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; } - return assetDeserializer(result.body); + return _assetListResultDeserializer(result.body); } -/** Get a Asset */ -export async function assetsGet( +/** List Asset resources by resource group */ +export function assetsListByResourceGroup( context: Client, - subscriptionId: string, resourceGroupName: string, - assetName: string, - options: AssetsGetOptionalParams = { requestOptions: {} }, -): Promise { - const result = await _assetsGetSend( + options: AssetsListByResourceGroupOptionalParams = { requestOptions: {} }, +): PagedAsyncIterableIterator { + return buildPagedAsyncIterator( context, - subscriptionId, - resourceGroupName, - assetName, - options, + () => _assetsListByResourceGroupSend(context, resourceGroupName, options), + _assetsListByResourceGroupDeserialize, + ["200"], + { itemName: "value", nextLinkName: "nextLink" }, ); - return _assetsGetDeserialize(result); } -export function _assetsCreateOrReplaceSend( +export function _assetsDeleteSend( context: Client, - subscriptionId: string, resourceGroupName: string, assetName: string, - resource: Asset, - options: AssetsCreateOrReplaceOptionalParams = { requestOptions: {} }, + options: AssetsDeleteOptionalParams = { requestOptions: {} }, ): StreamableMethod { return context .path( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", - subscriptionId, + context.subscriptionId, resourceGroupName, assetName, ) - .put({ + .delete({ ...operationOptionsToRequestParameters(options), - body: assetSerializer(resource), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + queryParameters: { "api-version": context.apiVersion }, }); } -export async function _assetsCreateOrReplaceDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["200", "201"]; +export async function _assetsDeleteDeserialize(result: PathUncheckedResponse): Promise { + const expectedStatuses = ["202", "204", "200"]; if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; } - return assetDeserializer(result.body); + return; } -/** Create a Asset */ -export function assetsCreateOrReplace( +/** Delete a Asset */ +export function assetsDelete( context: Client, - subscriptionId: string, resourceGroupName: string, assetName: string, - resource: Asset, - options: AssetsCreateOrReplaceOptionalParams = { requestOptions: {} }, -): PollerLike, Asset> { - return getLongRunningPoller(context, _assetsCreateOrReplaceDeserialize, ["200", "201"], { + options: AssetsDeleteOptionalParams = { requestOptions: {} }, +): PollerLike, void> { + return getLongRunningPoller(context, _assetsDeleteDeserialize, ["202", "204", "200"], { updateIntervalInMs: options?.updateIntervalInMs, abortSignal: options?.abortSignal, - getInitialResponse: () => - _assetsCreateOrReplaceSend( - context, - subscriptionId, - resourceGroupName, - assetName, - resource, - options, - ), - resourceLocationConfig: "azure-async-operation", - }) as PollerLike, Asset>; + getInitialResponse: () => _assetsDeleteSend(context, resourceGroupName, assetName, options), + resourceLocationConfig: "location", + }) as PollerLike, void>; } export function _assetsUpdateSend( context: Client, - subscriptionId: string, resourceGroupName: string, assetName: string, properties: AssetUpdate, @@ -144,12 +187,18 @@ export function _assetsUpdateSend( return context .path( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", - subscriptionId, + context.subscriptionId, resourceGroupName, assetName, ) .patch({ ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + queryParameters: { "api-version": context.apiVersion }, body: assetUpdateSerializer(properties), }); } @@ -157,7 +206,9 @@ export function _assetsUpdateSend( export async function _assetsUpdateDeserialize(result: PathUncheckedResponse): Promise { const expectedStatuses = ["200", "202"]; if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; } return assetDeserializer(result.body); @@ -166,7 +217,6 @@ export async function _assetsUpdateDeserialize(result: PathUncheckedResponse): P /** Update a Asset */ export function assetsUpdate( context: Client, - subscriptionId: string, resourceGroupName: string, assetName: string, properties: AssetUpdate, @@ -176,131 +226,108 @@ export function assetsUpdate( updateIntervalInMs: options?.updateIntervalInMs, abortSignal: options?.abortSignal, getInitialResponse: () => - _assetsUpdateSend(context, subscriptionId, resourceGroupName, assetName, properties, options), + _assetsUpdateSend(context, resourceGroupName, assetName, properties, options), resourceLocationConfig: "location", }) as PollerLike, Asset>; } -export function _assetsDeleteSend( +export function _assetsCreateOrReplaceSend( context: Client, - subscriptionId: string, resourceGroupName: string, assetName: string, - options: AssetsDeleteOptionalParams = { requestOptions: {} }, + resource: Asset, + options: AssetsCreateOrReplaceOptionalParams = { requestOptions: {} }, ): StreamableMethod { return context .path( "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", - subscriptionId, + context.subscriptionId, resourceGroupName, assetName, ) - .delete({ ...operationOptionsToRequestParameters(options) }); + .put({ + ...operationOptionsToRequestParameters(options), + contentType: "application/json", + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + queryParameters: { "api-version": context.apiVersion }, + body: assetSerializer(resource), + }); } -export async function _assetsDeleteDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["202", "204", "200"]; +export async function _assetsCreateOrReplaceDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200", "201"]; if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; } - return; + return assetDeserializer(result.body); } -/** Delete a Asset */ -export function assetsDelete( +/** Create a Asset */ +export function assetsCreateOrReplace( context: Client, - subscriptionId: string, resourceGroupName: string, assetName: string, - options: AssetsDeleteOptionalParams = { requestOptions: {} }, -): PollerLike, void> { - return getLongRunningPoller(context, _assetsDeleteDeserialize, ["202", "204", "200"], { + resource: Asset, + options: AssetsCreateOrReplaceOptionalParams = { requestOptions: {} }, +): PollerLike, Asset> { + return getLongRunningPoller(context, _assetsCreateOrReplaceDeserialize, ["200", "201"], { updateIntervalInMs: options?.updateIntervalInMs, abortSignal: options?.abortSignal, getInitialResponse: () => - _assetsDeleteSend(context, subscriptionId, resourceGroupName, assetName, options), - resourceLocationConfig: "location", - }) as PollerLike, void>; + _assetsCreateOrReplaceSend(context, resourceGroupName, assetName, resource, options), + resourceLocationConfig: "azure-async-operation", + }) as PollerLike, Asset>; } -export function _assetsListByResourceGroupSend( +export function _assetsGetSend( context: Client, - subscriptionId: string, resourceGroupName: string, - options: AssetsListByResourceGroupOptionalParams = { requestOptions: {} }, + assetName: string, + options: AssetsGetOptionalParams = { requestOptions: {} }, ): StreamableMethod { return context .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets", - subscriptionId, + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}", + context.subscriptionId, resourceGroupName, + assetName, ) - .get({ ...operationOptionsToRequestParameters(options) }); + .get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + queryParameters: { "api-version": context.apiVersion }, + }); } -export async function _assetsListByResourceGroupDeserialize( - result: PathUncheckedResponse, -): Promise<_AssetListResult> { +export async function _assetsGetDeserialize(result: PathUncheckedResponse): Promise { const expectedStatuses = ["200"]; if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; } - return _assetListResultDeserializer(result.body); + return assetDeserializer(result.body); } -/** List Asset resources by resource group */ -export function assetsListByResourceGroup( +/** Get a Asset */ +export async function assetsGet( context: Client, - subscriptionId: string, resourceGroupName: string, - options: AssetsListByResourceGroupOptionalParams = { requestOptions: {} }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( - context, - () => _assetsListByResourceGroupSend(context, subscriptionId, resourceGroupName, options), - _assetsListByResourceGroupDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, - ); -} - -export function _assetsListBySubscriptionSend( - context: Client, - subscriptionId: string, - options: AssetsListBySubscriptionOptionalParams = { requestOptions: {} }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/assets", - subscriptionId, - ) - .get({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _assetsListBySubscriptionDeserialize( - result: PathUncheckedResponse, -): Promise<_AssetListResult> { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return _assetListResultDeserializer(result.body); -} - -/** List Asset resources by subscription ID */ -export function assetsListBySubscription( - context: Client, - subscriptionId: string, - options: AssetsListBySubscriptionOptionalParams = { requestOptions: {} }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( - context, - () => _assetsListBySubscriptionSend(context, subscriptionId, options), - _assetsListBySubscriptionDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, - ); + assetName: string, + options: AssetsGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _assetsGetSend(context, resourceGroupName, assetName, options); + return _assetsGetDeserialize(result); } diff --git a/sdk/deviceregistry/arm-deviceregistry/src/api/billingContainers/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/api/billingContainers/index.ts index 3dac52cb152..7e6614946a8 100644 --- a/sdk/deviceregistry/arm-deviceregistry/src/api/billingContainers/index.ts +++ b/sdk/deviceregistry/arm-deviceregistry/src/api/billingContainers/index.ts @@ -9,6 +9,7 @@ import { import { BillingContainer, billingContainerDeserializer, + errorResponseDeserializer, _BillingContainerListResult, _billingContainerListResultDeserializer, } from "../../models/models.js"; @@ -23,51 +24,8 @@ import { operationOptionsToRequestParameters, } from "@azure-rest/core-client"; -export function _billingContainersGetSend( - context: Client, - subscriptionId: string, - billingContainerName: string, - options: BillingContainersGetOptionalParams = { requestOptions: {} }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers/{billingContainerName}", - subscriptionId, - billingContainerName, - ) - .get({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _billingContainersGetDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return billingContainerDeserializer(result.body); -} - -/** Get a BillingContainer */ -export async function billingContainersGet( - context: Client, - subscriptionId: string, - billingContainerName: string, - options: BillingContainersGetOptionalParams = { requestOptions: {} }, -): Promise { - const result = await _billingContainersGetSend( - context, - subscriptionId, - billingContainerName, - options, - ); - return _billingContainersGetDeserialize(result); -} - export function _billingContainersListBySubscriptionSend( context: Client, - subscriptionId: string, options: BillingContainersListBySubscriptionOptionalParams = { requestOptions: {}, }, @@ -75,9 +33,16 @@ export function _billingContainersListBySubscriptionSend( return context .path( "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers", - subscriptionId, + context.subscriptionId, ) - .get({ ...operationOptionsToRequestParameters(options) }); + .get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + queryParameters: { "api-version": context.apiVersion }, + }); } export async function _billingContainersListBySubscriptionDeserialize( @@ -85,7 +50,9 @@ export async function _billingContainersListBySubscriptionDeserialize( ): Promise<_BillingContainerListResult> { const expectedStatuses = ["200"]; if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; } return _billingContainerListResultDeserializer(result.body); @@ -94,16 +61,59 @@ export async function _billingContainersListBySubscriptionDeserialize( /** List BillingContainer resources by subscription ID */ export function billingContainersListBySubscription( context: Client, - subscriptionId: string, options: BillingContainersListBySubscriptionOptionalParams = { requestOptions: {}, }, ): PagedAsyncIterableIterator { return buildPagedAsyncIterator( context, - () => _billingContainersListBySubscriptionSend(context, subscriptionId, options), + () => _billingContainersListBySubscriptionSend(context, options), _billingContainersListBySubscriptionDeserialize, ["200"], { itemName: "value", nextLinkName: "nextLink" }, ); } + +export function _billingContainersGetSend( + context: Client, + billingContainerName: string, + options: BillingContainersGetOptionalParams = { requestOptions: {} }, +): StreamableMethod { + return context + .path( + "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/billingContainers/{billingContainerName}", + context.subscriptionId, + billingContainerName, + ) + .get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + queryParameters: { "api-version": context.apiVersion }, + }); +} + +export async function _billingContainersGetDeserialize( + result: PathUncheckedResponse, +): Promise { + const expectedStatuses = ["200"]; + if (!expectedStatuses.includes(result.status)) { + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; + } + + return billingContainerDeserializer(result.body); +} + +/** Get a BillingContainer */ +export async function billingContainersGet( + context: Client, + billingContainerName: string, + options: BillingContainersGetOptionalParams = { requestOptions: {} }, +): Promise { + const result = await _billingContainersGetSend(context, billingContainerName, options); + return _billingContainersGetDeserialize(result); +} diff --git a/sdk/deviceregistry/arm-deviceregistry/src/api/deviceRegistryManagementContext.ts b/sdk/deviceregistry/arm-deviceregistry/src/api/deviceRegistryManagementContext.ts index efa73f921ea..26a9bb25ad4 100644 --- a/sdk/deviceregistry/arm-deviceregistry/src/api/deviceRegistryManagementContext.ts +++ b/sdk/deviceregistry/arm-deviceregistry/src/api/deviceRegistryManagementContext.ts @@ -7,7 +7,13 @@ import { Client, ClientOptions, getClient } from "@azure-rest/core-client"; import { TokenCredential } from "@azure/core-auth"; /** Microsoft.DeviceRegistry Resource Provider management API. */ -export interface DeviceRegistryManagementContext extends Client {} +export interface DeviceRegistryManagementContext extends Client { + /** The API version to use for this operation. */ + /** Known values of {@link KnownVersions} that the service accepts. */ + apiVersion: string; + /** The ID of the target subscription. The value must be an UUID. */ + subscriptionId: string; +} /** Optional parameters for the client. */ export interface DeviceRegistryManagementClientOptionalParams extends ClientOptions { @@ -19,11 +25,12 @@ export interface DeviceRegistryManagementClientOptionalParams extends ClientOpti /** Microsoft.DeviceRegistry Resource Provider management API. */ export function createDeviceRegistryManagement( credential: TokenCredential, + subscriptionId: string, options: DeviceRegistryManagementClientOptionalParams = {}, ): DeviceRegistryManagementContext { - const endpointUrl = options.endpoint ?? options.baseUrl ?? `https://management.azure.com`; + const endpointUrl = options.endpoint ?? options.baseUrl ?? "https://management.azure.com"; const prefixFromOptions = options?.userAgentOptions?.userAgentPrefix; - const userAgentInfo = `azsdk-js-arm-deviceregistry/1.0.0-beta.2`; + const userAgentInfo = `azsdk-js-arm-deviceregistry/1.0.0`; const userAgentPrefix = prefixFromOptions ? `${prefixFromOptions} azsdk-js-api ${userAgentInfo}` : `azsdk-js-api ${userAgentInfo}`; @@ -37,7 +44,7 @@ export function createDeviceRegistryManagement( }; const clientContext = getClient(endpointUrl, credential, updatedOptions); clientContext.pipeline.removePolicy({ name: "ApiVersionPolicy" }); - const apiVersion = options.apiVersion ?? "2024-09-01-preview"; + const apiVersion = options.apiVersion ?? "2024-11-01"; clientContext.pipeline.addPolicy({ name: "ClientApiVersionPolicy", sendRequest: (req, next) => { @@ -53,5 +60,9 @@ export function createDeviceRegistryManagement( return next(req); }, }); - return clientContext; + return { + ...clientContext, + apiVersion, + subscriptionId, + } as DeviceRegistryManagementContext; } diff --git a/sdk/deviceregistry/arm-deviceregistry/src/api/discoveredAssetEndpointProfiles/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/api/discoveredAssetEndpointProfiles/index.ts deleted file mode 100644 index 137fe71bcc3..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/src/api/discoveredAssetEndpointProfiles/index.ts +++ /dev/null @@ -1,370 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { - DeviceRegistryManagementContext as Client, - DiscoveredAssetEndpointProfilesCreateOrReplaceOptionalParams, - DiscoveredAssetEndpointProfilesDeleteOptionalParams, - DiscoveredAssetEndpointProfilesGetOptionalParams, - DiscoveredAssetEndpointProfilesListByResourceGroupOptionalParams, - DiscoveredAssetEndpointProfilesListBySubscriptionOptionalParams, - DiscoveredAssetEndpointProfilesUpdateOptionalParams, -} from "../index.js"; -import { - DiscoveredAssetEndpointProfile, - discoveredAssetEndpointProfileSerializer, - discoveredAssetEndpointProfileDeserializer, - DiscoveredAssetEndpointProfileUpdate, - discoveredAssetEndpointProfileUpdateSerializer, - _DiscoveredAssetEndpointProfileListResult, - _discoveredAssetEndpointProfileListResultDeserializer, -} from "../../models/models.js"; -import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; -import { - PagedAsyncIterableIterator, - buildPagedAsyncIterator, -} from "../../static-helpers/pagingHelpers.js"; -import { - StreamableMethod, - PathUncheckedResponse, - createRestError, - operationOptionsToRequestParameters, -} from "@azure-rest/core-client"; -import { PollerLike, OperationState } from "@azure/core-lro"; - -export function _discoveredAssetEndpointProfilesGetSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - discoveredAssetEndpointProfileName: string, - options: DiscoveredAssetEndpointProfilesGetOptionalParams = { - requestOptions: {}, - }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName}", - subscriptionId, - resourceGroupName, - discoveredAssetEndpointProfileName, - ) - .get({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _discoveredAssetEndpointProfilesGetDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return discoveredAssetEndpointProfileDeserializer(result.body); -} - -/** Get a DiscoveredAssetEndpointProfile */ -export async function discoveredAssetEndpointProfilesGet( - context: Client, - subscriptionId: string, - resourceGroupName: string, - discoveredAssetEndpointProfileName: string, - options: DiscoveredAssetEndpointProfilesGetOptionalParams = { - requestOptions: {}, - }, -): Promise { - const result = await _discoveredAssetEndpointProfilesGetSend( - context, - subscriptionId, - resourceGroupName, - discoveredAssetEndpointProfileName, - options, - ); - return _discoveredAssetEndpointProfilesGetDeserialize(result); -} - -export function _discoveredAssetEndpointProfilesCreateOrReplaceSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - discoveredAssetEndpointProfileName: string, - resource: DiscoveredAssetEndpointProfile, - options: DiscoveredAssetEndpointProfilesCreateOrReplaceOptionalParams = { - requestOptions: {}, - }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName}", - subscriptionId, - resourceGroupName, - discoveredAssetEndpointProfileName, - ) - .put({ - ...operationOptionsToRequestParameters(options), - body: discoveredAssetEndpointProfileSerializer(resource), - }); -} - -export async function _discoveredAssetEndpointProfilesCreateOrReplaceDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["200", "201"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return discoveredAssetEndpointProfileDeserializer(result.body); -} - -/** Create a DiscoveredAssetEndpointProfile */ -export function discoveredAssetEndpointProfilesCreateOrReplace( - context: Client, - subscriptionId: string, - resourceGroupName: string, - discoveredAssetEndpointProfileName: string, - resource: DiscoveredAssetEndpointProfile, - options: DiscoveredAssetEndpointProfilesCreateOrReplaceOptionalParams = { - requestOptions: {}, - }, -): PollerLike, DiscoveredAssetEndpointProfile> { - return getLongRunningPoller( - context, - _discoveredAssetEndpointProfilesCreateOrReplaceDeserialize, - ["200", "201"], - { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _discoveredAssetEndpointProfilesCreateOrReplaceSend( - context, - subscriptionId, - resourceGroupName, - discoveredAssetEndpointProfileName, - resource, - options, - ), - resourceLocationConfig: "azure-async-operation", - }, - ) as PollerLike, DiscoveredAssetEndpointProfile>; -} - -export function _discoveredAssetEndpointProfilesUpdateSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - discoveredAssetEndpointProfileName: string, - properties: DiscoveredAssetEndpointProfileUpdate, - options: DiscoveredAssetEndpointProfilesUpdateOptionalParams = { - requestOptions: {}, - }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName}", - subscriptionId, - resourceGroupName, - discoveredAssetEndpointProfileName, - ) - .patch({ - ...operationOptionsToRequestParameters(options), - body: discoveredAssetEndpointProfileUpdateSerializer(properties), - }); -} - -export async function _discoveredAssetEndpointProfilesUpdateDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["200", "202"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return discoveredAssetEndpointProfileDeserializer(result.body); -} - -/** Update a DiscoveredAssetEndpointProfile */ -export function discoveredAssetEndpointProfilesUpdate( - context: Client, - subscriptionId: string, - resourceGroupName: string, - discoveredAssetEndpointProfileName: string, - properties: DiscoveredAssetEndpointProfileUpdate, - options: DiscoveredAssetEndpointProfilesUpdateOptionalParams = { - requestOptions: {}, - }, -): PollerLike, DiscoveredAssetEndpointProfile> { - return getLongRunningPoller( - context, - _discoveredAssetEndpointProfilesUpdateDeserialize, - ["200", "202"], - { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _discoveredAssetEndpointProfilesUpdateSend( - context, - subscriptionId, - resourceGroupName, - discoveredAssetEndpointProfileName, - properties, - options, - ), - resourceLocationConfig: "location", - }, - ) as PollerLike, DiscoveredAssetEndpointProfile>; -} - -export function _discoveredAssetEndpointProfilesDeleteSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - discoveredAssetEndpointProfileName: string, - options: DiscoveredAssetEndpointProfilesDeleteOptionalParams = { - requestOptions: {}, - }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName}", - subscriptionId, - resourceGroupName, - discoveredAssetEndpointProfileName, - ) - .delete({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _discoveredAssetEndpointProfilesDeleteDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["202", "204", "200"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return; -} - -/** Delete a DiscoveredAssetEndpointProfile */ -export function discoveredAssetEndpointProfilesDelete( - context: Client, - subscriptionId: string, - resourceGroupName: string, - discoveredAssetEndpointProfileName: string, - options: DiscoveredAssetEndpointProfilesDeleteOptionalParams = { - requestOptions: {}, - }, -): PollerLike, void> { - return getLongRunningPoller( - context, - _discoveredAssetEndpointProfilesDeleteDeserialize, - ["202", "204", "200"], - { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _discoveredAssetEndpointProfilesDeleteSend( - context, - subscriptionId, - resourceGroupName, - discoveredAssetEndpointProfileName, - options, - ), - resourceLocationConfig: "location", - }, - ) as PollerLike, void>; -} - -export function _discoveredAssetEndpointProfilesListByResourceGroupSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - options: DiscoveredAssetEndpointProfilesListByResourceGroupOptionalParams = { - requestOptions: {}, - }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles", - subscriptionId, - resourceGroupName, - ) - .get({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _discoveredAssetEndpointProfilesListByResourceGroupDeserialize( - result: PathUncheckedResponse, -): Promise<_DiscoveredAssetEndpointProfileListResult> { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return _discoveredAssetEndpointProfileListResultDeserializer(result.body); -} - -/** List DiscoveredAssetEndpointProfile resources by resource group */ -export function discoveredAssetEndpointProfilesListByResourceGroup( - context: Client, - subscriptionId: string, - resourceGroupName: string, - options: DiscoveredAssetEndpointProfilesListByResourceGroupOptionalParams = { - requestOptions: {}, - }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( - context, - () => - _discoveredAssetEndpointProfilesListByResourceGroupSend( - context, - subscriptionId, - resourceGroupName, - options, - ), - _discoveredAssetEndpointProfilesListByResourceGroupDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, - ); -} - -export function _discoveredAssetEndpointProfilesListBySubscriptionSend( - context: Client, - subscriptionId: string, - options: DiscoveredAssetEndpointProfilesListBySubscriptionOptionalParams = { - requestOptions: {}, - }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles", - subscriptionId, - ) - .get({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _discoveredAssetEndpointProfilesListBySubscriptionDeserialize( - result: PathUncheckedResponse, -): Promise<_DiscoveredAssetEndpointProfileListResult> { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return _discoveredAssetEndpointProfileListResultDeserializer(result.body); -} - -/** List DiscoveredAssetEndpointProfile resources by subscription ID */ -export function discoveredAssetEndpointProfilesListBySubscription( - context: Client, - subscriptionId: string, - options: DiscoveredAssetEndpointProfilesListBySubscriptionOptionalParams = { - requestOptions: {}, - }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( - context, - () => _discoveredAssetEndpointProfilesListBySubscriptionSend(context, subscriptionId, options), - _discoveredAssetEndpointProfilesListBySubscriptionDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, - ); -} diff --git a/sdk/deviceregistry/arm-deviceregistry/src/api/discoveredAssets/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/api/discoveredAssets/index.ts deleted file mode 100644 index 5e22b1d5e5e..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/src/api/discoveredAssets/index.ts +++ /dev/null @@ -1,343 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { - DeviceRegistryManagementContext as Client, - DiscoveredAssetsCreateOrReplaceOptionalParams, - DiscoveredAssetsDeleteOptionalParams, - DiscoveredAssetsGetOptionalParams, - DiscoveredAssetsListByResourceGroupOptionalParams, - DiscoveredAssetsListBySubscriptionOptionalParams, - DiscoveredAssetsUpdateOptionalParams, -} from "../index.js"; -import { - DiscoveredAsset, - discoveredAssetSerializer, - discoveredAssetDeserializer, - DiscoveredAssetUpdate, - discoveredAssetUpdateSerializer, - _DiscoveredAssetListResult, - _discoveredAssetListResultDeserializer, -} from "../../models/models.js"; -import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; -import { - PagedAsyncIterableIterator, - buildPagedAsyncIterator, -} from "../../static-helpers/pagingHelpers.js"; -import { - StreamableMethod, - PathUncheckedResponse, - createRestError, - operationOptionsToRequestParameters, -} from "@azure-rest/core-client"; -import { PollerLike, OperationState } from "@azure/core-lro"; - -export function _discoveredAssetsGetSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - discoveredAssetName: string, - options: DiscoveredAssetsGetOptionalParams = { requestOptions: {} }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName}", - subscriptionId, - resourceGroupName, - discoveredAssetName, - ) - .get({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _discoveredAssetsGetDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return discoveredAssetDeserializer(result.body); -} - -/** Get a DiscoveredAsset */ -export async function discoveredAssetsGet( - context: Client, - subscriptionId: string, - resourceGroupName: string, - discoveredAssetName: string, - options: DiscoveredAssetsGetOptionalParams = { requestOptions: {} }, -): Promise { - const result = await _discoveredAssetsGetSend( - context, - subscriptionId, - resourceGroupName, - discoveredAssetName, - options, - ); - return _discoveredAssetsGetDeserialize(result); -} - -export function _discoveredAssetsCreateOrReplaceSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - discoveredAssetName: string, - resource: DiscoveredAsset, - options: DiscoveredAssetsCreateOrReplaceOptionalParams = { - requestOptions: {}, - }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName}", - subscriptionId, - resourceGroupName, - discoveredAssetName, - ) - .put({ - ...operationOptionsToRequestParameters(options), - body: discoveredAssetSerializer(resource), - }); -} - -export async function _discoveredAssetsCreateOrReplaceDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["200", "201"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return discoveredAssetDeserializer(result.body); -} - -/** Create a DiscoveredAsset */ -export function discoveredAssetsCreateOrReplace( - context: Client, - subscriptionId: string, - resourceGroupName: string, - discoveredAssetName: string, - resource: DiscoveredAsset, - options: DiscoveredAssetsCreateOrReplaceOptionalParams = { - requestOptions: {}, - }, -): PollerLike, DiscoveredAsset> { - return getLongRunningPoller( - context, - _discoveredAssetsCreateOrReplaceDeserialize, - ["200", "201"], - { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _discoveredAssetsCreateOrReplaceSend( - context, - subscriptionId, - resourceGroupName, - discoveredAssetName, - resource, - options, - ), - resourceLocationConfig: "azure-async-operation", - }, - ) as PollerLike, DiscoveredAsset>; -} - -export function _discoveredAssetsUpdateSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - discoveredAssetName: string, - properties: DiscoveredAssetUpdate, - options: DiscoveredAssetsUpdateOptionalParams = { requestOptions: {} }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName}", - subscriptionId, - resourceGroupName, - discoveredAssetName, - ) - .patch({ - ...operationOptionsToRequestParameters(options), - body: discoveredAssetUpdateSerializer(properties), - }); -} - -export async function _discoveredAssetsUpdateDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["200", "202"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return discoveredAssetDeserializer(result.body); -} - -/** Update a DiscoveredAsset */ -export function discoveredAssetsUpdate( - context: Client, - subscriptionId: string, - resourceGroupName: string, - discoveredAssetName: string, - properties: DiscoveredAssetUpdate, - options: DiscoveredAssetsUpdateOptionalParams = { requestOptions: {} }, -): PollerLike, DiscoveredAsset> { - return getLongRunningPoller(context, _discoveredAssetsUpdateDeserialize, ["200", "202"], { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _discoveredAssetsUpdateSend( - context, - subscriptionId, - resourceGroupName, - discoveredAssetName, - properties, - options, - ), - resourceLocationConfig: "location", - }) as PollerLike, DiscoveredAsset>; -} - -export function _discoveredAssetsDeleteSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - discoveredAssetName: string, - options: DiscoveredAssetsDeleteOptionalParams = { requestOptions: {} }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName}", - subscriptionId, - resourceGroupName, - discoveredAssetName, - ) - .delete({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _discoveredAssetsDeleteDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["202", "204", "200"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return; -} - -/** Delete a DiscoveredAsset */ -export function discoveredAssetsDelete( - context: Client, - subscriptionId: string, - resourceGroupName: string, - discoveredAssetName: string, - options: DiscoveredAssetsDeleteOptionalParams = { requestOptions: {} }, -): PollerLike, void> { - return getLongRunningPoller(context, _discoveredAssetsDeleteDeserialize, ["202", "204", "200"], { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _discoveredAssetsDeleteSend( - context, - subscriptionId, - resourceGroupName, - discoveredAssetName, - options, - ), - resourceLocationConfig: "location", - }) as PollerLike, void>; -} - -export function _discoveredAssetsListByResourceGroupSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - options: DiscoveredAssetsListByResourceGroupOptionalParams = { - requestOptions: {}, - }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets", - subscriptionId, - resourceGroupName, - ) - .get({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _discoveredAssetsListByResourceGroupDeserialize( - result: PathUncheckedResponse, -): Promise<_DiscoveredAssetListResult> { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return _discoveredAssetListResultDeserializer(result.body); -} - -/** List DiscoveredAsset resources by resource group */ -export function discoveredAssetsListByResourceGroup( - context: Client, - subscriptionId: string, - resourceGroupName: string, - options: DiscoveredAssetsListByResourceGroupOptionalParams = { - requestOptions: {}, - }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( - context, - () => - _discoveredAssetsListByResourceGroupSend(context, subscriptionId, resourceGroupName, options), - _discoveredAssetsListByResourceGroupDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, - ); -} - -export function _discoveredAssetsListBySubscriptionSend( - context: Client, - subscriptionId: string, - options: DiscoveredAssetsListBySubscriptionOptionalParams = { - requestOptions: {}, - }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/discoveredAssets", - subscriptionId, - ) - .get({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _discoveredAssetsListBySubscriptionDeserialize( - result: PathUncheckedResponse, -): Promise<_DiscoveredAssetListResult> { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return _discoveredAssetListResultDeserializer(result.body); -} - -/** List DiscoveredAsset resources by subscription ID */ -export function discoveredAssetsListBySubscription( - context: Client, - subscriptionId: string, - options: DiscoveredAssetsListBySubscriptionOptionalParams = { - requestOptions: {}, - }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( - context, - () => _discoveredAssetsListBySubscriptionSend(context, subscriptionId, options), - _discoveredAssetsListBySubscriptionDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, - ); -} diff --git a/sdk/deviceregistry/arm-deviceregistry/src/api/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/api/index.ts index 48753155e02..d86d557e1a8 100644 --- a/sdk/deviceregistry/arm-deviceregistry/src/api/index.ts +++ b/sdk/deviceregistry/arm-deviceregistry/src/api/index.ts @@ -7,104 +7,42 @@ export { DeviceRegistryManagementClientOptionalParams, } from "./deviceRegistryManagementContext.js"; export { - OperationsListOptionalParams, - OperationStatusGetOptionalParams, - AssetsGetOptionalParams, - AssetsCreateOrReplaceOptionalParams, - AssetsUpdateOptionalParams, - AssetsDeleteOptionalParams, - AssetsListByResourceGroupOptionalParams, - AssetsListBySubscriptionOptionalParams, - AssetEndpointProfilesGetOptionalParams, - AssetEndpointProfilesCreateOrReplaceOptionalParams, - AssetEndpointProfilesUpdateOptionalParams, - AssetEndpointProfilesDeleteOptionalParams, - AssetEndpointProfilesListByResourceGroupOptionalParams, - AssetEndpointProfilesListBySubscriptionOptionalParams, - BillingContainersGetOptionalParams, BillingContainersListBySubscriptionOptionalParams, - DiscoveredAssetsGetOptionalParams, - DiscoveredAssetsCreateOrReplaceOptionalParams, - DiscoveredAssetsUpdateOptionalParams, - DiscoveredAssetsDeleteOptionalParams, - DiscoveredAssetsListByResourceGroupOptionalParams, - DiscoveredAssetsListBySubscriptionOptionalParams, - DiscoveredAssetEndpointProfilesGetOptionalParams, - DiscoveredAssetEndpointProfilesCreateOrReplaceOptionalParams, - DiscoveredAssetEndpointProfilesUpdateOptionalParams, - DiscoveredAssetEndpointProfilesDeleteOptionalParams, - DiscoveredAssetEndpointProfilesListByResourceGroupOptionalParams, - DiscoveredAssetEndpointProfilesListBySubscriptionOptionalParams, - SchemaRegistriesGetOptionalParams, - SchemaRegistriesCreateOrReplaceOptionalParams, - SchemaRegistriesUpdateOptionalParams, - SchemaRegistriesDeleteOptionalParams, - SchemaRegistriesListByResourceGroupOptionalParams, - SchemaRegistriesListBySubscriptionOptionalParams, - SchemasGetOptionalParams, - SchemasCreateOrReplaceOptionalParams, - SchemasDeleteOptionalParams, - SchemasListBySchemaRegistryOptionalParams, - SchemaVersionsGetOptionalParams, - SchemaVersionsCreateOrReplaceOptionalParams, - SchemaVersionsDeleteOptionalParams, - SchemaVersionsListBySchemaOptionalParams, + BillingContainersGetOptionalParams, + AssetEndpointProfilesListBySubscriptionOptionalParams, + AssetEndpointProfilesListByResourceGroupOptionalParams, + AssetEndpointProfilesDeleteOptionalParams, + AssetEndpointProfilesUpdateOptionalParams, + AssetEndpointProfilesCreateOrReplaceOptionalParams, + AssetEndpointProfilesGetOptionalParams, + AssetsListBySubscriptionOptionalParams, + AssetsListByResourceGroupOptionalParams, + AssetsDeleteOptionalParams, + AssetsUpdateOptionalParams, + AssetsCreateOrReplaceOptionalParams, + AssetsGetOptionalParams, + OperationStatusGetOptionalParams, + OperationsListOptionalParams, } from "./options.js"; export { - assetEndpointProfilesGet, - assetEndpointProfilesCreateOrReplace, - assetEndpointProfilesUpdate, - assetEndpointProfilesDelete, - assetEndpointProfilesListByResourceGroup, assetEndpointProfilesListBySubscription, + assetEndpointProfilesListByResourceGroup, + assetEndpointProfilesDelete, + assetEndpointProfilesUpdate, + assetEndpointProfilesCreateOrReplace, + assetEndpointProfilesGet, } from "./assetEndpointProfiles/index.js"; export { - assetsGet, - assetsCreateOrReplace, - assetsUpdate, - assetsDelete, - assetsListByResourceGroup, assetsListBySubscription, + assetsListByResourceGroup, + assetsDelete, + assetsUpdate, + assetsCreateOrReplace, + assetsGet, } from "./assets/index.js"; export { - billingContainersGet, billingContainersListBySubscription, + billingContainersGet, } from "./billingContainers/index.js"; -export { - discoveredAssetEndpointProfilesGet, - discoveredAssetEndpointProfilesCreateOrReplace, - discoveredAssetEndpointProfilesUpdate, - discoveredAssetEndpointProfilesDelete, - discoveredAssetEndpointProfilesListByResourceGroup, - discoveredAssetEndpointProfilesListBySubscription, -} from "./discoveredAssetEndpointProfiles/index.js"; -export { - discoveredAssetsGet, - discoveredAssetsCreateOrReplace, - discoveredAssetsUpdate, - discoveredAssetsDelete, - discoveredAssetsListByResourceGroup, - discoveredAssetsListBySubscription, -} from "./discoveredAssets/index.js"; export { operationsList } from "./operations/index.js"; export { operationStatusGet } from "./operationStatus/index.js"; -export { - schemaRegistriesGet, - schemaRegistriesCreateOrReplace, - schemaRegistriesUpdate, - schemaRegistriesDelete, - schemaRegistriesListByResourceGroup, - schemaRegistriesListBySubscription, -} from "./schemaRegistries/index.js"; -export { - schemasGet, - schemasCreateOrReplace, - schemasDelete, - schemasListBySchemaRegistry, -} from "./schemas/index.js"; -export { - schemaVersionsGet, - schemaVersionsCreateOrReplace, - schemaVersionsDelete, - schemaVersionsListBySchema, -} from "./schemaVersions/index.js"; diff --git a/sdk/deviceregistry/arm-deviceregistry/src/api/operationStatus/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/api/operationStatus/index.ts index 900bdc39721..30cf1588123 100644 --- a/sdk/deviceregistry/arm-deviceregistry/src/api/operationStatus/index.ts +++ b/sdk/deviceregistry/arm-deviceregistry/src/api/operationStatus/index.ts @@ -5,7 +5,11 @@ import { DeviceRegistryManagementContext as Client, OperationStatusGetOptionalParams, } from "../index.js"; -import { OperationStatusResult, operationStatusResultDeserializer } from "../../models/models.js"; +import { + errorResponseDeserializer, + OperationStatusResult, + operationStatusResultDeserializer, +} from "../../models/models.js"; import { StreamableMethod, PathUncheckedResponse, @@ -15,7 +19,6 @@ import { export function _operationStatusGetSend( context: Client, - subscriptionId: string, location: string, operationId: string, options: OperationStatusGetOptionalParams = { requestOptions: {} }, @@ -23,11 +26,18 @@ export function _operationStatusGetSend( return context .path( "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/locations/{location}/operationStatuses/{operationId}", - subscriptionId, + context.subscriptionId, location, operationId, ) - .get({ ...operationOptionsToRequestParameters(options) }); + .get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + queryParameters: { "api-version": context.apiVersion }, + }); } export async function _operationStatusGetDeserialize( @@ -35,7 +45,9 @@ export async function _operationStatusGetDeserialize( ): Promise { const expectedStatuses = ["200"]; if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; } return operationStatusResultDeserializer(result.body); @@ -44,17 +56,10 @@ export async function _operationStatusGetDeserialize( /** Returns the current status of an async operation. */ export async function operationStatusGet( context: Client, - subscriptionId: string, location: string, operationId: string, options: OperationStatusGetOptionalParams = { requestOptions: {} }, ): Promise { - const result = await _operationStatusGetSend( - context, - subscriptionId, - location, - operationId, - options, - ); + const result = await _operationStatusGetSend(context, location, operationId, options); return _operationStatusGetDeserialize(result); } diff --git a/sdk/deviceregistry/arm-deviceregistry/src/api/operations/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/api/operations/index.ts index 417ac844c11..7aa34f055a7 100644 --- a/sdk/deviceregistry/arm-deviceregistry/src/api/operations/index.ts +++ b/sdk/deviceregistry/arm-deviceregistry/src/api/operations/index.ts @@ -6,6 +6,7 @@ import { OperationsListOptionalParams, } from "../index.js"; import { + errorResponseDeserializer, _OperationListResult, _operationListResultDeserializer, Operation, @@ -25,9 +26,14 @@ export function _operationsListSend( context: Client, options: OperationsListOptionalParams = { requestOptions: {} }, ): StreamableMethod { - return context - .path("/providers/Microsoft.DeviceRegistry/operations") - .get({ ...operationOptionsToRequestParameters(options) }); + return context.path("/providers/Microsoft.DeviceRegistry/operations").get({ + ...operationOptionsToRequestParameters(options), + headers: { + accept: "application/json", + ...options.requestOptions?.headers, + }, + queryParameters: { "api-version": context.apiVersion }, + }); } export async function _operationsListDeserialize( @@ -35,7 +41,9 @@ export async function _operationsListDeserialize( ): Promise<_OperationListResult> { const expectedStatuses = ["200"]; if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); + const error = createRestError(result); + error.details = errorResponseDeserializer(result.body); + throw error; } return _operationListResultDeserializer(result.body); diff --git a/sdk/deviceregistry/arm-deviceregistry/src/api/options.ts b/sdk/deviceregistry/arm-deviceregistry/src/api/options.ts index 66c2f00f80c..0daf99a1805 100644 --- a/sdk/deviceregistry/arm-deviceregistry/src/api/options.ts +++ b/sdk/deviceregistry/arm-deviceregistry/src/api/options.ts @@ -3,176 +3,68 @@ import { OperationOptions } from "@azure-rest/core-client"; -/** Optional parameters. */ -export interface OperationsListOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface OperationStatusGetOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface AssetsGetOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface AssetsCreateOrReplaceOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface AssetsUpdateOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface AssetsDeleteOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface AssetsListByResourceGroupOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface AssetsListBySubscriptionOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface AssetEndpointProfilesGetOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface AssetEndpointProfilesCreateOrReplaceOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface AssetEndpointProfilesUpdateOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface AssetEndpointProfilesDeleteOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface AssetEndpointProfilesListByResourceGroupOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface AssetEndpointProfilesListBySubscriptionOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface BillingContainersGetOptionalParams extends OperationOptions {} - /** Optional parameters. */ export interface BillingContainersListBySubscriptionOptionalParams extends OperationOptions {} /** Optional parameters. */ -export interface DiscoveredAssetsGetOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface DiscoveredAssetsCreateOrReplaceOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface DiscoveredAssetsUpdateOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface DiscoveredAssetsDeleteOptionalParams extends OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; -} - -/** Optional parameters. */ -export interface DiscoveredAssetsListByResourceGroupOptionalParams extends OperationOptions {} +export interface BillingContainersGetOptionalParams extends OperationOptions {} /** Optional parameters. */ -export interface DiscoveredAssetsListBySubscriptionOptionalParams extends OperationOptions {} +export interface AssetEndpointProfilesListBySubscriptionOptionalParams extends OperationOptions {} /** Optional parameters. */ -export interface DiscoveredAssetEndpointProfilesGetOptionalParams extends OperationOptions {} +export interface AssetEndpointProfilesListByResourceGroupOptionalParams extends OperationOptions {} /** Optional parameters. */ -export interface DiscoveredAssetEndpointProfilesCreateOrReplaceOptionalParams - extends OperationOptions { +export interface AssetEndpointProfilesDeleteOptionalParams extends OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; } /** Optional parameters. */ -export interface DiscoveredAssetEndpointProfilesUpdateOptionalParams extends OperationOptions { +export interface AssetEndpointProfilesUpdateOptionalParams extends OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; } /** Optional parameters. */ -export interface DiscoveredAssetEndpointProfilesDeleteOptionalParams extends OperationOptions { +export interface AssetEndpointProfilesCreateOrReplaceOptionalParams extends OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; } /** Optional parameters. */ -export interface DiscoveredAssetEndpointProfilesListByResourceGroupOptionalParams - extends OperationOptions {} +export interface AssetEndpointProfilesGetOptionalParams extends OperationOptions {} /** Optional parameters. */ -export interface DiscoveredAssetEndpointProfilesListBySubscriptionOptionalParams - extends OperationOptions {} +export interface AssetsListBySubscriptionOptionalParams extends OperationOptions {} /** Optional parameters. */ -export interface SchemaRegistriesGetOptionalParams extends OperationOptions {} +export interface AssetsListByResourceGroupOptionalParams extends OperationOptions {} /** Optional parameters. */ -export interface SchemaRegistriesCreateOrReplaceOptionalParams extends OperationOptions { +export interface AssetsDeleteOptionalParams extends OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; } /** Optional parameters. */ -export interface SchemaRegistriesUpdateOptionalParams extends OperationOptions { +export interface AssetsUpdateOptionalParams extends OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; } /** Optional parameters. */ -export interface SchemaRegistriesDeleteOptionalParams extends OperationOptions { +export interface AssetsCreateOrReplaceOptionalParams extends OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; } /** Optional parameters. */ -export interface SchemaRegistriesListByResourceGroupOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface SchemaRegistriesListBySubscriptionOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface SchemasGetOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface SchemasCreateOrReplaceOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface SchemasDeleteOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface SchemasListBySchemaRegistryOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface SchemaVersionsGetOptionalParams extends OperationOptions {} - -/** Optional parameters. */ -export interface SchemaVersionsCreateOrReplaceOptionalParams extends OperationOptions {} +export interface AssetsGetOptionalParams extends OperationOptions {} /** Optional parameters. */ -export interface SchemaVersionsDeleteOptionalParams extends OperationOptions {} +export interface OperationStatusGetOptionalParams extends OperationOptions {} /** Optional parameters. */ -export interface SchemaVersionsListBySchemaOptionalParams extends OperationOptions {} +export interface OperationsListOptionalParams extends OperationOptions {} diff --git a/sdk/deviceregistry/arm-deviceregistry/src/api/schemaRegistries/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/api/schemaRegistries/index.ts deleted file mode 100644 index e8a38a57f31..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/src/api/schemaRegistries/index.ts +++ /dev/null @@ -1,343 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { - DeviceRegistryManagementContext as Client, - SchemaRegistriesCreateOrReplaceOptionalParams, - SchemaRegistriesDeleteOptionalParams, - SchemaRegistriesGetOptionalParams, - SchemaRegistriesListByResourceGroupOptionalParams, - SchemaRegistriesListBySubscriptionOptionalParams, - SchemaRegistriesUpdateOptionalParams, -} from "../index.js"; -import { - SchemaRegistry, - schemaRegistrySerializer, - schemaRegistryDeserializer, - SchemaRegistryUpdate, - schemaRegistryUpdateSerializer, - _SchemaRegistryListResult, - _schemaRegistryListResultDeserializer, -} from "../../models/models.js"; -import { getLongRunningPoller } from "../../static-helpers/pollingHelpers.js"; -import { - PagedAsyncIterableIterator, - buildPagedAsyncIterator, -} from "../../static-helpers/pagingHelpers.js"; -import { - StreamableMethod, - PathUncheckedResponse, - createRestError, - operationOptionsToRequestParameters, -} from "@azure-rest/core-client"; -import { PollerLike, OperationState } from "@azure/core-lro"; - -export function _schemaRegistriesGetSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - options: SchemaRegistriesGetOptionalParams = { requestOptions: {} }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}", - subscriptionId, - resourceGroupName, - schemaRegistryName, - ) - .get({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _schemaRegistriesGetDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return schemaRegistryDeserializer(result.body); -} - -/** Get a SchemaRegistry */ -export async function schemaRegistriesGet( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - options: SchemaRegistriesGetOptionalParams = { requestOptions: {} }, -): Promise { - const result = await _schemaRegistriesGetSend( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - options, - ); - return _schemaRegistriesGetDeserialize(result); -} - -export function _schemaRegistriesCreateOrReplaceSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - resource: SchemaRegistry, - options: SchemaRegistriesCreateOrReplaceOptionalParams = { - requestOptions: {}, - }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}", - subscriptionId, - resourceGroupName, - schemaRegistryName, - ) - .put({ - ...operationOptionsToRequestParameters(options), - body: schemaRegistrySerializer(resource), - }); -} - -export async function _schemaRegistriesCreateOrReplaceDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["200", "201"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return schemaRegistryDeserializer(result.body); -} - -/** Create a SchemaRegistry */ -export function schemaRegistriesCreateOrReplace( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - resource: SchemaRegistry, - options: SchemaRegistriesCreateOrReplaceOptionalParams = { - requestOptions: {}, - }, -): PollerLike, SchemaRegistry> { - return getLongRunningPoller( - context, - _schemaRegistriesCreateOrReplaceDeserialize, - ["200", "201"], - { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _schemaRegistriesCreateOrReplaceSend( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - resource, - options, - ), - resourceLocationConfig: "azure-async-operation", - }, - ) as PollerLike, SchemaRegistry>; -} - -export function _schemaRegistriesUpdateSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - properties: SchemaRegistryUpdate, - options: SchemaRegistriesUpdateOptionalParams = { requestOptions: {} }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}", - subscriptionId, - resourceGroupName, - schemaRegistryName, - ) - .patch({ - ...operationOptionsToRequestParameters(options), - body: schemaRegistryUpdateSerializer(properties), - }); -} - -export async function _schemaRegistriesUpdateDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["200", "202"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return schemaRegistryDeserializer(result.body); -} - -/** Update a SchemaRegistry */ -export function schemaRegistriesUpdate( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - properties: SchemaRegistryUpdate, - options: SchemaRegistriesUpdateOptionalParams = { requestOptions: {} }, -): PollerLike, SchemaRegistry> { - return getLongRunningPoller(context, _schemaRegistriesUpdateDeserialize, ["200", "202"], { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _schemaRegistriesUpdateSend( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - properties, - options, - ), - resourceLocationConfig: "location", - }) as PollerLike, SchemaRegistry>; -} - -export function _schemaRegistriesDeleteSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - options: SchemaRegistriesDeleteOptionalParams = { requestOptions: {} }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}", - subscriptionId, - resourceGroupName, - schemaRegistryName, - ) - .delete({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _schemaRegistriesDeleteDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["202", "204", "200"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return; -} - -/** Delete a SchemaRegistry */ -export function schemaRegistriesDelete( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - options: SchemaRegistriesDeleteOptionalParams = { requestOptions: {} }, -): PollerLike, void> { - return getLongRunningPoller(context, _schemaRegistriesDeleteDeserialize, ["202", "204", "200"], { - updateIntervalInMs: options?.updateIntervalInMs, - abortSignal: options?.abortSignal, - getInitialResponse: () => - _schemaRegistriesDeleteSend( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - options, - ), - resourceLocationConfig: "location", - }) as PollerLike, void>; -} - -export function _schemaRegistriesListByResourceGroupSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - options: SchemaRegistriesListByResourceGroupOptionalParams = { - requestOptions: {}, - }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries", - subscriptionId, - resourceGroupName, - ) - .get({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _schemaRegistriesListByResourceGroupDeserialize( - result: PathUncheckedResponse, -): Promise<_SchemaRegistryListResult> { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return _schemaRegistryListResultDeserializer(result.body); -} - -/** List SchemaRegistry resources by resource group */ -export function schemaRegistriesListByResourceGroup( - context: Client, - subscriptionId: string, - resourceGroupName: string, - options: SchemaRegistriesListByResourceGroupOptionalParams = { - requestOptions: {}, - }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( - context, - () => - _schemaRegistriesListByResourceGroupSend(context, subscriptionId, resourceGroupName, options), - _schemaRegistriesListByResourceGroupDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, - ); -} - -export function _schemaRegistriesListBySubscriptionSend( - context: Client, - subscriptionId: string, - options: SchemaRegistriesListBySubscriptionOptionalParams = { - requestOptions: {}, - }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/providers/Microsoft.DeviceRegistry/schemaRegistries", - subscriptionId, - ) - .get({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _schemaRegistriesListBySubscriptionDeserialize( - result: PathUncheckedResponse, -): Promise<_SchemaRegistryListResult> { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return _schemaRegistryListResultDeserializer(result.body); -} - -/** List SchemaRegistry resources by subscription ID */ -export function schemaRegistriesListBySubscription( - context: Client, - subscriptionId: string, - options: SchemaRegistriesListBySubscriptionOptionalParams = { - requestOptions: {}, - }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( - context, - () => _schemaRegistriesListBySubscriptionSend(context, subscriptionId, options), - _schemaRegistriesListBySubscriptionDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, - ); -} diff --git a/sdk/deviceregistry/arm-deviceregistry/src/api/schemaVersions/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/api/schemaVersions/index.ts deleted file mode 100644 index 441580b2629..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/src/api/schemaVersions/index.ts +++ /dev/null @@ -1,251 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { - DeviceRegistryManagementContext as Client, - SchemaVersionsCreateOrReplaceOptionalParams, - SchemaVersionsDeleteOptionalParams, - SchemaVersionsGetOptionalParams, - SchemaVersionsListBySchemaOptionalParams, -} from "../index.js"; -import { - SchemaVersion, - schemaVersionSerializer, - schemaVersionDeserializer, - _SchemaVersionListResult, - _schemaVersionListResultDeserializer, -} from "../../models/models.js"; -import { - PagedAsyncIterableIterator, - buildPagedAsyncIterator, -} from "../../static-helpers/pagingHelpers.js"; -import { - StreamableMethod, - PathUncheckedResponse, - createRestError, - operationOptionsToRequestParameters, -} from "@azure-rest/core-client"; - -export function _schemaVersionsGetSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - schemaVersionName: string, - options: SchemaVersionsGetOptionalParams = { requestOptions: {} }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - schemaVersionName, - ) - .get({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _schemaVersionsGetDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return schemaVersionDeserializer(result.body); -} - -/** Get a SchemaVersion */ -export async function schemaVersionsGet( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - schemaVersionName: string, - options: SchemaVersionsGetOptionalParams = { requestOptions: {} }, -): Promise { - const result = await _schemaVersionsGetSend( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - schemaVersionName, - options, - ); - return _schemaVersionsGetDeserialize(result); -} - -export function _schemaVersionsCreateOrReplaceSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - schemaVersionName: string, - resource: SchemaVersion, - options: SchemaVersionsCreateOrReplaceOptionalParams = { requestOptions: {} }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - schemaVersionName, - ) - .put({ - ...operationOptionsToRequestParameters(options), - body: schemaVersionSerializer(resource), - }); -} - -export async function _schemaVersionsCreateOrReplaceDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["200", "201"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return schemaVersionDeserializer(result.body); -} - -/** Create a SchemaVersion */ -export async function schemaVersionsCreateOrReplace( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - schemaVersionName: string, - resource: SchemaVersion, - options: SchemaVersionsCreateOrReplaceOptionalParams = { requestOptions: {} }, -): Promise { - const result = await _schemaVersionsCreateOrReplaceSend( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - schemaVersionName, - resource, - options, - ); - return _schemaVersionsCreateOrReplaceDeserialize(result); -} - -export function _schemaVersionsDeleteSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - schemaVersionName: string, - options: SchemaVersionsDeleteOptionalParams = { requestOptions: {} }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions/{schemaVersionName}", - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - schemaVersionName, - ) - .delete({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _schemaVersionsDeleteDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["200", "204"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return; -} - -/** Delete a SchemaVersion */ -export async function schemaVersionsDelete( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - schemaVersionName: string, - options: SchemaVersionsDeleteOptionalParams = { requestOptions: {} }, -): Promise { - const result = await _schemaVersionsDeleteSend( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - schemaVersionName, - options, - ); - return _schemaVersionsDeleteDeserialize(result); -} - -export function _schemaVersionsListBySchemaSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - options: SchemaVersionsListBySchemaOptionalParams = { requestOptions: {} }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}/schemaVersions", - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - ) - .get({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _schemaVersionsListBySchemaDeserialize( - result: PathUncheckedResponse, -): Promise<_SchemaVersionListResult> { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return _schemaVersionListResultDeserializer(result.body); -} - -/** List SchemaVersion resources by Schema */ -export function schemaVersionsListBySchema( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - options: SchemaVersionsListBySchemaOptionalParams = { requestOptions: {} }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( - context, - () => - _schemaVersionsListBySchemaSend( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - options, - ), - _schemaVersionsListBySchemaDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, - ); -} diff --git a/sdk/deviceregistry/arm-deviceregistry/src/api/schemas/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/api/schemas/index.ts deleted file mode 100644 index 02e6987dea3..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/src/api/schemas/index.ts +++ /dev/null @@ -1,231 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { - DeviceRegistryManagementContext as Client, - SchemasCreateOrReplaceOptionalParams, - SchemasDeleteOptionalParams, - SchemasGetOptionalParams, - SchemasListBySchemaRegistryOptionalParams, -} from "../index.js"; -import { - Schema, - schemaSerializer, - schemaDeserializer, - _SchemaListResult, - _schemaListResultDeserializer, -} from "../../models/models.js"; -import { - PagedAsyncIterableIterator, - buildPagedAsyncIterator, -} from "../../static-helpers/pagingHelpers.js"; -import { - StreamableMethod, - PathUncheckedResponse, - createRestError, - operationOptionsToRequestParameters, -} from "@azure-rest/core-client"; - -export function _schemasGetSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - options: SchemasGetOptionalParams = { requestOptions: {} }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - ) - .get({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _schemasGetDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return schemaDeserializer(result.body); -} - -/** Get a Schema */ -export async function schemasGet( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - options: SchemasGetOptionalParams = { requestOptions: {} }, -): Promise { - const result = await _schemasGetSend( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - options, - ); - return _schemasGetDeserialize(result); -} - -export function _schemasCreateOrReplaceSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - resource: Schema, - options: SchemasCreateOrReplaceOptionalParams = { requestOptions: {} }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - ) - .put({ - ...operationOptionsToRequestParameters(options), - body: schemaSerializer(resource), - }); -} - -export async function _schemasCreateOrReplaceDeserialize( - result: PathUncheckedResponse, -): Promise { - const expectedStatuses = ["200", "201"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return schemaDeserializer(result.body); -} - -/** Create a Schema */ -export async function schemasCreateOrReplace( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - resource: Schema, - options: SchemasCreateOrReplaceOptionalParams = { requestOptions: {} }, -): Promise { - const result = await _schemasCreateOrReplaceSend( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - resource, - options, - ); - return _schemasCreateOrReplaceDeserialize(result); -} - -export function _schemasDeleteSend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - options: SchemasDeleteOptionalParams = { requestOptions: {} }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas/{schemaName}", - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - ) - .delete({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _schemasDeleteDeserialize(result: PathUncheckedResponse): Promise { - const expectedStatuses = ["200", "204"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return; -} - -/** Delete a Schema */ -export async function schemasDelete( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - options: SchemasDeleteOptionalParams = { requestOptions: {} }, -): Promise { - const result = await _schemasDeleteSend( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - options, - ); - return _schemasDeleteDeserialize(result); -} - -export function _schemasListBySchemaRegistrySend( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - options: SchemasListBySchemaRegistryOptionalParams = { requestOptions: {} }, -): StreamableMethod { - return context - .path( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}/schemas", - subscriptionId, - resourceGroupName, - schemaRegistryName, - ) - .get({ ...operationOptionsToRequestParameters(options) }); -} - -export async function _schemasListBySchemaRegistryDeserialize( - result: PathUncheckedResponse, -): Promise<_SchemaListResult> { - const expectedStatuses = ["200"]; - if (!expectedStatuses.includes(result.status)) { - throw createRestError(result); - } - - return _schemaListResultDeserializer(result.body); -} - -/** List Schema resources by SchemaRegistry */ -export function schemasListBySchemaRegistry( - context: Client, - subscriptionId: string, - resourceGroupName: string, - schemaRegistryName: string, - options: SchemasListBySchemaRegistryOptionalParams = { requestOptions: {} }, -): PagedAsyncIterableIterator { - return buildPagedAsyncIterator( - context, - () => - _schemasListBySchemaRegistrySend( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - options, - ), - _schemasListBySchemaRegistryDeserialize, - ["200"], - { itemName: "value", nextLinkName: "nextLink" }, - ); -} diff --git a/sdk/deviceregistry/arm-deviceregistry/src/classic/assetEndpointProfiles/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/classic/assetEndpointProfiles/index.ts index d95f640203b..d0f3a65e708 100644 --- a/sdk/deviceregistry/arm-deviceregistry/src/classic/assetEndpointProfiles/index.ts +++ b/sdk/deviceregistry/arm-deviceregistry/src/classic/assetEndpointProfiles/index.ts @@ -3,40 +3,42 @@ import { DeviceRegistryManagementContext } from "../../api/deviceRegistryManagementContext.js"; import { - assetEndpointProfilesGet, - assetEndpointProfilesCreateOrReplace, - assetEndpointProfilesUpdate, - assetEndpointProfilesDelete, - assetEndpointProfilesListByResourceGroup, assetEndpointProfilesListBySubscription, + assetEndpointProfilesListByResourceGroup, + assetEndpointProfilesDelete, + assetEndpointProfilesUpdate, + assetEndpointProfilesCreateOrReplace, + assetEndpointProfilesGet, } from "../../api/assetEndpointProfiles/index.js"; import { AssetEndpointProfile, AssetEndpointProfileUpdate } from "../../models/models.js"; import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; import { PollerLike, OperationState } from "@azure/core-lro"; import { - AssetEndpointProfilesGetOptionalParams, - AssetEndpointProfilesCreateOrReplaceOptionalParams, - AssetEndpointProfilesUpdateOptionalParams, - AssetEndpointProfilesDeleteOptionalParams, - AssetEndpointProfilesListByResourceGroupOptionalParams, AssetEndpointProfilesListBySubscriptionOptionalParams, + AssetEndpointProfilesListByResourceGroupOptionalParams, + AssetEndpointProfilesDeleteOptionalParams, + AssetEndpointProfilesUpdateOptionalParams, + AssetEndpointProfilesCreateOrReplaceOptionalParams, + AssetEndpointProfilesGetOptionalParams, } from "../../api/options.js"; /** Interface representing a AssetEndpointProfiles operations. */ export interface AssetEndpointProfilesOperations { - /** Get a AssetEndpointProfile */ - get: ( + /** List AssetEndpointProfile resources by subscription ID */ + listBySubscription: ( + options?: AssetEndpointProfilesListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** List AssetEndpointProfile resources by resource group */ + listByResourceGroup: ( resourceGroupName: string, - assetEndpointProfileName: string, - options?: AssetEndpointProfilesGetOptionalParams, - ) => Promise; - /** Create a AssetEndpointProfile */ - createOrReplace: ( + options?: AssetEndpointProfilesListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a AssetEndpointProfile */ + delete: ( resourceGroupName: string, assetEndpointProfileName: string, - resource: AssetEndpointProfile, - options?: AssetEndpointProfilesCreateOrReplaceOptionalParams, - ) => PollerLike, AssetEndpointProfile>; + options?: AssetEndpointProfilesDeleteOptionalParams, + ) => PollerLike, void>; /** Update a AssetEndpointProfile */ update: ( resourceGroupName: string, @@ -44,54 +46,34 @@ export interface AssetEndpointProfilesOperations { properties: AssetEndpointProfileUpdate, options?: AssetEndpointProfilesUpdateOptionalParams, ) => PollerLike, AssetEndpointProfile>; - /** Delete a AssetEndpointProfile */ - delete: ( + /** Create a AssetEndpointProfile */ + createOrReplace: ( resourceGroupName: string, assetEndpointProfileName: string, - options?: AssetEndpointProfilesDeleteOptionalParams, - ) => PollerLike, void>; - /** List AssetEndpointProfile resources by resource group */ - listByResourceGroup: ( + resource: AssetEndpointProfile, + options?: AssetEndpointProfilesCreateOrReplaceOptionalParams, + ) => PollerLike, AssetEndpointProfile>; + /** Get a AssetEndpointProfile */ + get: ( resourceGroupName: string, - options?: AssetEndpointProfilesListByResourceGroupOptionalParams, - ) => PagedAsyncIterableIterator; - /** List AssetEndpointProfile resources by subscription ID */ - listBySubscription: ( - options?: AssetEndpointProfilesListBySubscriptionOptionalParams, - ) => PagedAsyncIterableIterator; + assetEndpointProfileName: string, + options?: AssetEndpointProfilesGetOptionalParams, + ) => Promise; } -export function getAssetEndpointProfiles( - context: DeviceRegistryManagementContext, - subscriptionId: string, -) { +function _getAssetEndpointProfiles(context: DeviceRegistryManagementContext) { return { - get: ( + listBySubscription: (options?: AssetEndpointProfilesListBySubscriptionOptionalParams) => + assetEndpointProfilesListBySubscription(context, options), + listByResourceGroup: ( resourceGroupName: string, - assetEndpointProfileName: string, - options?: AssetEndpointProfilesGetOptionalParams, - ) => - assetEndpointProfilesGet( - context, - subscriptionId, - resourceGroupName, - assetEndpointProfileName, - options, - ), - createOrReplace: ( + options?: AssetEndpointProfilesListByResourceGroupOptionalParams, + ) => assetEndpointProfilesListByResourceGroup(context, resourceGroupName, options), + delete: ( resourceGroupName: string, assetEndpointProfileName: string, - resource: AssetEndpointProfile, - options?: AssetEndpointProfilesCreateOrReplaceOptionalParams, - ) => - assetEndpointProfilesCreateOrReplace( - context, - subscriptionId, - resourceGroupName, - assetEndpointProfileName, - resource, - options, - ), + options?: AssetEndpointProfilesDeleteOptionalParams, + ) => assetEndpointProfilesDelete(context, resourceGroupName, assetEndpointProfileName, options), update: ( resourceGroupName: string, assetEndpointProfileName: string, @@ -100,39 +82,36 @@ export function getAssetEndpointProfiles( ) => assetEndpointProfilesUpdate( context, - subscriptionId, resourceGroupName, assetEndpointProfileName, properties, options, ), - delete: ( + createOrReplace: ( resourceGroupName: string, assetEndpointProfileName: string, - options?: AssetEndpointProfilesDeleteOptionalParams, + resource: AssetEndpointProfile, + options?: AssetEndpointProfilesCreateOrReplaceOptionalParams, ) => - assetEndpointProfilesDelete( + assetEndpointProfilesCreateOrReplace( context, - subscriptionId, resourceGroupName, assetEndpointProfileName, + resource, options, ), - listByResourceGroup: ( + get: ( resourceGroupName: string, - options?: AssetEndpointProfilesListByResourceGroupOptionalParams, - ) => - assetEndpointProfilesListByResourceGroup(context, subscriptionId, resourceGroupName, options), - listBySubscription: (options?: AssetEndpointProfilesListBySubscriptionOptionalParams) => - assetEndpointProfilesListBySubscription(context, subscriptionId, options), + assetEndpointProfileName: string, + options?: AssetEndpointProfilesGetOptionalParams, + ) => assetEndpointProfilesGet(context, resourceGroupName, assetEndpointProfileName, options), }; } -export function getAssetEndpointProfilesOperations( +export function _getAssetEndpointProfilesOperations( context: DeviceRegistryManagementContext, - subscriptionId: string, ): AssetEndpointProfilesOperations { return { - ...getAssetEndpointProfiles(context, subscriptionId), + ..._getAssetEndpointProfiles(context), }; } diff --git a/sdk/deviceregistry/arm-deviceregistry/src/classic/assets/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/classic/assets/index.ts index 895744a2285..1845011b316 100644 --- a/sdk/deviceregistry/arm-deviceregistry/src/classic/assets/index.ts +++ b/sdk/deviceregistry/arm-deviceregistry/src/classic/assets/index.ts @@ -3,40 +3,42 @@ import { DeviceRegistryManagementContext } from "../../api/deviceRegistryManagementContext.js"; import { - assetsGet, - assetsCreateOrReplace, - assetsUpdate, - assetsDelete, - assetsListByResourceGroup, assetsListBySubscription, + assetsListByResourceGroup, + assetsDelete, + assetsUpdate, + assetsCreateOrReplace, + assetsGet, } from "../../api/assets/index.js"; import { Asset, AssetUpdate } from "../../models/models.js"; import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; import { PollerLike, OperationState } from "@azure/core-lro"; import { - AssetsGetOptionalParams, - AssetsCreateOrReplaceOptionalParams, - AssetsUpdateOptionalParams, - AssetsDeleteOptionalParams, - AssetsListByResourceGroupOptionalParams, AssetsListBySubscriptionOptionalParams, + AssetsListByResourceGroupOptionalParams, + AssetsDeleteOptionalParams, + AssetsUpdateOptionalParams, + AssetsCreateOrReplaceOptionalParams, + AssetsGetOptionalParams, } from "../../api/options.js"; /** Interface representing a Assets operations. */ export interface AssetsOperations { - /** Get a Asset */ - get: ( + /** List Asset resources by subscription ID */ + listBySubscription: ( + options?: AssetsListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; + /** List Asset resources by resource group */ + listByResourceGroup: ( resourceGroupName: string, - assetName: string, - options?: AssetsGetOptionalParams, - ) => Promise; - /** Create a Asset */ - createOrReplace: ( + options?: AssetsListByResourceGroupOptionalParams, + ) => PagedAsyncIterableIterator; + /** Delete a Asset */ + delete: ( resourceGroupName: string, assetName: string, - resource: Asset, - options?: AssetsCreateOrReplaceOptionalParams, - ) => PollerLike, Asset>; + options?: AssetsDeleteOptionalParams, + ) => PollerLike, void>; /** Update a Asset */ update: ( resourceGroupName: string, @@ -44,63 +46,50 @@ export interface AssetsOperations { properties: AssetUpdate, options?: AssetsUpdateOptionalParams, ) => PollerLike, Asset>; - /** Delete a Asset */ - delete: ( + /** Create a Asset */ + createOrReplace: ( resourceGroupName: string, assetName: string, - options?: AssetsDeleteOptionalParams, - ) => PollerLike, void>; - /** List Asset resources by resource group */ - listByResourceGroup: ( + resource: Asset, + options?: AssetsCreateOrReplaceOptionalParams, + ) => PollerLike, Asset>; + /** Get a Asset */ + get: ( resourceGroupName: string, - options?: AssetsListByResourceGroupOptionalParams, - ) => PagedAsyncIterableIterator; - /** List Asset resources by subscription ID */ - listBySubscription: ( - options?: AssetsListBySubscriptionOptionalParams, - ) => PagedAsyncIterableIterator; + assetName: string, + options?: AssetsGetOptionalParams, + ) => Promise; } -export function getAssets(context: DeviceRegistryManagementContext, subscriptionId: string) { +function _getAssets(context: DeviceRegistryManagementContext) { return { - get: (resourceGroupName: string, assetName: string, options?: AssetsGetOptionalParams) => - assetsGet(context, subscriptionId, resourceGroupName, assetName, options), - createOrReplace: ( + listBySubscription: (options?: AssetsListBySubscriptionOptionalParams) => + assetsListBySubscription(context, options), + listByResourceGroup: ( resourceGroupName: string, - assetName: string, - resource: Asset, - options?: AssetsCreateOrReplaceOptionalParams, - ) => - assetsCreateOrReplace( - context, - subscriptionId, - resourceGroupName, - assetName, - resource, - options, - ), + options?: AssetsListByResourceGroupOptionalParams, + ) => assetsListByResourceGroup(context, resourceGroupName, options), + delete: (resourceGroupName: string, assetName: string, options?: AssetsDeleteOptionalParams) => + assetsDelete(context, resourceGroupName, assetName, options), update: ( resourceGroupName: string, assetName: string, properties: AssetUpdate, options?: AssetsUpdateOptionalParams, - ) => assetsUpdate(context, subscriptionId, resourceGroupName, assetName, properties, options), - delete: (resourceGroupName: string, assetName: string, options?: AssetsDeleteOptionalParams) => - assetsDelete(context, subscriptionId, resourceGroupName, assetName, options), - listByResourceGroup: ( + ) => assetsUpdate(context, resourceGroupName, assetName, properties, options), + createOrReplace: ( resourceGroupName: string, - options?: AssetsListByResourceGroupOptionalParams, - ) => assetsListByResourceGroup(context, subscriptionId, resourceGroupName, options), - listBySubscription: (options?: AssetsListBySubscriptionOptionalParams) => - assetsListBySubscription(context, subscriptionId, options), + assetName: string, + resource: Asset, + options?: AssetsCreateOrReplaceOptionalParams, + ) => assetsCreateOrReplace(context, resourceGroupName, assetName, resource, options), + get: (resourceGroupName: string, assetName: string, options?: AssetsGetOptionalParams) => + assetsGet(context, resourceGroupName, assetName, options), }; } -export function getAssetsOperations( - context: DeviceRegistryManagementContext, - subscriptionId: string, -): AssetsOperations { +export function _getAssetsOperations(context: DeviceRegistryManagementContext): AssetsOperations { return { - ...getAssets(context, subscriptionId), + ..._getAssets(context), }; } diff --git a/sdk/deviceregistry/arm-deviceregistry/src/classic/billingContainers/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/classic/billingContainers/index.ts index c93104da6fe..6afd4b47827 100644 --- a/sdk/deviceregistry/arm-deviceregistry/src/classic/billingContainers/index.ts +++ b/sdk/deviceregistry/arm-deviceregistry/src/classic/billingContainers/index.ts @@ -3,46 +3,42 @@ import { DeviceRegistryManagementContext } from "../../api/deviceRegistryManagementContext.js"; import { - billingContainersGet, billingContainersListBySubscription, + billingContainersGet, } from "../../api/billingContainers/index.js"; import { BillingContainer } from "../../models/models.js"; import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; import { - BillingContainersGetOptionalParams, BillingContainersListBySubscriptionOptionalParams, + BillingContainersGetOptionalParams, } from "../../api/options.js"; /** Interface representing a BillingContainers operations. */ export interface BillingContainersOperations { + /** List BillingContainer resources by subscription ID */ + listBySubscription: ( + options?: BillingContainersListBySubscriptionOptionalParams, + ) => PagedAsyncIterableIterator; /** Get a BillingContainer */ get: ( billingContainerName: string, options?: BillingContainersGetOptionalParams, ) => Promise; - /** List BillingContainer resources by subscription ID */ - listBySubscription: ( - options?: BillingContainersListBySubscriptionOptionalParams, - ) => PagedAsyncIterableIterator; } -export function getBillingContainers( - context: DeviceRegistryManagementContext, - subscriptionId: string, -) { +function _getBillingContainers(context: DeviceRegistryManagementContext) { return { - get: (billingContainerName: string, options?: BillingContainersGetOptionalParams) => - billingContainersGet(context, subscriptionId, billingContainerName, options), listBySubscription: (options?: BillingContainersListBySubscriptionOptionalParams) => - billingContainersListBySubscription(context, subscriptionId, options), + billingContainersListBySubscription(context, options), + get: (billingContainerName: string, options?: BillingContainersGetOptionalParams) => + billingContainersGet(context, billingContainerName, options), }; } -export function getBillingContainersOperations( +export function _getBillingContainersOperations( context: DeviceRegistryManagementContext, - subscriptionId: string, ): BillingContainersOperations { return { - ...getBillingContainers(context, subscriptionId), + ..._getBillingContainers(context), }; } diff --git a/sdk/deviceregistry/arm-deviceregistry/src/classic/discoveredAssetEndpointProfiles/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/classic/discoveredAssetEndpointProfiles/index.ts deleted file mode 100644 index 2eff295abc9..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/src/classic/discoveredAssetEndpointProfiles/index.ts +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementContext } from "../../api/deviceRegistryManagementContext.js"; -import { - discoveredAssetEndpointProfilesGet, - discoveredAssetEndpointProfilesCreateOrReplace, - discoveredAssetEndpointProfilesUpdate, - discoveredAssetEndpointProfilesDelete, - discoveredAssetEndpointProfilesListByResourceGroup, - discoveredAssetEndpointProfilesListBySubscription, -} from "../../api/discoveredAssetEndpointProfiles/index.js"; -import { - DiscoveredAssetEndpointProfilesGetOptionalParams, - DiscoveredAssetEndpointProfilesCreateOrReplaceOptionalParams, - DiscoveredAssetEndpointProfilesUpdateOptionalParams, - DiscoveredAssetEndpointProfilesDeleteOptionalParams, - DiscoveredAssetEndpointProfilesListByResourceGroupOptionalParams, - DiscoveredAssetEndpointProfilesListBySubscriptionOptionalParams, -} from "../../api/options.js"; -import { - DiscoveredAssetEndpointProfile, - DiscoveredAssetEndpointProfileUpdate, -} from "../../models/models.js"; -import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import { PollerLike, OperationState } from "@azure/core-lro"; - -/** Interface representing a DiscoveredAssetEndpointProfiles operations. */ -export interface DiscoveredAssetEndpointProfilesOperations { - /** Get a DiscoveredAssetEndpointProfile */ - get: ( - resourceGroupName: string, - discoveredAssetEndpointProfileName: string, - options?: DiscoveredAssetEndpointProfilesGetOptionalParams, - ) => Promise; - /** Create a DiscoveredAssetEndpointProfile */ - createOrReplace: ( - resourceGroupName: string, - discoveredAssetEndpointProfileName: string, - resource: DiscoveredAssetEndpointProfile, - options?: DiscoveredAssetEndpointProfilesCreateOrReplaceOptionalParams, - ) => PollerLike, DiscoveredAssetEndpointProfile>; - /** Update a DiscoveredAssetEndpointProfile */ - update: ( - resourceGroupName: string, - discoveredAssetEndpointProfileName: string, - properties: DiscoveredAssetEndpointProfileUpdate, - options?: DiscoveredAssetEndpointProfilesUpdateOptionalParams, - ) => PollerLike, DiscoveredAssetEndpointProfile>; - /** Delete a DiscoveredAssetEndpointProfile */ - delete: ( - resourceGroupName: string, - discoveredAssetEndpointProfileName: string, - options?: DiscoveredAssetEndpointProfilesDeleteOptionalParams, - ) => PollerLike, void>; - /** List DiscoveredAssetEndpointProfile resources by resource group */ - listByResourceGroup: ( - resourceGroupName: string, - options?: DiscoveredAssetEndpointProfilesListByResourceGroupOptionalParams, - ) => PagedAsyncIterableIterator; - /** List DiscoveredAssetEndpointProfile resources by subscription ID */ - listBySubscription: ( - options?: DiscoveredAssetEndpointProfilesListBySubscriptionOptionalParams, - ) => PagedAsyncIterableIterator; -} - -export function getDiscoveredAssetEndpointProfiles( - context: DeviceRegistryManagementContext, - subscriptionId: string, -) { - return { - get: ( - resourceGroupName: string, - discoveredAssetEndpointProfileName: string, - options?: DiscoveredAssetEndpointProfilesGetOptionalParams, - ) => - discoveredAssetEndpointProfilesGet( - context, - subscriptionId, - resourceGroupName, - discoveredAssetEndpointProfileName, - options, - ), - createOrReplace: ( - resourceGroupName: string, - discoveredAssetEndpointProfileName: string, - resource: DiscoveredAssetEndpointProfile, - options?: DiscoveredAssetEndpointProfilesCreateOrReplaceOptionalParams, - ) => - discoveredAssetEndpointProfilesCreateOrReplace( - context, - subscriptionId, - resourceGroupName, - discoveredAssetEndpointProfileName, - resource, - options, - ), - update: ( - resourceGroupName: string, - discoveredAssetEndpointProfileName: string, - properties: DiscoveredAssetEndpointProfileUpdate, - options?: DiscoveredAssetEndpointProfilesUpdateOptionalParams, - ) => - discoveredAssetEndpointProfilesUpdate( - context, - subscriptionId, - resourceGroupName, - discoveredAssetEndpointProfileName, - properties, - options, - ), - delete: ( - resourceGroupName: string, - discoveredAssetEndpointProfileName: string, - options?: DiscoveredAssetEndpointProfilesDeleteOptionalParams, - ) => - discoveredAssetEndpointProfilesDelete( - context, - subscriptionId, - resourceGroupName, - discoveredAssetEndpointProfileName, - options, - ), - listByResourceGroup: ( - resourceGroupName: string, - options?: DiscoveredAssetEndpointProfilesListByResourceGroupOptionalParams, - ) => - discoveredAssetEndpointProfilesListByResourceGroup( - context, - subscriptionId, - resourceGroupName, - options, - ), - listBySubscription: ( - options?: DiscoveredAssetEndpointProfilesListBySubscriptionOptionalParams, - ) => discoveredAssetEndpointProfilesListBySubscription(context, subscriptionId, options), - }; -} - -export function getDiscoveredAssetEndpointProfilesOperations( - context: DeviceRegistryManagementContext, - subscriptionId: string, -): DiscoveredAssetEndpointProfilesOperations { - return { - ...getDiscoveredAssetEndpointProfiles(context, subscriptionId), - }; -} diff --git a/sdk/deviceregistry/arm-deviceregistry/src/classic/discoveredAssets/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/classic/discoveredAssets/index.ts deleted file mode 100644 index 1f9e8ee3353..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/src/classic/discoveredAssets/index.ts +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementContext } from "../../api/deviceRegistryManagementContext.js"; -import { - discoveredAssetsGet, - discoveredAssetsCreateOrReplace, - discoveredAssetsUpdate, - discoveredAssetsDelete, - discoveredAssetsListByResourceGroup, - discoveredAssetsListBySubscription, -} from "../../api/discoveredAssets/index.js"; -import { - DiscoveredAssetsGetOptionalParams, - DiscoveredAssetsCreateOrReplaceOptionalParams, - DiscoveredAssetsUpdateOptionalParams, - DiscoveredAssetsDeleteOptionalParams, - DiscoveredAssetsListByResourceGroupOptionalParams, - DiscoveredAssetsListBySubscriptionOptionalParams, -} from "../../api/options.js"; -import { DiscoveredAsset, DiscoveredAssetUpdate } from "../../models/models.js"; -import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import { PollerLike, OperationState } from "@azure/core-lro"; - -/** Interface representing a DiscoveredAssets operations. */ -export interface DiscoveredAssetsOperations { - /** Get a DiscoveredAsset */ - get: ( - resourceGroupName: string, - discoveredAssetName: string, - options?: DiscoveredAssetsGetOptionalParams, - ) => Promise; - /** Create a DiscoveredAsset */ - createOrReplace: ( - resourceGroupName: string, - discoveredAssetName: string, - resource: DiscoveredAsset, - options?: DiscoveredAssetsCreateOrReplaceOptionalParams, - ) => PollerLike, DiscoveredAsset>; - /** Update a DiscoveredAsset */ - update: ( - resourceGroupName: string, - discoveredAssetName: string, - properties: DiscoveredAssetUpdate, - options?: DiscoveredAssetsUpdateOptionalParams, - ) => PollerLike, DiscoveredAsset>; - /** Delete a DiscoveredAsset */ - delete: ( - resourceGroupName: string, - discoveredAssetName: string, - options?: DiscoveredAssetsDeleteOptionalParams, - ) => PollerLike, void>; - /** List DiscoveredAsset resources by resource group */ - listByResourceGroup: ( - resourceGroupName: string, - options?: DiscoveredAssetsListByResourceGroupOptionalParams, - ) => PagedAsyncIterableIterator; - /** List DiscoveredAsset resources by subscription ID */ - listBySubscription: ( - options?: DiscoveredAssetsListBySubscriptionOptionalParams, - ) => PagedAsyncIterableIterator; -} - -export function getDiscoveredAssets( - context: DeviceRegistryManagementContext, - subscriptionId: string, -) { - return { - get: ( - resourceGroupName: string, - discoveredAssetName: string, - options?: DiscoveredAssetsGetOptionalParams, - ) => - discoveredAssetsGet(context, subscriptionId, resourceGroupName, discoveredAssetName, options), - createOrReplace: ( - resourceGroupName: string, - discoveredAssetName: string, - resource: DiscoveredAsset, - options?: DiscoveredAssetsCreateOrReplaceOptionalParams, - ) => - discoveredAssetsCreateOrReplace( - context, - subscriptionId, - resourceGroupName, - discoveredAssetName, - resource, - options, - ), - update: ( - resourceGroupName: string, - discoveredAssetName: string, - properties: DiscoveredAssetUpdate, - options?: DiscoveredAssetsUpdateOptionalParams, - ) => - discoveredAssetsUpdate( - context, - subscriptionId, - resourceGroupName, - discoveredAssetName, - properties, - options, - ), - delete: ( - resourceGroupName: string, - discoveredAssetName: string, - options?: DiscoveredAssetsDeleteOptionalParams, - ) => - discoveredAssetsDelete( - context, - subscriptionId, - resourceGroupName, - discoveredAssetName, - options, - ), - listByResourceGroup: ( - resourceGroupName: string, - options?: DiscoveredAssetsListByResourceGroupOptionalParams, - ) => discoveredAssetsListByResourceGroup(context, subscriptionId, resourceGroupName, options), - listBySubscription: (options?: DiscoveredAssetsListBySubscriptionOptionalParams) => - discoveredAssetsListBySubscription(context, subscriptionId, options), - }; -} - -export function getDiscoveredAssetsOperations( - context: DeviceRegistryManagementContext, - subscriptionId: string, -): DiscoveredAssetsOperations { - return { - ...getDiscoveredAssets(context, subscriptionId), - }; -} diff --git a/sdk/deviceregistry/arm-deviceregistry/src/classic/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/classic/index.ts index 26cef27446e..5347de45d59 100644 --- a/sdk/deviceregistry/arm-deviceregistry/src/classic/index.ts +++ b/sdk/deviceregistry/arm-deviceregistry/src/classic/index.ts @@ -4,10 +4,5 @@ export { AssetEndpointProfilesOperations } from "./assetEndpointProfiles/index.js"; export { AssetsOperations } from "./assets/index.js"; export { BillingContainersOperations } from "./billingContainers/index.js"; -export { DiscoveredAssetEndpointProfilesOperations } from "./discoveredAssetEndpointProfiles/index.js"; -export { DiscoveredAssetsOperations } from "./discoveredAssets/index.js"; export { OperationsOperations } from "./operations/index.js"; export { OperationStatusOperations } from "./operationStatus/index.js"; -export { SchemaRegistriesOperations } from "./schemaRegistries/index.js"; -export { SchemasOperations } from "./schemas/index.js"; -export { SchemaVersionsOperations } from "./schemaVersions/index.js"; diff --git a/sdk/deviceregistry/arm-deviceregistry/src/classic/operationStatus/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/classic/operationStatus/index.ts index a64b63c9899..a020591d348 100644 --- a/sdk/deviceregistry/arm-deviceregistry/src/classic/operationStatus/index.ts +++ b/sdk/deviceregistry/arm-deviceregistry/src/classic/operationStatus/index.ts @@ -16,21 +16,17 @@ export interface OperationStatusOperations { ) => Promise; } -export function getOperationStatus( - context: DeviceRegistryManagementContext, - subscriptionId: string, -) { +function _getOperationStatus(context: DeviceRegistryManagementContext) { return { get: (location: string, operationId: string, options?: OperationStatusGetOptionalParams) => - operationStatusGet(context, subscriptionId, location, operationId, options), + operationStatusGet(context, location, operationId, options), }; } -export function getOperationStatusOperations( +export function _getOperationStatusOperations( context: DeviceRegistryManagementContext, - subscriptionId: string, ): OperationStatusOperations { return { - ...getOperationStatus(context, subscriptionId), + ..._getOperationStatus(context), }; } diff --git a/sdk/deviceregistry/arm-deviceregistry/src/classic/operations/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/classic/operations/index.ts index 173fa4f5fea..9d963dda90d 100644 --- a/sdk/deviceregistry/arm-deviceregistry/src/classic/operations/index.ts +++ b/sdk/deviceregistry/arm-deviceregistry/src/classic/operations/index.ts @@ -13,16 +13,16 @@ export interface OperationsOperations { list: (options?: OperationsListOptionalParams) => PagedAsyncIterableIterator; } -export function getOperations(context: DeviceRegistryManagementContext) { +function _getOperations(context: DeviceRegistryManagementContext) { return { list: (options?: OperationsListOptionalParams) => operationsList(context, options), }; } -export function getOperationsOperations( +export function _getOperationsOperations( context: DeviceRegistryManagementContext, ): OperationsOperations { return { - ...getOperations(context), + ..._getOperations(context), }; } diff --git a/sdk/deviceregistry/arm-deviceregistry/src/classic/schemaRegistries/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/classic/schemaRegistries/index.ts deleted file mode 100644 index 36b541503ed..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/src/classic/schemaRegistries/index.ts +++ /dev/null @@ -1,131 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementContext } from "../../api/deviceRegistryManagementContext.js"; -import { - SchemaRegistriesGetOptionalParams, - SchemaRegistriesCreateOrReplaceOptionalParams, - SchemaRegistriesUpdateOptionalParams, - SchemaRegistriesDeleteOptionalParams, - SchemaRegistriesListByResourceGroupOptionalParams, - SchemaRegistriesListBySubscriptionOptionalParams, -} from "../../api/options.js"; -import { - schemaRegistriesGet, - schemaRegistriesCreateOrReplace, - schemaRegistriesUpdate, - schemaRegistriesDelete, - schemaRegistriesListByResourceGroup, - schemaRegistriesListBySubscription, -} from "../../api/schemaRegistries/index.js"; -import { SchemaRegistry, SchemaRegistryUpdate } from "../../models/models.js"; -import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; -import { PollerLike, OperationState } from "@azure/core-lro"; - -/** Interface representing a SchemaRegistries operations. */ -export interface SchemaRegistriesOperations { - /** Get a SchemaRegistry */ - get: ( - resourceGroupName: string, - schemaRegistryName: string, - options?: SchemaRegistriesGetOptionalParams, - ) => Promise; - /** Create a SchemaRegistry */ - createOrReplace: ( - resourceGroupName: string, - schemaRegistryName: string, - resource: SchemaRegistry, - options?: SchemaRegistriesCreateOrReplaceOptionalParams, - ) => PollerLike, SchemaRegistry>; - /** Update a SchemaRegistry */ - update: ( - resourceGroupName: string, - schemaRegistryName: string, - properties: SchemaRegistryUpdate, - options?: SchemaRegistriesUpdateOptionalParams, - ) => PollerLike, SchemaRegistry>; - /** Delete a SchemaRegistry */ - delete: ( - resourceGroupName: string, - schemaRegistryName: string, - options?: SchemaRegistriesDeleteOptionalParams, - ) => PollerLike, void>; - /** List SchemaRegistry resources by resource group */ - listByResourceGroup: ( - resourceGroupName: string, - options?: SchemaRegistriesListByResourceGroupOptionalParams, - ) => PagedAsyncIterableIterator; - /** List SchemaRegistry resources by subscription ID */ - listBySubscription: ( - options?: SchemaRegistriesListBySubscriptionOptionalParams, - ) => PagedAsyncIterableIterator; -} - -export function getSchemaRegistries( - context: DeviceRegistryManagementContext, - subscriptionId: string, -) { - return { - get: ( - resourceGroupName: string, - schemaRegistryName: string, - options?: SchemaRegistriesGetOptionalParams, - ) => - schemaRegistriesGet(context, subscriptionId, resourceGroupName, schemaRegistryName, options), - createOrReplace: ( - resourceGroupName: string, - schemaRegistryName: string, - resource: SchemaRegistry, - options?: SchemaRegistriesCreateOrReplaceOptionalParams, - ) => - schemaRegistriesCreateOrReplace( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - resource, - options, - ), - update: ( - resourceGroupName: string, - schemaRegistryName: string, - properties: SchemaRegistryUpdate, - options?: SchemaRegistriesUpdateOptionalParams, - ) => - schemaRegistriesUpdate( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - properties, - options, - ), - delete: ( - resourceGroupName: string, - schemaRegistryName: string, - options?: SchemaRegistriesDeleteOptionalParams, - ) => - schemaRegistriesDelete( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - options, - ), - listByResourceGroup: ( - resourceGroupName: string, - options?: SchemaRegistriesListByResourceGroupOptionalParams, - ) => schemaRegistriesListByResourceGroup(context, subscriptionId, resourceGroupName, options), - listBySubscription: (options?: SchemaRegistriesListBySubscriptionOptionalParams) => - schemaRegistriesListBySubscription(context, subscriptionId, options), - }; -} - -export function getSchemaRegistriesOperations( - context: DeviceRegistryManagementContext, - subscriptionId: string, -): SchemaRegistriesOperations { - return { - ...getSchemaRegistries(context, subscriptionId), - }; -} diff --git a/sdk/deviceregistry/arm-deviceregistry/src/classic/schemaVersions/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/classic/schemaVersions/index.ts deleted file mode 100644 index 5a6b9ac3275..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/src/classic/schemaVersions/index.ts +++ /dev/null @@ -1,135 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementContext } from "../../api/deviceRegistryManagementContext.js"; -import { - SchemaVersionsGetOptionalParams, - SchemaVersionsCreateOrReplaceOptionalParams, - SchemaVersionsDeleteOptionalParams, - SchemaVersionsListBySchemaOptionalParams, -} from "../../api/options.js"; -import { - schemaVersionsGet, - schemaVersionsCreateOrReplace, - schemaVersionsDelete, - schemaVersionsListBySchema, -} from "../../api/schemaVersions/index.js"; -import { SchemaVersion } from "../../models/models.js"; -import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; - -/** Interface representing a SchemaVersions operations. */ -export interface SchemaVersionsOperations { - /** Get a SchemaVersion */ - get: ( - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - schemaVersionName: string, - options?: SchemaVersionsGetOptionalParams, - ) => Promise; - /** Create a SchemaVersion */ - createOrReplace: ( - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - schemaVersionName: string, - resource: SchemaVersion, - options?: SchemaVersionsCreateOrReplaceOptionalParams, - ) => Promise; - /** Delete a SchemaVersion */ - delete: ( - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - schemaVersionName: string, - options?: SchemaVersionsDeleteOptionalParams, - ) => Promise; - /** List SchemaVersion resources by Schema */ - listBySchema: ( - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - options?: SchemaVersionsListBySchemaOptionalParams, - ) => PagedAsyncIterableIterator; -} - -export function getSchemaVersions( - context: DeviceRegistryManagementContext, - subscriptionId: string, -) { - return { - get: ( - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - schemaVersionName: string, - options?: SchemaVersionsGetOptionalParams, - ) => - schemaVersionsGet( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - schemaVersionName, - options, - ), - createOrReplace: ( - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - schemaVersionName: string, - resource: SchemaVersion, - options?: SchemaVersionsCreateOrReplaceOptionalParams, - ) => - schemaVersionsCreateOrReplace( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - schemaVersionName, - resource, - options, - ), - delete: ( - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - schemaVersionName: string, - options?: SchemaVersionsDeleteOptionalParams, - ) => - schemaVersionsDelete( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - schemaVersionName, - options, - ), - listBySchema: ( - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - options?: SchemaVersionsListBySchemaOptionalParams, - ) => - schemaVersionsListBySchema( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - options, - ), - }; -} - -export function getSchemaVersionsOperations( - context: DeviceRegistryManagementContext, - subscriptionId: string, -): SchemaVersionsOperations { - return { - ...getSchemaVersions(context, subscriptionId), - }; -} diff --git a/sdk/deviceregistry/arm-deviceregistry/src/classic/schemas/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/classic/schemas/index.ts deleted file mode 100644 index d727e71ce43..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/src/classic/schemas/index.ts +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -import { DeviceRegistryManagementContext } from "../../api/deviceRegistryManagementContext.js"; -import { - SchemasGetOptionalParams, - SchemasCreateOrReplaceOptionalParams, - SchemasDeleteOptionalParams, - SchemasListBySchemaRegistryOptionalParams, -} from "../../api/options.js"; -import { - schemasGet, - schemasCreateOrReplace, - schemasDelete, - schemasListBySchemaRegistry, -} from "../../api/schemas/index.js"; -import { Schema } from "../../models/models.js"; -import { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js"; - -/** Interface representing a Schemas operations. */ -export interface SchemasOperations { - /** Get a Schema */ - get: ( - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - options?: SchemasGetOptionalParams, - ) => Promise; - /** Create a Schema */ - createOrReplace: ( - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - resource: Schema, - options?: SchemasCreateOrReplaceOptionalParams, - ) => Promise; - /** Delete a Schema */ - delete: ( - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - options?: SchemasDeleteOptionalParams, - ) => Promise; - /** List Schema resources by SchemaRegistry */ - listBySchemaRegistry: ( - resourceGroupName: string, - schemaRegistryName: string, - options?: SchemasListBySchemaRegistryOptionalParams, - ) => PagedAsyncIterableIterator; -} - -export function getSchemas(context: DeviceRegistryManagementContext, subscriptionId: string) { - return { - get: ( - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - options?: SchemasGetOptionalParams, - ) => - schemasGet( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - options, - ), - createOrReplace: ( - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - resource: Schema, - options?: SchemasCreateOrReplaceOptionalParams, - ) => - schemasCreateOrReplace( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - resource, - options, - ), - delete: ( - resourceGroupName: string, - schemaRegistryName: string, - schemaName: string, - options?: SchemasDeleteOptionalParams, - ) => - schemasDelete( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - schemaName, - options, - ), - listBySchemaRegistry: ( - resourceGroupName: string, - schemaRegistryName: string, - options?: SchemasListBySchemaRegistryOptionalParams, - ) => - schemasListBySchemaRegistry( - context, - subscriptionId, - resourceGroupName, - schemaRegistryName, - options, - ), - }; -} - -export function getSchemasOperations( - context: DeviceRegistryManagementContext, - subscriptionId: string, -): SchemasOperations { - return { - ...getSchemas(context, subscriptionId), - }; -} diff --git a/sdk/deviceregistry/arm-deviceregistry/src/deviceRegistryManagementClient.ts b/sdk/deviceregistry/arm-deviceregistry/src/deviceRegistryManagementClient.ts index 1bb328d0512..f9e787faa6e 100644 --- a/sdk/deviceregistry/arm-deviceregistry/src/deviceRegistryManagementClient.ts +++ b/sdk/deviceregistry/arm-deviceregistry/src/deviceRegistryManagementClient.ts @@ -1,37 +1,20 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import { getOperationsOperations, OperationsOperations } from "./classic/operations/index.js"; import { - getOperationStatusOperations, - OperationStatusOperations, -} from "./classic/operationStatus/index.js"; -import { getAssetsOperations, AssetsOperations } from "./classic/assets/index.js"; -import { - getAssetEndpointProfilesOperations, - AssetEndpointProfilesOperations, -} from "./classic/assetEndpointProfiles/index.js"; -import { - getBillingContainersOperations, + _getBillingContainersOperations, BillingContainersOperations, } from "./classic/billingContainers/index.js"; import { - getDiscoveredAssetsOperations, - DiscoveredAssetsOperations, -} from "./classic/discoveredAssets/index.js"; -import { - getDiscoveredAssetEndpointProfilesOperations, - DiscoveredAssetEndpointProfilesOperations, -} from "./classic/discoveredAssetEndpointProfiles/index.js"; -import { - getSchemaRegistriesOperations, - SchemaRegistriesOperations, -} from "./classic/schemaRegistries/index.js"; -import { getSchemasOperations, SchemasOperations } from "./classic/schemas/index.js"; + _getAssetEndpointProfilesOperations, + AssetEndpointProfilesOperations, +} from "./classic/assetEndpointProfiles/index.js"; +import { _getAssetsOperations, AssetsOperations } from "./classic/assets/index.js"; import { - getSchemaVersionsOperations, - SchemaVersionsOperations, -} from "./classic/schemaVersions/index.js"; + _getOperationStatusOperations, + OperationStatusOperations, +} from "./classic/operationStatus/index.js"; +import { _getOperationsOperations, OperationsOperations } from "./classic/operations/index.js"; import { createDeviceRegistryManagement, DeviceRegistryManagementContext, @@ -57,44 +40,26 @@ export class DeviceRegistryManagementClient { const userAgentPrefix = prefixFromOptions ? `${prefixFromOptions} azsdk-js-client` : `azsdk-js-client`; - this._client = createDeviceRegistryManagement(credential, { + this._client = createDeviceRegistryManagement(credential, subscriptionId, { ...options, userAgentOptions: { userAgentPrefix }, }); this.pipeline = this._client.pipeline; - this.operations = getOperationsOperations(this._client); - this.operationStatus = getOperationStatusOperations(this._client, subscriptionId); - this.assets = getAssetsOperations(this._client, subscriptionId); - this.assetEndpointProfiles = getAssetEndpointProfilesOperations(this._client, subscriptionId); - this.billingContainers = getBillingContainersOperations(this._client, subscriptionId); - this.discoveredAssets = getDiscoveredAssetsOperations(this._client, subscriptionId); - this.discoveredAssetEndpointProfiles = getDiscoveredAssetEndpointProfilesOperations( - this._client, - subscriptionId, - ); - this.schemaRegistries = getSchemaRegistriesOperations(this._client, subscriptionId); - this.schemas = getSchemasOperations(this._client, subscriptionId); - this.schemaVersions = getSchemaVersionsOperations(this._client, subscriptionId); + this.billingContainers = _getBillingContainersOperations(this._client); + this.assetEndpointProfiles = _getAssetEndpointProfilesOperations(this._client); + this.assets = _getAssetsOperations(this._client); + this.operationStatus = _getOperationStatusOperations(this._client); + this.operations = _getOperationsOperations(this._client); } - /** The operation groups for Operations */ - public readonly operations: OperationsOperations; - /** The operation groups for OperationStatus */ - public readonly operationStatus: OperationStatusOperations; - /** The operation groups for Assets */ - public readonly assets: AssetsOperations; - /** The operation groups for AssetEndpointProfiles */ - public readonly assetEndpointProfiles: AssetEndpointProfilesOperations; - /** The operation groups for BillingContainers */ + /** The operation groups for billingContainers */ public readonly billingContainers: BillingContainersOperations; - /** The operation groups for DiscoveredAssets */ - public readonly discoveredAssets: DiscoveredAssetsOperations; - /** The operation groups for DiscoveredAssetEndpointProfiles */ - public readonly discoveredAssetEndpointProfiles: DiscoveredAssetEndpointProfilesOperations; - /** The operation groups for SchemaRegistries */ - public readonly schemaRegistries: SchemaRegistriesOperations; - /** The operation groups for Schemas */ - public readonly schemas: SchemasOperations; - /** The operation groups for SchemaVersions */ - public readonly schemaVersions: SchemaVersionsOperations; + /** The operation groups for assetEndpointProfiles */ + public readonly assetEndpointProfiles: AssetEndpointProfilesOperations; + /** The operation groups for assets */ + public readonly assets: AssetsOperations; + /** The operation groups for operationStatus */ + public readonly operationStatus: OperationStatusOperations; + /** The operation groups for operations */ + public readonly operations: OperationsOperations; } diff --git a/sdk/deviceregistry/arm-deviceregistry/src/helpers/serializerHelpers.ts b/sdk/deviceregistry/arm-deviceregistry/src/helpers/serializerHelpers.ts deleted file mode 100644 index 7518a16c2ee..00000000000 --- a/sdk/deviceregistry/arm-deviceregistry/src/helpers/serializerHelpers.ts +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT License. - -export function serializeRecord( - item: Record, -): Record; -export function serializeRecord( - item: Record, - serializer: (item: T) => R, -): Record; -export function serializeRecord( - item: Record, - serializer?: (item: T) => R, -): Record { - return Object.keys(item).reduce( - (acc, key) => { - if (isSupportedRecordType(item[key])) { - acc[key] = item[key] as any; - } else if (serializer) { - const value = item[key]; - if (value !== undefined) { - acc[key] = serializer(value); - } - } else { - console.warn(`Don't know how to serialize ${item[key]}`); - acc[key] = item[key] as any; - } - return acc; - }, - {} as Record, - ); -} - -function isSupportedRecordType(t: any) { - return ["number", "string", "boolean", "null"].includes(typeof t) || t instanceof Date; -} diff --git a/sdk/deviceregistry/arm-deviceregistry/src/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/index.ts index 46a6f657071..aae1f223f7d 100644 --- a/sdk/deviceregistry/arm-deviceregistry/src/index.ts +++ b/sdk/deviceregistry/arm-deviceregistry/src/index.ts @@ -10,8 +10,8 @@ import { export { DeviceRegistryManagementClient } from "./deviceRegistryManagementClient.js"; export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; export { - SchemaVersion, - SchemaVersionProperties, + BillingContainer, + BillingContainerProperties, KnownProvisioningState, ProvisioningState, ProxyResource, @@ -19,52 +19,27 @@ export { SystemData, KnownCreatedByType, CreatedByType, + ErrorResponse, ErrorDetail, ErrorAdditionalInfo, - Schema, - SchemaProperties, - KnownFormat, - Format, - KnownSchemaType, - SchemaType, - SchemaRegistry, - SchemaRegistryProperties, - SystemAssignedServiceIdentity, - KnownSystemAssignedServiceIdentityType, - SystemAssignedServiceIdentityType, - TrackedResource, - SchemaRegistryUpdate, - SchemaRegistryUpdateProperties, - DiscoveredAssetEndpointProfile, - DiscoveredAssetEndpointProfileProperties, - KnownAuthenticationMethod, - AuthenticationMethod, - ExtendedLocation, - DiscoveredAssetEndpointProfileUpdate, - DiscoveredAssetEndpointProfileUpdateProperties, - DiscoveredAsset, - DiscoveredAssetProperties, - Topic, - KnownTopicRetainType, - TopicRetainType, - DiscoveredDataset, - DiscoveredDataPoint, - DiscoveredEvent, - DiscoveredAssetUpdate, - DiscoveredAssetUpdateProperties, - BillingContainer, - BillingContainerProperties, AssetEndpointProfile, AssetEndpointProfileProperties, Authentication, + KnownAuthenticationMethod, + AuthenticationMethod, UsernamePasswordCredentials, X509Credentials, AssetEndpointProfileStatus, AssetEndpointProfileStatusError, + ExtendedLocation, + TrackedResource, AssetEndpointProfileUpdate, AssetEndpointProfileUpdateProperties, Asset, AssetProperties, + Topic, + KnownTopicRetainType, + TopicRetainType, Dataset, DataPoint, KnownDataPointObservabilityMode, @@ -92,59 +67,28 @@ export { } from "./models/index.js"; export { DeviceRegistryManagementClientOptionalParams, - OperationsListOptionalParams, - OperationStatusGetOptionalParams, - AssetsGetOptionalParams, - AssetsCreateOrReplaceOptionalParams, - AssetsUpdateOptionalParams, - AssetsDeleteOptionalParams, - AssetsListByResourceGroupOptionalParams, - AssetsListBySubscriptionOptionalParams, - AssetEndpointProfilesGetOptionalParams, - AssetEndpointProfilesCreateOrReplaceOptionalParams, - AssetEndpointProfilesUpdateOptionalParams, - AssetEndpointProfilesDeleteOptionalParams, - AssetEndpointProfilesListByResourceGroupOptionalParams, - AssetEndpointProfilesListBySubscriptionOptionalParams, - BillingContainersGetOptionalParams, BillingContainersListBySubscriptionOptionalParams, - DiscoveredAssetsGetOptionalParams, - DiscoveredAssetsCreateOrReplaceOptionalParams, - DiscoveredAssetsUpdateOptionalParams, - DiscoveredAssetsDeleteOptionalParams, - DiscoveredAssetsListByResourceGroupOptionalParams, - DiscoveredAssetsListBySubscriptionOptionalParams, - DiscoveredAssetEndpointProfilesGetOptionalParams, - DiscoveredAssetEndpointProfilesCreateOrReplaceOptionalParams, - DiscoveredAssetEndpointProfilesUpdateOptionalParams, - DiscoveredAssetEndpointProfilesDeleteOptionalParams, - DiscoveredAssetEndpointProfilesListByResourceGroupOptionalParams, - DiscoveredAssetEndpointProfilesListBySubscriptionOptionalParams, - SchemaRegistriesGetOptionalParams, - SchemaRegistriesCreateOrReplaceOptionalParams, - SchemaRegistriesUpdateOptionalParams, - SchemaRegistriesDeleteOptionalParams, - SchemaRegistriesListByResourceGroupOptionalParams, - SchemaRegistriesListBySubscriptionOptionalParams, - SchemasGetOptionalParams, - SchemasCreateOrReplaceOptionalParams, - SchemasDeleteOptionalParams, - SchemasListBySchemaRegistryOptionalParams, - SchemaVersionsGetOptionalParams, - SchemaVersionsCreateOrReplaceOptionalParams, - SchemaVersionsDeleteOptionalParams, - SchemaVersionsListBySchemaOptionalParams, + BillingContainersGetOptionalParams, + AssetEndpointProfilesListBySubscriptionOptionalParams, + AssetEndpointProfilesListByResourceGroupOptionalParams, + AssetEndpointProfilesDeleteOptionalParams, + AssetEndpointProfilesUpdateOptionalParams, + AssetEndpointProfilesCreateOrReplaceOptionalParams, + AssetEndpointProfilesGetOptionalParams, + AssetsListBySubscriptionOptionalParams, + AssetsListByResourceGroupOptionalParams, + AssetsDeleteOptionalParams, + AssetsUpdateOptionalParams, + AssetsCreateOrReplaceOptionalParams, + AssetsGetOptionalParams, + OperationStatusGetOptionalParams, + OperationsListOptionalParams, } from "./api/index.js"; export { AssetEndpointProfilesOperations, AssetsOperations, BillingContainersOperations, - DiscoveredAssetEndpointProfilesOperations, - DiscoveredAssetsOperations, OperationsOperations, OperationStatusOperations, - SchemaRegistriesOperations, - SchemasOperations, - SchemaVersionsOperations, } from "./classic/index.js"; export { PageSettings, ContinuablePage, PagedAsyncIterableIterator }; diff --git a/sdk/deviceregistry/arm-deviceregistry/src/models/index.ts b/sdk/deviceregistry/arm-deviceregistry/src/models/index.ts index 9d74b2d7878..aee07a305d8 100644 --- a/sdk/deviceregistry/arm-deviceregistry/src/models/index.ts +++ b/sdk/deviceregistry/arm-deviceregistry/src/models/index.ts @@ -2,8 +2,8 @@ // Licensed under the MIT License. export { - SchemaVersion, - SchemaVersionProperties, + BillingContainer, + BillingContainerProperties, KnownProvisioningState, ProvisioningState, ProxyResource, @@ -11,52 +11,27 @@ export { SystemData, KnownCreatedByType, CreatedByType, + ErrorResponse, ErrorDetail, ErrorAdditionalInfo, - Schema, - SchemaProperties, - KnownFormat, - Format, - KnownSchemaType, - SchemaType, - SchemaRegistry, - SchemaRegistryProperties, - SystemAssignedServiceIdentity, - KnownSystemAssignedServiceIdentityType, - SystemAssignedServiceIdentityType, - TrackedResource, - SchemaRegistryUpdate, - SchemaRegistryUpdateProperties, - DiscoveredAssetEndpointProfile, - DiscoveredAssetEndpointProfileProperties, - KnownAuthenticationMethod, - AuthenticationMethod, - ExtendedLocation, - DiscoveredAssetEndpointProfileUpdate, - DiscoveredAssetEndpointProfileUpdateProperties, - DiscoveredAsset, - DiscoveredAssetProperties, - Topic, - KnownTopicRetainType, - TopicRetainType, - DiscoveredDataset, - DiscoveredDataPoint, - DiscoveredEvent, - DiscoveredAssetUpdate, - DiscoveredAssetUpdateProperties, - BillingContainer, - BillingContainerProperties, AssetEndpointProfile, AssetEndpointProfileProperties, Authentication, + KnownAuthenticationMethod, + AuthenticationMethod, UsernamePasswordCredentials, X509Credentials, AssetEndpointProfileStatus, AssetEndpointProfileStatusError, + ExtendedLocation, + TrackedResource, AssetEndpointProfileUpdate, AssetEndpointProfileUpdateProperties, Asset, AssetProperties, + Topic, + KnownTopicRetainType, + TopicRetainType, Dataset, DataPoint, KnownDataPointObservabilityMode, diff --git a/sdk/deviceregistry/arm-deviceregistry/src/models/models.ts b/sdk/deviceregistry/arm-deviceregistry/src/models/models.ts index 0702d93da89..8ae6269afb3 100644 --- a/sdk/deviceregistry/arm-deviceregistry/src/models/models.ts +++ b/sdk/deviceregistry/arm-deviceregistry/src/models/models.ts @@ -1,21 +1,15 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -/** Schema version's definition. */ -export interface SchemaVersion extends ProxyResource { +/** billingContainer Model as Azure resource whose sole purpose is to keep track of billables resources under a subscription. */ +export interface BillingContainer extends ProxyResource { /** The resource-specific properties for this resource. */ - properties?: SchemaVersionProperties; -} - -export function schemaVersionSerializer(item: SchemaVersion): any { - return { - properties: !item["properties"] - ? item["properties"] - : schemaVersionPropertiesSerializer(item["properties"]), - }; + properties?: BillingContainerProperties; + /** Resource ETag */ + readonly etag?: string; } -export function schemaVersionDeserializer(item: any): SchemaVersion { +export function billingContainerDeserializer(item: any): BillingContainer { return { id: item["id"], name: item["name"], @@ -25,37 +19,19 @@ export function schemaVersionDeserializer(item: any): SchemaVersion { : systemDataDeserializer(item["systemData"]), properties: !item["properties"] ? item["properties"] - : schemaVersionPropertiesDeserializer(item["properties"]), + : billingContainerPropertiesDeserializer(item["properties"]), + etag: item["etag"], }; } -/** Defines the schema version properties. */ -export interface SchemaVersionProperties { - /** Globally unique, immutable, non-reusable id. */ - readonly uuid?: string; - /** Human-readable description of the schema. */ - description?: string; - /** Schema content. */ - schemaContent: string; - /** Hash of the schema content. */ - readonly hash?: string; +/** Defines the billingContainer properties. */ +export interface BillingContainerProperties { /** Provisioning state of the resource. */ readonly provisioningState?: ProvisioningState; } -export function schemaVersionPropertiesSerializer(item: SchemaVersionProperties): any { - return { - description: item["description"], - schemaContent: item["schemaContent"], - }; -} - -export function schemaVersionPropertiesDeserializer(item: any): SchemaVersionProperties { +export function billingContainerPropertiesDeserializer(item: any): BillingContainerProperties { return { - uuid: item["uuid"], - description: item["description"], - schemaContent: item["schemaContent"], - hash: item["hash"], provisioningState: item["provisioningState"], }; } @@ -90,10 +66,6 @@ export type ProvisioningState = string; /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ export interface ProxyResource extends Resource {} -export function proxyResourceSerializer(item: ProxyResource): any { - return item; -} - export function proxyResourceDeserializer(item: any): ProxyResource { return { id: item["id"], @@ -142,1121 +114,119 @@ export interface SystemData { createdAt?: Date; /** The identity that last modified the resource. */ lastModifiedBy?: string; - /** The type of identity that last modified the resource. */ - lastModifiedByType?: CreatedByType; - /** The timestamp of resource last modification (UTC) */ - lastModifiedAt?: Date; -} - -export function systemDataDeserializer(item: any): SystemData { - return { - createdBy: item["createdBy"], - createdByType: item["createdByType"], - createdAt: !item["createdAt"] ? item["createdAt"] : new Date(item["createdAt"]), - lastModifiedBy: item["lastModifiedBy"], - lastModifiedByType: item["lastModifiedByType"], - lastModifiedAt: !item["lastModifiedAt"] - ? item["lastModifiedAt"] - : new Date(item["lastModifiedAt"]), - }; -} - -/** The kind of entity that created the resource. */ -export enum KnownCreatedByType { - /** The entity was created by a user. */ - User = "User", - /** The entity was created by an application. */ - Application = "Application", - /** The entity was created by a managed identity. */ - ManagedIdentity = "ManagedIdentity", - /** The entity was created by a key. */ - Key = "Key", -} - -/** - * The kind of entity that created the resource. \ - * {@link KnowncreatedByType} can be used interchangeably with createdByType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **User**: The entity was created by a user. \ - * **Application**: The entity was created by an application. \ - * **ManagedIdentity**: The entity was created by a managed identity. \ - * **Key**: The entity was created by a key. - */ -export type CreatedByType = string; - -/** The error detail. */ -export interface ErrorDetail { - /** The error code. */ - readonly code?: string; - /** The error message. */ - readonly message?: string; - /** The error target. */ - readonly target?: string; - /** The error details. */ - readonly details?: ErrorDetail[]; - /** The error additional info. */ - readonly additionalInfo?: ErrorAdditionalInfo[]; -} - -export function errorDetailDeserializer(item: any): ErrorDetail { - return { - code: item["code"], - message: item["message"], - target: item["target"], - details: !item["details"] ? item["details"] : errorDetailArrayDeserializer(item["details"]), - additionalInfo: !item["additionalInfo"] - ? item["additionalInfo"] - : errorAdditionalInfoArrayDeserializer(item["additionalInfo"]), - }; -} - -export function errorDetailArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return errorDetailDeserializer(item); - }); -} - -export function errorAdditionalInfoArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return errorAdditionalInfoDeserializer(item); - }); -} - -/** The resource management error additional info. */ -export interface ErrorAdditionalInfo { - /** The additional info type. */ - readonly type?: string; - /** The additional info. */ - readonly info?: Record; -} - -export function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo { - return { - type: item["type"], - info: !item["info"] ? item["info"] : _errorAdditionalInfoInfoDeserializer(item["info"]), - }; -} - -/** model interface _ErrorAdditionalInfoInfo */ -export interface _ErrorAdditionalInfoInfo {} - -export function _errorAdditionalInfoInfoDeserializer(item: any): _ErrorAdditionalInfoInfo { - return item; -} - -/** The response of a SchemaVersion list operation. */ -export interface _SchemaVersionListResult { - /** The SchemaVersion items on this page */ - value: SchemaVersion[]; - /** The link to the next page of items */ - nextLink?: string; -} - -export function _schemaVersionListResultDeserializer(item: any): _SchemaVersionListResult { - return { - value: schemaVersionArrayDeserializer(item["value"]), - nextLink: item["nextLink"], - }; -} - -export function schemaVersionArraySerializer(result: Array): any[] { - return result.map((item) => { - return schemaVersionSerializer(item); - }); -} - -export function schemaVersionArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return schemaVersionDeserializer(item); - }); -} - -/** Schema definition. */ -export interface Schema extends ProxyResource { - /** The resource-specific properties for this resource. */ - properties?: SchemaProperties; -} - -export function schemaSerializer(item: Schema): any { - return { - properties: !item["properties"] - ? item["properties"] - : schemaPropertiesSerializer(item["properties"]), - }; -} - -export function schemaDeserializer(item: any): Schema { - return { - id: item["id"], - name: item["name"], - type: item["type"], - systemData: !item["systemData"] - ? item["systemData"] - : systemDataDeserializer(item["systemData"]), - properties: !item["properties"] - ? item["properties"] - : schemaPropertiesDeserializer(item["properties"]), - }; -} - -/** Defines the schema properties. */ -export interface SchemaProperties { - /** Globally unique, immutable, non-reusable id. */ - readonly uuid?: string; - /** Human-readable display name. */ - displayName?: string; - /** Human-readable description of the schema. */ - description?: string; - /** Format of the schema. */ - format: Format; - /** Type of the schema. */ - schemaType: SchemaType; - /** Provisioning state of the resource. */ - readonly provisioningState?: ProvisioningState; - /** Schema tags. */ - tags?: Record; -} - -export function schemaPropertiesSerializer(item: SchemaProperties): any { - return { - displayName: item["displayName"], - description: item["description"], - format: item["format"], - schemaType: item["schemaType"], - tags: item["tags"], - }; -} - -export function schemaPropertiesDeserializer(item: any): SchemaProperties { - return { - uuid: item["uuid"], - displayName: item["displayName"], - description: item["description"], - format: item["format"], - schemaType: item["schemaType"], - provisioningState: item["provisioningState"], - tags: item["tags"], - }; -} - -/** Defines the schema format. */ -export enum KnownFormat { - /** JSON Schema version draft 7 format */ - JsonSchemaDraft7 = "JsonSchema/draft-07", - /** Delta format */ - Delta_1_0 = "Delta/1.0", -} - -/** - * Defines the schema format. \ - * {@link KnownFormat} can be used interchangeably with Format, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **JsonSchema\/draft-07**: JSON Schema version draft 7 format \ - * **Delta\/1.0**: Delta format - */ -export type Format = string; - -/** Defines the schema type. */ -export enum KnownSchemaType { - /** Message Schema schema type */ - MessageSchema = "MessageSchema", -} - -/** - * Defines the schema type. \ - * {@link KnownSchemaType} can be used interchangeably with SchemaType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **MessageSchema**: Message Schema schema type - */ -export type SchemaType = string; - -/** The response of a Schema list operation. */ -export interface _SchemaListResult { - /** The Schema items on this page */ - value: Schema[]; - /** The link to the next page of items */ - nextLink?: string; -} - -export function _schemaListResultDeserializer(item: any): _SchemaListResult { - return { - value: schemaArrayDeserializer(item["value"]), - nextLink: item["nextLink"], - }; -} - -export function schemaArraySerializer(result: Array): any[] { - return result.map((item) => { - return schemaSerializer(item); - }); -} - -export function schemaArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return schemaDeserializer(item); - }); -} - -/** Schema registry definition. */ -export interface SchemaRegistry extends TrackedResource { - /** The resource-specific properties for this resource. */ - properties?: SchemaRegistryProperties; - /** The managed service identities assigned to this resource. */ - identity?: SystemAssignedServiceIdentity; -} - -export function schemaRegistrySerializer(item: SchemaRegistry): any { - return { - tags: item["tags"], - location: item["location"], - properties: !item["properties"] - ? item["properties"] - : schemaRegistryPropertiesSerializer(item["properties"]), - identity: !item["identity"] - ? item["identity"] - : systemAssignedServiceIdentitySerializer(item["identity"]), - }; -} - -export function schemaRegistryDeserializer(item: any): SchemaRegistry { - return { - tags: item["tags"], - location: item["location"], - id: item["id"], - name: item["name"], - type: item["type"], - systemData: !item["systemData"] - ? item["systemData"] - : systemDataDeserializer(item["systemData"]), - properties: !item["properties"] - ? item["properties"] - : schemaRegistryPropertiesDeserializer(item["properties"]), - identity: !item["identity"] - ? item["identity"] - : systemAssignedServiceIdentityDeserializer(item["identity"]), - }; -} - -/** Defines the schema registry properties. */ -export interface SchemaRegistryProperties { - /** Globally unique, immutable, non-reusable id. */ - readonly uuid?: string; - /** Schema registry namespace. Uniquely identifies a schema registry within a tenant. */ - namespace: string; - /** Human-readable display name. */ - displayName?: string; - /** Human-readable description of the schema registry. */ - description?: string; - /** The Storage Account's Container URL where schemas will be stored. */ - storageAccountContainerUrl: string; - /** Provisioning state of the resource. */ - readonly provisioningState?: ProvisioningState; -} - -export function schemaRegistryPropertiesSerializer(item: SchemaRegistryProperties): any { - return { - namespace: item["namespace"], - displayName: item["displayName"], - description: item["description"], - storageAccountContainerUrl: item["storageAccountContainerUrl"], - }; -} - -export function schemaRegistryPropertiesDeserializer(item: any): SchemaRegistryProperties { - return { - uuid: item["uuid"], - namespace: item["namespace"], - displayName: item["displayName"], - description: item["description"], - storageAccountContainerUrl: item["storageAccountContainerUrl"], - provisioningState: item["provisioningState"], - }; -} - -/** Managed service identity (either system assigned, or none) */ -export interface SystemAssignedServiceIdentity { - /** The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. */ - readonly principalId?: string; - /** The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. */ - readonly tenantId?: string; - /** The type of managed identity assigned to this resource. */ - type: SystemAssignedServiceIdentityType; -} - -export function systemAssignedServiceIdentitySerializer(item: SystemAssignedServiceIdentity): any { - return { type: item["type"] }; -} - -export function systemAssignedServiceIdentityDeserializer( - item: any, -): SystemAssignedServiceIdentity { - return { - principalId: item["principalId"], - tenantId: item["tenantId"], - type: item["type"], - }; -} - -/** Type of managed service identity (either system assigned, or none). */ -export enum KnownSystemAssignedServiceIdentityType { - /** No managed system identity. */ - None = "None", - /** System assigned managed system identity. */ - SystemAssigned = "SystemAssigned", -} - -/** - * Type of managed service identity (either system assigned, or none). \ - * {@link KnownSystemAssignedServiceIdentityType} can be used interchangeably with SystemAssignedServiceIdentityType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **None**: No managed system identity. \ - * **SystemAssigned**: System assigned managed system identity. - */ -export type SystemAssignedServiceIdentityType = string; - -/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ -export interface TrackedResource extends Resource { - /** Resource tags. */ - tags?: Record; - /** The geo-location where the resource lives */ - location: string; -} - -export function trackedResourceSerializer(item: TrackedResource): any { - return { tags: item["tags"], location: item["location"] }; -} - -export function trackedResourceDeserializer(item: any): TrackedResource { - return { - id: item["id"], - name: item["name"], - type: item["type"], - systemData: !item["systemData"] - ? item["systemData"] - : systemDataDeserializer(item["systemData"]), - tags: item["tags"], - location: item["location"], - }; -} - -/** The type used for update operations of the SchemaRegistry. */ -export interface SchemaRegistryUpdate { - /** The managed service identities assigned to this resource. */ - identity?: SystemAssignedServiceIdentity; - /** Resource tags. */ - tags?: Record; - /** The resource-specific properties for this resource. */ - properties?: SchemaRegistryUpdateProperties; -} - -export function schemaRegistryUpdateSerializer(item: SchemaRegistryUpdate): any { - return { - identity: !item["identity"] - ? item["identity"] - : systemAssignedServiceIdentitySerializer(item["identity"]), - tags: item["tags"], - properties: !item["properties"] - ? item["properties"] - : schemaRegistryUpdatePropertiesSerializer(item["properties"]), - }; -} - -/** The updatable properties of the SchemaRegistry. */ -export interface SchemaRegistryUpdateProperties { - /** Human-readable display name. */ - displayName?: string; - /** Human-readable description of the schema registry. */ - description?: string; -} - -export function schemaRegistryUpdatePropertiesSerializer( - item: SchemaRegistryUpdateProperties, -): any { - return { displayName: item["displayName"], description: item["description"] }; -} - -/** The response of a SchemaRegistry list operation. */ -export interface _SchemaRegistryListResult { - /** The SchemaRegistry items on this page */ - value: SchemaRegistry[]; - /** The link to the next page of items */ - nextLink?: string; -} - -export function _schemaRegistryListResultDeserializer(item: any): _SchemaRegistryListResult { - return { - value: schemaRegistryArrayDeserializer(item["value"]), - nextLink: item["nextLink"], - }; -} - -export function schemaRegistryArraySerializer(result: Array): any[] { - return result.map((item) => { - return schemaRegistrySerializer(item); - }); -} - -export function schemaRegistryArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return schemaRegistryDeserializer(item); - }); -} - -/** Discovered Asset Endpoint Profile definition. */ -export interface DiscoveredAssetEndpointProfile extends TrackedResource { - /** The resource-specific properties for this resource. */ - properties?: DiscoveredAssetEndpointProfileProperties; - /** The extended location. */ - extendedLocation: ExtendedLocation; -} - -export function discoveredAssetEndpointProfileSerializer( - item: DiscoveredAssetEndpointProfile, -): any { - return { - tags: item["tags"], - location: item["location"], - properties: !item["properties"] - ? item["properties"] - : discoveredAssetEndpointProfilePropertiesSerializer(item["properties"]), - extendedLocation: extendedLocationSerializer(item["extendedLocation"]), - }; -} - -export function discoveredAssetEndpointProfileDeserializer( - item: any, -): DiscoveredAssetEndpointProfile { - return { - tags: item["tags"], - location: item["location"], - id: item["id"], - name: item["name"], - type: item["type"], - systemData: !item["systemData"] - ? item["systemData"] - : systemDataDeserializer(item["systemData"]), - properties: !item["properties"] - ? item["properties"] - : discoveredAssetEndpointProfilePropertiesDeserializer(item["properties"]), - extendedLocation: extendedLocationDeserializer(item["extendedLocation"]), - }; -} - -/** Defines the Discovered Asset Endpoint Profile properties. */ -export interface DiscoveredAssetEndpointProfileProperties { - /** The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. */ - targetAddress: string; - /** Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). */ - additionalConfiguration?: string; - /** List of supported authentication methods supported by the target server. */ - supportedAuthenticationMethods?: AuthenticationMethod[]; - /** Defines the configuration for the connector type that is being used with the endpoint profile. */ - endpointProfileType: string; - /** Identifier used to detect changes in the asset endpoint profile. */ - discoveryId: string; - /** An integer that is incremented each time the resource is modified. */ - version: number; - /** Provisioning state of the resource. */ - readonly provisioningState?: ProvisioningState; -} - -export function discoveredAssetEndpointProfilePropertiesSerializer( - item: DiscoveredAssetEndpointProfileProperties, -): any { - return { - targetAddress: item["targetAddress"], - additionalConfiguration: item["additionalConfiguration"], - supportedAuthenticationMethods: !item["supportedAuthenticationMethods"] - ? item["supportedAuthenticationMethods"] - : item["supportedAuthenticationMethods"].map((p: any) => { - return p; - }), - endpointProfileType: item["endpointProfileType"], - discoveryId: item["discoveryId"], - version: item["version"], - }; -} - -export function discoveredAssetEndpointProfilePropertiesDeserializer( - item: any, -): DiscoveredAssetEndpointProfileProperties { - return { - targetAddress: item["targetAddress"], - additionalConfiguration: item["additionalConfiguration"], - supportedAuthenticationMethods: !item["supportedAuthenticationMethods"] - ? item["supportedAuthenticationMethods"] - : item["supportedAuthenticationMethods"].map((p: any) => { - return p; - }), - endpointProfileType: item["endpointProfileType"], - discoveryId: item["discoveryId"], - version: item["version"], - provisioningState: item["provisioningState"], - }; -} - -/** The method to authenticate the user of the client at the server. */ -export enum KnownAuthenticationMethod { - /** The user authentication method is anonymous. */ - Anonymous = "Anonymous", - /** The user authentication method is an x509 certificate. */ - Certificate = "Certificate", - /** The user authentication method is a username and password. */ - UsernamePassword = "UsernamePassword", -} - -/** - * The method to authenticate the user of the client at the server. \ - * {@link KnownAuthenticationMethod} can be used interchangeably with AuthenticationMethod, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Anonymous**: The user authentication method is anonymous. \ - * **Certificate**: The user authentication method is an x509 certificate. \ - * **UsernamePassword**: The user authentication method is a username and password. - */ -export type AuthenticationMethod = string; - -/** The extended location. */ -export interface ExtendedLocation { - /** The extended location type. */ - type: string; - /** The extended location name. */ - name: string; -} - -export function extendedLocationSerializer(item: ExtendedLocation): any { - return { type: item["type"], name: item["name"] }; -} - -export function extendedLocationDeserializer(item: any): ExtendedLocation { - return { - type: item["type"], - name: item["name"], - }; -} - -/** The type used for update operations of the DiscoveredAssetEndpointProfile. */ -export interface DiscoveredAssetEndpointProfileUpdate { - /** Resource tags. */ - tags?: Record; - /** The resource-specific properties for this resource. */ - properties?: DiscoveredAssetEndpointProfileUpdateProperties; -} - -export function discoveredAssetEndpointProfileUpdateSerializer( - item: DiscoveredAssetEndpointProfileUpdate, -): any { - return { - tags: item["tags"], - properties: !item["properties"] - ? item["properties"] - : discoveredAssetEndpointProfileUpdatePropertiesSerializer(item["properties"]), - }; -} - -/** The updatable properties of the DiscoveredAssetEndpointProfile. */ -export interface DiscoveredAssetEndpointProfileUpdateProperties { - /** The local valid URI specifying the network address/DNS name of a southbound device. The scheme part of the targetAddress URI specifies the type of the device. The additionalConfiguration field holds further connector type specific configuration. */ - targetAddress?: string; - /** Stringified JSON that contains connectivity type specific further configuration (e.g. OPC UA, Modbus, ONVIF). */ - additionalConfiguration?: string; - /** List of supported authentication methods supported by the target server. */ - supportedAuthenticationMethods?: AuthenticationMethod[]; - /** Defines the configuration for the connector type that is being used with the endpoint profile. */ - endpointProfileType?: string; - /** Identifier used to detect changes in the asset endpoint profile. */ - discoveryId?: string; - /** An integer that is incremented each time the resource is modified. */ - version?: number; -} - -export function discoveredAssetEndpointProfileUpdatePropertiesSerializer( - item: DiscoveredAssetEndpointProfileUpdateProperties, -): any { - return { - targetAddress: item["targetAddress"], - additionalConfiguration: item["additionalConfiguration"], - supportedAuthenticationMethods: !item["supportedAuthenticationMethods"] - ? item["supportedAuthenticationMethods"] - : item["supportedAuthenticationMethods"].map((p: any) => { - return p; - }), - endpointProfileType: item["endpointProfileType"], - discoveryId: item["discoveryId"], - version: item["version"], - }; -} - -/** The response of a DiscoveredAssetEndpointProfile list operation. */ -export interface _DiscoveredAssetEndpointProfileListResult { - /** The DiscoveredAssetEndpointProfile items on this page */ - value: DiscoveredAssetEndpointProfile[]; - /** The link to the next page of items */ - nextLink?: string; -} - -export function _discoveredAssetEndpointProfileListResultDeserializer( - item: any, -): _DiscoveredAssetEndpointProfileListResult { - return { - value: discoveredAssetEndpointProfileArrayDeserializer(item["value"]), - nextLink: item["nextLink"], - }; -} - -export function discoveredAssetEndpointProfileArraySerializer( - result: Array, -): any[] { - return result.map((item) => { - return discoveredAssetEndpointProfileSerializer(item); - }); -} - -export function discoveredAssetEndpointProfileArrayDeserializer( - result: Array, -): any[] { - return result.map((item) => { - return discoveredAssetEndpointProfileDeserializer(item); - }); -} - -/** Discovered Asset definition. */ -export interface DiscoveredAsset extends TrackedResource { - /** The resource-specific properties for this resource. */ - properties?: DiscoveredAssetProperties; - /** The extended location. */ - extendedLocation: ExtendedLocation; -} - -export function discoveredAssetSerializer(item: DiscoveredAsset): any { - return { - tags: item["tags"], - location: item["location"], - properties: !item["properties"] - ? item["properties"] - : discoveredAssetPropertiesSerializer(item["properties"]), - extendedLocation: extendedLocationSerializer(item["extendedLocation"]), - }; -} - -export function discoveredAssetDeserializer(item: any): DiscoveredAsset { - return { - tags: item["tags"], - location: item["location"], - id: item["id"], - name: item["name"], - type: item["type"], - systemData: !item["systemData"] - ? item["systemData"] - : systemDataDeserializer(item["systemData"]), - properties: !item["properties"] - ? item["properties"] - : discoveredAssetPropertiesDeserializer(item["properties"]), - extendedLocation: extendedLocationDeserializer(item["extendedLocation"]), - }; -} - -/** Defines the discovered asset properties. */ -export interface DiscoveredAssetProperties { - /** A reference to the asset endpoint profile (connection information) used by brokers to connect to an endpoint that provides data points for this asset. Must provide asset endpoint profile name. */ - assetEndpointProfileRef: string; - /** Identifier used to detect changes in the asset. */ - discoveryId: string; - /** An integer that is incremented each time the resource is modified. */ - version: number; - /** Asset manufacturer name. */ - manufacturer?: string; - /** Asset manufacturer URI. */ - manufacturerUri?: string; - /** Asset model name. */ - model?: string; - /** Asset product code. */ - productCode?: string; - /** Revision number of the hardware. */ - hardwareRevision?: string; - /** Revision number of the software. */ - softwareRevision?: string; - /** Reference to the documentation. */ - documentationUri?: string; - /** Asset serial number. */ - serialNumber?: string; - /** Stringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have its own configuration that overrides the default settings here. */ - defaultDatasetsConfiguration?: string; - /** Stringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. */ - defaultEventsConfiguration?: string; - /** Object that describes the default topic information for the asset. */ - defaultTopic?: Topic; - /** Array of datasets that are part of the asset. Each dataset spec describes the data points that make up the set. */ - datasets?: DiscoveredDataset[]; - /** Array of events that are part of the asset. Each event can have per-event configuration. */ - events?: DiscoveredEvent[]; - /** Provisioning state of the resource. */ - readonly provisioningState?: ProvisioningState; -} - -export function discoveredAssetPropertiesSerializer(item: DiscoveredAssetProperties): any { - return { - assetEndpointProfileRef: item["assetEndpointProfileRef"], - discoveryId: item["discoveryId"], - version: item["version"], - manufacturer: item["manufacturer"], - manufacturerUri: item["manufacturerUri"], - model: item["model"], - productCode: item["productCode"], - hardwareRevision: item["hardwareRevision"], - softwareRevision: item["softwareRevision"], - documentationUri: item["documentationUri"], - serialNumber: item["serialNumber"], - defaultDatasetsConfiguration: item["defaultDatasetsConfiguration"], - defaultEventsConfiguration: item["defaultEventsConfiguration"], - defaultTopic: !item["defaultTopic"] - ? item["defaultTopic"] - : topicSerializer(item["defaultTopic"]), - datasets: !item["datasets"] - ? item["datasets"] - : discoveredDatasetArraySerializer(item["datasets"]), - events: !item["events"] ? item["events"] : discoveredEventArraySerializer(item["events"]), - }; -} - -export function discoveredAssetPropertiesDeserializer(item: any): DiscoveredAssetProperties { - return { - assetEndpointProfileRef: item["assetEndpointProfileRef"], - discoveryId: item["discoveryId"], - version: item["version"], - manufacturer: item["manufacturer"], - manufacturerUri: item["manufacturerUri"], - model: item["model"], - productCode: item["productCode"], - hardwareRevision: item["hardwareRevision"], - softwareRevision: item["softwareRevision"], - documentationUri: item["documentationUri"], - serialNumber: item["serialNumber"], - defaultDatasetsConfiguration: item["defaultDatasetsConfiguration"], - defaultEventsConfiguration: item["defaultEventsConfiguration"], - defaultTopic: !item["defaultTopic"] - ? item["defaultTopic"] - : topicDeserializer(item["defaultTopic"]), - datasets: !item["datasets"] - ? item["datasets"] - : discoveredDatasetArrayDeserializer(item["datasets"]), - events: !item["events"] ? item["events"] : discoveredEventArrayDeserializer(item["events"]), - provisioningState: item["provisioningState"], - }; -} - -/** Object that describes the topic information. */ -export interface Topic { - /** The topic path for messages published to an MQTT broker. */ - path: string; - /** When set to 'Keep', messages published to an MQTT broker will have the retain flag set. Default: 'Never'. */ - retain?: TopicRetainType; -} - -export function topicSerializer(item: Topic): any { - return { path: item["path"], retain: item["retain"] }; -} - -export function topicDeserializer(item: any): Topic { - return { - path: item["path"], - retain: item["retain"], - }; -} - -/** Topic retain types. */ -export enum KnownTopicRetainType { - /** Retain the messages. */ - Keep = "Keep", - /** Never retain messages. */ - Never = "Never", -} - -/** - * Topic retain types. \ - * {@link KnownTopicRetainType} can be used interchangeably with TopicRetainType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Keep**: Retain the messages. \ - * **Never**: Never retain messages. - */ -export type TopicRetainType = string; - -export function discoveredDatasetArraySerializer(result: Array): any[] { - return result.map((item) => { - return discoveredDatasetSerializer(item); - }); -} - -export function discoveredDatasetArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return discoveredDatasetDeserializer(item); - }); -} - -/** Defines the dataset properties. */ -export interface DiscoveredDataset { - /** Name of the dataset. */ - name: string; - /** Stringified JSON that contains connector-specific properties that describes configuration for the specific dataset. */ - datasetConfiguration?: string; - /** Object that describes the topic information for the specific dataset. */ - topic?: Topic; - /** Array of data points that are part of the dataset. Each data point can have per-data point configuration. */ - dataPoints?: DiscoveredDataPoint[]; -} - -export function discoveredDatasetSerializer(item: DiscoveredDataset): any { - return { - name: item["name"], - datasetConfiguration: item["datasetConfiguration"], - topic: !item["topic"] ? item["topic"] : topicSerializer(item["topic"]), - dataPoints: !item["dataPoints"] - ? item["dataPoints"] - : discoveredDataPointArraySerializer(item["dataPoints"]), - }; -} - -export function discoveredDatasetDeserializer(item: any): DiscoveredDataset { - return { - name: item["name"], - datasetConfiguration: item["datasetConfiguration"], - topic: !item["topic"] ? item["topic"] : topicDeserializer(item["topic"]), - dataPoints: !item["dataPoints"] - ? item["dataPoints"] - : discoveredDataPointArrayDeserializer(item["dataPoints"]), - }; -} - -export function discoveredDataPointArraySerializer(result: Array): any[] { - return result.map((item) => { - return discoveredDataPointSerializer(item); - }); -} - -export function discoveredDataPointArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return discoveredDataPointDeserializer(item); - }); -} - -/** Defines the data point properties. */ -export interface DiscoveredDataPoint { - /** The name of the data point. */ - name: string; - /** The address of the source of the data in the asset (e.g. URL) so that a client can access the data source on the asset. */ - dataSource: string; - /** Stringified JSON that contains connector-specific configuration for the data point. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. */ - dataPointConfiguration?: string; - /** UTC timestamp indicating when the data point was added or modified. */ - lastUpdatedOn?: Date; -} - -export function discoveredDataPointSerializer(item: DiscoveredDataPoint): any { - return { - name: item["name"], - dataSource: item["dataSource"], - dataPointConfiguration: item["dataPointConfiguration"], - lastUpdatedOn: item["lastUpdatedOn"]?.toISOString(), - }; -} - -export function discoveredDataPointDeserializer(item: any): DiscoveredDataPoint { - return { - name: item["name"], - dataSource: item["dataSource"], - dataPointConfiguration: item["dataPointConfiguration"], - lastUpdatedOn: !item["lastUpdatedOn"] ? item["lastUpdatedOn"] : new Date(item["lastUpdatedOn"]), - }; -} - -export function discoveredEventArraySerializer(result: Array): any[] { - return result.map((item) => { - return discoveredEventSerializer(item); - }); -} - -export function discoveredEventArrayDeserializer(result: Array): any[] { - return result.map((item) => { - return discoveredEventDeserializer(item); - }); -} - -/** Defines the event properties. */ -export interface DiscoveredEvent { - /** The name of the event. */ - name: string; - /** The address of the notifier of the event in the asset (e.g. URL) so that a client can access the event on the asset. */ - eventNotifier: string; - /** Stringified JSON that contains connector-specific configuration for the event. For OPC UA, this could include configuration like, publishingInterval, samplingInterval, and queueSize. */ - eventConfiguration?: string; - /** Object that describes the topic information for the specific event. */ - topic?: Topic; - /** UTC timestamp indicating when the event was added or modified. */ - lastUpdatedOn?: Date; -} - -export function discoveredEventSerializer(item: DiscoveredEvent): any { - return { - name: item["name"], - eventNotifier: item["eventNotifier"], - eventConfiguration: item["eventConfiguration"], - topic: !item["topic"] ? item["topic"] : topicSerializer(item["topic"]), - lastUpdatedOn: item["lastUpdatedOn"]?.toISOString(), - }; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date; } -export function discoveredEventDeserializer(item: any): DiscoveredEvent { +export function systemDataDeserializer(item: any): SystemData { return { - name: item["name"], - eventNotifier: item["eventNotifier"], - eventConfiguration: item["eventConfiguration"], - topic: !item["topic"] ? item["topic"] : topicDeserializer(item["topic"]), - lastUpdatedOn: !item["lastUpdatedOn"] ? item["lastUpdatedOn"] : new Date(item["lastUpdatedOn"]), + createdBy: item["createdBy"], + createdByType: item["createdByType"], + createdAt: !item["createdAt"] ? item["createdAt"] : new Date(item["createdAt"]), + lastModifiedBy: item["lastModifiedBy"], + lastModifiedByType: item["lastModifiedByType"], + lastModifiedAt: !item["lastModifiedAt"] + ? item["lastModifiedAt"] + : new Date(item["lastModifiedAt"]), }; } -/** The type used for update operations of the DiscoveredAsset. */ -export interface DiscoveredAssetUpdate { - /** Resource tags. */ - tags?: Record; - /** The resource-specific properties for this resource. */ - properties?: DiscoveredAssetUpdateProperties; +/** The kind of entity that created the resource. */ +export enum KnownCreatedByType { + /** The entity was created by a user. */ + User = "User", + /** The entity was created by an application. */ + Application = "Application", + /** The entity was created by a managed identity. */ + ManagedIdentity = "ManagedIdentity", + /** The entity was created by a key. */ + Key = "Key", } -export function discoveredAssetUpdateSerializer(item: DiscoveredAssetUpdate): any { - return { - tags: item["tags"], - properties: !item["properties"] - ? item["properties"] - : discoveredAssetUpdatePropertiesSerializer(item["properties"]), - }; -} +/** + * The kind of entity that created the resource. \ + * {@link KnowncreatedByType} can be used interchangeably with createdByType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **User**: The entity was created by a user. \ + * **Application**: The entity was created by an application. \ + * **ManagedIdentity**: The entity was created by a managed identity. \ + * **Key**: The entity was created by a key. + */ +export type CreatedByType = string; -/** The updatable properties of the DiscoveredAsset. */ -export interface DiscoveredAssetUpdateProperties { - /** Identifier used to detect changes in the asset. */ - discoveryId?: string; - /** An integer that is incremented each time the resource is modified. */ - version?: number; - /** Asset manufacturer name. */ - manufacturer?: string; - /** Asset manufacturer URI. */ - manufacturerUri?: string; - /** Asset model name. */ - model?: string; - /** Asset product code. */ - productCode?: string; - /** Revision number of the hardware. */ - hardwareRevision?: string; - /** Revision number of the software. */ - softwareRevision?: string; - /** Reference to the documentation. */ - documentationUri?: string; - /** Asset serial number. */ - serialNumber?: string; - /** Stringified JSON that contains connector-specific default configuration for all datasets. Each dataset can have its own configuration that overrides the default settings here. */ - defaultDatasetsConfiguration?: string; - /** Stringified JSON that contains connector-specific default configuration for all events. Each event can have its own configuration that overrides the default settings here. */ - defaultEventsConfiguration?: string; - /** Object that describes the default topic information for the asset. */ - defaultTopic?: Topic; - /** Array of datasets that are part of the asset. Each dataset spec describes the data points that make up the set. */ - datasets?: DiscoveredDataset[]; - /** Array of events that are part of the asset. Each event can have per-event configuration. */ - events?: DiscoveredEvent[]; +/** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */ +export interface ErrorResponse { + /** The error object. */ + error?: ErrorDetail; } -export function discoveredAssetUpdatePropertiesSerializer( - item: DiscoveredAssetUpdateProperties, -): any { +export function errorResponseDeserializer(item: any): ErrorResponse { return { - discoveryId: item["discoveryId"], - version: item["version"], - manufacturer: item["manufacturer"], - manufacturerUri: item["manufacturerUri"], - model: item["model"], - productCode: item["productCode"], - hardwareRevision: item["hardwareRevision"], - softwareRevision: item["softwareRevision"], - documentationUri: item["documentationUri"], - serialNumber: item["serialNumber"], - defaultDatasetsConfiguration: item["defaultDatasetsConfiguration"], - defaultEventsConfiguration: item["defaultEventsConfiguration"], - defaultTopic: !item["defaultTopic"] - ? item["defaultTopic"] - : topicSerializer(item["defaultTopic"]), - datasets: !item["datasets"] - ? item["datasets"] - : discoveredDatasetArraySerializer(item["datasets"]), - events: !item["events"] ? item["events"] : discoveredEventArraySerializer(item["events"]), + error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), }; } -/** The response of a DiscoveredAsset list operation. */ -export interface _DiscoveredAssetListResult { - /** The DiscoveredAsset items on this page */ - value: DiscoveredAsset[]; - /** The link to the next page of items */ - nextLink?: string; +/** The error detail. */ +export interface ErrorDetail { + /** The error code. */ + readonly code?: string; + /** The error message. */ + readonly message?: string; + /** The error target. */ + readonly target?: string; + /** The error details. */ + readonly details?: ErrorDetail[]; + /** The error additional info. */ + readonly additionalInfo?: ErrorAdditionalInfo[]; } -export function _discoveredAssetListResultDeserializer(item: any): _DiscoveredAssetListResult { +export function errorDetailDeserializer(item: any): ErrorDetail { return { - value: discoveredAssetArrayDeserializer(item["value"]), - nextLink: item["nextLink"], + code: item["code"], + message: item["message"], + target: item["target"], + details: !item["details"] ? item["details"] : errorDetailArrayDeserializer(item["details"]), + additionalInfo: !item["additionalInfo"] + ? item["additionalInfo"] + : errorAdditionalInfoArrayDeserializer(item["additionalInfo"]), }; } -export function discoveredAssetArraySerializer(result: Array): any[] { +export function errorDetailArrayDeserializer(result: Array): any[] { return result.map((item) => { - return discoveredAssetSerializer(item); + return errorDetailDeserializer(item); }); } -export function discoveredAssetArrayDeserializer(result: Array): any[] { +export function errorAdditionalInfoArrayDeserializer(result: Array): any[] { return result.map((item) => { - return discoveredAssetDeserializer(item); + return errorAdditionalInfoDeserializer(item); }); } -/** billingContainer Model as Azure resource whose sole purpose is to keep track of billables resources under a subscription. */ -export interface BillingContainer extends ProxyResource { - /** The resource-specific properties for this resource. */ - properties?: BillingContainerProperties; - /** Resource ETag */ - readonly etag?: string; +/** The resource management error additional info. */ +export interface ErrorAdditionalInfo { + /** The additional info type. */ + readonly type?: string; + /** The additional info. */ + readonly info?: Record; } -export function billingContainerDeserializer(item: any): BillingContainer { +export function errorAdditionalInfoDeserializer(item: any): ErrorAdditionalInfo { return { - id: item["id"], - name: item["name"], type: item["type"], - systemData: !item["systemData"] - ? item["systemData"] - : systemDataDeserializer(item["systemData"]), - properties: !item["properties"] - ? item["properties"] - : billingContainerPropertiesDeserializer(item["properties"]), - etag: item["etag"], + info: !item["info"] ? item["info"] : _errorAdditionalInfoInfoDeserializer(item["info"]), }; } -/** Defines the billingContainer properties. */ -export interface BillingContainerProperties { - /** Provisioning state of the resource. */ - readonly provisioningState?: ProvisioningState; -} +/** model interface _ErrorAdditionalInfoInfo */ +export interface _ErrorAdditionalInfoInfo {} -export function billingContainerPropertiesDeserializer(item: any): BillingContainerProperties { - return { - provisioningState: item["provisioningState"], - }; +export function _errorAdditionalInfoInfoDeserializer(item: any): _ErrorAdditionalInfoInfo { + return item; } /** The response of a BillingContainer list operation. */ @@ -1403,6 +373,27 @@ export function authenticationDeserializer(item: any): Authentication { }; } +/** The method to authenticate the user of the client at the server. */ +export enum KnownAuthenticationMethod { + /** The user authentication method is anonymous. */ + Anonymous = "Anonymous", + /** The user authentication method is an x509 certificate. */ + Certificate = "Certificate", + /** The user authentication method is a username and password. */ + UsernamePassword = "UsernamePassword", +} + +/** + * The method to authenticate the user of the client at the server. \ + * {@link KnownAuthenticationMethod} can be used interchangeably with AuthenticationMethod, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Anonymous**: The user authentication method is anonymous. \ + * **Certificate**: The user authentication method is an x509 certificate. \ + * **UsernamePassword**: The user authentication method is a username and password. + */ +export type AuthenticationMethod = string; + /** The credentials for authentication mode UsernamePassword. */ export interface UsernamePasswordCredentials { /** The name of the secret containing the username. */ @@ -1480,6 +471,50 @@ export function assetEndpointProfileStatusErrorDeserializer( }; } +/** The extended location. */ +export interface ExtendedLocation { + /** The extended location type. */ + type: string; + /** The extended location name. */ + name: string; +} + +export function extendedLocationSerializer(item: ExtendedLocation): any { + return { type: item["type"], name: item["name"] }; +} + +export function extendedLocationDeserializer(item: any): ExtendedLocation { + return { + type: item["type"], + name: item["name"], + }; +} + +/** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ +export interface TrackedResource extends Resource { + /** Resource tags. */ + tags?: Record; + /** The geo-location where the resource lives */ + location: string; +} + +export function trackedResourceSerializer(item: TrackedResource): any { + return { tags: item["tags"], location: item["location"] }; +} + +export function trackedResourceDeserializer(item: any): TrackedResource { + return { + id: item["id"], + name: item["name"], + type: item["type"], + systemData: !item["systemData"] + ? item["systemData"] + : systemDataDeserializer(item["systemData"]), + tags: item["tags"], + location: item["location"], + }; +} + /** The type used for update operations of the AssetEndpointProfile. */ export interface AssetEndpointProfileUpdate { /** Resource tags. */ @@ -1705,6 +740,43 @@ export function assetPropertiesDeserializer(item: any): AssetProperties { }; } +/** Object that describes the topic information. */ +export interface Topic { + /** The topic path for messages published to an MQTT broker. */ + path: string; + /** When set to 'Keep', messages published to an MQTT broker will have the retain flag set. Default: 'Never'. */ + retain?: TopicRetainType; +} + +export function topicSerializer(item: Topic): any { + return { path: item["path"], retain: item["retain"] }; +} + +export function topicDeserializer(item: any): Topic { + return { + path: item["path"], + retain: item["retain"], + }; +} + +/** Topic retain types. */ +export enum KnownTopicRetainType { + /** Retain the messages. */ + Keep = "Keep", + /** Never retain messages. */ + Never = "Never", +} + +/** + * Topic retain types. \ + * {@link KnownTopicRetainType} can be used interchangeably with TopicRetainType, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Keep**: Retain the messages. \ + * **Never**: Never retain messages. + */ +export type TopicRetainType = string; + export function datasetArraySerializer(result: Array): any[] { return result.map((item) => { return datasetSerializer(item); @@ -2158,6 +1230,8 @@ export interface OperationStatusResult { operations?: OperationStatusResult[]; /** If present, details of the operation error. */ error?: ErrorDetail; + /** Fully qualified ID of the resource against which the original async operation was started. */ + readonly resourceId?: string; } export function operationStatusResultDeserializer(item: any): OperationStatusResult { @@ -2172,6 +1246,7 @@ export function operationStatusResultDeserializer(item: any): OperationStatusRes ? item["operations"] : operationStatusResultArrayDeserializer(item["operations"]), error: !item["error"] ? item["error"] : errorDetailDeserializer(item["error"]), + resourceId: item["resourceId"], }; } @@ -2211,11 +1286,11 @@ export interface Operation { /** Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for Azure Resource Manager/control-plane operations. */ readonly isDataAction?: boolean; /** Localized display information for this particular operation. */ - readonly display?: OperationDisplay; + display?: OperationDisplay; /** The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ readonly origin?: Origin; /** Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ - actionType?: ActionType; + readonly actionType?: ActionType; } export function operationDeserializer(item: any): Operation { @@ -2287,8 +1362,6 @@ export type ActionType = string; /** Microsoft.DeviceRegistry Resource Provider supported API versions. */ export enum KnownVersions { - /** Microsoft.DeviceRegistry Resource Provider management API version 2023-11-01-preview. */ - V2023_11_01_Preview = "2023-11-01-preview", - /** Microsoft.DeviceRegistry Resource Provider management API version 2024-09-01-preview. */ - V2024_09_01_Preview = "2024-09-01-preview", + /** Microsoft.DeviceRegistry Resource Provider management API version 2024-11-01. */ + V20241101 = "2024-11-01", } diff --git a/sdk/deviceregistry/arm-deviceregistry/src/restorePollerHelpers.ts b/sdk/deviceregistry/arm-deviceregistry/src/restorePollerHelpers.ts index bc6b8e91f29..d1ac8c4050f 100644 --- a/sdk/deviceregistry/arm-deviceregistry/src/restorePollerHelpers.ts +++ b/sdk/deviceregistry/arm-deviceregistry/src/restorePollerHelpers.ts @@ -3,30 +3,15 @@ import { DeviceRegistryManagementClient } from "./deviceRegistryManagementClient.js"; import { - _assetsCreateOrReplaceDeserialize, - _assetsUpdateDeserialize, - _assetsDeleteDeserialize, -} from "./api/assets/index.js"; -import { - _assetEndpointProfilesCreateOrReplaceDeserialize, - _assetEndpointProfilesUpdateDeserialize, _assetEndpointProfilesDeleteDeserialize, + _assetEndpointProfilesUpdateDeserialize, + _assetEndpointProfilesCreateOrReplaceDeserialize, } from "./api/assetEndpointProfiles/index.js"; import { - _discoveredAssetsCreateOrReplaceDeserialize, - _discoveredAssetsUpdateDeserialize, - _discoveredAssetsDeleteDeserialize, -} from "./api/discoveredAssets/index.js"; -import { - _discoveredAssetEndpointProfilesCreateOrReplaceDeserialize, - _discoveredAssetEndpointProfilesUpdateDeserialize, - _discoveredAssetEndpointProfilesDeleteDeserialize, -} from "./api/discoveredAssetEndpointProfiles/index.js"; -import { - _schemaRegistriesCreateOrReplaceDeserialize, - _schemaRegistriesUpdateDeserialize, - _schemaRegistriesDeleteDeserialize, -} from "./api/schemaRegistries/index.js"; + _assetsDeleteDeserialize, + _assetsUpdateDeserialize, + _assetsCreateOrReplaceDeserialize, +} from "./api/assets/index.js"; import { getLongRunningPoller } from "./static-helpers/pollingHelpers.js"; import { OperationOptions, PathUncheckedResponse } from "@azure-rest/core-client"; import { AbortSignalLike } from "@azure/abort-controller"; @@ -100,81 +85,36 @@ interface DeserializationHelper { } const deserializeMap: Record = { - "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}": - { - deserializer: _assetsCreateOrReplaceDeserialize, - expectedStatuses: ["200", "201"], - }, - "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}": - { - deserializer: _assetsUpdateDeserialize, - expectedStatuses: ["200", "202"], - }, - "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}": + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}": { - deserializer: _assetsDeleteDeserialize, + deserializer: _assetEndpointProfilesDeleteDeserialize, expectedStatuses: ["202", "204", "200"], }, - "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}": - { - deserializer: _assetEndpointProfilesCreateOrReplaceDeserialize, - expectedStatuses: ["200", "201"], - }, "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}": { deserializer: _assetEndpointProfilesUpdateDeserialize, expectedStatuses: ["200", "202"], }, - "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}": - { - deserializer: _assetEndpointProfilesDeleteDeserialize, - expectedStatuses: ["202", "204", "200"], - }, - "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName}": + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assetEndpointProfiles/{assetEndpointProfileName}": { - deserializer: _discoveredAssetsCreateOrReplaceDeserialize, + deserializer: _assetEndpointProfilesCreateOrReplaceDeserialize, expectedStatuses: ["200", "201"], }, - "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName}": - { - deserializer: _discoveredAssetsUpdateDeserialize, - expectedStatuses: ["200", "202"], - }, - "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssets/{discoveredAssetName}": + "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}": { - deserializer: _discoveredAssetsDeleteDeserialize, + deserializer: _assetsDeleteDeserialize, expectedStatuses: ["202", "204", "200"], }, - "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName}": - { - deserializer: _discoveredAssetEndpointProfilesCreateOrReplaceDeserialize, - expectedStatuses: ["200", "201"], - }, - "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName}": + "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}": { - deserializer: _discoveredAssetEndpointProfilesUpdateDeserialize, + deserializer: _assetsUpdateDeserialize, expectedStatuses: ["200", "202"], }, - "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/discoveredAssetEndpointProfiles/{discoveredAssetEndpointProfileName}": - { - deserializer: _discoveredAssetEndpointProfilesDeleteDeserialize, - expectedStatuses: ["202", "204", "200"], - }, - "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}": + "PUT /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/assets/{assetName}": { - deserializer: _schemaRegistriesCreateOrReplaceDeserialize, + deserializer: _assetsCreateOrReplaceDeserialize, expectedStatuses: ["200", "201"], }, - "PATCH /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}": - { - deserializer: _schemaRegistriesUpdateDeserialize, - expectedStatuses: ["200", "202"], - }, - "DELETE /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceRegistry/schemaRegistries/{schemaRegistryName}": - { - deserializer: _schemaRegistriesDeleteDeserialize, - expectedStatuses: ["202", "204", "200"], - }, }; function getDeserializationHelper( diff --git a/sdk/deviceregistry/arm-deviceregistry/tsp-location.yaml b/sdk/deviceregistry/arm-deviceregistry/tsp-location.yaml index dbbdd96677a..24019423375 100644 --- a/sdk/deviceregistry/arm-deviceregistry/tsp-location.yaml +++ b/sdk/deviceregistry/arm-deviceregistry/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/deviceregistry/DeviceRegistry.Management -commit: 6132d27fe22b7876e0064827a5ac70f7a6166ab9 -repo: ../azure-rest-api-specs +commit: f6674831693bce0982f08ccf356255248a4c9a8f +repo: Azure/azure-rest-api-specs additionalDirectories: diff --git a/sdk/deviceregistry/arm-deviceregistry/vitest.browser.config.ts b/sdk/deviceregistry/arm-deviceregistry/vitest.browser.config.ts index 10e70dbfa8e..182729ab5ce 100644 --- a/sdk/deviceregistry/arm-deviceregistry/vitest.browser.config.ts +++ b/sdk/deviceregistry/arm-deviceregistry/vitest.browser.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -8,7 +9,7 @@ export default mergeConfig( viteConfig, defineConfig({ test: { - include: ["dist-test/browser/test/**/*.spec.js"], + include: ["dist-test/browser/test/**/*.spec.js",], testTimeout: 1200000, hookTimeout: 1200000, }, diff --git a/sdk/deviceregistry/arm-deviceregistry/vitest.config.ts b/sdk/deviceregistry/arm-deviceregistry/vitest.config.ts index 86a71911ccc..40e031385dd 100644 --- a/sdk/deviceregistry/arm-deviceregistry/vitest.config.ts +++ b/sdk/deviceregistry/arm-deviceregistry/vitest.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. diff --git a/sdk/deviceregistry/arm-deviceregistry/vitest.esm.config.ts b/sdk/deviceregistry/arm-deviceregistry/vitest.esm.config.ts index 5e9735e9b14..a70127279fc 100644 --- a/sdk/deviceregistry/arm-deviceregistry/vitest.esm.config.ts +++ b/sdk/deviceregistry/arm-deviceregistry/vitest.esm.config.ts @@ -1,3 +1,4 @@ + // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. @@ -5,4 +6,7 @@ import { mergeConfig } from "vitest/config"; import vitestConfig from "./vitest.config.ts"; import vitestEsmConfig from "../../../vitest.esm.shared.config.ts"; -export default mergeConfig(vitestConfig, vitestEsmConfig); +export default mergeConfig( + vitestConfig, + vitestEsmConfig +);