From 70e762c30991b9ddcda8f056d57b9bdcb9f54125 Mon Sep 17 00:00:00 2001 From: kazrael2119 <98569699+kazrael2119@users.noreply.github.com> Date: Tue, 17 Jan 2023 10:25:24 +0800 Subject: [PATCH] mediaservice release (#24484) * mediaservice release * update files --- common/config/rush/pnpm-lock.yaml | 22 +- .../arm-mediaservices/CHANGELOG.md | 43 +++- sdk/mediaservices/arm-mediaservices/LICENSE | 2 +- .../arm-mediaservices/_meta.json | 8 +- .../arm-mediaservices/package.json | 10 +- .../recording_mediaservices_create_test.json | 192 ++++------------- .../recording_mediaservices_delete_test.json | 28 +-- .../recording_mediaservices_get_test.json | 18 +- .../recording_mediaservices_list_test.json | 18 +- .../review/arm-mediaservices.api.md | 45 ++-- .../accountFiltersCreateOrUpdateSample.ts | 18 +- .../samples-dev/accountFiltersDeleteSample.ts | 18 +- .../samples-dev/accountFiltersGetSample.ts | 18 +- .../samples-dev/accountFiltersListSample.ts | 18 +- .../samples-dev/accountFiltersUpdateSample.ts | 18 +- .../assetFiltersCreateOrUpdateSample.ts | 18 +- .../samples-dev/assetFiltersDeleteSample.ts | 18 +- .../samples-dev/assetFiltersGetSample.ts | 18 +- .../samples-dev/assetFiltersListSample.ts | 18 +- .../samples-dev/assetFiltersUpdateSample.ts | 18 +- .../samples-dev/assetsCreateOrUpdateSample.ts | 18 +- .../samples-dev/assetsDeleteSample.ts | 18 +- .../assetsGetEncryptionKeySample.ts | 18 +- .../samples-dev/assetsGetSample.ts | 18 +- .../assetsListContainerSasSample.ts | 18 +- .../samples-dev/assetsListSample.ts | 42 ++-- .../assetsListStreamingLocatorsSample.ts | 18 +- .../samples-dev/assetsUpdateSample.ts | 18 +- .../contentKeyPoliciesCreateOrUpdateSample.ts | 60 +++--- .../contentKeyPoliciesDeleteSample.ts | 18 +- ...iesGetPolicyPropertiesWithSecretsSample.ts | 18 +- .../contentKeyPoliciesGetSample.ts | 18 +- .../contentKeyPoliciesListSample.ts | 42 ++-- .../contentKeyPoliciesUpdateSample.ts | 18 +- .../samples-dev/jobsCancelJobSample.ts | 18 +- .../samples-dev/jobsCreateSample.ts | 18 +- .../samples-dev/jobsDeleteSample.ts | 18 +- .../samples-dev/jobsGetSample.ts | 18 +- .../samples-dev/jobsListSample.ts | 94 ++++---- .../samples-dev/jobsUpdateSample.ts | 18 +- .../samples-dev/liveEventsAllocateSample.ts | 18 +- .../liveEventsAsyncOperationSample.ts | 18 +- .../samples-dev/liveEventsCreateSample.ts | 18 +- .../samples-dev/liveEventsDeleteSample.ts | 18 +- .../samples-dev/liveEventsGetSample.ts | 18 +- .../samples-dev/liveEventsListSample.ts | 18 +- .../liveEventsOperationLocationSample.ts | 18 +- .../samples-dev/liveEventsResetSample.ts | 18 +- .../samples-dev/liveEventsStartSample.ts | 18 +- .../samples-dev/liveEventsStopSample.ts | 18 +- .../samples-dev/liveEventsUpdateSample.ts | 18 +- .../liveOutputsAsyncOperationSample.ts | 18 +- .../samples-dev/liveOutputsCreateSample.ts | 18 +- .../samples-dev/liveOutputsDeleteSample.ts | 18 +- .../samples-dev/liveOutputsGetSample.ts | 18 +- .../samples-dev/liveOutputsListSample.ts | 18 +- .../liveOutputsOperationLocationSample.ts | 18 +- .../locationsCheckNameAvailabilitySample.ts | 15 +- .../mediaServicesOperationResultsGetSample.ts | 15 +- ...mediaServicesOperationStatusesGetSample.ts | 35 +-- .../mediaservicesCreateOrUpdateSample.ts | 18 +- .../samples-dev/mediaservicesDeleteSample.ts | 18 +- .../samples-dev/mediaservicesGetSample.ts | 18 +- .../mediaservicesListBySubscriptionSample.ts | 15 +- .../mediaservicesListEdgePoliciesSample.ts | 18 +- .../samples-dev/mediaservicesListSample.ts | 18 +- .../mediaservicesSyncStorageKeysSample.ts | 18 +- .../samples-dev/mediaservicesUpdateSample.ts | 18 +- .../samples-dev/operationResultsGetSample.ts | 18 +- .../samples-dev/operationStatusesGetSample.ts | 44 ++-- .../samples-dev/operationsListSample.ts | 15 +- ...EndpointConnectionsCreateOrUpdateSample.ts | 18 +- .../privateEndpointConnectionsDeleteSample.ts | 18 +- .../privateEndpointConnectionsGetSample.ts | 18 +- .../privateEndpointConnectionsListSample.ts | 18 +- .../privateLinkResourcesGetSample.ts | 18 +- .../privateLinkResourcesListSample.ts | 18 +- .../streamingEndpointsAsyncOperationSample.ts | 18 +- .../streamingEndpointsCreateSample.ts | 18 +- .../streamingEndpointsDeleteSample.ts | 18 +- .../streamingEndpointsGetSample.ts | 18 +- .../streamingEndpointsListSample.ts | 18 +- ...reamingEndpointsOperationLocationSample.ts | 18 +- .../streamingEndpointsScaleSample.ts | 18 +- .../streamingEndpointsSkusSample.ts | 18 +- .../streamingEndpointsStartSample.ts | 18 +- .../streamingEndpointsStopSample.ts | 18 +- .../streamingEndpointsUpdateSample.ts | 18 +- .../streamingLocatorsCreateSample.ts | 42 ++-- .../streamingLocatorsDeleteSample.ts | 18 +- .../samples-dev/streamingLocatorsGetSample.ts | 18 +- .../streamingLocatorsListContentKeysSample.ts | 18 +- .../streamingLocatorsListPathsSample.ts | 30 ++- .../streamingLocatorsListSample.ts | 18 +- .../streamingPoliciesCreateSample.ts | 94 ++++---- .../streamingPoliciesDeleteSample.ts | 18 +- .../samples-dev/streamingPoliciesGetSample.ts | 18 +- .../streamingPoliciesListSample.ts | 18 +- .../samples-dev/tracksCreateOrUpdateSample.ts | 18 +- .../samples-dev/tracksDeleteSample.ts | 18 +- .../samples-dev/tracksGetSample.ts | 18 +- .../samples-dev/tracksListSample.ts | 18 +- .../samples-dev/tracksUpdateSample.ts | 18 +- .../tracksUpdateTrackDataSample.ts | 18 +- .../transformsCreateOrUpdateSample.ts | 18 +- .../samples-dev/transformsDeleteSample.ts | 18 +- .../samples-dev/transformsGetSample.ts | 18 +- .../samples-dev/transformsListSample.ts | 58 +++-- .../samples-dev/transformsUpdateSample.ts | 18 +- .../samples/v13/javascript/README.md | 204 +++++++++--------- .../accountFiltersCreateOrUpdateSample.js | 14 +- .../javascript/accountFiltersDeleteSample.js | 14 +- .../v13/javascript/accountFiltersGetSample.js | 14 +- .../javascript/accountFiltersListSample.js | 14 +- .../javascript/accountFiltersUpdateSample.js | 14 +- .../assetFiltersCreateOrUpdateSample.js | 14 +- .../javascript/assetFiltersDeleteSample.js | 14 +- .../v13/javascript/assetFiltersGetSample.js | 14 +- .../v13/javascript/assetFiltersListSample.js | 14 +- .../javascript/assetFiltersUpdateSample.js | 14 +- .../javascript/assetsCreateOrUpdateSample.js | 14 +- .../v13/javascript/assetsDeleteSample.js | 14 +- .../assetsGetEncryptionKeySample.js | 14 +- .../samples/v13/javascript/assetsGetSample.js | 14 +- .../assetsListContainerSasSample.js | 14 +- .../v13/javascript/assetsListSample.js | 34 +-- .../assetsListStreamingLocatorsSample.js | 14 +- .../v13/javascript/assetsUpdateSample.js | 14 +- .../contentKeyPoliciesCreateOrUpdateSample.js | 44 ++-- .../contentKeyPoliciesDeleteSample.js | 14 +- ...iesGetPolicyPropertiesWithSecretsSample.js | 14 +- .../javascript/contentKeyPoliciesGetSample.js | 14 +- .../contentKeyPoliciesListSample.js | 34 +-- .../contentKeyPoliciesUpdateSample.js | 14 +- .../v13/javascript/jobsCancelJobSample.js | 14 +- .../v13/javascript/jobsCreateSample.js | 14 +- .../v13/javascript/jobsDeleteSample.js | 14 +- .../samples/v13/javascript/jobsGetSample.js | 14 +- .../samples/v13/javascript/jobsListSample.js | 78 +++---- .../v13/javascript/jobsUpdateSample.js | 14 +- .../javascript/liveEventsAllocateSample.js | 14 +- .../liveEventsAsyncOperationSample.js | 14 +- .../v13/javascript/liveEventsCreateSample.js | 14 +- .../v13/javascript/liveEventsDeleteSample.js | 14 +- .../v13/javascript/liveEventsGetSample.js | 14 +- .../v13/javascript/liveEventsListSample.js | 14 +- .../liveEventsOperationLocationSample.js | 14 +- .../v13/javascript/liveEventsResetSample.js | 14 +- .../v13/javascript/liveEventsStartSample.js | 14 +- .../v13/javascript/liveEventsStopSample.js | 14 +- .../v13/javascript/liveEventsUpdateSample.js | 14 +- .../liveOutputsAsyncOperationSample.js | 14 +- .../v13/javascript/liveOutputsCreateSample.js | 14 +- .../v13/javascript/liveOutputsDeleteSample.js | 14 +- .../v13/javascript/liveOutputsGetSample.js | 14 +- .../v13/javascript/liveOutputsListSample.js | 14 +- .../liveOutputsOperationLocationSample.js | 14 +- .../locationsCheckNameAvailabilitySample.js | 12 +- .../mediaServicesOperationResultsGetSample.js | 12 +- ...mediaServicesOperationStatusesGetSample.js | 28 ++- .../mediaservicesCreateOrUpdateSample.js | 14 +- .../javascript/mediaservicesDeleteSample.js | 14 +- .../v13/javascript/mediaservicesGetSample.js | 14 +- .../mediaservicesListBySubscriptionSample.js | 12 +- .../mediaservicesListEdgePoliciesSample.js | 14 +- .../v13/javascript/mediaservicesListSample.js | 14 +- .../mediaservicesSyncStorageKeysSample.js | 14 +- .../javascript/mediaservicesUpdateSample.js | 14 +- .../javascript/operationResultsGetSample.js | 14 +- .../javascript/operationStatusesGetSample.js | 34 +-- .../v13/javascript/operationsListSample.js | 12 +- ...EndpointConnectionsCreateOrUpdateSample.js | 14 +- .../privateEndpointConnectionsDeleteSample.js | 14 +- .../privateEndpointConnectionsGetSample.js | 14 +- .../privateEndpointConnectionsListSample.js | 14 +- .../privateLinkResourcesGetSample.js | 14 +- .../privateLinkResourcesListSample.js | 14 +- .../streamingEndpointsAsyncOperationSample.js | 14 +- .../streamingEndpointsCreateSample.js | 14 +- .../streamingEndpointsDeleteSample.js | 14 +- .../javascript/streamingEndpointsGetSample.js | 14 +- .../streamingEndpointsListSample.js | 14 +- ...reamingEndpointsOperationLocationSample.js | 14 +- .../streamingEndpointsScaleSample.js | 14 +- .../streamingEndpointsSkusSample.js | 14 +- .../streamingEndpointsStartSample.js | 14 +- .../streamingEndpointsStopSample.js | 14 +- .../streamingEndpointsUpdateSample.js | 14 +- .../streamingLocatorsCreateSample.js | 34 +-- .../streamingLocatorsDeleteSample.js | 14 +- .../javascript/streamingLocatorsGetSample.js | 14 +- .../streamingLocatorsListContentKeysSample.js | 14 +- .../streamingLocatorsListPathsSample.js | 24 ++- .../javascript/streamingLocatorsListSample.js | 14 +- .../streamingPoliciesCreateSample.js | 74 ++++--- .../streamingPoliciesDeleteSample.js | 14 +- .../javascript/streamingPoliciesGetSample.js | 14 +- .../javascript/streamingPoliciesListSample.js | 14 +- .../javascript/tracksCreateOrUpdateSample.js | 14 +- .../v13/javascript/tracksDeleteSample.js | 14 +- .../samples/v13/javascript/tracksGetSample.js | 14 +- .../v13/javascript/tracksListSample.js | 14 +- .../v13/javascript/tracksUpdateSample.js | 14 +- .../javascript/tracksUpdateTrackDataSample.js | 14 +- .../transformsCreateOrUpdateSample.js | 14 +- .../v13/javascript/transformsDeleteSample.js | 14 +- .../v13/javascript/transformsGetSample.js | 14 +- .../v13/javascript/transformsListSample.js | 48 +++-- .../v13/javascript/transformsUpdateSample.js | 14 +- .../samples/v13/typescript/README.md | 204 +++++++++--------- .../samples/v13/typescript/package.json | 2 +- .../src/accountFiltersCreateOrUpdateSample.ts | 18 +- .../src/accountFiltersDeleteSample.ts | 18 +- .../typescript/src/accountFiltersGetSample.ts | 18 +- .../src/accountFiltersListSample.ts | 18 +- .../src/accountFiltersUpdateSample.ts | 18 +- .../src/assetFiltersCreateOrUpdateSample.ts | 18 +- .../src/assetFiltersDeleteSample.ts | 18 +- .../typescript/src/assetFiltersGetSample.ts | 18 +- .../typescript/src/assetFiltersListSample.ts | 18 +- .../src/assetFiltersUpdateSample.ts | 18 +- .../src/assetsCreateOrUpdateSample.ts | 18 +- .../v13/typescript/src/assetsDeleteSample.ts | 18 +- .../src/assetsGetEncryptionKeySample.ts | 18 +- .../v13/typescript/src/assetsGetSample.ts | 18 +- .../src/assetsListContainerSasSample.ts | 18 +- .../v13/typescript/src/assetsListSample.ts | 42 ++-- .../src/assetsListStreamingLocatorsSample.ts | 18 +- .../v13/typescript/src/assetsUpdateSample.ts | 18 +- .../contentKeyPoliciesCreateOrUpdateSample.ts | 60 +++--- .../src/contentKeyPoliciesDeleteSample.ts | 18 +- ...iesGetPolicyPropertiesWithSecretsSample.ts | 18 +- .../src/contentKeyPoliciesGetSample.ts | 18 +- .../src/contentKeyPoliciesListSample.ts | 42 ++-- .../src/contentKeyPoliciesUpdateSample.ts | 18 +- .../v13/typescript/src/jobsCancelJobSample.ts | 18 +- .../v13/typescript/src/jobsCreateSample.ts | 18 +- .../v13/typescript/src/jobsDeleteSample.ts | 18 +- .../v13/typescript/src/jobsGetSample.ts | 18 +- .../v13/typescript/src/jobsListSample.ts | 94 ++++---- .../v13/typescript/src/jobsUpdateSample.ts | 18 +- .../src/liveEventsAllocateSample.ts | 18 +- .../src/liveEventsAsyncOperationSample.ts | 18 +- .../typescript/src/liveEventsCreateSample.ts | 18 +- .../typescript/src/liveEventsDeleteSample.ts | 18 +- .../v13/typescript/src/liveEventsGetSample.ts | 18 +- .../typescript/src/liveEventsListSample.ts | 18 +- .../src/liveEventsOperationLocationSample.ts | 18 +- .../typescript/src/liveEventsResetSample.ts | 18 +- .../typescript/src/liveEventsStartSample.ts | 18 +- .../typescript/src/liveEventsStopSample.ts | 18 +- .../typescript/src/liveEventsUpdateSample.ts | 18 +- .../src/liveOutputsAsyncOperationSample.ts | 18 +- .../typescript/src/liveOutputsCreateSample.ts | 18 +- .../typescript/src/liveOutputsDeleteSample.ts | 18 +- .../typescript/src/liveOutputsGetSample.ts | 18 +- .../typescript/src/liveOutputsListSample.ts | 18 +- .../src/liveOutputsOperationLocationSample.ts | 18 +- .../locationsCheckNameAvailabilitySample.ts | 15 +- .../mediaServicesOperationResultsGetSample.ts | 15 +- ...mediaServicesOperationStatusesGetSample.ts | 35 +-- .../src/mediaservicesCreateOrUpdateSample.ts | 18 +- .../src/mediaservicesDeleteSample.ts | 18 +- .../typescript/src/mediaservicesGetSample.ts | 18 +- .../mediaservicesListBySubscriptionSample.ts | 15 +- .../mediaservicesListEdgePoliciesSample.ts | 18 +- .../typescript/src/mediaservicesListSample.ts | 18 +- .../src/mediaservicesSyncStorageKeysSample.ts | 18 +- .../src/mediaservicesUpdateSample.ts | 18 +- .../src/operationResultsGetSample.ts | 18 +- .../src/operationStatusesGetSample.ts | 44 ++-- .../typescript/src/operationsListSample.ts | 15 +- ...EndpointConnectionsCreateOrUpdateSample.ts | 18 +- .../privateEndpointConnectionsDeleteSample.ts | 18 +- .../privateEndpointConnectionsGetSample.ts | 18 +- .../privateEndpointConnectionsListSample.ts | 18 +- .../src/privateLinkResourcesGetSample.ts | 18 +- .../src/privateLinkResourcesListSample.ts | 18 +- .../streamingEndpointsAsyncOperationSample.ts | 18 +- .../src/streamingEndpointsCreateSample.ts | 18 +- .../src/streamingEndpointsDeleteSample.ts | 18 +- .../src/streamingEndpointsGetSample.ts | 18 +- .../src/streamingEndpointsListSample.ts | 18 +- ...reamingEndpointsOperationLocationSample.ts | 18 +- .../src/streamingEndpointsScaleSample.ts | 18 +- .../src/streamingEndpointsSkusSample.ts | 18 +- .../src/streamingEndpointsStartSample.ts | 18 +- .../src/streamingEndpointsStopSample.ts | 18 +- .../src/streamingEndpointsUpdateSample.ts | 18 +- .../src/streamingLocatorsCreateSample.ts | 42 ++-- .../src/streamingLocatorsDeleteSample.ts | 18 +- .../src/streamingLocatorsGetSample.ts | 18 +- .../streamingLocatorsListContentKeysSample.ts | 18 +- .../src/streamingLocatorsListPathsSample.ts | 30 ++- .../src/streamingLocatorsListSample.ts | 18 +- .../src/streamingPoliciesCreateSample.ts | 94 ++++---- .../src/streamingPoliciesDeleteSample.ts | 18 +- .../src/streamingPoliciesGetSample.ts | 18 +- .../src/streamingPoliciesListSample.ts | 18 +- .../src/tracksCreateOrUpdateSample.ts | 18 +- .../v13/typescript/src/tracksDeleteSample.ts | 18 +- .../v13/typescript/src/tracksGetSample.ts | 18 +- .../v13/typescript/src/tracksListSample.ts | 18 +- .../v13/typescript/src/tracksUpdateSample.ts | 18 +- .../src/tracksUpdateTrackDataSample.ts | 18 +- .../src/transformsCreateOrUpdateSample.ts | 18 +- .../typescript/src/transformsDeleteSample.ts | 18 +- .../v13/typescript/src/transformsGetSample.ts | 18 +- .../typescript/src/transformsListSample.ts | 58 +++-- .../typescript/src/transformsUpdateSample.ts | 18 +- .../samples/v13/typescript/tsconfig.json | 2 +- .../src/azureMediaServices.ts | 11 +- .../arm-mediaservices/src/index.ts | 1 + .../arm-mediaservices/src/models/index.ts | 109 +++++----- .../arm-mediaservices/src/models/mappers.ts | 64 ++++++ .../src/models/parameters.ts | 12 ++ .../src/operations/accountFilters.ts | 35 ++- .../src/operations/assetFilters.ts | 41 ++-- .../src/operations/assets.ts | 40 ++-- .../src/operations/contentKeyPolicies.ts | 40 ++-- .../arm-mediaservices/src/operations/jobs.ts | 59 ++--- .../src/operations/liveEvents.ts | 35 ++- .../src/operations/liveOutputs.ts | 41 ++-- .../src/operations/mediaservices.ts | 61 ++++-- .../src/operations/streamingEndpoints.ts | 35 ++- .../src/operations/streamingLocators.ts | 40 ++-- .../src/operations/streamingPolicies.ts | 40 ++-- .../src/operations/tracks.ts | 16 +- .../src/operations/transforms.ts | 51 +++-- .../arm-mediaservices/src/pagingHelper.ts | 39 ++++ 330 files changed, 5185 insertions(+), 2315 deletions(-) create mode 100644 sdk/mediaservices/arm-mediaservices/src/pagingHelper.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index ea719a2d94b5..2150ee191aee 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3680,7 +3680,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.0.0-dev.20230112 + typescript: 5.0.0-dev.20230115 dev: false /downlevel-dts/0.7.0: @@ -8277,8 +8277,8 @@ packages: hasBin: true dev: false - /typescript/5.0.0-dev.20230112: - resolution: {integrity: sha512-cO+lTlZiNKqZIkjDOZWjh4WtFz8Jba/Ut4nvjcguXGgHoEnHD3+LSmgJjotPcWxALJZyvpd4EuAd5D3H9XF8Ig==} + /typescript/5.0.0-dev.20230115: + resolution: {integrity: sha512-nwKvgk3rIDN9pa4fuI5vdpvR9LcLnFsLV/1HE4I5LTULB/DsN6MMeE1UF69L2RKCsv0PFYx4GXCWOsZUt/Jx9w==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -12506,7 +12506,7 @@ packages: dev: false file:projects/arm-mediaservices.tgz: - resolution: {integrity: sha512-D4fH76ZHXQaogbhhdLLBBHInkXfBqOq2JFnAEtieD5ttWUBFeBCnS0p1X1AI23ji8fLfCPtHx0aeCCvNjDUq2Q==, tarball: file:projects/arm-mediaservices.tgz} + resolution: {integrity: sha512-2YYMhqb2wGP1LBP8oJkP5dHZV6hh625QROa22VHaS+m7xvvkB3KxjqNbJt6pZ92p0zc1v+WH6G6se3iH3JxtHw==, tarball: file:projects/arm-mediaservices.tgz} name: '@rush-temp/arm-mediaservices' version: 0.0.0 dependencies: @@ -12518,18 +12518,19 @@ packages: '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.4 + '@types/node': 14.18.36 chai: 4.3.7 cross-env: 7.0.3 + dotenv: 8.6.0 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 + rollup-plugin-sourcemaps: 0.6.3_7e8d81808a761355f6c3da2f25cfe887 tslib: 2.4.1 - typescript: 4.6.4 + typescript: 4.8.4 uglify-js: 3.17.4 transitivePeerDependencies: - - '@types/node' - supports-color dev: false @@ -17974,7 +17975,7 @@ packages: dev: false file:projects/perf-storage-blob.tgz: - resolution: {integrity: sha512-kI/qJeEMQ1YPbHIB1MBdNx128oCKfr7p3dO4eyS+1hTEVTpUdRmffqa6OqAa+DNSSr4BWd9LEbVqMo1VLJaypw==, tarball: file:projects/perf-storage-blob.tgz} + resolution: {integrity: sha512-jK57Eg/wAEJQ9F/7j4JZzWpOODHK9T4kEqWTw3IZEaFGA6saKefrIDm+l1AS15vWD/lGDOioiibtkyHDE8w5mQ==, tarball: file:projects/perf-storage-blob.tgz} name: '@rush-temp/perf-storage-blob' version: 0.0.0 dependencies: @@ -18933,7 +18934,7 @@ packages: dev: false file:projects/synapse-managed-private-endpoints.tgz: - resolution: {integrity: sha512-sLJ5bTTZ+Og0WevfNPAAWLhyXvDgk3GarbQwwkNP8gQgP1IUESaXpnzW/uJZkDs0z7T9CqK//M/vJDCj/OmdeQ==, tarball: file:projects/synapse-managed-private-endpoints.tgz} + resolution: {integrity: sha512-zXcV4TSfY+5W5n3XkXzs7sofBsEf6CnHJKZmckvk2ZIs4yprRA8+9HrJxUdWm6hXGaEl5/eVeEwqCDHL8CUpug==, tarball: file:projects/synapse-managed-private-endpoints.tgz} name: '@rush-temp/synapse-managed-private-endpoints' version: 0.0.0 dependencies: @@ -18973,7 +18974,6 @@ packages: transitivePeerDependencies: - bufferutil - debug - - encoding - supports-color - utf-8-validate dev: false @@ -19156,7 +19156,7 @@ packages: dev: false file:projects/test-utils-perf.tgz: - resolution: {integrity: sha512-xucqchHdnYwM2FR86EIEsRh5Z3TtRMTwTivenrEwVfv0JVrU418HYXODjvE65GtuPtOK+Egn+Ftm5Ej78LbUAg==, tarball: file:projects/test-utils-perf.tgz} + resolution: {integrity: sha512-e0SWxrRiG1Zf9QaOueeMh/BUv53IiuT7oOU8Vf53Cx4LX2TwdgsWKvZH2GMWdSpAtZqKDJ9niw90PqqSdeX5Gw==, tarball: file:projects/test-utils-perf.tgz} name: '@rush-temp/test-utils-perf' version: 0.0.0 dependencies: diff --git a/sdk/mediaservices/arm-mediaservices/CHANGELOG.md b/sdk/mediaservices/arm-mediaservices/CHANGELOG.md index 4fb8f166730b..6ccf4a803f24 100644 --- a/sdk/mediaservices/arm-mediaservices/CHANGELOG.md +++ b/sdk/mediaservices/arm-mediaservices/CHANGELOG.md @@ -1,15 +1,38 @@ # Release History + +## 13.1.0 (2023-01-16) + +**Features** -## 13.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added Interface DDAudio + - Added Interface Fade + - Interface Filters has a new optional parameter fadeIn + - Interface Filters has a new optional parameter fadeOut + - Interface StandardEncoderPreset has a new optional parameter experimentalOptions + - Enum KnownEncoderNamedPreset has a new value DDGoodQualityAudio + - Enum KnownJobErrorCategory has a new value Account + - Enum KnownJobErrorCode has a new value IdentityUnsupported + - Added function getContinuationToken + - Interface AssetsListNextOptionalParams no longer has parameter filter + - Interface AssetsListNextOptionalParams no longer has parameter orderby + - Interface AssetsListNextOptionalParams no longer has parameter top + - Interface ContentKeyPoliciesListNextOptionalParams no longer has parameter filter + - Interface ContentKeyPoliciesListNextOptionalParams no longer has parameter orderby + - Interface ContentKeyPoliciesListNextOptionalParams no longer has parameter top + - Interface JobsListNextOptionalParams no longer has parameter filter + - Interface JobsListNextOptionalParams no longer has parameter orderby + - Interface StreamingLocatorsListNextOptionalParams no longer has parameter filter + - Interface StreamingLocatorsListNextOptionalParams no longer has parameter orderby + - Interface StreamingLocatorsListNextOptionalParams no longer has parameter top + - Interface StreamingPoliciesListNextOptionalParams no longer has parameter filter + - Interface StreamingPoliciesListNextOptionalParams no longer has parameter orderby + - Interface StreamingPoliciesListNextOptionalParams no longer has parameter top + - Interface TransformsListNextOptionalParams no longer has parameter filter + - Interface TransformsListNextOptionalParams no longer has parameter orderby + - Type of parameter odataType of interface Audio_2 is changed from "#Microsoft.Media.Audio" | "#Microsoft.Media.AacAudio" to "#Microsoft.Media.Audio" | "#Microsoft.Media.AacAudio" | "#Microsoft.Media.DDAudio" + - Type of parameter odataType of interface Codec is changed from "#Microsoft.Media.Audio" | "#Microsoft.Media.AacAudio" | "#Microsoft.Media.Video" | "#Microsoft.Media.H265Video" | "#Microsoft.Media.CopyVideo" | "#Microsoft.Media.Image" | "#Microsoft.Media.CopyAudio" | "#Microsoft.Media.H264Video" | "#Microsoft.Media.JpgImage" | "#Microsoft.Media.PngImage" to "#Microsoft.Media.Audio" | "#Microsoft.Media.AacAudio" | "#Microsoft.Media.DDAudio" | "#Microsoft.Media.Video" | "#Microsoft.Media.H265Video" | "#Microsoft.Media.CopyVideo" | "#Microsoft.Media.Image" | "#Microsoft.Media.CopyAudio" | "#Microsoft.Media.H264Video" | "#Microsoft.Media.JpgImage" | "#Microsoft.Media.PngImage" + + ## 13.0.0 (2022-09-06) **Features** diff --git a/sdk/mediaservices/arm-mediaservices/LICENSE b/sdk/mediaservices/arm-mediaservices/LICENSE index 5d1d36e0af80..3a1d9b6f24f7 100644 --- a/sdk/mediaservices/arm-mediaservices/LICENSE +++ b/sdk/mediaservices/arm-mediaservices/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2022 Microsoft +Copyright (c) 2023 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/sdk/mediaservices/arm-mediaservices/_meta.json b/sdk/mediaservices/arm-mediaservices/_meta.json index 577f3ab082d5..caa616755932 100644 --- a/sdk/mediaservices/arm-mediaservices/_meta.json +++ b/sdk/mediaservices/arm-mediaservices/_meta.json @@ -1,8 +1,8 @@ { - "commit": "5caa1523d49057d1a011bf0bdd1857dca7f9ab6b", + "commit": "4359ee079cc0f0d7c596cafeb8b363466d2d95f6", "readme": "specification/mediaservices/resource-manager/readme.md", - "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\mediaservices\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1.20220727.1 --generate-sample=true", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=F:\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\mediaservices\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.7 --generate-sample=true", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.1.20220727.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.5.4", + "use": "@autorest/typescript@6.0.0-rc.7" } \ No newline at end of file diff --git a/sdk/mediaservices/arm-mediaservices/package.json b/sdk/mediaservices/arm-mediaservices/package.json index b2ad89b93e44..3d5f27a19bec 100644 --- a/sdk/mediaservices/arm-mediaservices/package.json +++ b/sdk/mediaservices/arm-mediaservices/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for AzureMediaServices.", - "version": "13.0.1", + "version": "13.1.0", "engines": { "node": ">=14.0.0" }, @@ -11,7 +11,7 @@ "@azure/core-lro": "^2.2.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.5.0", + "@azure/core-client": "^1.6.1", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -36,9 +36,10 @@ "mkdirp": "^1.0.4", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~4.6.0", + "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", + "dotenv": "^8.2.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^2.0.0", "@azure-tools/test-credential": "^1.0.0", @@ -46,10 +47,10 @@ "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", + "@types/node": "^14.0.0", "@azure/dev-tool": "^1.0.0", "@azure/arm-storage": "^17.2.1" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mediaservices/arm-mediaservices", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" @@ -111,6 +112,7 @@ ] }, "autoPublish": true, + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mediaservices/arm-mediaservices", "//sampleConfiguration": { "productName": "", "productSlugs": [ diff --git a/sdk/mediaservices/arm-mediaservices/recordings/node/mediaservices_test/recording_mediaservices_create_test.json b/sdk/mediaservices/arm-mediaservices/recordings/node/mediaservices_test/recording_mediaservices_create_test.json index 92db01d10df5..2f38f0b90b8b 100644 --- a/sdk/mediaservices/arm-mediaservices/recordings/node/mediaservices_test/recording_mediaservices_create_test.json +++ b/sdk/mediaservices/arm-mediaservices/recordings/node/mediaservices_test/recording_mediaservices_create_test.json @@ -10,8 +10,8 @@ "Connection": "keep-alive", "Content-Length": "278", "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-storage/17.2.1 core-rest-pipeline/1.9.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "effa5d64-1ddf-4643-bf99-380218b8bb71" + "User-Agent": "azsdk-js-arm-storage/17.2.1 core-rest-pipeline/1.10.1 Node/v18.10.0 OS/(x64-Windows_NT-10.0.19042)", + "x-ms-client-request-id": "26aa8fc6-2cbc-4b7b-83fb-78c23849fade" }, "RequestBody": { "sku": { @@ -39,111 +39,12 @@ } } }, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Content-Type": "text/plain; charset=utf-8", - "Date": "Tue, 06 Sep 2022 02:38:59 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/westeurope/asyncoperations/0695ccc1-52c0-40c9-8afe-b8a1c0dbe952?monitor=true\u0026api-version=2021-09-01", - "Pragma": "no-cache", - "Retry-After": "17", - "Server": "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "d7889724-682c-44b0-a3e6-93fcd4a78b6b", - "x-ms-ratelimit-remaining-subscription-writes": "1199", - "x-ms-request-id": "0695ccc1-52c0-40c9-8afe-b8a1c0dbe952", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220906T023859Z:d7889724-682c-44b0-a3e6-93fcd4a78b6b" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/westeurope/asyncoperations/0695ccc1-52c0-40c9-8afe-b8a1c0dbe952?monitor=true\u0026api-version=2021-09-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-storage/17.2.1 core-rest-pipeline/1.9.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "a8c8539d-0106-4516-9849-d5f80e986242" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Content-Type": "text/plain; charset=utf-8", - "Date": "Tue, 06 Sep 2022 02:38:59 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/westeurope/asyncoperations/0695ccc1-52c0-40c9-8afe-b8a1c0dbe952?monitor=true\u0026api-version=2021-09-01", - "Pragma": "no-cache", - "Retry-After": "17", - "Server": "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "05bbd188-e408-46ac-af03-74237ff71419", - "x-ms-ratelimit-remaining-subscription-reads": "11999", - "x-ms-request-id": "229ffba8-ce8e-49ac-8390-c496e5046db1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220906T023900Z:05bbd188-e408-46ac-af03-74237ff71419" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/westeurope/asyncoperations/0695ccc1-52c0-40c9-8afe-b8a1c0dbe952?monitor=true\u0026api-version=2021-09-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-storage/17.2.1 core-rest-pipeline/1.9.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "df75ac6e-1384-48a7-aaf9-76568974226c" - }, - "RequestBody": null, - "StatusCode": 202, - "ResponseHeaders": { - "Cache-Control": "no-cache", - "Content-Length": "0", - "Content-Type": "text/plain; charset=utf-8", - "Date": "Tue, 06 Sep 2022 02:39:00 GMT", - "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/westeurope/asyncoperations/0695ccc1-52c0-40c9-8afe-b8a1c0dbe952?monitor=true\u0026api-version=2021-09-01", - "Pragma": "no-cache", - "Retry-After": "17", - "Server": "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", - "Strict-Transport-Security": "max-age=31536000; includeSubDomains", - "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "257d9c6c-e64c-4f18-a33a-d82035ad4872", - "x-ms-ratelimit-remaining-subscription-reads": "11998", - "x-ms-request-id": "126ab146-a903-489c-bb16-ad74525cff59", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220906T023900Z:257d9c6c-e64c-4f18-a33a-d82035ad4872" - }, - "ResponseBody": null - }, - { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Storage/locations/westeurope/asyncoperations/0695ccc1-52c0-40c9-8afe-b8a1c0dbe952?monitor=true\u0026api-version=2021-09-01", - "RequestMethod": "GET", - "RequestHeaders": { - "Accept": "application/json", - "Accept-Encoding": "gzip,deflate", - "Authorization": "Sanitized", - "Connection": "keep-alive", - "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-storage/17.2.1 core-rest-pipeline/1.9.0 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "5ff36bad-efac-4d10-8de1-cee5b1ed5cc6" - }, - "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json", - "Date": "Tue, 06 Sep 2022 02:39:17 GMT", + "Date": "Mon, 16 Jan 2023 09:30:42 GMT", "Expires": "-1", "Pragma": "no-cache", "Server": "Microsoft-Azure-Storage-Resource-Provider/1.0,Microsoft-HTTPAPI/2.0 Microsoft-HTTPAPI/2.0", @@ -151,10 +52,10 @@ "Transfer-Encoding": "chunked", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "18956d87-41d7-417e-b429-8413b9ced10a", - "x-ms-ratelimit-remaining-subscription-reads": "11997", - "x-ms-request-id": "a6db79e3-053e-4a46-bdd1-66bd2b6bbdc3", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220906T023917Z:18956d87-41d7-417e-b429-8413b9ced10a" + "x-ms-correlation-request-id": "210d5380-b9e3-4f0c-9700-bd91810d9b75", + "x-ms-ratelimit-remaining-subscription-writes": "1199", + "x-ms-request-id": "878ab93f-f399-4d47-a0b3-2f3cfa9357fd", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230116T093043Z:210d5380-b9e3-4f0c-9700-bd91810d9b75" }, "ResponseBody": { "sku": { @@ -162,7 +63,7 @@ "tier": "Standard" }, "kind": "StorageV2", - "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountxxx111", + "id": "/subscriptions/92f95d8f-3c67-4124-91c7-8cf07cdbf241/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountxxx111", "name": "mystorageaccountxxx111", "type": "Microsoft.Storage/storageAccounts", "location": "westeurope", @@ -172,8 +73,8 @@ }, "properties": { "keyCreationTime": { - "key1": "2022-09-06T02:38:57.5935630Z", - "key2": "2022-09-06T02:38:57.5935630Z" + "key1": "2023-01-16T02:23:10.8995919Z", + "key2": "2023-01-16T02:23:10.8995919Z" }, "privateEndpointConnections": [], "minimumTlsVersion": "TLS1_0", @@ -190,19 +91,19 @@ "file": { "keyType": "Account", "enabled": true, - "lastEnabledTime": "2022-09-06T02:38:57.8279517Z" + "lastEnabledTime": "2023-01-16T02:23:10.9151918Z" }, "blob": { "keyType": "Account", "enabled": true, - "lastEnabledTime": "2022-09-06T02:38:57.8279517Z" + "lastEnabledTime": "2023-01-16T02:23:10.9151918Z" } }, "keySource": "Microsoft.Storage" }, "accessTier": "Hot", "provisioningState": "Succeeded", - "creationTime": "2022-09-06T02:38:57.4529485Z", + "creationTime": "2023-01-16T02:23:10.7589455Z", "primaryEndpoints": { "dfs": "https://mystorageaccountxxx111.dfs.core.windows.net/", "web": "https://mystorageaccountxxx111.z6.web.core.windows.net/", @@ -228,8 +129,8 @@ "Connection": "keep-alive", "Content-Length": "210", "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-mediaservices/13.0.0 core-rest-pipeline/1.9.3 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "f74c6a84-5a76-4546-aec8-7bc3adaee56a" + "User-Agent": "azsdk-js-arm-mediaservices/13.1.0 core-rest-pipeline/1.10.2 Node/v18.10.0 OS/(x64-Windows_NT-10.0.19042)", + "x-ms-client-request-id": "65b8d51a-b29b-4619-83a6-a2b049fd813c" }, "RequestBody": { "location": "eastus", @@ -244,24 +145,24 @@ }, "StatusCode": 201, "ResponseHeaders": { - "Azure-AsyncOperation": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Media/locations/eastus/mediaServicesOperationStatuses/08156265-be4d-4b51-9854-e8895fe5a3f5?api-version=2021-11-01", + "Azure-AsyncOperation": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Media/locations/eastus/mediaServicesOperationStatuses/b2525167-1dae-47dc-93d7-39b3263e940a?api-version=2021-11-01", "Cache-Control": "no-cache", - "Content-Length": "733", + "Content-Length": "766", "Content-Type": "application/json; odata.metadata=minimal", - "Date": "Tue, 06 Sep 2022 02:39:21 GMT", + "Date": "Mon, 16 Jan 2023 09:30:46 GMT", "Expires": "-1", - "Location": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Media/locations/eastus/mediaServicesOperationResults/08156265-be4d-4b51-9854-e8895fe5a3f5?api-version=2021-11-01", + "Location": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Media/locations/eastus/mediaServicesOperationResults/b2525167-1dae-47dc-93d7-39b3263e940a?api-version=2021-11-01", "OData-Version": "4.0", "Pragma": "no-cache", "Retry-After": "30", "Server": "Microsoft-HTTPAPI/2.0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-client-request-id": "f74c6a84-5a76-4546-aec8-7bc3adaee56a", - "x-ms-correlation-request-id": "3b88e019-1c0c-4274-be63-3214a682d810", + "x-ms-client-request-id": "65b8d51a-b29b-4619-83a6-a2b049fd813c", + "x-ms-correlation-request-id": "3b956a1f-6700-4fa2-954a-38758f23a8a2", "x-ms-ratelimit-remaining-subscription-writes": "1198", - "x-ms-request-id": "da73e7e6-9ea5-4c1a-a886-b3e017f380b4", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220906T023922Z:3b88e019-1c0c-4274-be63-3214a682d810" + "x-ms-request-id": "f5c3d5d2-213f-419f-9950-552bcd71032d", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230116T093047Z:3b956a1f-6700-4fa2-954a-38758f23a8a2" }, "ResponseBody": { "name": "mymediaxxx", @@ -269,13 +170,14 @@ "type": "Microsoft.Media/mediaservices", "location": "East US", "properties": { - "mediaServiceId": "446dce70-1df2-4593-a609-62812e1ff39c", + "mediaServiceId": "e5db1d3a-33c1-457d-81c1-838033d77616", "storageAccounts": [ { "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountxxx111", "type": "Primary" } ], + "storageAuthentication": "System", "keyDelivery": { "accessControl": { "defaultAction": "Allow", @@ -289,7 +191,7 @@ } }, { - "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Media/locations/eastus/mediaServicesOperationStatuses/08156265-be4d-4b51-9854-e8895fe5a3f5?api-version=2021-11-01", + "RequestUri": "https://management.azure.com/subscriptions/azure_subscription_id/providers/Microsoft.Media/locations/eastus/mediaServicesOperationStatuses/b2525167-1dae-47dc-93d7-39b3263e940a?api-version=2021-11-01", "RequestMethod": "GET", "RequestHeaders": { "Accept": "application/json", @@ -297,8 +199,8 @@ "Authorization": "Sanitized", "Connection": "keep-alive", "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-mediaservices/13.0.0 core-rest-pipeline/1.9.3 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "fa9ab599-566f-4342-aeb2-63f6ae2c2bba" + "User-Agent": "azsdk-js-arm-mediaservices/13.1.0 core-rest-pipeline/1.10.2 Node/v18.10.0 OS/(x64-Windows_NT-10.0.19042)", + "x-ms-client-request-id": "9e25eb31-e0ea-4171-8736-e96dd8b0fdc1" }, "RequestBody": null, "StatusCode": 200, @@ -306,7 +208,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; odata.metadata=minimal", - "Date": "Tue, 06 Sep 2022 02:39:22 GMT", + "Date": "Mon, 16 Jan 2023 09:30:47 GMT", "Expires": "-1", "OData-Version": "4.0", "Pragma": "no-cache", @@ -315,17 +217,17 @@ "Transfer-Encoding": "chunked", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-client-request-id": "fa9ab599-566f-4342-aeb2-63f6ae2c2bba", - "x-ms-correlation-request-id": "882be393-281e-43d7-9651-eb5d8df940e0", - "x-ms-ratelimit-remaining-subscription-reads": "11996", - "x-ms-request-id": "1411fed1-4a17-433e-8657-000950c40de6", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220906T023922Z:882be393-281e-43d7-9651-eb5d8df940e0" + "x-ms-client-request-id": "9e25eb31-e0ea-4171-8736-e96dd8b0fdc1", + "x-ms-correlation-request-id": "38aa2f4b-1e43-48a3-af87-ed6932ea152f", + "x-ms-ratelimit-remaining-subscription-reads": "11999", + "x-ms-request-id": "dc2562e0-8211-4161-8875-0b6d787f4651", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230116T093047Z:38aa2f4b-1e43-48a3-af87-ed6932ea152f" }, "ResponseBody": { - "name": "08156265-be4d-4b51-9854-e8895fe5a3f5", - "id": "/subscriptions/azure_subscription_id/providers/Microsoft.Media/locations/eastus/mediaServicesOperationStatuses/08156265-be4d-4b51-9854-e8895fe5a3f5", - "startTime": "2022-09-06T02:39:20.8765452Z", - "endTime": "2022-09-06T02:39:22.2828383Z", + "name": "b2525167-1dae-47dc-93d7-39b3263e940a", + "id": "/subscriptions/azure_subscription_id/providers/Microsoft.Media/locations/eastus/mediaServicesOperationStatuses/b2525167-1dae-47dc-93d7-39b3263e940a", + "startTime": "2023-01-16T09:30:46.4626789Z", + "endTime": "2023-01-16T09:30:47.3386943Z", "status": "Succeeded" } }, @@ -338,8 +240,8 @@ "Authorization": "Sanitized", "Connection": "keep-alive", "Content-Type": "application/json", - "User-Agent": "azsdk-js-arm-mediaservices/13.0.0 core-rest-pipeline/1.9.3 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "31f31798-f582-4fd1-9b1d-dfbb92574584" + "User-Agent": "azsdk-js-arm-mediaservices/13.1.0 core-rest-pipeline/1.10.2 Node/v18.10.0 OS/(x64-Windows_NT-10.0.19042)", + "x-ms-client-request-id": "f4dfa020-f548-4e0f-8ba8-ff59b26a887e" }, "RequestBody": null, "StatusCode": 200, @@ -347,7 +249,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; odata.metadata=minimal", - "Date": "Tue, 06 Sep 2022 02:39:22 GMT", + "Date": "Mon, 16 Jan 2023 09:30:47 GMT", "Expires": "-1", "OData-Version": "4.0", "Pragma": "no-cache", @@ -356,11 +258,11 @@ "Transfer-Encoding": "chunked", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-client-request-id": "31f31798-f582-4fd1-9b1d-dfbb92574584", - "x-ms-correlation-request-id": "0f9f051e-d09e-4f3b-a8f0-a09502ad303d", - "x-ms-ratelimit-remaining-subscription-reads": "11995", - "x-ms-request-id": "3887e0a3-2c0d-4fff-80de-ff6c978d9dc8", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220906T023923Z:0f9f051e-d09e-4f3b-a8f0-a09502ad303d" + "x-ms-client-request-id": "f4dfa020-f548-4e0f-8ba8-ff59b26a887e", + "x-ms-correlation-request-id": "29c36636-8aeb-4436-b4f8-7dcfff8fd4c2", + "x-ms-ratelimit-remaining-subscription-reads": "11998", + "x-ms-request-id": "566f1353-c708-47c0-9a96-e42c9f9f160d", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230116T093048Z:29c36636-8aeb-4436-b4f8-7dcfff8fd4c2" }, "ResponseBody": { "name": "mymediaxxx", @@ -368,7 +270,7 @@ "type": "Microsoft.Media/mediaservices", "location": "East US", "properties": { - "mediaServiceId": "446dce70-1df2-4593-a609-62812e1ff39c", + "mediaServiceId": "e5db1d3a-33c1-457d-81c1-838033d77616", "storageAccounts": [ { "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountxxx111", diff --git a/sdk/mediaservices/arm-mediaservices/recordings/node/mediaservices_test/recording_mediaservices_delete_test.json b/sdk/mediaservices/arm-mediaservices/recordings/node/mediaservices_test/recording_mediaservices_delete_test.json index 805648f33616..8a26f41b808a 100644 --- a/sdk/mediaservices/arm-mediaservices/recordings/node/mediaservices_test/recording_mediaservices_delete_test.json +++ b/sdk/mediaservices/arm-mediaservices/recordings/node/mediaservices_test/recording_mediaservices_delete_test.json @@ -8,25 +8,25 @@ "Accept-Encoding": "gzip,deflate", "Authorization": "Sanitized", "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-mediaservices/13.0.0 core-rest-pipeline/1.9.3 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "9083da4a-b2ed-4814-a948-0030140d5607" + "User-Agent": "azsdk-js-arm-mediaservices/13.1.0 core-rest-pipeline/1.10.2 Node/v18.10.0 OS/(x64-Windows_NT-10.0.19042)", + "x-ms-client-request-id": "f4718254-a02b-4f5b-ba23-b460f2969e71" }, "RequestBody": null, "StatusCode": 200, "ResponseHeaders": { "Cache-Control": "no-cache", "Content-Length": "0", - "Date": "Tue, 06 Sep 2022 02:39:32 GMT", + "Date": "Mon, 16 Jan 2023 09:30:59 GMT", "Expires": "-1", "Pragma": "no-cache", "Server": "Microsoft-HTTPAPI/2.0", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "X-Content-Type-Options": "nosniff", - "x-ms-client-request-id": "9083da4a-b2ed-4814-a948-0030140d5607", - "x-ms-correlation-request-id": "366ffa7f-7d4f-4cd5-9137-1d905b9ae86d", + "x-ms-client-request-id": "f4718254-a02b-4f5b-ba23-b460f2969e71", + "x-ms-correlation-request-id": "f881a114-9403-40a7-afa4-8d73507e5c26", "x-ms-ratelimit-remaining-subscription-deletes": "14999", - "x-ms-request-id": "8c77416f-27e8-4054-91c0-fab06d2fe0c1", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220906T023933Z:366ffa7f-7d4f-4cd5-9137-1d905b9ae86d" + "x-ms-request-id": "5cb86db5-7831-43fa-9b1c-c7c02ff9629f", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230116T093059Z:f881a114-9403-40a7-afa4-8d73507e5c26" }, "ResponseBody": null }, @@ -38,8 +38,8 @@ "Accept-Encoding": "gzip,deflate", "Authorization": "Sanitized", "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-mediaservices/13.0.0 core-rest-pipeline/1.9.3 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "c1dfcce6-fad5-4eee-81f9-dcd7a96670ba" + "User-Agent": "azsdk-js-arm-mediaservices/13.1.0 core-rest-pipeline/1.10.2 Node/v18.10.0 OS/(x64-Windows_NT-10.0.19042)", + "x-ms-client-request-id": "3a6c6b0e-fcdd-4a1a-9688-071edb0439f5" }, "RequestBody": null, "StatusCode": 200, @@ -48,16 +48,16 @@ "Content-Encoding": "gzip", "Content-Length": "12", "Content-Type": "application/json; charset=utf-8", - "Date": "Tue, 06 Sep 2022 02:39:33 GMT", + "Date": "Mon, 16 Jan 2023 09:30:59 GMT", "Expires": "-1", "Pragma": "no-cache", "Strict-Transport-Security": "max-age=31536000; includeSubDomains", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-correlation-request-id": "a32734d3-9463-43e3-ad6e-22bdbc1dc011", - "x-ms-ratelimit-remaining-subscription-reads": "11992", - "x-ms-request-id": "a32734d3-9463-43e3-ad6e-22bdbc1dc011", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220906T023933Z:a32734d3-9463-43e3-ad6e-22bdbc1dc011" + "x-ms-correlation-request-id": "8fedc15d-1c9d-474c-a323-6a91db44a49e", + "x-ms-ratelimit-remaining-subscription-reads": "11995", + "x-ms-request-id": "8fedc15d-1c9d-474c-a323-6a91db44a49e", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230116T093059Z:8fedc15d-1c9d-474c-a323-6a91db44a49e" }, "ResponseBody": { "value": [] diff --git a/sdk/mediaservices/arm-mediaservices/recordings/node/mediaservices_test/recording_mediaservices_get_test.json b/sdk/mediaservices/arm-mediaservices/recordings/node/mediaservices_test/recording_mediaservices_get_test.json index e187175edff5..2a2aaa40d0ee 100644 --- a/sdk/mediaservices/arm-mediaservices/recordings/node/mediaservices_test/recording_mediaservices_get_test.json +++ b/sdk/mediaservices/arm-mediaservices/recordings/node/mediaservices_test/recording_mediaservices_get_test.json @@ -8,8 +8,8 @@ "Accept-Encoding": "gzip,deflate", "Authorization": "Sanitized", "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-mediaservices/13.0.0 core-rest-pipeline/1.9.3 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "0ecc6efa-989d-4d37-b0d3-04aa5d7c8190" + "User-Agent": "azsdk-js-arm-mediaservices/13.1.0 core-rest-pipeline/1.10.2 Node/v18.10.0 OS/(x64-Windows_NT-10.0.19042)", + "x-ms-client-request-id": "6d0a5c54-f831-402a-9cc1-ca7b148787a8" }, "RequestBody": null, "StatusCode": 200, @@ -17,7 +17,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; odata.metadata=minimal", - "Date": "Tue, 06 Sep 2022 02:39:23 GMT", + "Date": "Mon, 16 Jan 2023 09:30:49 GMT", "Expires": "-1", "OData-Version": "4.0", "Pragma": "no-cache", @@ -26,11 +26,11 @@ "Transfer-Encoding": "chunked", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-client-request-id": "0ecc6efa-989d-4d37-b0d3-04aa5d7c8190", - "x-ms-correlation-request-id": "55dda21b-4e17-48f8-98e0-3aab4860c671", - "x-ms-ratelimit-remaining-subscription-reads": "11994", - "x-ms-request-id": "a786aec9-a377-4cdb-bf2e-cf2798ecc85e", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220906T023924Z:55dda21b-4e17-48f8-98e0-3aab4860c671" + "x-ms-client-request-id": "6d0a5c54-f831-402a-9cc1-ca7b148787a8", + "x-ms-correlation-request-id": "a8f25aa9-323f-47eb-a3f3-3d3e6c6536d2", + "x-ms-ratelimit-remaining-subscription-reads": "11997", + "x-ms-request-id": "535efd07-d89f-4b69-8c03-752bc0c83681", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230116T093050Z:a8f25aa9-323f-47eb-a3f3-3d3e6c6536d2" }, "ResponseBody": { "name": "mymediaxxx", @@ -38,7 +38,7 @@ "type": "Microsoft.Media/mediaservices", "location": "East US", "properties": { - "mediaServiceId": "446dce70-1df2-4593-a609-62812e1ff39c", + "mediaServiceId": "e5db1d3a-33c1-457d-81c1-838033d77616", "storageAccounts": [ { "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountxxx111", diff --git a/sdk/mediaservices/arm-mediaservices/recordings/node/mediaservices_test/recording_mediaservices_list_test.json b/sdk/mediaservices/arm-mediaservices/recordings/node/mediaservices_test/recording_mediaservices_list_test.json index a1aa6e416d09..bea56357ea1c 100644 --- a/sdk/mediaservices/arm-mediaservices/recordings/node/mediaservices_test/recording_mediaservices_list_test.json +++ b/sdk/mediaservices/arm-mediaservices/recordings/node/mediaservices_test/recording_mediaservices_list_test.json @@ -8,8 +8,8 @@ "Accept-Encoding": "gzip,deflate", "Authorization": "Sanitized", "Connection": "keep-alive", - "User-Agent": "azsdk-js-arm-mediaservices/13.0.0 core-rest-pipeline/1.9.3 Node/v16.17.0 OS/(x64-Windows_NT-10.0.22000)", - "x-ms-client-request-id": "510a3b8f-9573-4b41-b8a0-18e1bd1b5253" + "User-Agent": "azsdk-js-arm-mediaservices/13.1.0 core-rest-pipeline/1.10.2 Node/v18.10.0 OS/(x64-Windows_NT-10.0.19042)", + "x-ms-client-request-id": "4582d16d-548e-4c96-86c8-c2f7be7149c7" }, "RequestBody": null, "StatusCode": 200, @@ -17,7 +17,7 @@ "Cache-Control": "no-cache", "Content-Encoding": "gzip", "Content-Type": "application/json; odata.metadata=minimal", - "Date": "Tue, 06 Sep 2022 02:39:24 GMT", + "Date": "Mon, 16 Jan 2023 09:30:50 GMT", "Expires": "-1", "OData-Version": "4.0", "Pragma": "no-cache", @@ -26,11 +26,11 @@ "Transfer-Encoding": "chunked", "Vary": "Accept-Encoding", "X-Content-Type-Options": "nosniff", - "x-ms-client-request-id": "510a3b8f-9573-4b41-b8a0-18e1bd1b5253", - "x-ms-correlation-request-id": "834078eb-a572-4d0b-b420-f90ede300d85", - "x-ms-ratelimit-remaining-subscription-reads": "11993", - "x-ms-request-id": "13813e40-e1e0-4973-9ddf-93e8b539ee6e", - "x-ms-routing-request-id": "SOUTHEASTASIA:20220906T023925Z:834078eb-a572-4d0b-b420-f90ede300d85" + "x-ms-client-request-id": "4582d16d-548e-4c96-86c8-c2f7be7149c7", + "x-ms-correlation-request-id": "f51d35a9-7c4e-48a6-a78f-34f19e7a9320", + "x-ms-ratelimit-remaining-subscription-reads": "11996", + "x-ms-request-id": "64873efb-acbb-4502-b88f-fa9f5db6119a", + "x-ms-routing-request-id": "SOUTHEASTASIA:20230116T093051Z:f51d35a9-7c4e-48a6-a78f-34f19e7a9320" }, "ResponseBody": { "value": [ @@ -40,7 +40,7 @@ "type": "Microsoft.Media/mediaservices", "location": "East US", "properties": { - "mediaServiceId": "446dce70-1df2-4593-a609-62812e1ff39c", + "mediaServiceId": "e5db1d3a-33c1-457d-81c1-838033d77616", "storageAccounts": [ { "id": "/subscriptions/azure_subscription_id/resourceGroups/myjstest/providers/Microsoft.Storage/storageAccounts/mystorageaccountxxx111", diff --git a/sdk/mediaservices/arm-mediaservices/review/arm-mediaservices.api.md b/sdk/mediaservices/arm-mediaservices/review/arm-mediaservices.api.md index f6e6ca48d3af..3f8d4cb3f058 100644 --- a/sdk/mediaservices/arm-mediaservices/review/arm-mediaservices.api.md +++ b/sdk/mediaservices/arm-mediaservices/review/arm-mediaservices.api.md @@ -291,9 +291,6 @@ export type AssetsListContainerSasResponse = AssetContainerSas; // @public export interface AssetsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - orderby?: string; - top?: number; } // @public @@ -376,7 +373,7 @@ export type AttributeFilter = string; interface Audio_2 extends Codec { bitrate?: number; channels?: number; - odataType: "#Microsoft.Media.Audio" | "#Microsoft.Media.AacAudio"; + odataType: "#Microsoft.Media.Audio" | "#Microsoft.Media.AacAudio" | "#Microsoft.Media.DDAudio"; samplingRate?: number; } export { Audio_2 as Audio } @@ -424,7 +421,7 @@ export interface AudioTrackDescriptor extends TrackDescriptor { export type AudioTrackDescriptorUnion = AudioTrackDescriptor | SelectAudioTrackByAttribute | SelectAudioTrackById; // @public (undocumented) -export type AudioUnion = Audio_2 | AacAudio; +export type AudioUnion = Audio_2 | AacAudio | DDAudio; // @public (undocumented) export class AzureMediaServices extends coreClient.ServiceClient { @@ -531,7 +528,7 @@ export type ClipTimeUnion = ClipTime | AbsoluteClipTime | UtcClipTime; // @public export interface Codec { label?: string; - odataType: "#Microsoft.Media.Audio" | "#Microsoft.Media.AacAudio" | "#Microsoft.Media.Video" | "#Microsoft.Media.H265Video" | "#Microsoft.Media.CopyVideo" | "#Microsoft.Media.Image" | "#Microsoft.Media.CopyAudio" | "#Microsoft.Media.H264Video" | "#Microsoft.Media.JpgImage" | "#Microsoft.Media.PngImage"; + odataType: "#Microsoft.Media.Audio" | "#Microsoft.Media.AacAudio" | "#Microsoft.Media.DDAudio" | "#Microsoft.Media.Video" | "#Microsoft.Media.H265Video" | "#Microsoft.Media.CopyVideo" | "#Microsoft.Media.Image" | "#Microsoft.Media.CopyAudio" | "#Microsoft.Media.H264Video" | "#Microsoft.Media.JpgImage" | "#Microsoft.Media.PngImage"; } // @public (undocumented) @@ -595,9 +592,6 @@ export type ContentKeyPoliciesGetResponse = ContentKeyPolicy; // @public export interface ContentKeyPoliciesListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - orderby?: string; - top?: number; } // @public @@ -860,6 +854,11 @@ export interface DashSettings { role?: string; } +// @public +export interface DDAudio extends Audio_2 { + odataType: "#Microsoft.Media.DDAudio"; +} + // @public export type DefaultAction = string; @@ -968,10 +967,19 @@ export interface FaceDetectorPreset extends Preset { // @public export type FaceRedactorMode = string; +// @public +export interface Fade { + duration: string; + fadeColor: string; + start?: string; +} + // @public export interface Filters { crop?: Rectangle; deinterlace?: Deinterlace; + fadeIn?: Fade; + fadeOut?: Fade; overlays?: OverlayUnion[]; rotation?: Rotation; } @@ -1018,6 +1026,9 @@ export interface FromEachInputFile extends InputDefinition { odataType: "#Microsoft.Media.FromEachInputFile"; } +// @public +export function getContinuationToken(page: unknown): string | undefined; + // @public export type H264Complexity = string; @@ -1291,8 +1302,6 @@ export type JobsGetResponse = Job; // @public export interface JobsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - orderby?: string; } // @public @@ -1504,6 +1513,7 @@ export enum KnownEncoderNamedPreset { ContentAwareEncoding = "ContentAwareEncoding", ContentAwareEncodingExperimental = "ContentAwareEncodingExperimental", CopyAllBitrateNonInterleaved = "CopyAllBitrateNonInterleaved", + DDGoodQualityAudio = "DDGoodQualityAudio", H264MultipleBitrate1080P = "H264MultipleBitrate1080p", H264MultipleBitrate720P = "H264MultipleBitrate720p", H264MultipleBitrateSD = "H264MultipleBitrateSD", @@ -1607,6 +1617,7 @@ export enum KnownInterleaveOutput { // @public export enum KnownJobErrorCategory { + Account = "Account", Configuration = "Configuration", Content = "Content", Download = "Download", @@ -1621,6 +1632,7 @@ export enum KnownJobErrorCode { ContentUnsupported = "ContentUnsupported", DownloadNotAccessible = "DownloadNotAccessible", DownloadTransientError = "DownloadTransientError", + IdentityUnsupported = "IdentityUnsupported", ServiceError = "ServiceError", ServiceTransientError = "ServiceTransientError", UploadNotAccessible = "UploadNotAccessible", @@ -2723,6 +2735,9 @@ export interface ServiceSpecification { // @public export interface StandardEncoderPreset extends Preset { codecs: CodecUnion[]; + experimentalOptions?: { + [propertyName: string]: string; + }; filters?: Filters; formats: FormatUnion[]; odataType: "#Microsoft.Media.StandardEncoderPreset"; @@ -2973,9 +2988,6 @@ export type StreamingLocatorsListContentKeysResponse = ListContentKeysResponse; // @public export interface StreamingLocatorsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - orderby?: string; - top?: number; } // @public @@ -3033,9 +3045,6 @@ export type StreamingPoliciesGetResponse = StreamingPolicy; // @public export interface StreamingPoliciesListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - orderby?: string; - top?: number; } // @public @@ -3321,8 +3330,6 @@ export type TransformsGetResponse = Transform; // @public export interface TransformsListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - orderby?: string; } // @public diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersCreateOrUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersCreateOrUpdateSample.ts index 61d5887c49d3..dd6ef1df2c00 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersCreateOrUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersCreateOrUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AccountFilter, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates an Account Filter in the Media Services account. * * @summary Creates or updates an Account Filter in the Media Services account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-create.json */ async function createAnAccountFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const filterName = "newAccountFilter"; const parameters: AccountFilter = { @@ -59,4 +65,8 @@ async function createAnAccountFilter() { console.log(result); } -createAnAccountFilter().catch(console.error); +async function main() { + createAnAccountFilter(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersDeleteSample.ts index f65307c05913..36c4b1700941 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes an Account Filter in the Media Services account. * * @summary Deletes an Account Filter in the Media Services account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-delete.json */ async function deleteAnAccountFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const filterName = "accountFilterWithTimeWindowAndTrack"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteAnAccountFilter() { console.log(result); } -deleteAnAccountFilter().catch(console.error); +async function main() { + deleteAnAccountFilter(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersGetSample.ts index b0ad7335baea..83c245565a76 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the details of an Account Filter in the Media Services account. * * @summary Get the details of an Account Filter in the Media Services account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-get-by-name.json */ async function getAnAccountFilterByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const filterName = "accountFilterWithTrack"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAnAccountFilterByName() { console.log(result); } -getAnAccountFilterByName().catch(console.error); +async function main() { + getAnAccountFilterByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersListSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersListSample.ts index ab9ee13f4e96..3a428d88edfb 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List Account Filters in the Media Services account. * * @summary List Account Filters in the Media Services account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-list-all.json */ async function listAllAccountFilters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listAllAccountFilters() { console.log(resArray); } -listAllAccountFilters().catch(console.error); +async function main() { + listAllAccountFilters(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersUpdateSample.ts index aa5de632238c..43ddafa08bb6 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/accountFiltersUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AccountFilter, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates an existing Account Filter in the Media Services account. * * @summary Updates an existing Account Filter in the Media Services account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-update.json */ async function updateAnAccountFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const filterName = "accountFilterWithTimeWindowAndTrack"; const parameters: AccountFilter = { @@ -44,4 +50,8 @@ async function updateAnAccountFilter() { console.log(result); } -updateAnAccountFilter().catch(console.error); +async function main() { + updateAnAccountFilter(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersCreateOrUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersCreateOrUpdateSample.ts index 15ccf36ffcdd..ff784830764c 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersCreateOrUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersCreateOrUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AssetFilter, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates an Asset Filter associated with the specified Asset. * * @summary Creates or updates an Asset Filter associated with the specified Asset. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-create.json */ async function createAnAssetFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const filterName = "newAssetFilter"; @@ -61,4 +67,8 @@ async function createAnAssetFilter() { console.log(result); } -createAnAssetFilter().catch(console.error); +async function main() { + createAnAssetFilter(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersDeleteSample.ts index c9085a49b640..16f768861483 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes an Asset Filter associated with the specified Asset. * * @summary Deletes an Asset Filter associated with the specified Asset. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-delete.json */ async function deleteAnAssetFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const filterName = "assetFilterWithTimeWindowAndTrack"; @@ -34,4 +40,8 @@ async function deleteAnAssetFilter() { console.log(result); } -deleteAnAssetFilter().catch(console.error); +async function main() { + deleteAnAssetFilter(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersGetSample.ts index e07d1aef894a..88917a6fbfbe 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the details of an Asset Filter associated with the specified Asset. * * @summary Get the details of an Asset Filter associated with the specified Asset. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-get-by-name.json */ async function getAnAssetFilterByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const filterName = "assetFilterWithTimeWindowAndTrack"; @@ -34,4 +40,8 @@ async function getAnAssetFilterByName() { console.log(result); } -getAnAssetFilterByName().catch(console.error); +async function main() { + getAnAssetFilterByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersListSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersListSample.ts index 59b5218f10ef..f6c2d18aebc0 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List Asset Filters associated with the specified Asset. * * @summary List Asset Filters associated with the specified Asset. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-list-all.json */ async function listAllAssetFilters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function listAllAssetFilters() { console.log(resArray); } -listAllAssetFilters().catch(console.error); +async function main() { + listAllAssetFilters(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersUpdateSample.ts index 95e51ce9bbe3..ef16c85cdd75 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/assetFiltersUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AssetFilter, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates an existing Asset Filter associated with the specified Asset. * * @summary Updates an existing Asset Filter associated with the specified Asset. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-update.json */ async function updateAnAssetFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const filterName = "assetFilterWithTimeWindowAndTrack"; @@ -46,4 +52,8 @@ async function updateAnAssetFilter() { console.log(result); } -updateAnAssetFilter().catch(console.error); +async function main() { + updateAnAssetFilter(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/assetsCreateOrUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/assetsCreateOrUpdateSample.ts index 01bc39e9273f..4915c03ac1c8 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/assetsCreateOrUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/assetsCreateOrUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { Asset, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates an Asset in the Media Services account * * @summary Creates or updates an Asset in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-create.json */ async function createAnAsset() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountLogan"; const parameters: Asset = { @@ -37,4 +43,8 @@ async function createAnAsset() { console.log(result); } -createAnAsset().catch(console.error); +async function main() { + createAnAsset(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/assetsDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/assetsDeleteSample.ts index b159944a9406..a42091c870e0 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/assetsDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/assetsDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes an Asset in the Media Services account * * @summary Deletes an Asset in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-delete.json */ async function deleteAnAsset() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountAdams"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteAnAsset() { console.log(result); } -deleteAnAsset().catch(console.error); +async function main() { + deleteAnAsset(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/assetsGetEncryptionKeySample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/assetsGetEncryptionKeySample.ts index d489cdc22825..747ce47a280b 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/assetsGetEncryptionKeySample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/assetsGetEncryptionKeySample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API * * @summary Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-get-encryption-keys.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-get-encryption-keys.json */ async function getAssetStorageEncryptionKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountSaintHelens"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAssetStorageEncryptionKeys() { console.log(result); } -getAssetStorageEncryptionKeys().catch(console.error); +async function main() { + getAssetStorageEncryptionKeys(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/assetsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/assetsGetSample.ts index be6f7b32b3dd..2d560fc29709 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/assetsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/assetsGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the details of an Asset in the Media Services account * * @summary Get the details of an Asset in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-get-by-name.json */ async function getAnAssetByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountAdams"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAnAssetByName() { console.log(result); } -getAnAssetByName().catch(console.error); +async function main() { + getAnAssetByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/assetsListContainerSasSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/assetsListContainerSasSample.ts index 01f67a90ca3f..38e8f14f1ad3 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/assetsListContainerSasSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/assetsListContainerSasSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. * * @summary Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-sas-urls.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-sas-urls.json */ async function listAssetSasUrLs() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountBaker"; const parameters: ListContainerSasInput = { @@ -40,4 +46,8 @@ async function listAssetSasUrLs() { console.log(result); } -listAssetSasUrLs().catch(console.error); +async function main() { + listAssetSasUrLs(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/assetsListSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/assetsListSample.ts index 934bdc25c252..2e8b036a1902 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/assetsListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/assetsListSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List Assets in the Media Services account with optional filtering and ordering * * @summary List Assets in the Media Services account with optional filtering and ordering - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-in-date-range.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-in-date-range.json */ async function listAssetCreatedInADateRange() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const filter = "properties/created gt 2012-06-01 and properties/created lt 2013-07-01"; @@ -41,17 +47,18 @@ async function listAssetCreatedInADateRange() { console.log(resArray); } -listAssetCreatedInADateRange().catch(console.error); - /** * This sample demonstrates how to List Assets in the Media Services account with optional filtering and ordering * * @summary List Assets in the Media Services account with optional filtering and ordering - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-by-date.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-by-date.json */ async function listAssetOrderedByDate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const orderby = "properties/created"; const options: AssetsListOptionalParams = { orderby }; @@ -68,17 +75,18 @@ async function listAssetOrderedByDate() { console.log(resArray); } -listAssetOrderedByDate().catch(console.error); - /** * This sample demonstrates how to List Assets in the Media Services account with optional filtering and ordering * * @summary List Assets in the Media Services account with optional filtering and ordering - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-all.json */ async function listAllAssets() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -89,4 +97,10 @@ async function listAllAssets() { console.log(resArray); } -listAllAssets().catch(console.error); +async function main() { + listAssetCreatedInADateRange(); + listAssetOrderedByDate(); + listAllAssets(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/assetsListStreamingLocatorsSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/assetsListStreamingLocatorsSample.ts index 57dc59a37db8..7221ec348d21 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/assetsListStreamingLocatorsSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/assetsListStreamingLocatorsSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists Streaming Locators which are associated with this asset. * * @summary Lists Streaming Locators which are associated with this asset. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-streaming-locators.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-streaming-locators.json */ async function listAssetSasUrLs() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountSaintHelens"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function listAssetSasUrLs() { console.log(result); } -listAssetSasUrLs().catch(console.error); +async function main() { + listAssetSasUrLs(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/assetsUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/assetsUpdateSample.ts index 889961a03ea9..5fe4f0f076f3 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/assetsUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/assetsUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { Asset, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates an existing Asset in the Media Services account * * @summary Updates an existing Asset in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-update.json */ async function updateAnAsset() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountBaker"; const parameters: Asset = { @@ -36,4 +42,8 @@ async function updateAnAsset() { console.log(result); } -updateAnAsset().catch(console.error); +async function main() { + updateAnAsset(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesCreateOrUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesCreateOrUpdateSample.ts index d185394a5196..a7a9d5e663fc 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesCreateOrUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesCreateOrUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { ContentKeyPolicy, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or update a Content Key Policy in the Media Services account * * @summary Create or update a Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-create-nodrm-token.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-nodrm-token.json */ async function createsAContentKeyPolicyWithClearKeyOptionAndTokenRestriction() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithClearKeyOptionAndSwtTokenRestriction"; const parameters: ContentKeyPolicy = { @@ -54,19 +60,18 @@ async function createsAContentKeyPolicyWithClearKeyOptionAndTokenRestriction() { console.log(result); } -createsAContentKeyPolicyWithClearKeyOptionAndTokenRestriction().catch( - console.error -); - /** * This sample demonstrates how to Create or update a Content Key Policy in the Media Services account * * @summary Create or update a Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-create-playready-open.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-playready-open.json */ async function createsAContentKeyPolicyWithPlayReadyOptionAndOpenRestriction() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithPlayReadyOptionAndOpenRestriction"; const parameters: ContentKeyPolicy = { @@ -114,19 +119,18 @@ async function createsAContentKeyPolicyWithPlayReadyOptionAndOpenRestriction() { console.log(result); } -createsAContentKeyPolicyWithPlayReadyOptionAndOpenRestriction().catch( - console.error -); - /** * This sample demonstrates how to Create or update a Content Key Policy in the Media Services account * * @summary Create or update a Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-create-widevine-token.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-widevine-token.json */ async function createsAContentKeyPolicyWithWidevineOptionAndTokenRestriction() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithWidevineOptionAndJwtTokenRestriction"; const parameters: ContentKeyPolicy = { @@ -170,19 +174,18 @@ async function createsAContentKeyPolicyWithWidevineOptionAndTokenRestriction() { console.log(result); } -createsAContentKeyPolicyWithWidevineOptionAndTokenRestriction().catch( - console.error -); - /** * This sample demonstrates how to Create or update a Content Key Policy in the Media Services account * * @summary Create or update a Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-create-multiple-options.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-multiple-options.json */ async function createsAContentKeyPolicyWithMultipleOptions() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyCreatedWithMultipleOptions"; const parameters: ContentKeyPolicy = { @@ -228,4 +231,11 @@ async function createsAContentKeyPolicyWithMultipleOptions() { console.log(result); } -createsAContentKeyPolicyWithMultipleOptions().catch(console.error); +async function main() { + createsAContentKeyPolicyWithClearKeyOptionAndTokenRestriction(); + createsAContentKeyPolicyWithPlayReadyOptionAndOpenRestriction(); + createsAContentKeyPolicyWithWidevineOptionAndTokenRestriction(); + createsAContentKeyPolicyWithMultipleOptions(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesDeleteSample.ts index 98f914ee3ab6..649cfca5f328 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Content Key Policy in the Media Services account * * @summary Deletes a Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-delete.json */ async function deleteAKeyPolicy() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithPlayReadyOptionAndOpenRestriction"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteAKeyPolicy() { console.log(result); } -deleteAKeyPolicy().catch(console.error); +async function main() { + deleteAKeyPolicy(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesGetPolicyPropertiesWithSecretsSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesGetPolicyPropertiesWithSecretsSample.ts index dd862308ce25..028c315ae2cf 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesGetPolicyPropertiesWithSecretsSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesGetPolicyPropertiesWithSecretsSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a Content Key Policy including secret values * * @summary Get a Content Key Policy including secret values - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-get-with-secrets.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-get-with-secrets.json */ async function getAnContentKeyPolicyWithSecrets() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithMultipleOptions"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAnContentKeyPolicyWithSecrets() { console.log(result); } -getAnContentKeyPolicyWithSecrets().catch(console.error); +async function main() { + getAnContentKeyPolicyWithSecrets(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesGetSample.ts index c51400e976fc..d711d1f3d157 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the details of a Content Key Policy in the Media Services account * * @summary Get the details of a Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-get-by-name.json */ async function getAContentKeyPolicyByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithMultipleOptions"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAContentKeyPolicyByName() { console.log(result); } -getAContentKeyPolicyByName().catch(console.error); +async function main() { + getAContentKeyPolicyByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesListSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesListSample.ts index c50363c77f6a..a38fb07898ce 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesListSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the Content Key Policies in the account * * @summary Lists the Content Key Policies in the account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-list-by-lastModified.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-list-by-lastModified.json */ async function listsContentKeyPoliciesOrderedByLastModified() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const orderby = "properties/lastModified"; const options: ContentKeyPoliciesListOptionalParams = { orderby }; @@ -39,17 +45,18 @@ async function listsContentKeyPoliciesOrderedByLastModified() { console.log(resArray); } -listsContentKeyPoliciesOrderedByLastModified().catch(console.error); - /** * This sample demonstrates how to Lists the Content Key Policies in the account * * @summary Lists the Content Key Policies in the account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-list-in-date-range.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-list-in-date-range.json */ async function listsContentKeyPoliciesWithCreatedAndLastModifiedFilters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const filter = "properties/lastModified gt 2016-06-01 and properties/created lt 2013-07-01"; @@ -67,17 +74,18 @@ async function listsContentKeyPoliciesWithCreatedAndLastModifiedFilters() { console.log(resArray); } -listsContentKeyPoliciesWithCreatedAndLastModifiedFilters().catch(console.error); - /** * This sample demonstrates how to Lists the Content Key Policies in the account * * @summary Lists the Content Key Policies in the account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-list-all.json */ async function listsAllContentKeyPolicies() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -91,4 +99,10 @@ async function listsAllContentKeyPolicies() { console.log(resArray); } -listsAllContentKeyPolicies().catch(console.error); +async function main() { + listsContentKeyPoliciesOrderedByLastModified(); + listsContentKeyPoliciesWithCreatedAndLastModifiedFilters(); + listsAllContentKeyPolicies(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesUpdateSample.ts index dcd8b09c260f..5f3943da0c20 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/contentKeyPoliciesUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { ContentKeyPolicy, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates an existing Content Key Policy in the Media Services account * * @summary Updates an existing Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-update.json */ async function updateAContentKeyPolicy() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithClearKeyOptionAndTokenRestriction"; const parameters: ContentKeyPolicy = { @@ -47,4 +53,8 @@ async function updateAContentKeyPolicy() { console.log(result); } -updateAContentKeyPolicy().catch(console.error); +async function main() { + updateAContentKeyPolicy(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/jobsCancelJobSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/jobsCancelJobSample.ts index 0afea373a95f..39747e3fabff 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/jobsCancelJobSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/jobsCancelJobSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Cancel a Job. * * @summary Cancel a Job. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-cancel.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-cancel.json */ async function cancelAJob() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const jobName = "job1"; @@ -34,4 +40,8 @@ async function cancelAJob() { console.log(result); } -cancelAJob().catch(console.error); +async function main() { + cancelAJob(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/jobsCreateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/jobsCreateSample.ts index b12a6b8f0e08..08d3cd66411d 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/jobsCreateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/jobsCreateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { Job, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates a Job. * * @summary Creates a Job. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-create.json */ async function createAJob() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const jobName = "job1"; @@ -48,4 +54,8 @@ async function createAJob() { console.log(result); } -createAJob().catch(console.error); +async function main() { + createAJob(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/jobsDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/jobsDeleteSample.ts index 26a971e905d2..bba6f3c032bd 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/jobsDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/jobsDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Job. * * @summary Deletes a Job. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-delete.json */ async function deleteAJob() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const jobName = "jobToDelete"; @@ -34,4 +40,8 @@ async function deleteAJob() { console.log(result); } -deleteAJob().catch(console.error); +async function main() { + deleteAJob(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/jobsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/jobsGetSample.ts index 35fcccb0be92..982937a2d945 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/jobsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/jobsGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a Job. * * @summary Gets a Job. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-get-by-name.json */ async function getAJobByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const jobName = "job1"; @@ -34,4 +40,8 @@ async function getAJobByName() { console.log(result); } -getAJobByName().catch(console.error); +async function main() { + getAJobByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/jobsListSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/jobsListSample.ts index ee54add4577b..f4122a0c6a44 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/jobsListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/jobsListSample.ts @@ -13,20 +13,26 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-created.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-created.json */ async function listsJobsForTheTransformFilterByCreated() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const filter = - "properties/created ge 2021-11-01T00:00:10.0000000Z and properties/created le 2021-11-01T00:00:20.0000000Z"; + "properties/created ge 2021-06-01T00:00:10.0000000Z and properties/created le 2021-06-01T00:00:20.0000000Z"; const orderby = "properties/created"; const options: JobsListOptionalParams = { filter, orderby }; const credential = new DefaultAzureCredential(); @@ -43,21 +49,22 @@ async function listsJobsForTheTransformFilterByCreated() { console.log(resArray); } -listsJobsForTheTransformFilterByCreated().catch(console.error); - /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-lastmodified.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-lastmodified.json */ async function listsJobsForTheTransformFilterByLastmodified() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const filter = - "properties/lastmodified ge 2021-11-01T00:00:10.0000000Z and properties/lastmodified le 2021-11-01T00:00:20.0000000Z"; + "properties/lastmodified ge 2021-06-01T00:00:10.0000000Z and properties/lastmodified le 2021-06-01T00:00:20.0000000Z"; const orderby = "properties/lastmodified desc"; const options: JobsListOptionalParams = { filter, orderby }; const credential = new DefaultAzureCredential(); @@ -74,17 +81,18 @@ async function listsJobsForTheTransformFilterByLastmodified() { console.log(resArray); } -listsJobsForTheTransformFilterByLastmodified().catch(console.error); - /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-name-and-state.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-name-and-state.json */ async function listsJobsForTheTransformFilterByNameAndState() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const filter = @@ -104,17 +112,18 @@ async function listsJobsForTheTransformFilterByNameAndState() { console.log(resArray); } -listsJobsForTheTransformFilterByNameAndState().catch(console.error); - /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-name.json */ async function listsJobsForTheTransformFilterByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const filter = "name eq 'job1' or name eq 'job2'"; @@ -134,17 +143,18 @@ async function listsJobsForTheTransformFilterByName() { console.log(resArray); } -listsJobsForTheTransformFilterByName().catch(console.error); - /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-state-eq.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-state-eq.json */ async function listsJobsForTheTransformFilterByStateEqual() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const filter = "properties/state eq Microsoft.Media.JobState'Processing'"; @@ -163,17 +173,18 @@ async function listsJobsForTheTransformFilterByStateEqual() { console.log(resArray); } -listsJobsForTheTransformFilterByStateEqual().catch(console.error); - /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-state-ne.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-state-ne.json */ async function listsJobsForTheTransformFilterByStateNotEqual() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const filter = "properties/state ne Microsoft.Media.JobState'processing'"; @@ -192,17 +203,18 @@ async function listsJobsForTheTransformFilterByStateNotEqual() { console.log(resArray); } -listsJobsForTheTransformFilterByStateNotEqual().catch(console.error); - /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all.json */ async function listsAllOfTheJobsForTheTransform() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const credential = new DefaultAzureCredential(); @@ -218,4 +230,14 @@ async function listsAllOfTheJobsForTheTransform() { console.log(resArray); } -listsAllOfTheJobsForTheTransform().catch(console.error); +async function main() { + listsJobsForTheTransformFilterByCreated(); + listsJobsForTheTransformFilterByLastmodified(); + listsJobsForTheTransformFilterByNameAndState(); + listsJobsForTheTransformFilterByName(); + listsJobsForTheTransformFilterByStateEqual(); + listsJobsForTheTransformFilterByStateNotEqual(); + listsAllOfTheJobsForTheTransform(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/jobsUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/jobsUpdateSample.ts index 7c506309017d..c19d69a51599 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/jobsUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/jobsUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { Job, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Update is only supported for description and priority. Updating Priority will take effect when the Job state is Queued or Scheduled and depending on the timing the priority update may be ignored. * * @summary Update is only supported for description and priority. Updating Priority will take effect when the Job state is Queued or Scheduled and depending on the timing the priority update may be ignored. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-update.json */ async function updateAJob() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const jobName = "job1"; @@ -49,4 +55,8 @@ async function updateAJob() { console.log(result); } -updateAJob().catch(console.error); +async function main() { + updateAJob(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsAllocateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsAllocateSample.ts index 4bbd4a3ee080..f83d735f9422 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsAllocateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsAllocateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to A live event is in StandBy state after allocation completes, and is ready to start. * * @summary A live event is in StandBy state after allocation completes, and is ready to start. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-allocate.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-allocate.json */ async function allocateALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function allocateALiveEvent() { console.log(result); } -allocateALiveEvent().catch(console.error); +async function main() { + allocateALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsAsyncOperationSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsAsyncOperationSample.ts index 5a4daae18121..c1530195bd53 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsAsyncOperationSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsAsyncOperationSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a live event operation status. * * @summary Get a live event operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/async-operation-result.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json */ async function getTheLiveEventOperationStatus() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const operationId = "62e4d893-d233-4005-988e-a428d9f77076"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getTheLiveEventOperationStatus() { console.log(result); } -getTheLiveEventOperationStatus().catch(console.error); +async function main() { + getTheLiveEventOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsCreateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsCreateSample.ts index 242bef561220..f7f1d5188cdc 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsCreateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsCreateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { LiveEvent, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates a new live event. * * @summary Creates a new live event. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-create.json */ async function createALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const parameters: LiveEvent = { @@ -58,4 +64,8 @@ async function createALiveEvent() { console.log(result); } -createALiveEvent().catch(console.error); +async function main() { + createALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsDeleteSample.ts index 920ca8775f79..78e5e5349b07 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a live event. * * @summary Deletes a live event. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-delete.json */ async function deleteALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteALiveEvent() { console.log(result); } -deleteALiveEvent().catch(console.error); +async function main() { + deleteALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsGetSample.ts index 83371da957b3..1f542582e55a 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets properties of a live event. * * @summary Gets properties of a live event. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-list-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-list-by-name.json */ async function getALiveEventByName() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getALiveEventByName() { console.log(result); } -getALiveEventByName().catch(console.error); +async function main() { + getALiveEventByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsListSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsListSample.ts index efbf0a1b156c..476de48ba313 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all the live events in the account. * * @summary Lists all the live events in the account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-list-all.json */ async function listAllLiveEvents() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listAllLiveEvents() { console.log(resArray); } -listAllLiveEvents().catch(console.error); +async function main() { + listAllLiveEvents(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsOperationLocationSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsOperationLocationSample.ts index 12f0233220d5..3fbfa8c8a2ef 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsOperationLocationSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsOperationLocationSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a live event operation status. * * @summary Get a live event operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-operation-location.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-operation-location.json */ async function getTheLiveEventOperationStatus() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const operationId = "62e4d893-d233-4005-988e-a428d9f77076"; @@ -34,4 +40,8 @@ async function getTheLiveEventOperationStatus() { console.log(result); } -getTheLiveEventOperationStatus().catch(console.error); +async function main() { + getTheLiveEventOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsResetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsResetSample.ts index 259cc8f9e73f..54750d2fd2b0 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsResetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsResetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and will be started again. All assets used by the live outputs and streaming locators created on these assets are unaffected. * * @summary Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and will be started again. All assets used by the live outputs and streaming locators created on these assets are unaffected. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-reset.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-reset.json */ async function resetALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function resetALiveEvent() { console.log(result); } -resetALiveEvent().catch(console.error); +async function main() { + resetALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsStartSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsStartSample.ts index 2a1df1f5cce1..3bdcd67b1afb 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsStartSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsStartSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to A live event in Stopped or StandBy state will be in Running state after the start operation completes. * * @summary A live event in Stopped or StandBy state will be in Running state after the start operation completes. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-start.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-start.json */ async function startALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function startALiveEvent() { console.log(result); } -startALiveEvent().catch(console.error); +async function main() { + startALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsStopSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsStopSample.ts index ab04223575f7..d64446a141ba 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsStopSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsStopSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Stops a running live event. * * @summary Stops a running live event. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-stop.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-stop.json */ async function stopALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const parameters: LiveEventActionInput = { removeOutputsOnStop: false }; @@ -37,4 +43,8 @@ async function stopALiveEvent() { console.log(result); } -stopALiveEvent().catch(console.error); +async function main() { + stopALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsUpdateSample.ts index e290681a1d28..6a170dc47c91 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/liveEventsUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { LiveEvent, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates settings on an existing live event. * * @summary Updates settings on an existing live event. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-update.json */ async function updateALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const parameters: LiveEvent = { @@ -50,4 +56,8 @@ async function updateALiveEvent() { console.log(result); } -updateALiveEvent().catch(console.error); +async function main() { + updateALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsAsyncOperationSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsAsyncOperationSample.ts index eebe139233c3..3320015aa386 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsAsyncOperationSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsAsyncOperationSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a Live Output operation status. * * @summary Get a Live Output operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/async-operation-result.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json */ async function getTheLiveOutputOperationStatus() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const operationId = "62e4d893-d233-4005-988e-a428d9f77076"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getTheLiveOutputOperationStatus() { console.log(result); } -getTheLiveOutputOperationStatus().catch(console.error); +async function main() { + getTheLiveOutputOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsCreateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsCreateSample.ts index ea077b119f9f..16c1be02786b 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsCreateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsCreateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { LiveOutput, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates a new live output. * * @summary Creates a new live output. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-create.json */ async function createALiveOutput() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const liveOutputName = "myLiveOutput1"; @@ -43,4 +49,8 @@ async function createALiveOutput() { console.log(result); } -createALiveOutput().catch(console.error); +async function main() { + createALiveOutput(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsDeleteSample.ts index fb65a6f3a77b..cd6923502357 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. * * @summary Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-delete.json */ async function deleteALiveOutput() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const liveOutputName = "myLiveOutput1"; @@ -34,4 +40,8 @@ async function deleteALiveOutput() { console.log(result); } -deleteALiveOutput().catch(console.error); +async function main() { + deleteALiveOutput(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsGetSample.ts index 448e278b277d..b103aa3a3d32 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a live output. * * @summary Gets a live output. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-list-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-list-by-name.json */ async function getALiveOutputByName() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const liveOutputName = "myLiveOutput1"; @@ -34,4 +40,8 @@ async function getALiveOutputByName() { console.log(result); } -getALiveOutputByName().catch(console.error); +async function main() { + getALiveOutputByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsListSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsListSample.ts index e779c2374e5f..a5bbbbc61704 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the live outputs of a live event. * * @summary Lists the live outputs of a live event. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-list-all.json */ async function listAllLiveOutputs() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function listAllLiveOutputs() { console.log(resArray); } -listAllLiveOutputs().catch(console.error); +async function main() { + listAllLiveOutputs(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsOperationLocationSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsOperationLocationSample.ts index 3547a3caf465..1901050e93e9 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsOperationLocationSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/liveOutputsOperationLocationSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a Live Output operation status. * * @summary Get a Live Output operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-operation-location.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-operation-location.json */ async function getTheLiveOutputOperationStatus() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const liveOutputName = "myLiveOutput1"; @@ -36,4 +42,8 @@ async function getTheLiveOutputOperationStatus() { console.log(result); } -getTheLiveOutputOperationStatus().catch(console.error); +async function main() { + getTheLiveOutputOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/locationsCheckNameAvailabilitySample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/locationsCheckNameAvailabilitySample.ts index 97865b2b68ba..a118d2d54aef 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/locationsCheckNameAvailabilitySample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/locationsCheckNameAvailabilitySample.ts @@ -13,15 +13,20 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks whether the Media Service resource name is available. * * @summary Checks whether the Media Service resource name is available. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-check-name-availability.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-check-name-availability.json */ async function checkNameAvailability() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const locationName = "japanwest"; const parameters: CheckNameAvailabilityInput = { name: "contosotv", @@ -36,4 +41,8 @@ async function checkNameAvailability() { console.log(result); } -checkNameAvailability().catch(console.error); +async function main() { + checkNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaServicesOperationResultsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaServicesOperationResultsGetSample.ts index 708adc92a64b..31a65bacc2ec 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaServicesOperationResultsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaServicesOperationResultsGetSample.ts @@ -10,15 +10,20 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get media service operation result. * * @summary Get media service operation result. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/media-service-operation-result-by-id.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-result-by-id.json */ async function getStatusOfAsynchronousOperation() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const locationName = "westus"; const operationId = "6FBA62C4-99B5-4FF8-9826-FC4744A8864F"; const credential = new DefaultAzureCredential(); @@ -30,4 +35,8 @@ async function getStatusOfAsynchronousOperation() { console.log(result); } -getStatusOfAsynchronousOperation().catch(console.error); +async function main() { + getStatusOfAsynchronousOperation(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaServicesOperationStatusesGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaServicesOperationStatusesGetSample.ts index 6e411d105d37..9acf839ea6b1 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaServicesOperationStatusesGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaServicesOperationStatusesGetSample.ts @@ -10,15 +10,20 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get media service operation status. * * @summary Get media service operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state-failed.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state-failed.json */ async function getStatusOfAsynchronousOperationWhenItIsCompletedWithError() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const locationName = "westus"; const operationId = "D612C429-2526-49D5-961B-885AE11406FD"; const credential = new DefaultAzureCredential(); @@ -30,18 +35,16 @@ async function getStatusOfAsynchronousOperationWhenItIsCompletedWithError() { console.log(result); } -getStatusOfAsynchronousOperationWhenItIsCompletedWithError().catch( - console.error -); - /** * This sample demonstrates how to Get media service operation status. * * @summary Get media service operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/media-service-operation-status-by-id-terminal-state.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-status-by-id-terminal-state.json */ async function getStatusOfAsynchronousOperationWhenItIsCompleted() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const locationName = "westus"; const operationId = "D612C429-2526-49D5-961B-885AE11406FD"; const credential = new DefaultAzureCredential(); @@ -53,16 +56,16 @@ async function getStatusOfAsynchronousOperationWhenItIsCompleted() { console.log(result); } -getStatusOfAsynchronousOperationWhenItIsCompleted().catch(console.error); - /** * This sample demonstrates how to Get media service operation status. * * @summary Get media service operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state.json */ async function getStatusOfAsynchronousOperationWhenItIsOngoing() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const locationName = "westus"; const operationId = "D612C429-2526-49D5-961B-885AE11406FD"; const credential = new DefaultAzureCredential(); @@ -74,4 +77,10 @@ async function getStatusOfAsynchronousOperationWhenItIsOngoing() { console.log(result); } -getStatusOfAsynchronousOperationWhenItIsOngoing().catch(console.error); +async function main() { + getStatusOfAsynchronousOperationWhenItIsCompletedWithError(); + getStatusOfAsynchronousOperationWhenItIsCompleted(); + getStatusOfAsynchronousOperationWhenItIsOngoing(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesCreateOrUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesCreateOrUpdateSample.ts index 957af57cc1f0..e219c943c697 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesCreateOrUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesCreateOrUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { MediaService, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a Media Services account * * @summary Creates or updates a Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/async-accounts-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/async-accounts-create.json */ async function createAMediaServicesAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const parameters: MediaService = { encryption: { @@ -65,4 +71,8 @@ async function createAMediaServicesAccount() { console.log(result); } -createAMediaServicesAccount().catch(console.error); +async function main() { + createAMediaServicesAccount(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesDeleteSample.ts index a4e04c6a0351..197a894ae5c7 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Media Services account * * @summary Deletes a Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-delete.json */ async function deleteAMediaServicesAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -30,4 +36,8 @@ async function deleteAMediaServicesAccount() { console.log(result); } -deleteAMediaServicesAccount().catch(console.error); +async function main() { + deleteAMediaServicesAccount(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesGetSample.ts index a8b55a60257d..03400c7109b0 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the details of a Media Services account * * @summary Get the details of a Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-get-by-name.json */ async function getAMediaServicesAccountByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosotv"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -27,4 +33,8 @@ async function getAMediaServicesAccountByName() { console.log(result); } -getAMediaServicesAccountByName().catch(console.error); +async function main() { + getAMediaServicesAccountByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesListBySubscriptionSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesListBySubscriptionSample.ts index b764b456170a..e668335e2ecb 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesListBySubscriptionSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesListBySubscriptionSample.ts @@ -10,15 +10,20 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List Media Services accounts in the subscription. * * @summary List Media Services accounts in the subscription. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-subscription-list-all-accounts.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-subscription-list-all-accounts.json */ async function listAllMediaServicesAccounts() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +33,8 @@ async function listAllMediaServicesAccounts() { console.log(resArray); } -listAllMediaServicesAccounts().catch(console.error); +async function main() { + listAllMediaServicesAccounts(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesListEdgePoliciesSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesListEdgePoliciesSample.ts index 812563f07b94..81b65cd134b8 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesListEdgePoliciesSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesListEdgePoliciesSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List all the media edge policies associated with the Media Services account. * * @summary List all the media edge policies associated with the Media Services account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-list-media-edge-policies.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-list-media-edge-policies.json */ async function listTheMediaEdgePolicies() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const parameters: ListEdgePoliciesInput = { deviceId: "contosiothubhost_contosoiotdevice" @@ -37,4 +43,8 @@ async function listTheMediaEdgePolicies() { console.log(result); } -listTheMediaEdgePolicies().catch(console.error); +async function main() { + listTheMediaEdgePolicies(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesListSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesListSample.ts index a24336b5c2d9..d8996614d607 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List Media Services accounts in the resource group * * @summary List Media Services accounts in the resource group - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-list-all-accounts.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-list-all-accounts.json */ async function listAllMediaServicesAccounts() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); const resArray = new Array(); @@ -29,4 +35,8 @@ async function listAllMediaServicesAccounts() { console.log(resArray); } -listAllMediaServicesAccounts().catch(console.error); +async function main() { + listAllMediaServicesAccounts(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesSyncStorageKeysSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesSyncStorageKeysSample.ts index d1a4238f9700..0c119d9c27f9 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesSyncStorageKeysSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesSyncStorageKeysSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Synchronizes storage account keys for a storage account associated with the Media Service account. * * @summary Synchronizes storage account keys for a storage account associated with the Media Service account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-sync-storage-keys.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-sync-storage-keys.json */ async function synchronizesStorageAccountKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const parameters: SyncStorageKeysInput = { id: "contososportsstore" }; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function synchronizesStorageAccountKeys() { console.log(result); } -synchronizesStorageAccountKeys().catch(console.error); +async function main() { + synchronizesStorageAccountKeys(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesUpdateSample.ts index 8f123beddf45..59d86facf94e 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/mediaservicesUpdateSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates an existing Media Services account * * @summary Updates an existing Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/async-accounts-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/async-accounts-update.json */ async function updateAMediaServicesAccounts() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const parameters: MediaServiceUpdate = { tags: { key1: "value3" } }; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function updateAMediaServicesAccounts() { console.log(result); } -updateAMediaServicesAccounts().catch(console.error); +async function main() { + updateAMediaServicesAccounts(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/operationResultsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/operationResultsGetSample.ts index 611af1e46671..6bf725d0b399 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/operationResultsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/operationResultsGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get asset track operation result. * * @summary Get asset track operation result. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-operation-result-by-id.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-result-by-id.json */ async function getResultOfAsynchronousOperation() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text1"; @@ -36,4 +42,8 @@ async function getResultOfAsynchronousOperation() { console.log(result); } -getResultOfAsynchronousOperation().catch(console.error); +async function main() { + getResultOfAsynchronousOperation(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/operationStatusesGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/operationStatusesGetSample.ts index 33823685b196..2ed9a59e254f 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/operationStatusesGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/operationStatusesGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get asset track operation status. * * @summary Get asset track operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state-failed.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state-failed.json */ async function getStatusOfAsynchronousOperationWhenItIsCompletedWithError() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text1"; @@ -36,19 +42,18 @@ async function getStatusOfAsynchronousOperationWhenItIsCompletedWithError() { console.log(result); } -getStatusOfAsynchronousOperationWhenItIsCompletedWithError().catch( - console.error -); - /** * This sample demonstrates how to Get asset track operation status. * * @summary Get asset track operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state.json */ async function getStatusOfAsynchronousOperationWhenItIsCompleted() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text1"; @@ -65,17 +70,18 @@ async function getStatusOfAsynchronousOperationWhenItIsCompleted() { console.log(result); } -getStatusOfAsynchronousOperationWhenItIsCompleted().catch(console.error); - /** * This sample demonstrates how to Get asset track operation status. * * @summary Get asset track operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-non-terminal-state.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-non-terminal-state.json */ async function getStatusOfAsynchronousOperationWhenItIsOngoing() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text1"; @@ -92,4 +98,10 @@ async function getStatusOfAsynchronousOperationWhenItIsOngoing() { console.log(result); } -getStatusOfAsynchronousOperationWhenItIsOngoing().catch(console.error); +async function main() { + getStatusOfAsynchronousOperationWhenItIsCompletedWithError(); + getStatusOfAsynchronousOperationWhenItIsCompleted(); + getStatusOfAsynchronousOperationWhenItIsOngoing(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/operationsListSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/operationsListSample.ts index 0872c6d8ce6c..11f3acc29932 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/operationsListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/operationsListSample.ts @@ -10,19 +10,28 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all the Media Services operations. * * @summary Lists all the Media Services operations. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/operations-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/operations-list-all.json */ async function listOperations() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); const result = await client.operations.list(); console.log(result); } -listOperations().catch(console.error); +async function main() { + listOperations(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.ts index 31ba18df0a34..022560ccca65 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Update an existing private endpoint connection. * * @summary Update an existing private endpoint connection. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-put.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-put.json */ async function updatePrivateEndpointConnection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const name = "connectionName1"; const parameters: PrivateEndpointConnection = { @@ -42,4 +48,8 @@ async function updatePrivateEndpointConnection() { console.log(result); } -updatePrivateEndpointConnection().catch(console.error); +async function main() { + updatePrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/privateEndpointConnectionsDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/privateEndpointConnectionsDeleteSample.ts index 492fd2bc7c11..ce3f77f95d44 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/privateEndpointConnectionsDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/privateEndpointConnectionsDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a private endpoint connection. * * @summary Deletes a private endpoint connection. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-delete.json */ async function deletePrivateEndpointConnection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const name = "connectionName1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deletePrivateEndpointConnection() { console.log(result); } -deletePrivateEndpointConnection().catch(console.error); +async function main() { + deletePrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/privateEndpointConnectionsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/privateEndpointConnectionsGetSample.ts index 6ecacc3c8d81..41cc2b23ec68 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/privateEndpointConnectionsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/privateEndpointConnectionsGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the details of a private endpoint connection. * * @summary Get the details of a private endpoint connection. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-get-by-name.json */ async function getPrivateEndpointConnection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const name = "connectionName1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getPrivateEndpointConnection() { console.log(result); } -getPrivateEndpointConnection().catch(console.error); +async function main() { + getPrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/privateEndpointConnectionsListSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/privateEndpointConnectionsListSample.ts index 17a970c1fa54..a15a414d9cb4 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/privateEndpointConnectionsListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/privateEndpointConnectionsListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List all private endpoint connections. * * @summary List all private endpoint connections. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-list.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-list.json */ async function getAllPrivateEndpointConnections() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -30,4 +36,8 @@ async function getAllPrivateEndpointConnections() { console.log(result); } -getAllPrivateEndpointConnections().catch(console.error); +async function main() { + getAllPrivateEndpointConnections(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/privateLinkResourcesGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/privateLinkResourcesGetSample.ts index 7c1e22a88abe..1fb3e907dbf0 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/privateLinkResourcesGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/privateLinkResourcesGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get details of a group ID. * * @summary Get details of a group ID. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-link-resources-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-link-resources-get-by-name.json */ async function getDetailsOfAGroupId() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const name = "keydelivery"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getDetailsOfAGroupId() { console.log(result); } -getDetailsOfAGroupId().catch(console.error); +async function main() { + getDetailsOfAGroupId(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/privateLinkResourcesListSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/privateLinkResourcesListSample.ts index 98d3cf2276ba..a92980551c2e 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/privateLinkResourcesListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/privateLinkResourcesListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List supported group IDs. * * @summary List supported group IDs. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-link-resources-list.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-link-resources-list.json */ async function getListOfAllGroupIDs() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -30,4 +36,8 @@ async function getListOfAllGroupIDs() { console.log(result); } -getListOfAllGroupIDs().catch(console.error); +async function main() { + getListOfAllGroupIDs(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsAsyncOperationSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsAsyncOperationSample.ts index bbc26d33eec8..99badfc5ffd5 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsAsyncOperationSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsAsyncOperationSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a streaming endpoint operation status. * * @summary Get a streaming endpoint operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/async-operation-result.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json */ async function getTheStreamingEndpointOperationStatus() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const operationId = "62e4d893-d233-4005-988e-a428d9f77076"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getTheStreamingEndpointOperationStatus() { console.log(result); } -getTheStreamingEndpointOperationStatus().catch(console.error); +async function main() { + getTheStreamingEndpointOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsCreateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsCreateSample.ts index 71930345ea21..65826091681a 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsCreateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsCreateSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates a streaming endpoint. * * @summary Creates a streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-create.json */ async function createAStreamingEndpoint() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const parameters: StreamingEndpoint = { @@ -61,4 +67,8 @@ async function createAStreamingEndpoint() { console.log(result); } -createAStreamingEndpoint().catch(console.error); +async function main() { + createAStreamingEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsDeleteSample.ts index f334108abae2..08a47d038291 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a streaming endpoint. * * @summary Deletes a streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-delete.json */ async function deleteAStreamingEndpoint() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteAStreamingEndpoint() { console.log(result); } -deleteAStreamingEndpoint().catch(console.error); +async function main() { + deleteAStreamingEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsGetSample.ts index 0b3984dc5505..ee59b865bca0 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a streaming endpoint. * * @summary Gets a streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-list-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-list-by-name.json */ async function getAStreamingEndpointByName() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAStreamingEndpointByName() { console.log(result); } -getAStreamingEndpointByName().catch(console.error); +async function main() { + getAStreamingEndpointByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsListSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsListSample.ts index 98e6bdbd663a..5bf0c5a3486c 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the streaming endpoints in the account. * * @summary Lists the streaming endpoints in the account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-list-all.json */ async function listAllStreamingEndpoints() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listAllStreamingEndpoints() { console.log(resArray); } -listAllStreamingEndpoints().catch(console.error); +async function main() { + listAllStreamingEndpoints(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsOperationLocationSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsOperationLocationSample.ts index 04783e184e65..4f4d16ec5b24 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsOperationLocationSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsOperationLocationSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a streaming endpoint operation status. * * @summary Get a streaming endpoint operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-operation-location.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-operation-location.json */ async function getTheStreamingEndpointOperationStatus() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const operationId = "62e4d893-d233-4005-988e-a428d9f77076"; @@ -34,4 +40,8 @@ async function getTheStreamingEndpointOperationStatus() { console.log(result); } -getTheStreamingEndpointOperationStatus().catch(console.error); +async function main() { + getTheStreamingEndpointOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsScaleSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsScaleSample.ts index f0cf0c929d73..285190d70056 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsScaleSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsScaleSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Scales an existing streaming endpoint. * * @summary Scales an existing streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-scale.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-scale.json */ async function scaleAStreamingEndpoint() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const parameters: StreamingEntityScaleUnit = { scaleUnit: 5 }; @@ -37,4 +43,8 @@ async function scaleAStreamingEndpoint() { console.log(result); } -scaleAStreamingEndpoint().catch(console.error); +async function main() { + scaleAStreamingEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsSkusSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsSkusSample.ts index 33743b5aa774..169f5a8dfc86 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsSkusSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsSkusSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List streaming endpoint supported skus. * * @summary List streaming endpoint supported skus. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-list-skus.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-list-skus.json */ async function listAStreamingEndpointSku() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function listAStreamingEndpointSku() { console.log(result); } -listAStreamingEndpointSku().catch(console.error); +async function main() { + listAStreamingEndpointSku(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsStartSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsStartSample.ts index 2b5c003bd75b..d69c2e5e7dd4 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsStartSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsStartSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Starts an existing streaming endpoint. * * @summary Starts an existing streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-start.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-start.json */ async function startAStreamingEndpoint() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function startAStreamingEndpoint() { console.log(result); } -startAStreamingEndpoint().catch(console.error); +async function main() { + startAStreamingEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsStopSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsStopSample.ts index 19d180cb295e..4b866d8d3607 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsStopSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsStopSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Stops an existing streaming endpoint. * * @summary Stops an existing streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-stop.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-stop.json */ async function stopAStreamingEndpoint() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function stopAStreamingEndpoint() { console.log(result); } -stopAStreamingEndpoint().catch(console.error); +async function main() { + stopAStreamingEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsUpdateSample.ts index abe257dc1735..d62b82a7ecc5 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingEndpointsUpdateSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates a existing streaming endpoint. * * @summary Updates a existing streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-update.json */ async function updateAStreamingEndpoint() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const parameters: StreamingEndpoint = { @@ -43,4 +49,8 @@ async function updateAStreamingEndpoint() { console.log(result); } -updateAStreamingEndpoint().catch(console.error); +async function main() { + updateAStreamingEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsCreateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsCreateSample.ts index 91fb56111863..a4e8bb7e9cd7 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsCreateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsCreateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { StreamingLocator, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create a Streaming Locator in the Media Services account * * @summary Create a Streaming Locator in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-create-clear.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-create-clear.json */ async function createsAStreamingLocatorWithClearStreaming() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "UserCreatedClearStreamingLocator"; const parameters: StreamingLocator = { @@ -37,17 +43,18 @@ async function createsAStreamingLocatorWithClearStreaming() { console.log(result); } -createsAStreamingLocatorWithClearStreaming().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Locator in the Media Services account * * @summary Create a Streaming Locator in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-create-secure.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-create-secure.json */ async function createsAStreamingLocatorWithSecureStreaming() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "UserCreatedSecureStreamingLocator"; const parameters: StreamingLocator = { @@ -67,17 +74,18 @@ async function createsAStreamingLocatorWithSecureStreaming() { console.log(result); } -createsAStreamingLocatorWithSecureStreaming().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Locator in the Media Services account * * @summary Create a Streaming Locator in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-create-secure-userDefinedContentKeys.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-create-secure-userDefinedContentKeys.json */ async function createsAStreamingLocatorWithUserDefinedContentKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "UserCreatedSecureStreamingLocatorWithUserDefinedContentKeys"; @@ -114,4 +122,10 @@ async function createsAStreamingLocatorWithUserDefinedContentKeys() { console.log(result); } -createsAStreamingLocatorWithUserDefinedContentKeys().catch(console.error); +async function main() { + createsAStreamingLocatorWithClearStreaming(); + createsAStreamingLocatorWithSecureStreaming(); + createsAStreamingLocatorWithUserDefinedContentKeys(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsDeleteSample.ts index 748f898dad49..3050ec03859b 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Streaming Locator in the Media Services account * * @summary Deletes a Streaming Locator in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-delete.json */ async function deleteAStreamingLocator() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "clearStreamingLocator"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteAStreamingLocator() { console.log(result); } -deleteAStreamingLocator().catch(console.error); +async function main() { + deleteAStreamingLocator(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsGetSample.ts index 13a3071fc4b6..5537e15fd438 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the details of a Streaming Locator in the Media Services account * * @summary Get the details of a Streaming Locator in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-get-by-name.json */ async function getAStreamingLocatorByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "clearStreamingLocator"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAStreamingLocatorByName() { console.log(result); } -getAStreamingLocatorByName().catch(console.error); +async function main() { + getAStreamingLocatorByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsListContentKeysSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsListContentKeysSample.ts index 20f08a0c82b8..2c2462aae194 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsListContentKeysSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsListContentKeysSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List Content Keys used by this Streaming Locator * * @summary List Content Keys used by this Streaming Locator - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-list-content-keys.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list-content-keys.json */ async function listContentKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "secureStreamingLocator"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function listContentKeys() { console.log(result); } -listContentKeys().catch(console.error); +async function main() { + listContentKeys(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsListPathsSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsListPathsSample.ts index 6c234c934126..586ab211135d 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsListPathsSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsListPathsSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List Paths supported by this Streaming Locator * * @summary List Paths supported by this Streaming Locator - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-and-download.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-and-download.json */ async function listPathsWhichHasStreamingPathsAndDownloadPaths() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "clearStreamingLocator"; const credential = new DefaultAzureCredential(); @@ -32,17 +38,18 @@ async function listPathsWhichHasStreamingPathsAndDownloadPaths() { console.log(result); } -listPathsWhichHasStreamingPathsAndDownloadPaths().catch(console.error); - /** * This sample demonstrates how to List Paths supported by this Streaming Locator * * @summary List Paths supported by this Streaming Locator - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-only.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-only.json */ async function listPathsWhichHasStreamingPathsOnly() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "secureStreamingLocator"; const credential = new DefaultAzureCredential(); @@ -55,4 +62,9 @@ async function listPathsWhichHasStreamingPathsOnly() { console.log(result); } -listPathsWhichHasStreamingPathsOnly().catch(console.error); +async function main() { + listPathsWhichHasStreamingPathsAndDownloadPaths(); + listPathsWhichHasStreamingPathsOnly(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsListSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsListSample.ts index 6dcc3df9c3e0..f2f9cf032468 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingLocatorsListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the Streaming Locators in the account * * @summary Lists the Streaming Locators in the account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-list.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list.json */ async function listsStreamingLocators() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listsStreamingLocators() { console.log(resArray); } -listsStreamingLocators().catch(console.error); +async function main() { + listsStreamingLocators(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingPoliciesCreateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingPoliciesCreateSample.ts index 18e91d60d8c8..bff98ca9bf27 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingPoliciesCreateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingPoliciesCreateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { StreamingPolicy, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-clearKeyEncryption.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-clearKeyEncryption.json */ async function createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCbcs() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedSecureStreamingPolicyWithCommonEncryptionCbcsOnly"; @@ -50,19 +56,18 @@ async function createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCb console.log(result); } -createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCbcs().catch( - console.error -); - /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCenc-clearKeyEncryption.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCenc-clearKeyEncryption.json */ async function createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCenc() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedSecureStreamingPolicyWithCommonEncryptionCencOnly"; @@ -100,19 +105,18 @@ async function createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCe console.log(result); } -createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCenc().catch( - console.error -); - /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-clear.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-clear.json */ async function createsAStreamingPolicyWithClearStreaming() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedClearStreamingPolicy"; const parameters: StreamingPolicy = { @@ -136,17 +140,18 @@ async function createsAStreamingPolicyWithClearStreaming() { console.log(result); } -createsAStreamingPolicyWithClearStreaming().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-only.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-only.json */ async function createsAStreamingPolicyWithCommonEncryptionCbcsOnly() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedSecureStreamingPolicyWithCommonEncryptionCbcsOnly"; @@ -180,17 +185,18 @@ async function createsAStreamingPolicyWithCommonEncryptionCbcsOnly() { console.log(result); } -createsAStreamingPolicyWithCommonEncryptionCbcsOnly().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCenc-only.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCenc-only.json */ async function createsAStreamingPolicyWithCommonEncryptionCencOnly() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedSecureStreamingPolicyWithCommonEncryptionCencOnly"; @@ -235,17 +241,18 @@ async function createsAStreamingPolicyWithCommonEncryptionCencOnly() { console.log(result); } -createsAStreamingPolicyWithCommonEncryptionCencOnly().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-envelopeEncryption-only.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-envelopeEncryption-only.json */ async function createsAStreamingPolicyWithEnvelopeEncryptionOnly() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedSecureStreamingPolicyWithEnvelopeEncryptionOnly"; @@ -274,17 +281,18 @@ async function createsAStreamingPolicyWithEnvelopeEncryptionOnly() { console.log(result); } -createsAStreamingPolicyWithEnvelopeEncryptionOnly().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-secure-streaming.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-secure-streaming.json */ async function createsAStreamingPolicyWithSecureStreaming() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedSecureStreamingPolicy"; const parameters: StreamingPolicy = { @@ -355,4 +363,14 @@ async function createsAStreamingPolicyWithSecureStreaming() { console.log(result); } -createsAStreamingPolicyWithSecureStreaming().catch(console.error); +async function main() { + createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCbcs(); + createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCenc(); + createsAStreamingPolicyWithClearStreaming(); + createsAStreamingPolicyWithCommonEncryptionCbcsOnly(); + createsAStreamingPolicyWithCommonEncryptionCencOnly(); + createsAStreamingPolicyWithEnvelopeEncryptionOnly(); + createsAStreamingPolicyWithSecureStreaming(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingPoliciesDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingPoliciesDeleteSample.ts index d63458402c96..3715299083d9 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingPoliciesDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingPoliciesDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Streaming Policy in the Media Services account * * @summary Deletes a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-delete.json */ async function deleteAStreamingPolicy() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "secureStreamingPolicyWithCommonEncryptionCbcsOnly"; @@ -33,4 +39,8 @@ async function deleteAStreamingPolicy() { console.log(result); } -deleteAStreamingPolicy().catch(console.error); +async function main() { + deleteAStreamingPolicy(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingPoliciesGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingPoliciesGetSample.ts index 775e0a1fdffd..520be3237d42 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingPoliciesGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingPoliciesGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the details of a Streaming Policy in the Media Services account * * @summary Get the details of a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policy-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policy-get-by-name.json */ async function getAStreamingPolicyByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "clearStreamingPolicy"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAStreamingPolicyByName() { console.log(result); } -getAStreamingPolicyByName().catch(console.error); +async function main() { + getAStreamingPolicyByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingPoliciesListSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingPoliciesListSample.ts index 44cf0117eb50..628300048e2a 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/streamingPoliciesListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/streamingPoliciesListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the Streaming Policies in the account * * @summary Lists the Streaming Policies in the account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-list.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-list.json */ async function listsStreamingPolicies() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listsStreamingPolicies() { console.log(resArray); } -listsStreamingPolicies().catch(console.error); +async function main() { + listsStreamingPolicies(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/tracksCreateOrUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/tracksCreateOrUpdateSample.ts index bd5affd1e80d..d636c19a00fe 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/tracksCreateOrUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/tracksCreateOrUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AssetTrack, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or update a Track in the asset * * @summary Create or update a Track in the asset - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-create.json */ async function createsATrack() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text3"; @@ -43,4 +49,8 @@ async function createsATrack() { console.log(result); } -createsATrack().catch(console.error); +async function main() { + createsATrack(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/tracksDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/tracksDeleteSample.ts index e1364c23ecb8..b18c92fe49ef 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/tracksDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/tracksDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Track in the asset * * @summary Deletes a Track in the asset - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-delete.json */ async function deleteATrack() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text2"; @@ -34,4 +40,8 @@ async function deleteATrack() { console.log(result); } -deleteATrack().catch(console.error); +async function main() { + deleteATrack(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/tracksGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/tracksGetSample.ts index f5ef414af370..17a5d525770d 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/tracksGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/tracksGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the details of a Track in the Asset * * @summary Get the details of a Track in the Asset - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-get-by-name.json */ async function getATrackByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text1"; @@ -34,4 +40,8 @@ async function getATrackByName() { console.log(result); } -getATrackByName().catch(console.error); +async function main() { + getATrackByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/tracksListSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/tracksListSample.ts index 57604abf5638..cae7e573f7b1 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/tracksListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/tracksListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the Tracks in the asset * * @summary Lists the Tracks in the asset - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-list-all.json */ async function listsAllTracks() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function listsAllTracks() { console.log(resArray); } -listsAllTracks().catch(console.error); +async function main() { + listsAllTracks(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/tracksUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/tracksUpdateSample.ts index 23d8d0451615..36a99a5850cc 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/tracksUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/tracksUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AssetTrack, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates an existing Track in the asset * * @summary Updates an existing Track in the asset - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-update.json */ async function updateATrack() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text1"; @@ -41,4 +47,8 @@ async function updateATrack() { console.log(result); } -updateATrack().catch(console.error); +async function main() { + updateATrack(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/tracksUpdateTrackDataSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/tracksUpdateTrackDataSample.ts index da358c6300a3..b1cca81bd859 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/tracksUpdateTrackDataSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/tracksUpdateTrackDataSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Update the track data. Call this API after any changes are made to the track data stored in the asset container. For example, you have modified the WebVTT captions file in the Azure blob storage container for the asset, viewers will not see the new version of the captions unless this API is called. Note, the changes may not be reflected immediately. CDN cache may also need to be purged if applicable. * * @summary Update the track data. Call this API after any changes are made to the track data stored in the asset container. For example, you have modified the WebVTT captions file in the Azure blob storage container for the asset, viewers will not see the new version of the captions unless this API is called. Note, the changes may not be reflected immediately. CDN cache may also need to be purged if applicable. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-update-data.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-update-data.json */ async function updateTheDataForATracks() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text2"; @@ -34,4 +40,8 @@ async function updateTheDataForATracks() { console.log(result); } -updateTheDataForATracks().catch(console.error); +async function main() { + updateTheDataForATracks(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/transformsCreateOrUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/transformsCreateOrUpdateSample.ts index d24730c0a487..75a30eff6ddd 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/transformsCreateOrUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/transformsCreateOrUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { Transform, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a new Transform. * * @summary Creates or updates a new Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-create.json */ async function createOrUpdateATransform() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "createdTransform"; const parameters: Transform = { @@ -44,4 +50,8 @@ async function createOrUpdateATransform() { console.log(result); } -createOrUpdateATransform().catch(console.error); +async function main() { + createOrUpdateATransform(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/transformsDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/transformsDeleteSample.ts index 025ae1d8e534..a665c173fd18 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/transformsDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/transformsDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Transform. * * @summary Deletes a Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-delete.json */ async function deleteATransform() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "sampleTransform"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteATransform() { console.log(result); } -deleteATransform().catch(console.error); +async function main() { + deleteATransform(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/transformsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/transformsGetSample.ts index cba6589be61c..ca117c40b23e 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/transformsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/transformsGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a Transform. * * @summary Gets a Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-get-by-name.json */ async function getATransformByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "sampleTransform"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getATransformByName() { console.log(result); } -getATransformByName().catch(console.error); +async function main() { + getATransformByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/transformsListSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/transformsListSample.ts index adea3ccdf4e5..b111b331961b 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/transformsListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/transformsListSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the Transforms in the account. * * @summary Lists the Transforms in the account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-list-all.json */ async function listsTheTransforms() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -36,20 +42,21 @@ async function listsTheTransforms() { console.log(resArray); } -listsTheTransforms().catch(console.error); - /** * This sample demonstrates how to Lists the Transforms in the account. * * @summary Lists the Transforms in the account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-list-all-filter-by-created.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-list-all-filter-by-created.json */ async function listsTheTransformsFilterByCreated() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const filter = - "properties/created gt 2021-11-01T00:00:00.0000000Z and properties/created le 2021-11-01T00:00:10.0000000Z"; + "properties/created gt 2021-06-01T00:00:00.0000000Z and properties/created le 2021-06-01T00:00:10.0000000Z"; const orderby = "properties/created"; const options: TransformsListOptionalParams = { filter, orderby }; const credential = new DefaultAzureCredential(); @@ -65,20 +72,21 @@ async function listsTheTransformsFilterByCreated() { console.log(resArray); } -listsTheTransformsFilterByCreated().catch(console.error); - /** * This sample demonstrates how to Lists the Transforms in the account. * * @summary Lists the Transforms in the account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-list-all-filter-by-lastmodified.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-list-all-filter-by-lastmodified.json */ async function listsTheTransformsFilterByLastmodified() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const filter = - "properties/lastmodified gt 2021-11-01T00:00:00.0000000Z and properties/lastmodified le 2021-11-01T00:00:10.0000000Z"; + "properties/lastmodified gt 2021-06-01T00:00:00.0000000Z and properties/lastmodified le 2021-06-01T00:00:10.0000000Z"; const orderby = "properties/lastmodified desc"; const options: TransformsListOptionalParams = { filter, orderby }; const credential = new DefaultAzureCredential(); @@ -94,17 +102,18 @@ async function listsTheTransformsFilterByLastmodified() { console.log(resArray); } -listsTheTransformsFilterByLastmodified().catch(console.error); - /** * This sample demonstrates how to Lists the Transforms in the account. * * @summary Lists the Transforms in the account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-list-all-filter-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-list-all-filter-by-name.json */ async function listsTheTransformsFilterByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const filter = "(name eq 'sampleEncode') or (name eq 'sampleEncodeAndVideoIndex')"; @@ -123,4 +132,11 @@ async function listsTheTransformsFilterByName() { console.log(resArray); } -listsTheTransformsFilterByName().catch(console.error); +async function main() { + listsTheTransforms(); + listsTheTransformsFilterByCreated(); + listsTheTransformsFilterByLastmodified(); + listsTheTransformsFilterByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples-dev/transformsUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples-dev/transformsUpdateSample.ts index 19f28eb48625..43fcdabd8a90 100644 --- a/sdk/mediaservices/arm-mediaservices/samples-dev/transformsUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples-dev/transformsUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { Transform, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates a Transform. * * @summary Updates a Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-update.json */ async function updateATransform() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "transformToUpdate"; const parameters: Transform = { @@ -45,4 +51,8 @@ async function updateATransform() { console.log(result); } -updateATransform().catch(console.error); +async function main() { + updateATransform(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/README.md b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/README.md index 03ba0ced1fb5..6ccd316468d1 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/README.md +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/README.md @@ -2,107 +2,107 @@ These sample programs show how to use the JavaScript client libraries for in some common scenarios. -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [accountFiltersCreateOrUpdateSample.js][accountfilterscreateorupdatesample] | Creates or updates an Account Filter in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-create.json | -| [accountFiltersDeleteSample.js][accountfiltersdeletesample] | Deletes an Account Filter in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-delete.json | -| [accountFiltersGetSample.js][accountfiltersgetsample] | Get the details of an Account Filter in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-get-by-name.json | -| [accountFiltersListSample.js][accountfilterslistsample] | List Account Filters in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-list-all.json | -| [accountFiltersUpdateSample.js][accountfiltersupdatesample] | Updates an existing Account Filter in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-update.json | -| [assetFiltersCreateOrUpdateSample.js][assetfilterscreateorupdatesample] | Creates or updates an Asset Filter associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-create.json | -| [assetFiltersDeleteSample.js][assetfiltersdeletesample] | Deletes an Asset Filter associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-delete.json | -| [assetFiltersGetSample.js][assetfiltersgetsample] | Get the details of an Asset Filter associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-get-by-name.json | -| [assetFiltersListSample.js][assetfilterslistsample] | List Asset Filters associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-list-all.json | -| [assetFiltersUpdateSample.js][assetfiltersupdatesample] | Updates an existing Asset Filter associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-update.json | -| [assetsCreateOrUpdateSample.js][assetscreateorupdatesample] | Creates or updates an Asset in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-create.json | -| [assetsDeleteSample.js][assetsdeletesample] | Deletes an Asset in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-delete.json | -| [assetsGetEncryptionKeySample.js][assetsgetencryptionkeysample] | Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-get-encryption-keys.json | -| [assetsGetSample.js][assetsgetsample] | Get the details of an Asset in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-get-by-name.json | -| [assetsListContainerSasSample.js][assetslistcontainersassample] | Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-sas-urls.json | -| [assetsListSample.js][assetslistsample] | List Assets in the Media Services account with optional filtering and ordering x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-in-date-range.json | -| [assetsListStreamingLocatorsSample.js][assetsliststreaminglocatorssample] | Lists Streaming Locators which are associated with this asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-streaming-locators.json | -| [assetsUpdateSample.js][assetsupdatesample] | Updates an existing Asset in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-update.json | -| [contentKeyPoliciesCreateOrUpdateSample.js][contentkeypoliciescreateorupdatesample] | Create or update a Content Key Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-create-nodrm-token.json | -| [contentKeyPoliciesDeleteSample.js][contentkeypoliciesdeletesample] | Deletes a Content Key Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-delete.json | -| [contentKeyPoliciesGetPolicyPropertiesWithSecretsSample.js][contentkeypoliciesgetpolicypropertieswithsecretssample] | Get a Content Key Policy including secret values x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-get-with-secrets.json | -| [contentKeyPoliciesGetSample.js][contentkeypoliciesgetsample] | Get the details of a Content Key Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-get-by-name.json | -| [contentKeyPoliciesListSample.js][contentkeypolicieslistsample] | Lists the Content Key Policies in the account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-list-by-lastModified.json | -| [contentKeyPoliciesUpdateSample.js][contentkeypoliciesupdatesample] | Updates an existing Content Key Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-update.json | -| [jobsCancelJobSample.js][jobscanceljobsample] | Cancel a Job. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-cancel.json | -| [jobsCreateSample.js][jobscreatesample] | Creates a Job. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-create.json | -| [jobsDeleteSample.js][jobsdeletesample] | Deletes a Job. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-delete.json | -| [jobsGetSample.js][jobsgetsample] | Gets a Job. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-get-by-name.json | -| [jobsListSample.js][jobslistsample] | Lists all of the Jobs for the Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-created.json | -| [jobsUpdateSample.js][jobsupdatesample] | Update is only supported for description and priority. Updating Priority will take effect when the Job state is Queued or Scheduled and depending on the timing the priority update may be ignored. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-update.json | -| [liveEventsAllocateSample.js][liveeventsallocatesample] | A live event is in StandBy state after allocation completes, and is ready to start. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-allocate.json | -| [liveEventsAsyncOperationSample.js][liveeventsasyncoperationsample] | Get a live event operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/async-operation-result.json | -| [liveEventsCreateSample.js][liveeventscreatesample] | Creates a new live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-create.json | -| [liveEventsDeleteSample.js][liveeventsdeletesample] | Deletes a live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-delete.json | -| [liveEventsGetSample.js][liveeventsgetsample] | Gets properties of a live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-list-by-name.json | -| [liveEventsListSample.js][liveeventslistsample] | Lists all the live events in the account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-list-all.json | -| [liveEventsOperationLocationSample.js][liveeventsoperationlocationsample] | Get a live event operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-operation-location.json | -| [liveEventsResetSample.js][liveeventsresetsample] | Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and will be started again. All assets used by the live outputs and streaming locators created on these assets are unaffected. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-reset.json | -| [liveEventsStartSample.js][liveeventsstartsample] | A live event in Stopped or StandBy state will be in Running state after the start operation completes. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-start.json | -| [liveEventsStopSample.js][liveeventsstopsample] | Stops a running live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-stop.json | -| [liveEventsUpdateSample.js][liveeventsupdatesample] | Updates settings on an existing live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-update.json | -| [liveOutputsAsyncOperationSample.js][liveoutputsasyncoperationsample] | Get a Live Output operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/async-operation-result.json | -| [liveOutputsCreateSample.js][liveoutputscreatesample] | Creates a new live output. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-create.json | -| [liveOutputsDeleteSample.js][liveoutputsdeletesample] | Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-delete.json | -| [liveOutputsGetSample.js][liveoutputsgetsample] | Gets a live output. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-list-by-name.json | -| [liveOutputsListSample.js][liveoutputslistsample] | Lists the live outputs of a live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-list-all.json | -| [liveOutputsOperationLocationSample.js][liveoutputsoperationlocationsample] | Get a Live Output operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-operation-location.json | -| [locationsCheckNameAvailabilitySample.js][locationschecknameavailabilitysample] | Checks whether the Media Service resource name is available. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-check-name-availability.json | -| [mediaServicesOperationResultsGetSample.js][mediaservicesoperationresultsgetsample] | Get media service operation result. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/media-service-operation-result-by-id.json | -| [mediaServicesOperationStatusesGetSample.js][mediaservicesoperationstatusesgetsample] | Get media service operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state-failed.json | -| [mediaservicesCreateOrUpdateSample.js][mediaservicescreateorupdatesample] | Creates or updates a Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/async-accounts-create.json | -| [mediaservicesDeleteSample.js][mediaservicesdeletesample] | Deletes a Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-delete.json | -| [mediaservicesGetSample.js][mediaservicesgetsample] | Get the details of a Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-get-by-name.json | -| [mediaservicesListBySubscriptionSample.js][mediaserviceslistbysubscriptionsample] | List Media Services accounts in the subscription. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-subscription-list-all-accounts.json | -| [mediaservicesListEdgePoliciesSample.js][mediaserviceslistedgepoliciessample] | List all the media edge policies associated with the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-list-media-edge-policies.json | -| [mediaservicesListSample.js][mediaserviceslistsample] | List Media Services accounts in the resource group x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-list-all-accounts.json | -| [mediaservicesSyncStorageKeysSample.js][mediaservicessyncstoragekeyssample] | Synchronizes storage account keys for a storage account associated with the Media Service account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-sync-storage-keys.json | -| [mediaservicesUpdateSample.js][mediaservicesupdatesample] | Updates an existing Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/async-accounts-update.json | -| [operationResultsGetSample.js][operationresultsgetsample] | Get asset track operation result. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-operation-result-by-id.json | -| [operationStatusesGetSample.js][operationstatusesgetsample] | Get asset track operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state-failed.json | -| [operationsListSample.js][operationslistsample] | Lists all the Media Services operations. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/operations-list-all.json | -| [privateEndpointConnectionsCreateOrUpdateSample.js][privateendpointconnectionscreateorupdatesample] | Update an existing private endpoint connection. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-put.json | -| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | Deletes a private endpoint connection. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-delete.json | -| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | Get the details of a private endpoint connection. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-get-by-name.json | -| [privateEndpointConnectionsListSample.js][privateendpointconnectionslistsample] | List all private endpoint connections. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-list.json | -| [privateLinkResourcesGetSample.js][privatelinkresourcesgetsample] | Get details of a group ID. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-link-resources-get-by-name.json | -| [privateLinkResourcesListSample.js][privatelinkresourceslistsample] | List supported group IDs. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-link-resources-list.json | -| [streamingEndpointsAsyncOperationSample.js][streamingendpointsasyncoperationsample] | Get a streaming endpoint operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/async-operation-result.json | -| [streamingEndpointsCreateSample.js][streamingendpointscreatesample] | Creates a streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-create.json | -| [streamingEndpointsDeleteSample.js][streamingendpointsdeletesample] | Deletes a streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-delete.json | -| [streamingEndpointsGetSample.js][streamingendpointsgetsample] | Gets a streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-list-by-name.json | -| [streamingEndpointsListSample.js][streamingendpointslistsample] | Lists the streaming endpoints in the account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-list-all.json | -| [streamingEndpointsOperationLocationSample.js][streamingendpointsoperationlocationsample] | Get a streaming endpoint operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-operation-location.json | -| [streamingEndpointsScaleSample.js][streamingendpointsscalesample] | Scales an existing streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-scale.json | -| [streamingEndpointsSkusSample.js][streamingendpointsskussample] | List streaming endpoint supported skus. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-list-skus.json | -| [streamingEndpointsStartSample.js][streamingendpointsstartsample] | Starts an existing streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-start.json | -| [streamingEndpointsStopSample.js][streamingendpointsstopsample] | Stops an existing streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-stop.json | -| [streamingEndpointsUpdateSample.js][streamingendpointsupdatesample] | Updates a existing streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-update.json | -| [streamingLocatorsCreateSample.js][streaminglocatorscreatesample] | Create a Streaming Locator in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-create-clear.json | -| [streamingLocatorsDeleteSample.js][streaminglocatorsdeletesample] | Deletes a Streaming Locator in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-delete.json | -| [streamingLocatorsGetSample.js][streaminglocatorsgetsample] | Get the details of a Streaming Locator in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-get-by-name.json | -| [streamingLocatorsListContentKeysSample.js][streaminglocatorslistcontentkeyssample] | List Content Keys used by this Streaming Locator x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-list-content-keys.json | -| [streamingLocatorsListPathsSample.js][streaminglocatorslistpathssample] | List Paths supported by this Streaming Locator x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-and-download.json | -| [streamingLocatorsListSample.js][streaminglocatorslistsample] | Lists the Streaming Locators in the account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-list.json | -| [streamingPoliciesCreateSample.js][streamingpoliciescreatesample] | Create a Streaming Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-clearKeyEncryption.json | -| [streamingPoliciesDeleteSample.js][streamingpoliciesdeletesample] | Deletes a Streaming Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-delete.json | -| [streamingPoliciesGetSample.js][streamingpoliciesgetsample] | Get the details of a Streaming Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policy-get-by-name.json | -| [streamingPoliciesListSample.js][streamingpolicieslistsample] | Lists the Streaming Policies in the account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-list.json | -| [tracksCreateOrUpdateSample.js][trackscreateorupdatesample] | Create or update a Track in the asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-create.json | -| [tracksDeleteSample.js][tracksdeletesample] | Deletes a Track in the asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-delete.json | -| [tracksGetSample.js][tracksgetsample] | Get the details of a Track in the Asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-get-by-name.json | -| [tracksListSample.js][trackslistsample] | Lists the Tracks in the asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-list-all.json | -| [tracksUpdateSample.js][tracksupdatesample] | Updates an existing Track in the asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-update.json | -| [tracksUpdateTrackDataSample.js][tracksupdatetrackdatasample] | Update the track data. Call this API after any changes are made to the track data stored in the asset container. For example, you have modified the WebVTT captions file in the Azure blob storage container for the asset, viewers will not see the new version of the captions unless this API is called. Note, the changes may not be reflected immediately. CDN cache may also need to be purged if applicable. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-update-data.json | -| [transformsCreateOrUpdateSample.js][transformscreateorupdatesample] | Creates or updates a new Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-create.json | -| [transformsDeleteSample.js][transformsdeletesample] | Deletes a Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-delete.json | -| [transformsGetSample.js][transformsgetsample] | Gets a Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-get-by-name.json | -| [transformsListSample.js][transformslistsample] | Lists the Transforms in the account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-list-all.json | -| [transformsUpdateSample.js][transformsupdatesample] | Updates a Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-update.json | +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [accountFiltersCreateOrUpdateSample.js][accountfilterscreateorupdatesample] | Creates or updates an Account Filter in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-create.json | +| [accountFiltersDeleteSample.js][accountfiltersdeletesample] | Deletes an Account Filter in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-delete.json | +| [accountFiltersGetSample.js][accountfiltersgetsample] | Get the details of an Account Filter in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-get-by-name.json | +| [accountFiltersListSample.js][accountfilterslistsample] | List Account Filters in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-list-all.json | +| [accountFiltersUpdateSample.js][accountfiltersupdatesample] | Updates an existing Account Filter in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-update.json | +| [assetFiltersCreateOrUpdateSample.js][assetfilterscreateorupdatesample] | Creates or updates an Asset Filter associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-create.json | +| [assetFiltersDeleteSample.js][assetfiltersdeletesample] | Deletes an Asset Filter associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-delete.json | +| [assetFiltersGetSample.js][assetfiltersgetsample] | Get the details of an Asset Filter associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-get-by-name.json | +| [assetFiltersListSample.js][assetfilterslistsample] | List Asset Filters associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-list-all.json | +| [assetFiltersUpdateSample.js][assetfiltersupdatesample] | Updates an existing Asset Filter associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-update.json | +| [assetsCreateOrUpdateSample.js][assetscreateorupdatesample] | Creates or updates an Asset in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-create.json | +| [assetsDeleteSample.js][assetsdeletesample] | Deletes an Asset in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-delete.json | +| [assetsGetEncryptionKeySample.js][assetsgetencryptionkeysample] | Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-get-encryption-keys.json | +| [assetsGetSample.js][assetsgetsample] | Get the details of an Asset in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-get-by-name.json | +| [assetsListContainerSasSample.js][assetslistcontainersassample] | Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-sas-urls.json | +| [assetsListSample.js][assetslistsample] | List Assets in the Media Services account with optional filtering and ordering x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-in-date-range.json | +| [assetsListStreamingLocatorsSample.js][assetsliststreaminglocatorssample] | Lists Streaming Locators which are associated with this asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-streaming-locators.json | +| [assetsUpdateSample.js][assetsupdatesample] | Updates an existing Asset in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-update.json | +| [contentKeyPoliciesCreateOrUpdateSample.js][contentkeypoliciescreateorupdatesample] | Create or update a Content Key Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-nodrm-token.json | +| [contentKeyPoliciesDeleteSample.js][contentkeypoliciesdeletesample] | Deletes a Content Key Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-delete.json | +| [contentKeyPoliciesGetPolicyPropertiesWithSecretsSample.js][contentkeypoliciesgetpolicypropertieswithsecretssample] | Get a Content Key Policy including secret values x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-get-with-secrets.json | +| [contentKeyPoliciesGetSample.js][contentkeypoliciesgetsample] | Get the details of a Content Key Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-get-by-name.json | +| [contentKeyPoliciesListSample.js][contentkeypolicieslistsample] | Lists the Content Key Policies in the account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-list-by-lastModified.json | +| [contentKeyPoliciesUpdateSample.js][contentkeypoliciesupdatesample] | Updates an existing Content Key Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-update.json | +| [jobsCancelJobSample.js][jobscanceljobsample] | Cancel a Job. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-cancel.json | +| [jobsCreateSample.js][jobscreatesample] | Creates a Job. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-create.json | +| [jobsDeleteSample.js][jobsdeletesample] | Deletes a Job. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-delete.json | +| [jobsGetSample.js][jobsgetsample] | Gets a Job. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-get-by-name.json | +| [jobsListSample.js][jobslistsample] | Lists all of the Jobs for the Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-created.json | +| [jobsUpdateSample.js][jobsupdatesample] | Update is only supported for description and priority. Updating Priority will take effect when the Job state is Queued or Scheduled and depending on the timing the priority update may be ignored. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-update.json | +| [liveEventsAllocateSample.js][liveeventsallocatesample] | A live event is in StandBy state after allocation completes, and is ready to start. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-allocate.json | +| [liveEventsAsyncOperationSample.js][liveeventsasyncoperationsample] | Get a live event operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json | +| [liveEventsCreateSample.js][liveeventscreatesample] | Creates a new live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-create.json | +| [liveEventsDeleteSample.js][liveeventsdeletesample] | Deletes a live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-delete.json | +| [liveEventsGetSample.js][liveeventsgetsample] | Gets properties of a live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-list-by-name.json | +| [liveEventsListSample.js][liveeventslistsample] | Lists all the live events in the account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-list-all.json | +| [liveEventsOperationLocationSample.js][liveeventsoperationlocationsample] | Get a live event operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-operation-location.json | +| [liveEventsResetSample.js][liveeventsresetsample] | Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and will be started again. All assets used by the live outputs and streaming locators created on these assets are unaffected. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-reset.json | +| [liveEventsStartSample.js][liveeventsstartsample] | A live event in Stopped or StandBy state will be in Running state after the start operation completes. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-start.json | +| [liveEventsStopSample.js][liveeventsstopsample] | Stops a running live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-stop.json | +| [liveEventsUpdateSample.js][liveeventsupdatesample] | Updates settings on an existing live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-update.json | +| [liveOutputsAsyncOperationSample.js][liveoutputsasyncoperationsample] | Get a Live Output operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json | +| [liveOutputsCreateSample.js][liveoutputscreatesample] | Creates a new live output. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-create.json | +| [liveOutputsDeleteSample.js][liveoutputsdeletesample] | Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-delete.json | +| [liveOutputsGetSample.js][liveoutputsgetsample] | Gets a live output. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-list-by-name.json | +| [liveOutputsListSample.js][liveoutputslistsample] | Lists the live outputs of a live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-list-all.json | +| [liveOutputsOperationLocationSample.js][liveoutputsoperationlocationsample] | Get a Live Output operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-operation-location.json | +| [locationsCheckNameAvailabilitySample.js][locationschecknameavailabilitysample] | Checks whether the Media Service resource name is available. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-check-name-availability.json | +| [mediaServicesOperationResultsGetSample.js][mediaservicesoperationresultsgetsample] | Get media service operation result. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-result-by-id.json | +| [mediaServicesOperationStatusesGetSample.js][mediaservicesoperationstatusesgetsample] | Get media service operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state-failed.json | +| [mediaservicesCreateOrUpdateSample.js][mediaservicescreateorupdatesample] | Creates or updates a Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/async-accounts-create.json | +| [mediaservicesDeleteSample.js][mediaservicesdeletesample] | Deletes a Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-delete.json | +| [mediaservicesGetSample.js][mediaservicesgetsample] | Get the details of a Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-get-by-name.json | +| [mediaservicesListBySubscriptionSample.js][mediaserviceslistbysubscriptionsample] | List Media Services accounts in the subscription. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-subscription-list-all-accounts.json | +| [mediaservicesListEdgePoliciesSample.js][mediaserviceslistedgepoliciessample] | List all the media edge policies associated with the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-list-media-edge-policies.json | +| [mediaservicesListSample.js][mediaserviceslistsample] | List Media Services accounts in the resource group x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-list-all-accounts.json | +| [mediaservicesSyncStorageKeysSample.js][mediaservicessyncstoragekeyssample] | Synchronizes storage account keys for a storage account associated with the Media Service account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-sync-storage-keys.json | +| [mediaservicesUpdateSample.js][mediaservicesupdatesample] | Updates an existing Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/async-accounts-update.json | +| [operationResultsGetSample.js][operationresultsgetsample] | Get asset track operation result. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-result-by-id.json | +| [operationStatusesGetSample.js][operationstatusesgetsample] | Get asset track operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state-failed.json | +| [operationsListSample.js][operationslistsample] | Lists all the Media Services operations. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/operations-list-all.json | +| [privateEndpointConnectionsCreateOrUpdateSample.js][privateendpointconnectionscreateorupdatesample] | Update an existing private endpoint connection. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-put.json | +| [privateEndpointConnectionsDeleteSample.js][privateendpointconnectionsdeletesample] | Deletes a private endpoint connection. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-delete.json | +| [privateEndpointConnectionsGetSample.js][privateendpointconnectionsgetsample] | Get the details of a private endpoint connection. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-get-by-name.json | +| [privateEndpointConnectionsListSample.js][privateendpointconnectionslistsample] | List all private endpoint connections. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-list.json | +| [privateLinkResourcesGetSample.js][privatelinkresourcesgetsample] | Get details of a group ID. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-link-resources-get-by-name.json | +| [privateLinkResourcesListSample.js][privatelinkresourceslistsample] | List supported group IDs. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-link-resources-list.json | +| [streamingEndpointsAsyncOperationSample.js][streamingendpointsasyncoperationsample] | Get a streaming endpoint operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json | +| [streamingEndpointsCreateSample.js][streamingendpointscreatesample] | Creates a streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-create.json | +| [streamingEndpointsDeleteSample.js][streamingendpointsdeletesample] | Deletes a streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-delete.json | +| [streamingEndpointsGetSample.js][streamingendpointsgetsample] | Gets a streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-list-by-name.json | +| [streamingEndpointsListSample.js][streamingendpointslistsample] | Lists the streaming endpoints in the account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-list-all.json | +| [streamingEndpointsOperationLocationSample.js][streamingendpointsoperationlocationsample] | Get a streaming endpoint operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-operation-location.json | +| [streamingEndpointsScaleSample.js][streamingendpointsscalesample] | Scales an existing streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-scale.json | +| [streamingEndpointsSkusSample.js][streamingendpointsskussample] | List streaming endpoint supported skus. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-list-skus.json | +| [streamingEndpointsStartSample.js][streamingendpointsstartsample] | Starts an existing streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-start.json | +| [streamingEndpointsStopSample.js][streamingendpointsstopsample] | Stops an existing streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-stop.json | +| [streamingEndpointsUpdateSample.js][streamingendpointsupdatesample] | Updates a existing streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-update.json | +| [streamingLocatorsCreateSample.js][streaminglocatorscreatesample] | Create a Streaming Locator in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-create-clear.json | +| [streamingLocatorsDeleteSample.js][streaminglocatorsdeletesample] | Deletes a Streaming Locator in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-delete.json | +| [streamingLocatorsGetSample.js][streaminglocatorsgetsample] | Get the details of a Streaming Locator in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-get-by-name.json | +| [streamingLocatorsListContentKeysSample.js][streaminglocatorslistcontentkeyssample] | List Content Keys used by this Streaming Locator x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list-content-keys.json | +| [streamingLocatorsListPathsSample.js][streaminglocatorslistpathssample] | List Paths supported by this Streaming Locator x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-and-download.json | +| [streamingLocatorsListSample.js][streaminglocatorslistsample] | Lists the Streaming Locators in the account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list.json | +| [streamingPoliciesCreateSample.js][streamingpoliciescreatesample] | Create a Streaming Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-clearKeyEncryption.json | +| [streamingPoliciesDeleteSample.js][streamingpoliciesdeletesample] | Deletes a Streaming Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-delete.json | +| [streamingPoliciesGetSample.js][streamingpoliciesgetsample] | Get the details of a Streaming Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policy-get-by-name.json | +| [streamingPoliciesListSample.js][streamingpolicieslistsample] | Lists the Streaming Policies in the account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-list.json | +| [tracksCreateOrUpdateSample.js][trackscreateorupdatesample] | Create or update a Track in the asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-create.json | +| [tracksDeleteSample.js][tracksdeletesample] | Deletes a Track in the asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-delete.json | +| [tracksGetSample.js][tracksgetsample] | Get the details of a Track in the Asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-get-by-name.json | +| [tracksListSample.js][trackslistsample] | Lists the Tracks in the asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-list-all.json | +| [tracksUpdateSample.js][tracksupdatesample] | Updates an existing Track in the asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-update.json | +| [tracksUpdateTrackDataSample.js][tracksupdatetrackdatasample] | Update the track data. Call this API after any changes are made to the track data stored in the asset container. For example, you have modified the WebVTT captions file in the Azure blob storage container for the asset, viewers will not see the new version of the captions unless this API is called. Note, the changes may not be reflected immediately. CDN cache may also need to be purged if applicable. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-update-data.json | +| [transformsCreateOrUpdateSample.js][transformscreateorupdatesample] | Creates or updates a new Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-create.json | +| [transformsDeleteSample.js][transformsdeletesample] | Deletes a Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-delete.json | +| [transformsGetSample.js][transformsgetsample] | Gets a Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-get-by-name.json | +| [transformsListSample.js][transformslistsample] | Lists the Transforms in the account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-list-all.json | +| [transformsUpdateSample.js][transformsupdatesample] | Updates a Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-update.json | ## Prerequisites @@ -135,7 +135,7 @@ node accountFiltersCreateOrUpdateSample.js Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): ```bash -npx cross-env node accountFiltersCreateOrUpdateSample.js +npx cross-env MEDIASERVICES_SUBSCRIPTION_ID="" MEDIASERVICES_RESOURCE_GROUP="" node accountFiltersCreateOrUpdateSample.js ``` ## Next Steps diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersCreateOrUpdateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersCreateOrUpdateSample.js index 122c3c8530f7..3c1065cdf3e5 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersCreateOrUpdateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersCreateOrUpdateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates an Account Filter in the Media Services account. * * @summary Creates or updates an Account Filter in the Media Services account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-create.json */ async function createAnAccountFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const filterName = "newAccountFilter"; const parameters = { @@ -59,4 +61,8 @@ async function createAnAccountFilter() { console.log(result); } -createAnAccountFilter().catch(console.error); +async function main() { + createAnAccountFilter(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersDeleteSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersDeleteSample.js index 20d0eff6b52d..da62fda86821 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersDeleteSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersDeleteSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes an Account Filter in the Media Services account. * * @summary Deletes an Account Filter in the Media Services account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-delete.json */ async function deleteAnAccountFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const filterName = "accountFilterWithTimeWindowAndTrack"; const credential = new DefaultAzureCredential(); @@ -28,4 +30,8 @@ async function deleteAnAccountFilter() { console.log(result); } -deleteAnAccountFilter().catch(console.error); +async function main() { + deleteAnAccountFilter(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersGetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersGetSample.js index 84fe75e4c7b0..654f899e5d27 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersGetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersGetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get the details of an Account Filter in the Media Services account. * * @summary Get the details of an Account Filter in the Media Services account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-get-by-name.json */ async function getAnAccountFilterByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const filterName = "accountFilterWithTrack"; const credential = new DefaultAzureCredential(); @@ -28,4 +30,8 @@ async function getAnAccountFilterByName() { console.log(result); } -getAnAccountFilterByName().catch(console.error); +async function main() { + getAnAccountFilterByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersListSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersListSample.js index 440e93915914..d9a5791ecf6c 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersListSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersListSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List Account Filters in the Media Services account. * * @summary List Account Filters in the Media Services account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-list-all.json */ async function listAllAccountFilters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -30,4 +32,8 @@ async function listAllAccountFilters() { console.log(resArray); } -listAllAccountFilters().catch(console.error); +async function main() { + listAllAccountFilters(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersUpdateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersUpdateSample.js index 56cbb182facd..73a5f4f846f6 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersUpdateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/accountFiltersUpdateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates an existing Account Filter in the Media Services account. * * @summary Updates an existing Account Filter in the Media Services account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-update.json */ async function updateAnAccountFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const filterName = "accountFilterWithTimeWindowAndTrack"; const parameters = { @@ -44,4 +46,8 @@ async function updateAnAccountFilter() { console.log(result); } -updateAnAccountFilter().catch(console.error); +async function main() { + updateAnAccountFilter(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersCreateOrUpdateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersCreateOrUpdateSample.js index 9b09dd51cbb7..0f08b4fe162a 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersCreateOrUpdateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersCreateOrUpdateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates an Asset Filter associated with the specified Asset. * * @summary Creates or updates an Asset Filter associated with the specified Asset. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-create.json */ async function createAnAssetFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const filterName = "newAssetFilter"; @@ -61,4 +63,8 @@ async function createAnAssetFilter() { console.log(result); } -createAnAssetFilter().catch(console.error); +async function main() { + createAnAssetFilter(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersDeleteSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersDeleteSample.js index 27646af5adbe..67eac730f904 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersDeleteSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersDeleteSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes an Asset Filter associated with the specified Asset. * * @summary Deletes an Asset Filter associated with the specified Asset. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-delete.json */ async function deleteAnAssetFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const filterName = "assetFilterWithTimeWindowAndTrack"; @@ -34,4 +36,8 @@ async function deleteAnAssetFilter() { console.log(result); } -deleteAnAssetFilter().catch(console.error); +async function main() { + deleteAnAssetFilter(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersGetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersGetSample.js index 00c33dadb32b..3907c2c87616 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersGetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersGetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get the details of an Asset Filter associated with the specified Asset. * * @summary Get the details of an Asset Filter associated with the specified Asset. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-get-by-name.json */ async function getAnAssetFilterByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const filterName = "assetFilterWithTimeWindowAndTrack"; @@ -34,4 +36,8 @@ async function getAnAssetFilterByName() { console.log(result); } -getAnAssetFilterByName().catch(console.error); +async function main() { + getAnAssetFilterByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersListSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersListSample.js index 960a0ae8109b..60c908c65f59 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersListSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersListSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List Asset Filters associated with the specified Asset. * * @summary List Asset Filters associated with the specified Asset. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-list-all.json */ async function listAllAssetFilters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const credential = new DefaultAzureCredential(); @@ -31,4 +33,8 @@ async function listAllAssetFilters() { console.log(resArray); } -listAllAssetFilters().catch(console.error); +async function main() { + listAllAssetFilters(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersUpdateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersUpdateSample.js index 259949c40bb3..2e84c77c97e9 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersUpdateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetFiltersUpdateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates an existing Asset Filter associated with the specified Asset. * * @summary Updates an existing Asset Filter associated with the specified Asset. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-update.json */ async function updateAnAssetFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const filterName = "assetFilterWithTimeWindowAndTrack"; @@ -46,4 +48,8 @@ async function updateAnAssetFilter() { console.log(result); } -updateAnAssetFilter().catch(console.error); +async function main() { + updateAnAssetFilter(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsCreateOrUpdateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsCreateOrUpdateSample.js index d3be73b9f0cc..3a30909bd515 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsCreateOrUpdateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsCreateOrUpdateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates an Asset in the Media Services account * * @summary Creates or updates an Asset in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-create.json */ async function createAnAsset() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountLogan"; const parameters = { @@ -37,4 +39,8 @@ async function createAnAsset() { console.log(result); } -createAnAsset().catch(console.error); +async function main() { + createAnAsset(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsDeleteSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsDeleteSample.js index 1a69717afebf..b617d77af940 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsDeleteSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsDeleteSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes an Asset in the Media Services account * * @summary Deletes an Asset in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-delete.json */ async function deleteAnAsset() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountAdams"; const credential = new DefaultAzureCredential(); @@ -28,4 +30,8 @@ async function deleteAnAsset() { console.log(result); } -deleteAnAsset().catch(console.error); +async function main() { + deleteAnAsset(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsGetEncryptionKeySample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsGetEncryptionKeySample.js index 1488d3a21373..13450e8ab002 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsGetEncryptionKeySample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsGetEncryptionKeySample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API * * @summary Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-get-encryption-keys.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-get-encryption-keys.json */ async function getAssetStorageEncryptionKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountSaintHelens"; const credential = new DefaultAzureCredential(); @@ -28,4 +30,8 @@ async function getAssetStorageEncryptionKeys() { console.log(result); } -getAssetStorageEncryptionKeys().catch(console.error); +async function main() { + getAssetStorageEncryptionKeys(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsGetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsGetSample.js index 6b0b5858ce41..96049d696345 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsGetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsGetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get the details of an Asset in the Media Services account * * @summary Get the details of an Asset in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-get-by-name.json */ async function getAnAssetByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountAdams"; const credential = new DefaultAzureCredential(); @@ -28,4 +30,8 @@ async function getAnAssetByName() { console.log(result); } -getAnAssetByName().catch(console.error); +async function main() { + getAnAssetByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsListContainerSasSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsListContainerSasSample.js index 19e3f4083efd..64f57e53019d 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsListContainerSasSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsListContainerSasSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. * * @summary Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-sas-urls.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-sas-urls.json */ async function listAssetSasUrLs() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountBaker"; const parameters = { @@ -37,4 +39,8 @@ async function listAssetSasUrLs() { console.log(result); } -listAssetSasUrLs().catch(console.error); +async function main() { + listAssetSasUrLs(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsListSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsListSample.js index b9ab4ae0cf4c..79ff148db3ac 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsListSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsListSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List Assets in the Media Services account with optional filtering and ordering * * @summary List Assets in the Media Services account with optional filtering and ordering - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-in-date-range.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-in-date-range.json */ async function listAssetCreatedInADateRange() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const filter = "properties/created gt 2012-06-01 and properties/created lt 2013-07-01"; const orderby = "properties/created"; @@ -33,17 +35,16 @@ async function listAssetCreatedInADateRange() { console.log(resArray); } -listAssetCreatedInADateRange().catch(console.error); - /** * This sample demonstrates how to List Assets in the Media Services account with optional filtering and ordering * * @summary List Assets in the Media Services account with optional filtering and ordering - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-by-date.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-by-date.json */ async function listAssetOrderedByDate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const orderby = "properties/created"; const options = { orderby }; @@ -56,17 +57,16 @@ async function listAssetOrderedByDate() { console.log(resArray); } -listAssetOrderedByDate().catch(console.error); - /** * This sample demonstrates how to List Assets in the Media Services account with optional filtering and ordering * * @summary List Assets in the Media Services account with optional filtering and ordering - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-all.json */ async function listAllAssets() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -77,4 +77,10 @@ async function listAllAssets() { console.log(resArray); } -listAllAssets().catch(console.error); +async function main() { + listAssetCreatedInADateRange(); + listAssetOrderedByDate(); + listAllAssets(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsListStreamingLocatorsSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsListStreamingLocatorsSample.js index 2ce5efee29ff..cd62bf8cf071 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsListStreamingLocatorsSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsListStreamingLocatorsSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists Streaming Locators which are associated with this asset. * * @summary Lists Streaming Locators which are associated with this asset. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-streaming-locators.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-streaming-locators.json */ async function listAssetSasUrLs() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountSaintHelens"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function listAssetSasUrLs() { console.log(result); } -listAssetSasUrLs().catch(console.error); +async function main() { + listAssetSasUrLs(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsUpdateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsUpdateSample.js index dc3148a441c1..3d14dc9b3e86 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsUpdateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/assetsUpdateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates an existing Asset in the Media Services account * * @summary Updates an existing Asset in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-update.json */ async function updateAnAsset() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountBaker"; const parameters = { @@ -31,4 +33,8 @@ async function updateAnAsset() { console.log(result); } -updateAnAsset().catch(console.error); +async function main() { + updateAnAsset(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesCreateOrUpdateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesCreateOrUpdateSample.js index 0d9e03bd41fa..ca7b6e16a002 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesCreateOrUpdateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesCreateOrUpdateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Create or update a Content Key Policy in the Media Services account * * @summary Create or update a Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-create-nodrm-token.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-nodrm-token.json */ async function createsAContentKeyPolicyWithClearKeyOptionAndTokenRestriction() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithClearKeyOptionAndSwtTokenRestriction"; const parameters = { @@ -54,17 +56,16 @@ async function createsAContentKeyPolicyWithClearKeyOptionAndTokenRestriction() { console.log(result); } -createsAContentKeyPolicyWithClearKeyOptionAndTokenRestriction().catch(console.error); - /** * This sample demonstrates how to Create or update a Content Key Policy in the Media Services account * * @summary Create or update a Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-create-playready-open.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-playready-open.json */ async function createsAContentKeyPolicyWithPlayReadyOptionAndOpenRestriction() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithPlayReadyOptionAndOpenRestriction"; const parameters = { @@ -112,17 +113,16 @@ async function createsAContentKeyPolicyWithPlayReadyOptionAndOpenRestriction() { console.log(result); } -createsAContentKeyPolicyWithPlayReadyOptionAndOpenRestriction().catch(console.error); - /** * This sample demonstrates how to Create or update a Content Key Policy in the Media Services account * * @summary Create or update a Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-create-widevine-token.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-widevine-token.json */ async function createsAContentKeyPolicyWithWidevineOptionAndTokenRestriction() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithWidevineOptionAndJwtTokenRestriction"; const parameters = { @@ -166,17 +166,16 @@ async function createsAContentKeyPolicyWithWidevineOptionAndTokenRestriction() { console.log(result); } -createsAContentKeyPolicyWithWidevineOptionAndTokenRestriction().catch(console.error); - /** * This sample demonstrates how to Create or update a Content Key Policy in the Media Services account * * @summary Create or update a Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-create-multiple-options.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-multiple-options.json */ async function createsAContentKeyPolicyWithMultipleOptions() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyCreatedWithMultipleOptions"; const parameters = { @@ -222,4 +221,11 @@ async function createsAContentKeyPolicyWithMultipleOptions() { console.log(result); } -createsAContentKeyPolicyWithMultipleOptions().catch(console.error); +async function main() { + createsAContentKeyPolicyWithClearKeyOptionAndTokenRestriction(); + createsAContentKeyPolicyWithPlayReadyOptionAndOpenRestriction(); + createsAContentKeyPolicyWithWidevineOptionAndTokenRestriction(); + createsAContentKeyPolicyWithMultipleOptions(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesDeleteSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesDeleteSample.js index 034b8eab09d6..6cdaad1d716a 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesDeleteSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesDeleteSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a Content Key Policy in the Media Services account * * @summary Deletes a Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-delete.json */ async function deleteAKeyPolicy() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithPlayReadyOptionAndOpenRestriction"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function deleteAKeyPolicy() { console.log(result); } -deleteAKeyPolicy().catch(console.error); +async function main() { + deleteAKeyPolicy(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesGetPolicyPropertiesWithSecretsSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesGetPolicyPropertiesWithSecretsSample.js index ffc84a94cc7c..d746e3ffc7e4 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesGetPolicyPropertiesWithSecretsSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesGetPolicyPropertiesWithSecretsSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a Content Key Policy including secret values * * @summary Get a Content Key Policy including secret values - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-get-with-secrets.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-get-with-secrets.json */ async function getAnContentKeyPolicyWithSecrets() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithMultipleOptions"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getAnContentKeyPolicyWithSecrets() { console.log(result); } -getAnContentKeyPolicyWithSecrets().catch(console.error); +async function main() { + getAnContentKeyPolicyWithSecrets(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesGetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesGetSample.js index 0679d95650b9..60f5180706e4 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesGetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesGetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get the details of a Content Key Policy in the Media Services account * * @summary Get the details of a Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-get-by-name.json */ async function getAContentKeyPolicyByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithMultipleOptions"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getAContentKeyPolicyByName() { console.log(result); } -getAContentKeyPolicyByName().catch(console.error); +async function main() { + getAContentKeyPolicyByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesListSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesListSample.js index 8648cef9d480..90cbf0a8dbd8 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesListSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesListSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the Content Key Policies in the account * * @summary Lists the Content Key Policies in the account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-list-by-lastModified.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-list-by-lastModified.json */ async function listsContentKeyPoliciesOrderedByLastModified() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const orderby = "properties/lastModified"; const options = { orderby }; @@ -32,17 +34,16 @@ async function listsContentKeyPoliciesOrderedByLastModified() { console.log(resArray); } -listsContentKeyPoliciesOrderedByLastModified().catch(console.error); - /** * This sample demonstrates how to Lists the Content Key Policies in the account * * @summary Lists the Content Key Policies in the account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-list-in-date-range.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-list-in-date-range.json */ async function listsContentKeyPoliciesWithCreatedAndLastModifiedFilters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const filter = "properties/lastModified gt 2016-06-01 and properties/created lt 2013-07-01"; const options = { filter }; @@ -55,17 +56,16 @@ async function listsContentKeyPoliciesWithCreatedAndLastModifiedFilters() { console.log(resArray); } -listsContentKeyPoliciesWithCreatedAndLastModifiedFilters().catch(console.error); - /** * This sample demonstrates how to Lists the Content Key Policies in the account * * @summary Lists the Content Key Policies in the account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-list-all.json */ async function listsAllContentKeyPolicies() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -76,4 +76,10 @@ async function listsAllContentKeyPolicies() { console.log(resArray); } -listsAllContentKeyPolicies().catch(console.error); +async function main() { + listsContentKeyPoliciesOrderedByLastModified(); + listsContentKeyPoliciesWithCreatedAndLastModifiedFilters(); + listsAllContentKeyPolicies(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesUpdateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesUpdateSample.js index 4b4ba40b316a..8ea0d6cda5d8 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesUpdateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/contentKeyPoliciesUpdateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates an existing Content Key Policy in the Media Services account * * @summary Updates an existing Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-update.json */ async function updateAContentKeyPolicy() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithClearKeyOptionAndTokenRestriction"; const parameters = { @@ -47,4 +49,8 @@ async function updateAContentKeyPolicy() { console.log(result); } -updateAContentKeyPolicy().catch(console.error); +async function main() { + updateAContentKeyPolicy(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsCancelJobSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsCancelJobSample.js index 8f115dbe3214..9c40f20b8c0f 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsCancelJobSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsCancelJobSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Cancel a Job. * * @summary Cancel a Job. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-cancel.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-cancel.json */ async function cancelAJob() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const jobName = "job1"; @@ -34,4 +36,8 @@ async function cancelAJob() { console.log(result); } -cancelAJob().catch(console.error); +async function main() { + cancelAJob(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsCreateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsCreateSample.js index f18cc69aaf6f..572c2bf39e26 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsCreateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsCreateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates a Job. * * @summary Creates a Job. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-create.json */ async function createAJob() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const jobName = "job1"; @@ -48,4 +50,8 @@ async function createAJob() { console.log(result); } -createAJob().catch(console.error); +async function main() { + createAJob(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsDeleteSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsDeleteSample.js index 4f77917d440a..9ddabdce4438 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsDeleteSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsDeleteSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a Job. * * @summary Deletes a Job. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-delete.json */ async function deleteAJob() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const jobName = "jobToDelete"; @@ -29,4 +31,8 @@ async function deleteAJob() { console.log(result); } -deleteAJob().catch(console.error); +async function main() { + deleteAJob(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsGetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsGetSample.js index c53d312cc672..f9d065cb62f7 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsGetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsGetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a Job. * * @summary Gets a Job. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-get-by-name.json */ async function getAJobByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const jobName = "job1"; @@ -29,4 +31,8 @@ async function getAJobByName() { console.log(result); } -getAJobByName().catch(console.error); +async function main() { + getAJobByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsListSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsListSample.js index 742ad29bd111..47f0732e2890 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsListSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsListSample.js @@ -10,20 +10,22 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-created.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-created.json */ async function listsJobsForTheTransformFilterByCreated() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const filter = - "properties/created ge 2021-11-01T00:00:10.0000000Z and properties/created le 2021-11-01T00:00:20.0000000Z"; + "properties/created ge 2021-06-01T00:00:10.0000000Z and properties/created le 2021-06-01T00:00:20.0000000Z"; const orderby = "properties/created"; const options = { filter, orderby }; const credential = new DefaultAzureCredential(); @@ -35,21 +37,20 @@ async function listsJobsForTheTransformFilterByCreated() { console.log(resArray); } -listsJobsForTheTransformFilterByCreated().catch(console.error); - /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-lastmodified.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-lastmodified.json */ async function listsJobsForTheTransformFilterByLastmodified() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const filter = - "properties/lastmodified ge 2021-11-01T00:00:10.0000000Z and properties/lastmodified le 2021-11-01T00:00:20.0000000Z"; + "properties/lastmodified ge 2021-06-01T00:00:10.0000000Z and properties/lastmodified le 2021-06-01T00:00:20.0000000Z"; const orderby = "properties/lastmodified desc"; const options = { filter, orderby }; const credential = new DefaultAzureCredential(); @@ -61,17 +62,16 @@ async function listsJobsForTheTransformFilterByLastmodified() { console.log(resArray); } -listsJobsForTheTransformFilterByLastmodified().catch(console.error); - /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-name-and-state.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-name-and-state.json */ async function listsJobsForTheTransformFilterByNameAndState() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const filter = "name eq 'job3' and properties/state eq Microsoft.Media.JobState'finished'"; @@ -85,17 +85,16 @@ async function listsJobsForTheTransformFilterByNameAndState() { console.log(resArray); } -listsJobsForTheTransformFilterByNameAndState().catch(console.error); - /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-name.json */ async function listsJobsForTheTransformFilterByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const filter = "name eq 'job1' or name eq 'job2'"; @@ -110,17 +109,16 @@ async function listsJobsForTheTransformFilterByName() { console.log(resArray); } -listsJobsForTheTransformFilterByName().catch(console.error); - /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-state-eq.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-state-eq.json */ async function listsJobsForTheTransformFilterByStateEqual() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const filter = "properties/state eq Microsoft.Media.JobState'Processing'"; @@ -134,17 +132,16 @@ async function listsJobsForTheTransformFilterByStateEqual() { console.log(resArray); } -listsJobsForTheTransformFilterByStateEqual().catch(console.error); - /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-state-ne.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-state-ne.json */ async function listsJobsForTheTransformFilterByStateNotEqual() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const filter = "properties/state ne Microsoft.Media.JobState'processing'"; @@ -158,17 +155,16 @@ async function listsJobsForTheTransformFilterByStateNotEqual() { console.log(resArray); } -listsJobsForTheTransformFilterByStateNotEqual().catch(console.error); - /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all.json */ async function listsAllOfTheJobsForTheTransform() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const credential = new DefaultAzureCredential(); @@ -180,4 +176,14 @@ async function listsAllOfTheJobsForTheTransform() { console.log(resArray); } -listsAllOfTheJobsForTheTransform().catch(console.error); +async function main() { + listsJobsForTheTransformFilterByCreated(); + listsJobsForTheTransformFilterByLastmodified(); + listsJobsForTheTransformFilterByNameAndState(); + listsJobsForTheTransformFilterByName(); + listsJobsForTheTransformFilterByStateEqual(); + listsJobsForTheTransformFilterByStateNotEqual(); + listsAllOfTheJobsForTheTransform(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsUpdateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsUpdateSample.js index 4e38e6570139..61617e43bc33 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsUpdateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/jobsUpdateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Update is only supported for description and priority. Updating Priority will take effect when the Job state is Queued or Scheduled and depending on the timing the priority update may be ignored. * * @summary Update is only supported for description and priority. Updating Priority will take effect when the Job state is Queued or Scheduled and depending on the timing the priority update may be ignored. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-update.json */ async function updateAJob() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const jobName = "job1"; @@ -49,4 +51,8 @@ async function updateAJob() { console.log(result); } -updateAJob().catch(console.error); +async function main() { + updateAJob(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsAllocateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsAllocateSample.js index f1b7960a16ee..b2113b1d2158 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsAllocateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsAllocateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to A live event is in StandBy state after allocation completes, and is ready to start. * * @summary A live event is in StandBy state after allocation completes, and is ready to start. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-allocate.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-allocate.json */ async function allocateALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function allocateALiveEvent() { console.log(result); } -allocateALiveEvent().catch(console.error); +async function main() { + allocateALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsAsyncOperationSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsAsyncOperationSample.js index 107eefb3e097..5aa67aa6eca8 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsAsyncOperationSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsAsyncOperationSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a live event operation status. * * @summary Get a live event operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/async-operation-result.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json */ async function getTheLiveEventOperationStatus() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const operationId = "62e4d893-d233-4005-988e-a428d9f77076"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getTheLiveEventOperationStatus() { console.log(result); } -getTheLiveEventOperationStatus().catch(console.error); +async function main() { + getTheLiveEventOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsCreateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsCreateSample.js index 66364f84747e..7f55eefa9dc8 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsCreateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsCreateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates a new live event. * * @summary Creates a new live event. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-create.json */ async function createALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const parameters = { @@ -54,4 +56,8 @@ async function createALiveEvent() { console.log(result); } -createALiveEvent().catch(console.error); +async function main() { + createALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsDeleteSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsDeleteSample.js index 3fa55df5d9ee..c5cab29a526d 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsDeleteSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsDeleteSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a live event. * * @summary Deletes a live event. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-delete.json */ async function deleteALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function deleteALiveEvent() { console.log(result); } -deleteALiveEvent().catch(console.error); +async function main() { + deleteALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsGetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsGetSample.js index 247d18897460..8cffb605d2e2 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsGetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsGetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets properties of a live event. * * @summary Gets properties of a live event. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-list-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-list-by-name.json */ async function getALiveEventByName() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const credential = new DefaultAzureCredential(); @@ -28,4 +30,8 @@ async function getALiveEventByName() { console.log(result); } -getALiveEventByName().catch(console.error); +async function main() { + getALiveEventByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsListSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsListSample.js index 8744b29735bb..25a74c884bc1 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsListSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsListSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists all the live events in the account. * * @summary Lists all the live events in the account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-list-all.json */ async function listAllLiveEvents() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -30,4 +32,8 @@ async function listAllLiveEvents() { console.log(resArray); } -listAllLiveEvents().catch(console.error); +async function main() { + listAllLiveEvents(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsOperationLocationSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsOperationLocationSample.js index 918c649f5b68..48f62f4b5eea 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsOperationLocationSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsOperationLocationSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a live event operation status. * * @summary Get a live event operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-operation-location.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-operation-location.json */ async function getTheLiveEventOperationStatus() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const operationId = "62e4d893-d233-4005-988e-a428d9f77076"; @@ -34,4 +36,8 @@ async function getTheLiveEventOperationStatus() { console.log(result); } -getTheLiveEventOperationStatus().catch(console.error); +async function main() { + getTheLiveEventOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsResetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsResetSample.js index 9752d0758b4b..c5ab74e3e4e5 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsResetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsResetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and will be started again. All assets used by the live outputs and streaming locators created on these assets are unaffected. * * @summary Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and will be started again. All assets used by the live outputs and streaming locators created on these assets are unaffected. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-reset.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-reset.json */ async function resetALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function resetALiveEvent() { console.log(result); } -resetALiveEvent().catch(console.error); +async function main() { + resetALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsStartSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsStartSample.js index 267cc377bbb1..a64348e76c73 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsStartSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsStartSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to A live event in Stopped or StandBy state will be in Running state after the start operation completes. * * @summary A live event in Stopped or StandBy state will be in Running state after the start operation completes. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-start.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-start.json */ async function startALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function startALiveEvent() { console.log(result); } -startALiveEvent().catch(console.error); +async function main() { + startALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsStopSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsStopSample.js index 6c7a2a47533c..b208cc7ad16a 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsStopSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsStopSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Stops a running live event. * * @summary Stops a running live event. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-stop.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-stop.json */ async function stopALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const parameters = { removeOutputsOnStop: false }; @@ -34,4 +36,8 @@ async function stopALiveEvent() { console.log(result); } -stopALiveEvent().catch(console.error); +async function main() { + stopALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsUpdateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsUpdateSample.js index 1177dda80a29..eaa96ef5d4b7 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsUpdateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveEventsUpdateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates settings on an existing live event. * * @summary Updates settings on an existing live event. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-update.json */ async function updateALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const parameters = { @@ -50,4 +52,8 @@ async function updateALiveEvent() { console.log(result); } -updateALiveEvent().catch(console.error); +async function main() { + updateALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsAsyncOperationSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsAsyncOperationSample.js index 788dcda34092..3b3a6a0a4ce2 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsAsyncOperationSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsAsyncOperationSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a Live Output operation status. * * @summary Get a Live Output operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/async-operation-result.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json */ async function getTheLiveOutputOperationStatus() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const operationId = "62e4d893-d233-4005-988e-a428d9f77076"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getTheLiveOutputOperationStatus() { console.log(result); } -getTheLiveOutputOperationStatus().catch(console.error); +async function main() { + getTheLiveOutputOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsCreateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsCreateSample.js index 43d956fd8f21..5171821d2311 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsCreateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsCreateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates a new live output. * * @summary Creates a new live output. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-create.json */ async function createALiveOutput() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const liveOutputName = "myLiveOutput1"; @@ -43,4 +45,8 @@ async function createALiveOutput() { console.log(result); } -createALiveOutput().catch(console.error); +async function main() { + createALiveOutput(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsDeleteSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsDeleteSample.js index a52d717abade..d70907e5a6e5 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsDeleteSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsDeleteSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. * * @summary Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-delete.json */ async function deleteALiveOutput() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const liveOutputName = "myLiveOutput1"; @@ -34,4 +36,8 @@ async function deleteALiveOutput() { console.log(result); } -deleteALiveOutput().catch(console.error); +async function main() { + deleteALiveOutput(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsGetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsGetSample.js index 71006870fc70..373e342794d9 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsGetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsGetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a live output. * * @summary Gets a live output. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-list-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-list-by-name.json */ async function getALiveOutputByName() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const liveOutputName = "myLiveOutput1"; @@ -34,4 +36,8 @@ async function getALiveOutputByName() { console.log(result); } -getALiveOutputByName().catch(console.error); +async function main() { + getALiveOutputByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsListSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsListSample.js index bb8b1f96fcb2..2c5eb59871ac 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsListSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsListSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the live outputs of a live event. * * @summary Lists the live outputs of a live event. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-list-all.json */ async function listAllLiveOutputs() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const credential = new DefaultAzureCredential(); @@ -31,4 +33,8 @@ async function listAllLiveOutputs() { console.log(resArray); } -listAllLiveOutputs().catch(console.error); +async function main() { + listAllLiveOutputs(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsOperationLocationSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsOperationLocationSample.js index 12943df2f324..5452cebf2d0a 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsOperationLocationSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/liveOutputsOperationLocationSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a Live Output operation status. * * @summary Get a Live Output operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-operation-location.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-operation-location.json */ async function getTheLiveOutputOperationStatus() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const liveOutputName = "myLiveOutput1"; @@ -36,4 +38,8 @@ async function getTheLiveOutputOperationStatus() { console.log(result); } -getTheLiveOutputOperationStatus().catch(console.error); +async function main() { + getTheLiveOutputOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/locationsCheckNameAvailabilitySample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/locationsCheckNameAvailabilitySample.js index cf4f38f30a0c..9566394f372b 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/locationsCheckNameAvailabilitySample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/locationsCheckNameAvailabilitySample.js @@ -10,15 +10,17 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Checks whether the Media Service resource name is available. * * @summary Checks whether the Media Service resource name is available. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-check-name-availability.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-check-name-availability.json */ async function checkNameAvailability() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const locationName = "japanwest"; const parameters = { name: "contosotv", @@ -30,4 +32,8 @@ async function checkNameAvailability() { console.log(result); } -checkNameAvailability().catch(console.error); +async function main() { + checkNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaServicesOperationResultsGetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaServicesOperationResultsGetSample.js index 55ec6e83de02..b43aaea9b637 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaServicesOperationResultsGetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaServicesOperationResultsGetSample.js @@ -10,15 +10,17 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get media service operation result. * * @summary Get media service operation result. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/media-service-operation-result-by-id.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-result-by-id.json */ async function getStatusOfAsynchronousOperation() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const locationName = "westus"; const operationId = "6FBA62C4-99B5-4FF8-9826-FC4744A8864F"; const credential = new DefaultAzureCredential(); @@ -27,4 +29,8 @@ async function getStatusOfAsynchronousOperation() { console.log(result); } -getStatusOfAsynchronousOperation().catch(console.error); +async function main() { + getStatusOfAsynchronousOperation(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaServicesOperationStatusesGetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaServicesOperationStatusesGetSample.js index 35e63fa47d12..e910be9d04eb 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaServicesOperationStatusesGetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaServicesOperationStatusesGetSample.js @@ -10,15 +10,17 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get media service operation status. * * @summary Get media service operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state-failed.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state-failed.json */ async function getStatusOfAsynchronousOperationWhenItIsCompletedWithError() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const locationName = "westus"; const operationId = "D612C429-2526-49D5-961B-885AE11406FD"; const credential = new DefaultAzureCredential(); @@ -27,16 +29,15 @@ async function getStatusOfAsynchronousOperationWhenItIsCompletedWithError() { console.log(result); } -getStatusOfAsynchronousOperationWhenItIsCompletedWithError().catch(console.error); - /** * This sample demonstrates how to Get media service operation status. * * @summary Get media service operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/media-service-operation-status-by-id-terminal-state.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-status-by-id-terminal-state.json */ async function getStatusOfAsynchronousOperationWhenItIsCompleted() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const locationName = "westus"; const operationId = "D612C429-2526-49D5-961B-885AE11406FD"; const credential = new DefaultAzureCredential(); @@ -45,16 +46,15 @@ async function getStatusOfAsynchronousOperationWhenItIsCompleted() { console.log(result); } -getStatusOfAsynchronousOperationWhenItIsCompleted().catch(console.error); - /** * This sample demonstrates how to Get media service operation status. * * @summary Get media service operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state.json */ async function getStatusOfAsynchronousOperationWhenItIsOngoing() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const locationName = "westus"; const operationId = "D612C429-2526-49D5-961B-885AE11406FD"; const credential = new DefaultAzureCredential(); @@ -63,4 +63,10 @@ async function getStatusOfAsynchronousOperationWhenItIsOngoing() { console.log(result); } -getStatusOfAsynchronousOperationWhenItIsOngoing().catch(console.error); +async function main() { + getStatusOfAsynchronousOperationWhenItIsCompletedWithError(); + getStatusOfAsynchronousOperationWhenItIsCompleted(); + getStatusOfAsynchronousOperationWhenItIsOngoing(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesCreateOrUpdateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesCreateOrUpdateSample.js index 2c1ee5b6ae37..7f9c214967a8 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesCreateOrUpdateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesCreateOrUpdateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates a Media Services account * * @summary Creates or updates a Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/async-accounts-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/async-accounts-create.json */ async function createAMediaServicesAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const parameters = { encryption: { @@ -66,4 +68,8 @@ async function createAMediaServicesAccount() { console.log(result); } -createAMediaServicesAccount().catch(console.error); +async function main() { + createAMediaServicesAccount(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesDeleteSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesDeleteSample.js index 416773e5f834..742b1bef2a93 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesDeleteSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesDeleteSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a Media Services account * * @summary Deletes a Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-delete.json */ async function deleteAMediaServicesAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -27,4 +29,8 @@ async function deleteAMediaServicesAccount() { console.log(result); } -deleteAMediaServicesAccount().catch(console.error); +async function main() { + deleteAMediaServicesAccount(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesGetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesGetSample.js index b2323ac6996b..d8d56422c32e 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesGetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesGetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get the details of a Media Services account * * @summary Get the details of a Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-get-by-name.json */ async function getAMediaServicesAccountByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosotv"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -27,4 +29,8 @@ async function getAMediaServicesAccountByName() { console.log(result); } -getAMediaServicesAccountByName().catch(console.error); +async function main() { + getAMediaServicesAccountByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesListBySubscriptionSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesListBySubscriptionSample.js index 01b47a6e4bda..12eace824f0d 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesListBySubscriptionSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesListBySubscriptionSample.js @@ -10,15 +10,17 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List Media Services accounts in the subscription. * * @summary List Media Services accounts in the subscription. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-subscription-list-all-accounts.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-subscription-list-all-accounts.json */ async function listAllMediaServicesAccounts() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +30,8 @@ async function listAllMediaServicesAccounts() { console.log(resArray); } -listAllMediaServicesAccounts().catch(console.error); +async function main() { + listAllMediaServicesAccounts(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesListEdgePoliciesSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesListEdgePoliciesSample.js index 182b742bfa23..7d8c2f515a26 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesListEdgePoliciesSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesListEdgePoliciesSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List all the media edge policies associated with the Media Services account. * * @summary List all the media edge policies associated with the Media Services account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-list-media-edge-policies.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-list-media-edge-policies.json */ async function listTheMediaEdgePolicies() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const parameters = { deviceId: "contosiothubhost_contosoiotdevice", @@ -34,4 +36,8 @@ async function listTheMediaEdgePolicies() { console.log(result); } -listTheMediaEdgePolicies().catch(console.error); +async function main() { + listTheMediaEdgePolicies(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesListSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesListSample.js index 4dda236d74d0..bb6e50ed544f 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesListSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesListSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List Media Services accounts in the resource group * * @summary List Media Services accounts in the resource group - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-list-all-accounts.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-list-all-accounts.json */ async function listAllMediaServicesAccounts() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); const resArray = new Array(); @@ -29,4 +31,8 @@ async function listAllMediaServicesAccounts() { console.log(resArray); } -listAllMediaServicesAccounts().catch(console.error); +async function main() { + listAllMediaServicesAccounts(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesSyncStorageKeysSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesSyncStorageKeysSample.js index fda9a5c0ef74..87d20f34f62b 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesSyncStorageKeysSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesSyncStorageKeysSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Synchronizes storage account keys for a storage account associated with the Media Service account. * * @summary Synchronizes storage account keys for a storage account associated with the Media Service account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-sync-storage-keys.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-sync-storage-keys.json */ async function synchronizesStorageAccountKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const parameters = { id: "contososportsstore" }; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function synchronizesStorageAccountKeys() { console.log(result); } -synchronizesStorageAccountKeys().catch(console.error); +async function main() { + synchronizesStorageAccountKeys(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesUpdateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesUpdateSample.js index 502e9d46da46..2bcb9cb315a7 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesUpdateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/mediaservicesUpdateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates an existing Media Services account * * @summary Updates an existing Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/async-accounts-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/async-accounts-update.json */ async function updateAMediaServicesAccounts() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const parameters = { tags: { key1: "value3" } }; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function updateAMediaServicesAccounts() { console.log(result); } -updateAMediaServicesAccounts().catch(console.error); +async function main() { + updateAMediaServicesAccounts(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/operationResultsGetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/operationResultsGetSample.js index fe828a055bbd..be2fe0423887 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/operationResultsGetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/operationResultsGetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get asset track operation result. * * @summary Get asset track operation result. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-operation-result-by-id.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-result-by-id.json */ async function getResultOfAsynchronousOperation() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text1"; @@ -36,4 +38,8 @@ async function getResultOfAsynchronousOperation() { console.log(result); } -getResultOfAsynchronousOperation().catch(console.error); +async function main() { + getResultOfAsynchronousOperation(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/operationStatusesGetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/operationStatusesGetSample.js index 10cd70eadda2..78b1911b6fb6 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/operationStatusesGetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/operationStatusesGetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get asset track operation status. * * @summary Get asset track operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state-failed.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state-failed.json */ async function getStatusOfAsynchronousOperationWhenItIsCompletedWithError() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text1"; @@ -36,17 +38,16 @@ async function getStatusOfAsynchronousOperationWhenItIsCompletedWithError() { console.log(result); } -getStatusOfAsynchronousOperationWhenItIsCompletedWithError().catch(console.error); - /** * This sample demonstrates how to Get asset track operation status. * * @summary Get asset track operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state.json */ async function getStatusOfAsynchronousOperationWhenItIsCompleted() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text1"; @@ -63,17 +64,16 @@ async function getStatusOfAsynchronousOperationWhenItIsCompleted() { console.log(result); } -getStatusOfAsynchronousOperationWhenItIsCompleted().catch(console.error); - /** * This sample demonstrates how to Get asset track operation status. * * @summary Get asset track operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-non-terminal-state.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-non-terminal-state.json */ async function getStatusOfAsynchronousOperationWhenItIsOngoing() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text1"; @@ -90,4 +90,10 @@ async function getStatusOfAsynchronousOperationWhenItIsOngoing() { console.log(result); } -getStatusOfAsynchronousOperationWhenItIsOngoing().catch(console.error); +async function main() { + getStatusOfAsynchronousOperationWhenItIsCompletedWithError(); + getStatusOfAsynchronousOperationWhenItIsCompleted(); + getStatusOfAsynchronousOperationWhenItIsOngoing(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/operationsListSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/operationsListSample.js index 5b3ed10ee1e9..6ca4a28ed73a 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/operationsListSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/operationsListSample.js @@ -10,19 +10,25 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists all the Media Services operations. * * @summary Lists all the Media Services operations. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/operations-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/operations-list-all.json */ async function listOperations() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); const result = await client.operations.list(); console.log(result); } -listOperations().catch(console.error); +async function main() { + listOperations(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateEndpointConnectionsCreateOrUpdateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateEndpointConnectionsCreateOrUpdateSample.js index a71f93f6bef2..17f2dd592707 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateEndpointConnectionsCreateOrUpdateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateEndpointConnectionsCreateOrUpdateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Update an existing private endpoint connection. * * @summary Update an existing private endpoint connection. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-put.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-put.json */ async function updatePrivateEndpointConnection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const name = "connectionName1"; const parameters = { @@ -39,4 +41,8 @@ async function updatePrivateEndpointConnection() { console.log(result); } -updatePrivateEndpointConnection().catch(console.error); +async function main() { + updatePrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateEndpointConnectionsDeleteSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateEndpointConnectionsDeleteSample.js index 9a5a2784c19f..0af1c348a406 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateEndpointConnectionsDeleteSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateEndpointConnectionsDeleteSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a private endpoint connection. * * @summary Deletes a private endpoint connection. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-delete.json */ async function deletePrivateEndpointConnection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const name = "connectionName1"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function deletePrivateEndpointConnection() { console.log(result); } -deletePrivateEndpointConnection().catch(console.error); +async function main() { + deletePrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateEndpointConnectionsGetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateEndpointConnectionsGetSample.js index 2ba62b3a2e22..d82ec7500cd3 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateEndpointConnectionsGetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateEndpointConnectionsGetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get the details of a private endpoint connection. * * @summary Get the details of a private endpoint connection. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-get-by-name.json */ async function getPrivateEndpointConnection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const name = "connectionName1"; const credential = new DefaultAzureCredential(); @@ -28,4 +30,8 @@ async function getPrivateEndpointConnection() { console.log(result); } -getPrivateEndpointConnection().catch(console.error); +async function main() { + getPrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateEndpointConnectionsListSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateEndpointConnectionsListSample.js index 30cac8647e8c..1523c99d7087 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateEndpointConnectionsListSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateEndpointConnectionsListSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List all private endpoint connections. * * @summary List all private endpoint connections. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-list.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-list.json */ async function getAllPrivateEndpointConnections() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -27,4 +29,8 @@ async function getAllPrivateEndpointConnections() { console.log(result); } -getAllPrivateEndpointConnections().catch(console.error); +async function main() { + getAllPrivateEndpointConnections(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateLinkResourcesGetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateLinkResourcesGetSample.js index be79f21cf152..02515f560625 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateLinkResourcesGetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateLinkResourcesGetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get details of a group ID. * * @summary Get details of a group ID. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-link-resources-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-link-resources-get-by-name.json */ async function getDetailsOfAGroupId() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const name = "keydelivery"; const credential = new DefaultAzureCredential(); @@ -28,4 +30,8 @@ async function getDetailsOfAGroupId() { console.log(result); } -getDetailsOfAGroupId().catch(console.error); +async function main() { + getDetailsOfAGroupId(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateLinkResourcesListSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateLinkResourcesListSample.js index 5c059a125002..4197d744fb90 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateLinkResourcesListSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/privateLinkResourcesListSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List supported group IDs. * * @summary List supported group IDs. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-link-resources-list.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-link-resources-list.json */ async function getListOfAllGroupIDs() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -27,4 +29,8 @@ async function getListOfAllGroupIDs() { console.log(result); } -getListOfAllGroupIDs().catch(console.error); +async function main() { + getListOfAllGroupIDs(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsAsyncOperationSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsAsyncOperationSample.js index 112e2ee220ee..26ec947610a9 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsAsyncOperationSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsAsyncOperationSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a streaming endpoint operation status. * * @summary Get a streaming endpoint operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/async-operation-result.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json */ async function getTheStreamingEndpointOperationStatus() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const operationId = "62e4d893-d233-4005-988e-a428d9f77076"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getTheStreamingEndpointOperationStatus() { console.log(result); } -getTheStreamingEndpointOperationStatus().catch(console.error); +async function main() { + getTheStreamingEndpointOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsCreateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsCreateSample.js index b266d6b750b7..086926fdf78f 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsCreateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsCreateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates a streaming endpoint. * * @summary Creates a streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-create.json */ async function createAStreamingEndpoint() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const parameters = { @@ -58,4 +60,8 @@ async function createAStreamingEndpoint() { console.log(result); } -createAStreamingEndpoint().catch(console.error); +async function main() { + createAStreamingEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsDeleteSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsDeleteSample.js index 1aba24c1082d..8df534d43399 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsDeleteSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsDeleteSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a streaming endpoint. * * @summary Deletes a streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-delete.json */ async function deleteAStreamingEndpoint() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function deleteAStreamingEndpoint() { console.log(result); } -deleteAStreamingEndpoint().catch(console.error); +async function main() { + deleteAStreamingEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsGetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsGetSample.js index 605e160893b8..f7ccc52bc8cd 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsGetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsGetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a streaming endpoint. * * @summary Gets a streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-list-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-list-by-name.json */ async function getAStreamingEndpointByName() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getAStreamingEndpointByName() { console.log(result); } -getAStreamingEndpointByName().catch(console.error); +async function main() { + getAStreamingEndpointByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsListSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsListSample.js index 507998e87731..5fc715f7d5ed 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsListSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsListSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the streaming endpoints in the account. * * @summary Lists the streaming endpoints in the account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-list-all.json */ async function listAllStreamingEndpoints() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -30,4 +32,8 @@ async function listAllStreamingEndpoints() { console.log(resArray); } -listAllStreamingEndpoints().catch(console.error); +async function main() { + listAllStreamingEndpoints(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsOperationLocationSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsOperationLocationSample.js index 0b905b2c9bd5..5efbe2c3e2fe 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsOperationLocationSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsOperationLocationSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get a streaming endpoint operation status. * * @summary Get a streaming endpoint operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-operation-location.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-operation-location.json */ async function getTheStreamingEndpointOperationStatus() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const operationId = "62e4d893-d233-4005-988e-a428d9f77076"; @@ -34,4 +36,8 @@ async function getTheStreamingEndpointOperationStatus() { console.log(result); } -getTheStreamingEndpointOperationStatus().catch(console.error); +async function main() { + getTheStreamingEndpointOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsScaleSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsScaleSample.js index 2ee430e4fea6..96b5f81b3142 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsScaleSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsScaleSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Scales an existing streaming endpoint. * * @summary Scales an existing streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-scale.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-scale.json */ async function scaleAStreamingEndpoint() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const parameters = { scaleUnit: 5 }; @@ -34,4 +36,8 @@ async function scaleAStreamingEndpoint() { console.log(result); } -scaleAStreamingEndpoint().catch(console.error); +async function main() { + scaleAStreamingEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsSkusSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsSkusSample.js index e5d948d6d6d6..604a90c00302 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsSkusSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsSkusSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List streaming endpoint supported skus. * * @summary List streaming endpoint supported skus. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-list-skus.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-list-skus.json */ async function listAStreamingEndpointSku() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function listAStreamingEndpointSku() { console.log(result); } -listAStreamingEndpointSku().catch(console.error); +async function main() { + listAStreamingEndpointSku(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsStartSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsStartSample.js index 98ea85d1b4c5..ab50e9a71195 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsStartSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsStartSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Starts an existing streaming endpoint. * * @summary Starts an existing streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-start.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-start.json */ async function startAStreamingEndpoint() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function startAStreamingEndpoint() { console.log(result); } -startAStreamingEndpoint().catch(console.error); +async function main() { + startAStreamingEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsStopSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsStopSample.js index dc825497797b..1277c9a83e68 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsStopSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsStopSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Stops an existing streaming endpoint. * * @summary Stops an existing streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-stop.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-stop.json */ async function stopAStreamingEndpoint() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function stopAStreamingEndpoint() { console.log(result); } -stopAStreamingEndpoint().catch(console.error); +async function main() { + stopAStreamingEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsUpdateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsUpdateSample.js index e92299fa4d10..0c2a990ec57c 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsUpdateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingEndpointsUpdateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates a existing streaming endpoint. * * @summary Updates a existing streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-update.json */ async function updateAStreamingEndpoint() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const parameters = { @@ -40,4 +42,8 @@ async function updateAStreamingEndpoint() { console.log(result); } -updateAStreamingEndpoint().catch(console.error); +async function main() { + updateAStreamingEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsCreateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsCreateSample.js index a2f2f6a16962..c33358bda4f2 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsCreateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsCreateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Create a Streaming Locator in the Media Services account * * @summary Create a Streaming Locator in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-create-clear.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-create-clear.json */ async function createsAStreamingLocatorWithClearStreaming() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "UserCreatedClearStreamingLocator"; const parameters = { @@ -37,17 +39,16 @@ async function createsAStreamingLocatorWithClearStreaming() { console.log(result); } -createsAStreamingLocatorWithClearStreaming().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Locator in the Media Services account * * @summary Create a Streaming Locator in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-create-secure.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-create-secure.json */ async function createsAStreamingLocatorWithSecureStreaming() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "UserCreatedSecureStreamingLocator"; const parameters = { @@ -67,17 +68,16 @@ async function createsAStreamingLocatorWithSecureStreaming() { console.log(result); } -createsAStreamingLocatorWithSecureStreaming().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Locator in the Media Services account * * @summary Create a Streaming Locator in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-create-secure-userDefinedContentKeys.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-create-secure-userDefinedContentKeys.json */ async function createsAStreamingLocatorWithUserDefinedContentKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "UserCreatedSecureStreamingLocatorWithUserDefinedContentKeys"; const parameters = { @@ -113,4 +113,10 @@ async function createsAStreamingLocatorWithUserDefinedContentKeys() { console.log(result); } -createsAStreamingLocatorWithUserDefinedContentKeys().catch(console.error); +async function main() { + createsAStreamingLocatorWithClearStreaming(); + createsAStreamingLocatorWithSecureStreaming(); + createsAStreamingLocatorWithUserDefinedContentKeys(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsDeleteSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsDeleteSample.js index 258c80fbdac2..bfdad3d06fda 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsDeleteSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsDeleteSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a Streaming Locator in the Media Services account * * @summary Deletes a Streaming Locator in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-delete.json */ async function deleteAStreamingLocator() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "clearStreamingLocator"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function deleteAStreamingLocator() { console.log(result); } -deleteAStreamingLocator().catch(console.error); +async function main() { + deleteAStreamingLocator(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsGetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsGetSample.js index 3fb6887b8ff9..26611889652a 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsGetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsGetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get the details of a Streaming Locator in the Media Services account * * @summary Get the details of a Streaming Locator in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-get-by-name.json */ async function getAStreamingLocatorByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "clearStreamingLocator"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getAStreamingLocatorByName() { console.log(result); } -getAStreamingLocatorByName().catch(console.error); +async function main() { + getAStreamingLocatorByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsListContentKeysSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsListContentKeysSample.js index 63ee08656b12..1f08643e9830 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsListContentKeysSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsListContentKeysSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List Content Keys used by this Streaming Locator * * @summary List Content Keys used by this Streaming Locator - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-list-content-keys.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list-content-keys.json */ async function listContentKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "secureStreamingLocator"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function listContentKeys() { console.log(result); } -listContentKeys().catch(console.error); +async function main() { + listContentKeys(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsListPathsSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsListPathsSample.js index 9fe9cd46fe8f..f261eb157443 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsListPathsSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsListPathsSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to List Paths supported by this Streaming Locator * * @summary List Paths supported by this Streaming Locator - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-and-download.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-and-download.json */ async function listPathsWhichHasStreamingPathsAndDownloadPaths() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "clearStreamingLocator"; const credential = new DefaultAzureCredential(); @@ -32,17 +34,16 @@ async function listPathsWhichHasStreamingPathsAndDownloadPaths() { console.log(result); } -listPathsWhichHasStreamingPathsAndDownloadPaths().catch(console.error); - /** * This sample demonstrates how to List Paths supported by this Streaming Locator * * @summary List Paths supported by this Streaming Locator - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-only.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-only.json */ async function listPathsWhichHasStreamingPathsOnly() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "secureStreamingLocator"; const credential = new DefaultAzureCredential(); @@ -55,4 +56,9 @@ async function listPathsWhichHasStreamingPathsOnly() { console.log(result); } -listPathsWhichHasStreamingPathsOnly().catch(console.error); +async function main() { + listPathsWhichHasStreamingPathsAndDownloadPaths(); + listPathsWhichHasStreamingPathsOnly(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsListSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsListSample.js index 3a95cb78f067..ae68893ef376 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsListSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingLocatorsListSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the Streaming Locators in the account * * @summary Lists the Streaming Locators in the account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-list.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list.json */ async function listsStreamingLocators() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -30,4 +32,8 @@ async function listsStreamingLocators() { console.log(resArray); } -listsStreamingLocators().catch(console.error); +async function main() { + listsStreamingLocators(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingPoliciesCreateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingPoliciesCreateSample.js index fc3458c6aec6..4fec4fdcfe2f 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingPoliciesCreateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingPoliciesCreateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-clearKeyEncryption.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-clearKeyEncryption.json */ async function createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCbcs() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedSecureStreamingPolicyWithCommonEncryptionCbcsOnly"; const parameters = { @@ -48,17 +50,16 @@ async function createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCb console.log(result); } -createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCbcs().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCenc-clearKeyEncryption.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCenc-clearKeyEncryption.json */ async function createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCenc() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedSecureStreamingPolicyWithCommonEncryptionCencOnly"; const parameters = { @@ -92,17 +93,16 @@ async function createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCe console.log(result); } -createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCenc().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-clear.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-clear.json */ async function createsAStreamingPolicyWithClearStreaming() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedClearStreamingPolicy"; const parameters = { @@ -126,17 +126,16 @@ async function createsAStreamingPolicyWithClearStreaming() { console.log(result); } -createsAStreamingPolicyWithClearStreaming().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-only.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-only.json */ async function createsAStreamingPolicyWithCommonEncryptionCbcsOnly() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedSecureStreamingPolicyWithCommonEncryptionCbcsOnly"; const parameters = { @@ -169,17 +168,16 @@ async function createsAStreamingPolicyWithCommonEncryptionCbcsOnly() { console.log(result); } -createsAStreamingPolicyWithCommonEncryptionCbcsOnly().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCenc-only.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCenc-only.json */ async function createsAStreamingPolicyWithCommonEncryptionCencOnly() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedSecureStreamingPolicyWithCommonEncryptionCencOnly"; const parameters = { @@ -221,17 +219,16 @@ async function createsAStreamingPolicyWithCommonEncryptionCencOnly() { console.log(result); } -createsAStreamingPolicyWithCommonEncryptionCencOnly().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-envelopeEncryption-only.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-envelopeEncryption-only.json */ async function createsAStreamingPolicyWithEnvelopeEncryptionOnly() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedSecureStreamingPolicyWithEnvelopeEncryptionOnly"; const parameters = { @@ -259,17 +256,16 @@ async function createsAStreamingPolicyWithEnvelopeEncryptionOnly() { console.log(result); } -createsAStreamingPolicyWithEnvelopeEncryptionOnly().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-secure-streaming.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-secure-streaming.json */ async function createsAStreamingPolicyWithSecureStreaming() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedSecureStreamingPolicy"; const parameters = { @@ -338,4 +334,14 @@ async function createsAStreamingPolicyWithSecureStreaming() { console.log(result); } -createsAStreamingPolicyWithSecureStreaming().catch(console.error); +async function main() { + createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCbcs(); + createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCenc(); + createsAStreamingPolicyWithClearStreaming(); + createsAStreamingPolicyWithCommonEncryptionCbcsOnly(); + createsAStreamingPolicyWithCommonEncryptionCencOnly(); + createsAStreamingPolicyWithEnvelopeEncryptionOnly(); + createsAStreamingPolicyWithSecureStreaming(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingPoliciesDeleteSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingPoliciesDeleteSample.js index e84118d8e2ac..c804e8284754 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingPoliciesDeleteSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingPoliciesDeleteSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a Streaming Policy in the Media Services account * * @summary Deletes a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-delete.json */ async function deleteAStreamingPolicy() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "secureStreamingPolicyWithCommonEncryptionCbcsOnly"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function deleteAStreamingPolicy() { console.log(result); } -deleteAStreamingPolicy().catch(console.error); +async function main() { + deleteAStreamingPolicy(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingPoliciesGetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingPoliciesGetSample.js index f0d6e775d8f9..5c5eddb66c47 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingPoliciesGetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingPoliciesGetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get the details of a Streaming Policy in the Media Services account * * @summary Get the details of a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policy-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policy-get-by-name.json */ async function getAStreamingPolicyByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "clearStreamingPolicy"; const credential = new DefaultAzureCredential(); @@ -32,4 +34,8 @@ async function getAStreamingPolicyByName() { console.log(result); } -getAStreamingPolicyByName().catch(console.error); +async function main() { + getAStreamingPolicyByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingPoliciesListSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingPoliciesListSample.js index 98eb7f1fc139..c2ef8139a6a1 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingPoliciesListSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/streamingPoliciesListSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the Streaming Policies in the account * * @summary Lists the Streaming Policies in the account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-list.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-list.json */ async function listsStreamingPolicies() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -30,4 +32,8 @@ async function listsStreamingPolicies() { console.log(resArray); } -listsStreamingPolicies().catch(console.error); +async function main() { + listsStreamingPolicies(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksCreateOrUpdateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksCreateOrUpdateSample.js index 18743f9fa3e2..435f806167a9 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksCreateOrUpdateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksCreateOrUpdateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Create or update a Track in the asset * * @summary Create or update a Track in the asset - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-create.json */ async function createsATrack() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text3"; @@ -43,4 +45,8 @@ async function createsATrack() { console.log(result); } -createsATrack().catch(console.error); +async function main() { + createsATrack(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksDeleteSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksDeleteSample.js index 93cca61b8658..e9b84dc79822 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksDeleteSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksDeleteSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a Track in the asset * * @summary Deletes a Track in the asset - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-delete.json */ async function deleteATrack() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text2"; @@ -34,4 +36,8 @@ async function deleteATrack() { console.log(result); } -deleteATrack().catch(console.error); +async function main() { + deleteATrack(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksGetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksGetSample.js index 32d5594c57fa..b710d4d03d56 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksGetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksGetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Get the details of a Track in the Asset * * @summary Get the details of a Track in the Asset - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-get-by-name.json */ async function getATrackByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text1"; @@ -29,4 +31,8 @@ async function getATrackByName() { console.log(result); } -getATrackByName().catch(console.error); +async function main() { + getATrackByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksListSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksListSample.js index 2ef1b5abde3a..c1bb343b3dad 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksListSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksListSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the Tracks in the asset * * @summary Lists the Tracks in the asset - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-list-all.json */ async function listsAllTracks() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const credential = new DefaultAzureCredential(); @@ -31,4 +33,8 @@ async function listsAllTracks() { console.log(resArray); } -listsAllTracks().catch(console.error); +async function main() { + listsAllTracks(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksUpdateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksUpdateSample.js index 764fb45481d0..08bdf9ea80bb 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksUpdateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksUpdateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates an existing Track in the asset * * @summary Updates an existing Track in the asset - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-update.json */ async function updateATrack() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text1"; @@ -41,4 +43,8 @@ async function updateATrack() { console.log(result); } -updateATrack().catch(console.error); +async function main() { + updateATrack(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksUpdateTrackDataSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksUpdateTrackDataSample.js index a9433e565aaa..185eb70ce3c0 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksUpdateTrackDataSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/tracksUpdateTrackDataSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Update the track data. Call this API after any changes are made to the track data stored in the asset container. For example, you have modified the WebVTT captions file in the Azure blob storage container for the asset, viewers will not see the new version of the captions unless this API is called. Note, the changes may not be reflected immediately. CDN cache may also need to be purged if applicable. * * @summary Update the track data. Call this API after any changes are made to the track data stored in the asset container. For example, you have modified the WebVTT captions file in the Azure blob storage container for the asset, viewers will not see the new version of the captions unless this API is called. Note, the changes may not be reflected immediately. CDN cache may also need to be purged if applicable. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-update-data.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-update-data.json */ async function updateTheDataForATracks() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text2"; @@ -34,4 +36,8 @@ async function updateTheDataForATracks() { console.log(result); } -updateTheDataForATracks().catch(console.error); +async function main() { + updateTheDataForATracks(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsCreateOrUpdateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsCreateOrUpdateSample.js index 128e07ae1621..e9c0fe33ff8b 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsCreateOrUpdateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsCreateOrUpdateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Creates or updates a new Transform. * * @summary Creates or updates a new Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-create.json */ async function createOrUpdateATransform() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "createdTransform"; const parameters = { @@ -44,4 +46,8 @@ async function createOrUpdateATransform() { console.log(result); } -createOrUpdateATransform().catch(console.error); +async function main() { + createOrUpdateATransform(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsDeleteSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsDeleteSample.js index a39372bb43dc..f6ff5eee2985 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsDeleteSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsDeleteSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Deletes a Transform. * * @summary Deletes a Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-delete.json */ async function deleteATransform() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "sampleTransform"; const credential = new DefaultAzureCredential(); @@ -28,4 +30,8 @@ async function deleteATransform() { console.log(result); } -deleteATransform().catch(console.error); +async function main() { + deleteATransform(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsGetSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsGetSample.js index 82a20ab92e1d..05aa47123b50 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsGetSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsGetSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Gets a Transform. * * @summary Gets a Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-get-by-name.json */ async function getATransformByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "sampleTransform"; const credential = new DefaultAzureCredential(); @@ -28,4 +30,8 @@ async function getATransformByName() { console.log(result); } -getATransformByName().catch(console.error); +async function main() { + getATransformByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsListSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsListSample.js index 073abf91305d..f3353733a9bc 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsListSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsListSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Lists the Transforms in the account. * * @summary Lists the Transforms in the account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-list-all.json */ async function listsTheTransforms() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -30,20 +32,19 @@ async function listsTheTransforms() { console.log(resArray); } -listsTheTransforms().catch(console.error); - /** * This sample demonstrates how to Lists the Transforms in the account. * * @summary Lists the Transforms in the account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-list-all-filter-by-created.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-list-all-filter-by-created.json */ async function listsTheTransformsFilterByCreated() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const filter = - "properties/created gt 2021-11-01T00:00:00.0000000Z and properties/created le 2021-11-01T00:00:10.0000000Z"; + "properties/created gt 2021-06-01T00:00:00.0000000Z and properties/created le 2021-06-01T00:00:10.0000000Z"; const orderby = "properties/created"; const options = { filter, orderby }; const credential = new DefaultAzureCredential(); @@ -55,20 +56,19 @@ async function listsTheTransformsFilterByCreated() { console.log(resArray); } -listsTheTransformsFilterByCreated().catch(console.error); - /** * This sample demonstrates how to Lists the Transforms in the account. * * @summary Lists the Transforms in the account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-list-all-filter-by-lastmodified.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-list-all-filter-by-lastmodified.json */ async function listsTheTransformsFilterByLastmodified() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const filter = - "properties/lastmodified gt 2021-11-01T00:00:00.0000000Z and properties/lastmodified le 2021-11-01T00:00:10.0000000Z"; + "properties/lastmodified gt 2021-06-01T00:00:00.0000000Z and properties/lastmodified le 2021-06-01T00:00:10.0000000Z"; const orderby = "properties/lastmodified desc"; const options = { filter, orderby }; const credential = new DefaultAzureCredential(); @@ -80,17 +80,16 @@ async function listsTheTransformsFilterByLastmodified() { console.log(resArray); } -listsTheTransformsFilterByLastmodified().catch(console.error); - /** * This sample demonstrates how to Lists the Transforms in the account. * * @summary Lists the Transforms in the account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-list-all-filter-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-list-all-filter-by-name.json */ async function listsTheTransformsFilterByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const filter = "(name eq 'sampleEncode') or (name eq 'sampleEncodeAndVideoIndex')"; const orderby = "name desc"; @@ -104,4 +103,11 @@ async function listsTheTransformsFilterByName() { console.log(resArray); } -listsTheTransformsFilterByName().catch(console.error); +async function main() { + listsTheTransforms(); + listsTheTransformsFilterByCreated(); + listsTheTransformsFilterByLastmodified(); + listsTheTransformsFilterByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsUpdateSample.js b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsUpdateSample.js index 39b85bb72e70..915f757d0121 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsUpdateSample.js +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/javascript/transformsUpdateSample.js @@ -10,16 +10,18 @@ // Licensed under the MIT License. const { AzureMediaServices } = require("@azure/arm-mediaservices"); const { DefaultAzureCredential } = require("@azure/identity"); +require("dotenv").config(); /** * This sample demonstrates how to Updates a Transform. * * @summary Updates a Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-update.json */ async function updateATransform() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "transformToUpdate"; const parameters = { @@ -45,4 +47,8 @@ async function updateATransform() { console.log(result); } -updateATransform().catch(console.error); +async function main() { + updateATransform(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/README.md b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/README.md index 040a13e6f4ad..d1b1a219db6e 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/README.md +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/README.md @@ -2,107 +2,107 @@ These sample programs show how to use the TypeScript client libraries for in some common scenarios. -| **File Name** | **Description** | -| ------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [accountFiltersCreateOrUpdateSample.ts][accountfilterscreateorupdatesample] | Creates or updates an Account Filter in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-create.json | -| [accountFiltersDeleteSample.ts][accountfiltersdeletesample] | Deletes an Account Filter in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-delete.json | -| [accountFiltersGetSample.ts][accountfiltersgetsample] | Get the details of an Account Filter in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-get-by-name.json | -| [accountFiltersListSample.ts][accountfilterslistsample] | List Account Filters in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-list-all.json | -| [accountFiltersUpdateSample.ts][accountfiltersupdatesample] | Updates an existing Account Filter in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-update.json | -| [assetFiltersCreateOrUpdateSample.ts][assetfilterscreateorupdatesample] | Creates or updates an Asset Filter associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-create.json | -| [assetFiltersDeleteSample.ts][assetfiltersdeletesample] | Deletes an Asset Filter associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-delete.json | -| [assetFiltersGetSample.ts][assetfiltersgetsample] | Get the details of an Asset Filter associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-get-by-name.json | -| [assetFiltersListSample.ts][assetfilterslistsample] | List Asset Filters associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-list-all.json | -| [assetFiltersUpdateSample.ts][assetfiltersupdatesample] | Updates an existing Asset Filter associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-update.json | -| [assetsCreateOrUpdateSample.ts][assetscreateorupdatesample] | Creates or updates an Asset in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-create.json | -| [assetsDeleteSample.ts][assetsdeletesample] | Deletes an Asset in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-delete.json | -| [assetsGetEncryptionKeySample.ts][assetsgetencryptionkeysample] | Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-get-encryption-keys.json | -| [assetsGetSample.ts][assetsgetsample] | Get the details of an Asset in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-get-by-name.json | -| [assetsListContainerSasSample.ts][assetslistcontainersassample] | Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-sas-urls.json | -| [assetsListSample.ts][assetslistsample] | List Assets in the Media Services account with optional filtering and ordering x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-in-date-range.json | -| [assetsListStreamingLocatorsSample.ts][assetsliststreaminglocatorssample] | Lists Streaming Locators which are associated with this asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-streaming-locators.json | -| [assetsUpdateSample.ts][assetsupdatesample] | Updates an existing Asset in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-update.json | -| [contentKeyPoliciesCreateOrUpdateSample.ts][contentkeypoliciescreateorupdatesample] | Create or update a Content Key Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-create-nodrm-token.json | -| [contentKeyPoliciesDeleteSample.ts][contentkeypoliciesdeletesample] | Deletes a Content Key Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-delete.json | -| [contentKeyPoliciesGetPolicyPropertiesWithSecretsSample.ts][contentkeypoliciesgetpolicypropertieswithsecretssample] | Get a Content Key Policy including secret values x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-get-with-secrets.json | -| [contentKeyPoliciesGetSample.ts][contentkeypoliciesgetsample] | Get the details of a Content Key Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-get-by-name.json | -| [contentKeyPoliciesListSample.ts][contentkeypolicieslistsample] | Lists the Content Key Policies in the account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-list-by-lastModified.json | -| [contentKeyPoliciesUpdateSample.ts][contentkeypoliciesupdatesample] | Updates an existing Content Key Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-update.json | -| [jobsCancelJobSample.ts][jobscanceljobsample] | Cancel a Job. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-cancel.json | -| [jobsCreateSample.ts][jobscreatesample] | Creates a Job. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-create.json | -| [jobsDeleteSample.ts][jobsdeletesample] | Deletes a Job. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-delete.json | -| [jobsGetSample.ts][jobsgetsample] | Gets a Job. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-get-by-name.json | -| [jobsListSample.ts][jobslistsample] | Lists all of the Jobs for the Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-created.json | -| [jobsUpdateSample.ts][jobsupdatesample] | Update is only supported for description and priority. Updating Priority will take effect when the Job state is Queued or Scheduled and depending on the timing the priority update may be ignored. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-update.json | -| [liveEventsAllocateSample.ts][liveeventsallocatesample] | A live event is in StandBy state after allocation completes, and is ready to start. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-allocate.json | -| [liveEventsAsyncOperationSample.ts][liveeventsasyncoperationsample] | Get a live event operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/async-operation-result.json | -| [liveEventsCreateSample.ts][liveeventscreatesample] | Creates a new live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-create.json | -| [liveEventsDeleteSample.ts][liveeventsdeletesample] | Deletes a live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-delete.json | -| [liveEventsGetSample.ts][liveeventsgetsample] | Gets properties of a live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-list-by-name.json | -| [liveEventsListSample.ts][liveeventslistsample] | Lists all the live events in the account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-list-all.json | -| [liveEventsOperationLocationSample.ts][liveeventsoperationlocationsample] | Get a live event operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-operation-location.json | -| [liveEventsResetSample.ts][liveeventsresetsample] | Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and will be started again. All assets used by the live outputs and streaming locators created on these assets are unaffected. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-reset.json | -| [liveEventsStartSample.ts][liveeventsstartsample] | A live event in Stopped or StandBy state will be in Running state after the start operation completes. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-start.json | -| [liveEventsStopSample.ts][liveeventsstopsample] | Stops a running live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-stop.json | -| [liveEventsUpdateSample.ts][liveeventsupdatesample] | Updates settings on an existing live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-update.json | -| [liveOutputsAsyncOperationSample.ts][liveoutputsasyncoperationsample] | Get a Live Output operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/async-operation-result.json | -| [liveOutputsCreateSample.ts][liveoutputscreatesample] | Creates a new live output. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-create.json | -| [liveOutputsDeleteSample.ts][liveoutputsdeletesample] | Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-delete.json | -| [liveOutputsGetSample.ts][liveoutputsgetsample] | Gets a live output. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-list-by-name.json | -| [liveOutputsListSample.ts][liveoutputslistsample] | Lists the live outputs of a live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-list-all.json | -| [liveOutputsOperationLocationSample.ts][liveoutputsoperationlocationsample] | Get a Live Output operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-operation-location.json | -| [locationsCheckNameAvailabilitySample.ts][locationschecknameavailabilitysample] | Checks whether the Media Service resource name is available. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-check-name-availability.json | -| [mediaServicesOperationResultsGetSample.ts][mediaservicesoperationresultsgetsample] | Get media service operation result. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/media-service-operation-result-by-id.json | -| [mediaServicesOperationStatusesGetSample.ts][mediaservicesoperationstatusesgetsample] | Get media service operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state-failed.json | -| [mediaservicesCreateOrUpdateSample.ts][mediaservicescreateorupdatesample] | Creates or updates a Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/async-accounts-create.json | -| [mediaservicesDeleteSample.ts][mediaservicesdeletesample] | Deletes a Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-delete.json | -| [mediaservicesGetSample.ts][mediaservicesgetsample] | Get the details of a Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-get-by-name.json | -| [mediaservicesListBySubscriptionSample.ts][mediaserviceslistbysubscriptionsample] | List Media Services accounts in the subscription. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-subscription-list-all-accounts.json | -| [mediaservicesListEdgePoliciesSample.ts][mediaserviceslistedgepoliciessample] | List all the media edge policies associated with the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-list-media-edge-policies.json | -| [mediaservicesListSample.ts][mediaserviceslistsample] | List Media Services accounts in the resource group x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-list-all-accounts.json | -| [mediaservicesSyncStorageKeysSample.ts][mediaservicessyncstoragekeyssample] | Synchronizes storage account keys for a storage account associated with the Media Service account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-sync-storage-keys.json | -| [mediaservicesUpdateSample.ts][mediaservicesupdatesample] | Updates an existing Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/async-accounts-update.json | -| [operationResultsGetSample.ts][operationresultsgetsample] | Get asset track operation result. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-operation-result-by-id.json | -| [operationStatusesGetSample.ts][operationstatusesgetsample] | Get asset track operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state-failed.json | -| [operationsListSample.ts][operationslistsample] | Lists all the Media Services operations. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/operations-list-all.json | -| [privateEndpointConnectionsCreateOrUpdateSample.ts][privateendpointconnectionscreateorupdatesample] | Update an existing private endpoint connection. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-put.json | -| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | Deletes a private endpoint connection. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-delete.json | -| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | Get the details of a private endpoint connection. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-get-by-name.json | -| [privateEndpointConnectionsListSample.ts][privateendpointconnectionslistsample] | List all private endpoint connections. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-list.json | -| [privateLinkResourcesGetSample.ts][privatelinkresourcesgetsample] | Get details of a group ID. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-link-resources-get-by-name.json | -| [privateLinkResourcesListSample.ts][privatelinkresourceslistsample] | List supported group IDs. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-link-resources-list.json | -| [streamingEndpointsAsyncOperationSample.ts][streamingendpointsasyncoperationsample] | Get a streaming endpoint operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/async-operation-result.json | -| [streamingEndpointsCreateSample.ts][streamingendpointscreatesample] | Creates a streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-create.json | -| [streamingEndpointsDeleteSample.ts][streamingendpointsdeletesample] | Deletes a streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-delete.json | -| [streamingEndpointsGetSample.ts][streamingendpointsgetsample] | Gets a streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-list-by-name.json | -| [streamingEndpointsListSample.ts][streamingendpointslistsample] | Lists the streaming endpoints in the account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-list-all.json | -| [streamingEndpointsOperationLocationSample.ts][streamingendpointsoperationlocationsample] | Get a streaming endpoint operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-operation-location.json | -| [streamingEndpointsScaleSample.ts][streamingendpointsscalesample] | Scales an existing streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-scale.json | -| [streamingEndpointsSkusSample.ts][streamingendpointsskussample] | List streaming endpoint supported skus. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-list-skus.json | -| [streamingEndpointsStartSample.ts][streamingendpointsstartsample] | Starts an existing streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-start.json | -| [streamingEndpointsStopSample.ts][streamingendpointsstopsample] | Stops an existing streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-stop.json | -| [streamingEndpointsUpdateSample.ts][streamingendpointsupdatesample] | Updates a existing streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-update.json | -| [streamingLocatorsCreateSample.ts][streaminglocatorscreatesample] | Create a Streaming Locator in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-create-clear.json | -| [streamingLocatorsDeleteSample.ts][streaminglocatorsdeletesample] | Deletes a Streaming Locator in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-delete.json | -| [streamingLocatorsGetSample.ts][streaminglocatorsgetsample] | Get the details of a Streaming Locator in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-get-by-name.json | -| [streamingLocatorsListContentKeysSample.ts][streaminglocatorslistcontentkeyssample] | List Content Keys used by this Streaming Locator x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-list-content-keys.json | -| [streamingLocatorsListPathsSample.ts][streaminglocatorslistpathssample] | List Paths supported by this Streaming Locator x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-and-download.json | -| [streamingLocatorsListSample.ts][streaminglocatorslistsample] | Lists the Streaming Locators in the account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-list.json | -| [streamingPoliciesCreateSample.ts][streamingpoliciescreatesample] | Create a Streaming Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-clearKeyEncryption.json | -| [streamingPoliciesDeleteSample.ts][streamingpoliciesdeletesample] | Deletes a Streaming Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-delete.json | -| [streamingPoliciesGetSample.ts][streamingpoliciesgetsample] | Get the details of a Streaming Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policy-get-by-name.json | -| [streamingPoliciesListSample.ts][streamingpolicieslistsample] | Lists the Streaming Policies in the account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-list.json | -| [tracksCreateOrUpdateSample.ts][trackscreateorupdatesample] | Create or update a Track in the asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-create.json | -| [tracksDeleteSample.ts][tracksdeletesample] | Deletes a Track in the asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-delete.json | -| [tracksGetSample.ts][tracksgetsample] | Get the details of a Track in the Asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-get-by-name.json | -| [tracksListSample.ts][trackslistsample] | Lists the Tracks in the asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-list-all.json | -| [tracksUpdateSample.ts][tracksupdatesample] | Updates an existing Track in the asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-update.json | -| [tracksUpdateTrackDataSample.ts][tracksupdatetrackdatasample] | Update the track data. Call this API after any changes are made to the track data stored in the asset container. For example, you have modified the WebVTT captions file in the Azure blob storage container for the asset, viewers will not see the new version of the captions unless this API is called. Note, the changes may not be reflected immediately. CDN cache may also need to be purged if applicable. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-update-data.json | -| [transformsCreateOrUpdateSample.ts][transformscreateorupdatesample] | Creates or updates a new Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-create.json | -| [transformsDeleteSample.ts][transformsdeletesample] | Deletes a Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-delete.json | -| [transformsGetSample.ts][transformsgetsample] | Gets a Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-get-by-name.json | -| [transformsListSample.ts][transformslistsample] | Lists the Transforms in the account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-list-all.json | -| [transformsUpdateSample.ts][transformsupdatesample] | Updates a Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-update.json | +| **File Name** | **Description** | +| ------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [accountFiltersCreateOrUpdateSample.ts][accountfilterscreateorupdatesample] | Creates or updates an Account Filter in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-create.json | +| [accountFiltersDeleteSample.ts][accountfiltersdeletesample] | Deletes an Account Filter in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-delete.json | +| [accountFiltersGetSample.ts][accountfiltersgetsample] | Get the details of an Account Filter in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-get-by-name.json | +| [accountFiltersListSample.ts][accountfilterslistsample] | List Account Filters in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-list-all.json | +| [accountFiltersUpdateSample.ts][accountfiltersupdatesample] | Updates an existing Account Filter in the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-update.json | +| [assetFiltersCreateOrUpdateSample.ts][assetfilterscreateorupdatesample] | Creates or updates an Asset Filter associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-create.json | +| [assetFiltersDeleteSample.ts][assetfiltersdeletesample] | Deletes an Asset Filter associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-delete.json | +| [assetFiltersGetSample.ts][assetfiltersgetsample] | Get the details of an Asset Filter associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-get-by-name.json | +| [assetFiltersListSample.ts][assetfilterslistsample] | List Asset Filters associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-list-all.json | +| [assetFiltersUpdateSample.ts][assetfiltersupdatesample] | Updates an existing Asset Filter associated with the specified Asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-update.json | +| [assetsCreateOrUpdateSample.ts][assetscreateorupdatesample] | Creates or updates an Asset in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-create.json | +| [assetsDeleteSample.ts][assetsdeletesample] | Deletes an Asset in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-delete.json | +| [assetsGetEncryptionKeySample.ts][assetsgetencryptionkeysample] | Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-get-encryption-keys.json | +| [assetsGetSample.ts][assetsgetsample] | Get the details of an Asset in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-get-by-name.json | +| [assetsListContainerSasSample.ts][assetslistcontainersassample] | Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-sas-urls.json | +| [assetsListSample.ts][assetslistsample] | List Assets in the Media Services account with optional filtering and ordering x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-in-date-range.json | +| [assetsListStreamingLocatorsSample.ts][assetsliststreaminglocatorssample] | Lists Streaming Locators which are associated with this asset. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-streaming-locators.json | +| [assetsUpdateSample.ts][assetsupdatesample] | Updates an existing Asset in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-update.json | +| [contentKeyPoliciesCreateOrUpdateSample.ts][contentkeypoliciescreateorupdatesample] | Create or update a Content Key Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-nodrm-token.json | +| [contentKeyPoliciesDeleteSample.ts][contentkeypoliciesdeletesample] | Deletes a Content Key Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-delete.json | +| [contentKeyPoliciesGetPolicyPropertiesWithSecretsSample.ts][contentkeypoliciesgetpolicypropertieswithsecretssample] | Get a Content Key Policy including secret values x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-get-with-secrets.json | +| [contentKeyPoliciesGetSample.ts][contentkeypoliciesgetsample] | Get the details of a Content Key Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-get-by-name.json | +| [contentKeyPoliciesListSample.ts][contentkeypolicieslistsample] | Lists the Content Key Policies in the account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-list-by-lastModified.json | +| [contentKeyPoliciesUpdateSample.ts][contentkeypoliciesupdatesample] | Updates an existing Content Key Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-update.json | +| [jobsCancelJobSample.ts][jobscanceljobsample] | Cancel a Job. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-cancel.json | +| [jobsCreateSample.ts][jobscreatesample] | Creates a Job. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-create.json | +| [jobsDeleteSample.ts][jobsdeletesample] | Deletes a Job. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-delete.json | +| [jobsGetSample.ts][jobsgetsample] | Gets a Job. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-get-by-name.json | +| [jobsListSample.ts][jobslistsample] | Lists all of the Jobs for the Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-created.json | +| [jobsUpdateSample.ts][jobsupdatesample] | Update is only supported for description and priority. Updating Priority will take effect when the Job state is Queued or Scheduled and depending on the timing the priority update may be ignored. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-update.json | +| [liveEventsAllocateSample.ts][liveeventsallocatesample] | A live event is in StandBy state after allocation completes, and is ready to start. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-allocate.json | +| [liveEventsAsyncOperationSample.ts][liveeventsasyncoperationsample] | Get a live event operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json | +| [liveEventsCreateSample.ts][liveeventscreatesample] | Creates a new live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-create.json | +| [liveEventsDeleteSample.ts][liveeventsdeletesample] | Deletes a live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-delete.json | +| [liveEventsGetSample.ts][liveeventsgetsample] | Gets properties of a live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-list-by-name.json | +| [liveEventsListSample.ts][liveeventslistsample] | Lists all the live events in the account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-list-all.json | +| [liveEventsOperationLocationSample.ts][liveeventsoperationlocationsample] | Get a live event operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-operation-location.json | +| [liveEventsResetSample.ts][liveeventsresetsample] | Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and will be started again. All assets used by the live outputs and streaming locators created on these assets are unaffected. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-reset.json | +| [liveEventsStartSample.ts][liveeventsstartsample] | A live event in Stopped or StandBy state will be in Running state after the start operation completes. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-start.json | +| [liveEventsStopSample.ts][liveeventsstopsample] | Stops a running live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-stop.json | +| [liveEventsUpdateSample.ts][liveeventsupdatesample] | Updates settings on an existing live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-update.json | +| [liveOutputsAsyncOperationSample.ts][liveoutputsasyncoperationsample] | Get a Live Output operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json | +| [liveOutputsCreateSample.ts][liveoutputscreatesample] | Creates a new live output. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-create.json | +| [liveOutputsDeleteSample.ts][liveoutputsdeletesample] | Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-delete.json | +| [liveOutputsGetSample.ts][liveoutputsgetsample] | Gets a live output. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-list-by-name.json | +| [liveOutputsListSample.ts][liveoutputslistsample] | Lists the live outputs of a live event. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-list-all.json | +| [liveOutputsOperationLocationSample.ts][liveoutputsoperationlocationsample] | Get a Live Output operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-operation-location.json | +| [locationsCheckNameAvailabilitySample.ts][locationschecknameavailabilitysample] | Checks whether the Media Service resource name is available. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-check-name-availability.json | +| [mediaServicesOperationResultsGetSample.ts][mediaservicesoperationresultsgetsample] | Get media service operation result. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-result-by-id.json | +| [mediaServicesOperationStatusesGetSample.ts][mediaservicesoperationstatusesgetsample] | Get media service operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state-failed.json | +| [mediaservicesCreateOrUpdateSample.ts][mediaservicescreateorupdatesample] | Creates or updates a Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/async-accounts-create.json | +| [mediaservicesDeleteSample.ts][mediaservicesdeletesample] | Deletes a Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-delete.json | +| [mediaservicesGetSample.ts][mediaservicesgetsample] | Get the details of a Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-get-by-name.json | +| [mediaservicesListBySubscriptionSample.ts][mediaserviceslistbysubscriptionsample] | List Media Services accounts in the subscription. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-subscription-list-all-accounts.json | +| [mediaservicesListEdgePoliciesSample.ts][mediaserviceslistedgepoliciessample] | List all the media edge policies associated with the Media Services account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-list-media-edge-policies.json | +| [mediaservicesListSample.ts][mediaserviceslistsample] | List Media Services accounts in the resource group x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-list-all-accounts.json | +| [mediaservicesSyncStorageKeysSample.ts][mediaservicessyncstoragekeyssample] | Synchronizes storage account keys for a storage account associated with the Media Service account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-sync-storage-keys.json | +| [mediaservicesUpdateSample.ts][mediaservicesupdatesample] | Updates an existing Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/async-accounts-update.json | +| [operationResultsGetSample.ts][operationresultsgetsample] | Get asset track operation result. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-result-by-id.json | +| [operationStatusesGetSample.ts][operationstatusesgetsample] | Get asset track operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state-failed.json | +| [operationsListSample.ts][operationslistsample] | Lists all the Media Services operations. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/operations-list-all.json | +| [privateEndpointConnectionsCreateOrUpdateSample.ts][privateendpointconnectionscreateorupdatesample] | Update an existing private endpoint connection. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-put.json | +| [privateEndpointConnectionsDeleteSample.ts][privateendpointconnectionsdeletesample] | Deletes a private endpoint connection. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-delete.json | +| [privateEndpointConnectionsGetSample.ts][privateendpointconnectionsgetsample] | Get the details of a private endpoint connection. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-get-by-name.json | +| [privateEndpointConnectionsListSample.ts][privateendpointconnectionslistsample] | List all private endpoint connections. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-list.json | +| [privateLinkResourcesGetSample.ts][privatelinkresourcesgetsample] | Get details of a group ID. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-link-resources-get-by-name.json | +| [privateLinkResourcesListSample.ts][privatelinkresourceslistsample] | List supported group IDs. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-link-resources-list.json | +| [streamingEndpointsAsyncOperationSample.ts][streamingendpointsasyncoperationsample] | Get a streaming endpoint operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json | +| [streamingEndpointsCreateSample.ts][streamingendpointscreatesample] | Creates a streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-create.json | +| [streamingEndpointsDeleteSample.ts][streamingendpointsdeletesample] | Deletes a streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-delete.json | +| [streamingEndpointsGetSample.ts][streamingendpointsgetsample] | Gets a streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-list-by-name.json | +| [streamingEndpointsListSample.ts][streamingendpointslistsample] | Lists the streaming endpoints in the account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-list-all.json | +| [streamingEndpointsOperationLocationSample.ts][streamingendpointsoperationlocationsample] | Get a streaming endpoint operation status. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-operation-location.json | +| [streamingEndpointsScaleSample.ts][streamingendpointsscalesample] | Scales an existing streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-scale.json | +| [streamingEndpointsSkusSample.ts][streamingendpointsskussample] | List streaming endpoint supported skus. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-list-skus.json | +| [streamingEndpointsStartSample.ts][streamingendpointsstartsample] | Starts an existing streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-start.json | +| [streamingEndpointsStopSample.ts][streamingendpointsstopsample] | Stops an existing streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-stop.json | +| [streamingEndpointsUpdateSample.ts][streamingendpointsupdatesample] | Updates a existing streaming endpoint. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-update.json | +| [streamingLocatorsCreateSample.ts][streaminglocatorscreatesample] | Create a Streaming Locator in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-create-clear.json | +| [streamingLocatorsDeleteSample.ts][streaminglocatorsdeletesample] | Deletes a Streaming Locator in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-delete.json | +| [streamingLocatorsGetSample.ts][streaminglocatorsgetsample] | Get the details of a Streaming Locator in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-get-by-name.json | +| [streamingLocatorsListContentKeysSample.ts][streaminglocatorslistcontentkeyssample] | List Content Keys used by this Streaming Locator x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list-content-keys.json | +| [streamingLocatorsListPathsSample.ts][streaminglocatorslistpathssample] | List Paths supported by this Streaming Locator x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-and-download.json | +| [streamingLocatorsListSample.ts][streaminglocatorslistsample] | Lists the Streaming Locators in the account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list.json | +| [streamingPoliciesCreateSample.ts][streamingpoliciescreatesample] | Create a Streaming Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-clearKeyEncryption.json | +| [streamingPoliciesDeleteSample.ts][streamingpoliciesdeletesample] | Deletes a Streaming Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-delete.json | +| [streamingPoliciesGetSample.ts][streamingpoliciesgetsample] | Get the details of a Streaming Policy in the Media Services account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policy-get-by-name.json | +| [streamingPoliciesListSample.ts][streamingpolicieslistsample] | Lists the Streaming Policies in the account x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-list.json | +| [tracksCreateOrUpdateSample.ts][trackscreateorupdatesample] | Create or update a Track in the asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-create.json | +| [tracksDeleteSample.ts][tracksdeletesample] | Deletes a Track in the asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-delete.json | +| [tracksGetSample.ts][tracksgetsample] | Get the details of a Track in the Asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-get-by-name.json | +| [tracksListSample.ts][trackslistsample] | Lists the Tracks in the asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-list-all.json | +| [tracksUpdateSample.ts][tracksupdatesample] | Updates an existing Track in the asset x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-update.json | +| [tracksUpdateTrackDataSample.ts][tracksupdatetrackdatasample] | Update the track data. Call this API after any changes are made to the track data stored in the asset container. For example, you have modified the WebVTT captions file in the Azure blob storage container for the asset, viewers will not see the new version of the captions unless this API is called. Note, the changes may not be reflected immediately. CDN cache may also need to be purged if applicable. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-update-data.json | +| [transformsCreateOrUpdateSample.ts][transformscreateorupdatesample] | Creates or updates a new Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-create.json | +| [transformsDeleteSample.ts][transformsdeletesample] | Deletes a Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-delete.json | +| [transformsGetSample.ts][transformsgetsample] | Gets a Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-get-by-name.json | +| [transformsListSample.ts][transformslistsample] | Lists the Transforms in the account. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-list-all.json | +| [transformsUpdateSample.ts][transformsupdatesample] | Updates a Transform. x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-update.json | ## Prerequisites @@ -147,7 +147,7 @@ node dist/accountFiltersCreateOrUpdateSample.js Alternatively, run a single sample with the correct environment variables set (setting up the `.env` file is not required if you do this), for example (cross-platform): ```bash -npx cross-env node dist/accountFiltersCreateOrUpdateSample.js +npx cross-env MEDIASERVICES_SUBSCRIPTION_ID="" MEDIASERVICES_RESOURCE_GROUP="" node dist/accountFiltersCreateOrUpdateSample.js ``` ## Next Steps diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/package.json b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/package.json index 90992841ab21..6138b6e3ea12 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/package.json +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/package.json @@ -35,7 +35,7 @@ }, "devDependencies": { "@types/node": "^14.0.0", - "typescript": "~4.6.0", + "typescript": "~4.8.0", "rimraf": "latest" } } diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersCreateOrUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersCreateOrUpdateSample.ts index 61d5887c49d3..dd6ef1df2c00 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersCreateOrUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersCreateOrUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AccountFilter, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates an Account Filter in the Media Services account. * * @summary Creates or updates an Account Filter in the Media Services account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-create.json */ async function createAnAccountFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const filterName = "newAccountFilter"; const parameters: AccountFilter = { @@ -59,4 +65,8 @@ async function createAnAccountFilter() { console.log(result); } -createAnAccountFilter().catch(console.error); +async function main() { + createAnAccountFilter(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersDeleteSample.ts index f65307c05913..36c4b1700941 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes an Account Filter in the Media Services account. * * @summary Deletes an Account Filter in the Media Services account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-delete.json */ async function deleteAnAccountFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const filterName = "accountFilterWithTimeWindowAndTrack"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteAnAccountFilter() { console.log(result); } -deleteAnAccountFilter().catch(console.error); +async function main() { + deleteAnAccountFilter(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersGetSample.ts index b0ad7335baea..83c245565a76 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the details of an Account Filter in the Media Services account. * * @summary Get the details of an Account Filter in the Media Services account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-get-by-name.json */ async function getAnAccountFilterByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const filterName = "accountFilterWithTrack"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAnAccountFilterByName() { console.log(result); } -getAnAccountFilterByName().catch(console.error); +async function main() { + getAnAccountFilterByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersListSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersListSample.ts index ab9ee13f4e96..3a428d88edfb 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List Account Filters in the Media Services account. * * @summary List Account Filters in the Media Services account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-list-all.json */ async function listAllAccountFilters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listAllAccountFilters() { console.log(resArray); } -listAllAccountFilters().catch(console.error); +async function main() { + listAllAccountFilters(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersUpdateSample.ts index aa5de632238c..43ddafa08bb6 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/accountFiltersUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AccountFilter, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates an existing Account Filter in the Media Services account. * * @summary Updates an existing Account Filter in the Media Services account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/accountFilters-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/accountFilters-update.json */ async function updateAnAccountFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const filterName = "accountFilterWithTimeWindowAndTrack"; const parameters: AccountFilter = { @@ -44,4 +50,8 @@ async function updateAnAccountFilter() { console.log(result); } -updateAnAccountFilter().catch(console.error); +async function main() { + updateAnAccountFilter(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersCreateOrUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersCreateOrUpdateSample.ts index 15ccf36ffcdd..ff784830764c 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersCreateOrUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersCreateOrUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AssetFilter, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates an Asset Filter associated with the specified Asset. * * @summary Creates or updates an Asset Filter associated with the specified Asset. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-create.json */ async function createAnAssetFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const filterName = "newAssetFilter"; @@ -61,4 +67,8 @@ async function createAnAssetFilter() { console.log(result); } -createAnAssetFilter().catch(console.error); +async function main() { + createAnAssetFilter(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersDeleteSample.ts index c9085a49b640..16f768861483 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes an Asset Filter associated with the specified Asset. * * @summary Deletes an Asset Filter associated with the specified Asset. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-delete.json */ async function deleteAnAssetFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const filterName = "assetFilterWithTimeWindowAndTrack"; @@ -34,4 +40,8 @@ async function deleteAnAssetFilter() { console.log(result); } -deleteAnAssetFilter().catch(console.error); +async function main() { + deleteAnAssetFilter(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersGetSample.ts index e07d1aef894a..88917a6fbfbe 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the details of an Asset Filter associated with the specified Asset. * * @summary Get the details of an Asset Filter associated with the specified Asset. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-get-by-name.json */ async function getAnAssetFilterByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const filterName = "assetFilterWithTimeWindowAndTrack"; @@ -34,4 +40,8 @@ async function getAnAssetFilterByName() { console.log(result); } -getAnAssetFilterByName().catch(console.error); +async function main() { + getAnAssetFilterByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersListSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersListSample.ts index 59b5218f10ef..f6c2d18aebc0 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List Asset Filters associated with the specified Asset. * * @summary List Asset Filters associated with the specified Asset. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-list-all.json */ async function listAllAssetFilters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function listAllAssetFilters() { console.log(resArray); } -listAllAssetFilters().catch(console.error); +async function main() { + listAllAssetFilters(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersUpdateSample.ts index 95e51ce9bbe3..ef16c85cdd75 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetFiltersUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AssetFilter, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates an existing Asset Filter associated with the specified Asset. * * @summary Updates an existing Asset Filter associated with the specified Asset. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assetFilters-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assetFilters-update.json */ async function updateAnAssetFilter() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const filterName = "assetFilterWithTimeWindowAndTrack"; @@ -46,4 +52,8 @@ async function updateAnAssetFilter() { console.log(result); } -updateAnAssetFilter().catch(console.error); +async function main() { + updateAnAssetFilter(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsCreateOrUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsCreateOrUpdateSample.ts index 01bc39e9273f..4915c03ac1c8 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsCreateOrUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsCreateOrUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { Asset, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates an Asset in the Media Services account * * @summary Creates or updates an Asset in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-create.json */ async function createAnAsset() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountLogan"; const parameters: Asset = { @@ -37,4 +43,8 @@ async function createAnAsset() { console.log(result); } -createAnAsset().catch(console.error); +async function main() { + createAnAsset(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsDeleteSample.ts index b159944a9406..a42091c870e0 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes an Asset in the Media Services account * * @summary Deletes an Asset in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-delete.json */ async function deleteAnAsset() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountAdams"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteAnAsset() { console.log(result); } -deleteAnAsset().catch(console.error); +async function main() { + deleteAnAsset(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsGetEncryptionKeySample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsGetEncryptionKeySample.ts index d489cdc22825..747ce47a280b 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsGetEncryptionKeySample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsGetEncryptionKeySample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API * * @summary Gets the Asset storage encryption keys used to decrypt content created by version 2 of the Media Services API - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-get-encryption-keys.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-get-encryption-keys.json */ async function getAssetStorageEncryptionKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountSaintHelens"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAssetStorageEncryptionKeys() { console.log(result); } -getAssetStorageEncryptionKeys().catch(console.error); +async function main() { + getAssetStorageEncryptionKeys(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsGetSample.ts index be6f7b32b3dd..2d560fc29709 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the details of an Asset in the Media Services account * * @summary Get the details of an Asset in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-get-by-name.json */ async function getAnAssetByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountAdams"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAnAssetByName() { console.log(result); } -getAnAssetByName().catch(console.error); +async function main() { + getAnAssetByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsListContainerSasSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsListContainerSasSample.ts index 01f67a90ca3f..38e8f14f1ad3 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsListContainerSasSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsListContainerSasSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. * * @summary Lists storage container URLs with shared access signatures (SAS) for uploading and downloading Asset content. The signatures are derived from the storage account keys. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-sas-urls.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-sas-urls.json */ async function listAssetSasUrLs() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountBaker"; const parameters: ListContainerSasInput = { @@ -40,4 +46,8 @@ async function listAssetSasUrLs() { console.log(result); } -listAssetSasUrLs().catch(console.error); +async function main() { + listAssetSasUrLs(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsListSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsListSample.ts index 934bdc25c252..2e8b036a1902 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsListSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List Assets in the Media Services account with optional filtering and ordering * * @summary List Assets in the Media Services account with optional filtering and ordering - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-in-date-range.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-in-date-range.json */ async function listAssetCreatedInADateRange() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const filter = "properties/created gt 2012-06-01 and properties/created lt 2013-07-01"; @@ -41,17 +47,18 @@ async function listAssetCreatedInADateRange() { console.log(resArray); } -listAssetCreatedInADateRange().catch(console.error); - /** * This sample demonstrates how to List Assets in the Media Services account with optional filtering and ordering * * @summary List Assets in the Media Services account with optional filtering and ordering - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-by-date.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-by-date.json */ async function listAssetOrderedByDate() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const orderby = "properties/created"; const options: AssetsListOptionalParams = { orderby }; @@ -68,17 +75,18 @@ async function listAssetOrderedByDate() { console.log(resArray); } -listAssetOrderedByDate().catch(console.error); - /** * This sample demonstrates how to List Assets in the Media Services account with optional filtering and ordering * * @summary List Assets in the Media Services account with optional filtering and ordering - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-all.json */ async function listAllAssets() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -89,4 +97,10 @@ async function listAllAssets() { console.log(resArray); } -listAllAssets().catch(console.error); +async function main() { + listAssetCreatedInADateRange(); + listAssetOrderedByDate(); + listAllAssets(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsListStreamingLocatorsSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsListStreamingLocatorsSample.ts index 57dc59a37db8..7221ec348d21 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsListStreamingLocatorsSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsListStreamingLocatorsSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists Streaming Locators which are associated with this asset. * * @summary Lists Streaming Locators which are associated with this asset. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-list-streaming-locators.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-list-streaming-locators.json */ async function listAssetSasUrLs() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountSaintHelens"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function listAssetSasUrLs() { console.log(result); } -listAssetSasUrLs().catch(console.error); +async function main() { + listAssetSasUrLs(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsUpdateSample.ts index 889961a03ea9..5fe4f0f076f3 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/assetsUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { Asset, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates an existing Asset in the Media Services account * * @summary Updates an existing Asset in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/assets-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/assets-update.json */ async function updateAnAsset() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountBaker"; const parameters: Asset = { @@ -36,4 +42,8 @@ async function updateAnAsset() { console.log(result); } -updateAnAsset().catch(console.error); +async function main() { + updateAnAsset(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesCreateOrUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesCreateOrUpdateSample.ts index d185394a5196..a7a9d5e663fc 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesCreateOrUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesCreateOrUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { ContentKeyPolicy, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or update a Content Key Policy in the Media Services account * * @summary Create or update a Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-create-nodrm-token.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-nodrm-token.json */ async function createsAContentKeyPolicyWithClearKeyOptionAndTokenRestriction() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithClearKeyOptionAndSwtTokenRestriction"; const parameters: ContentKeyPolicy = { @@ -54,19 +60,18 @@ async function createsAContentKeyPolicyWithClearKeyOptionAndTokenRestriction() { console.log(result); } -createsAContentKeyPolicyWithClearKeyOptionAndTokenRestriction().catch( - console.error -); - /** * This sample demonstrates how to Create or update a Content Key Policy in the Media Services account * * @summary Create or update a Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-create-playready-open.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-playready-open.json */ async function createsAContentKeyPolicyWithPlayReadyOptionAndOpenRestriction() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithPlayReadyOptionAndOpenRestriction"; const parameters: ContentKeyPolicy = { @@ -114,19 +119,18 @@ async function createsAContentKeyPolicyWithPlayReadyOptionAndOpenRestriction() { console.log(result); } -createsAContentKeyPolicyWithPlayReadyOptionAndOpenRestriction().catch( - console.error -); - /** * This sample demonstrates how to Create or update a Content Key Policy in the Media Services account * * @summary Create or update a Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-create-widevine-token.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-widevine-token.json */ async function createsAContentKeyPolicyWithWidevineOptionAndTokenRestriction() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithWidevineOptionAndJwtTokenRestriction"; const parameters: ContentKeyPolicy = { @@ -170,19 +174,18 @@ async function createsAContentKeyPolicyWithWidevineOptionAndTokenRestriction() { console.log(result); } -createsAContentKeyPolicyWithWidevineOptionAndTokenRestriction().catch( - console.error -); - /** * This sample demonstrates how to Create or update a Content Key Policy in the Media Services account * * @summary Create or update a Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-create-multiple-options.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-create-multiple-options.json */ async function createsAContentKeyPolicyWithMultipleOptions() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyCreatedWithMultipleOptions"; const parameters: ContentKeyPolicy = { @@ -228,4 +231,11 @@ async function createsAContentKeyPolicyWithMultipleOptions() { console.log(result); } -createsAContentKeyPolicyWithMultipleOptions().catch(console.error); +async function main() { + createsAContentKeyPolicyWithClearKeyOptionAndTokenRestriction(); + createsAContentKeyPolicyWithPlayReadyOptionAndOpenRestriction(); + createsAContentKeyPolicyWithWidevineOptionAndTokenRestriction(); + createsAContentKeyPolicyWithMultipleOptions(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesDeleteSample.ts index 98f914ee3ab6..649cfca5f328 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Content Key Policy in the Media Services account * * @summary Deletes a Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-delete.json */ async function deleteAKeyPolicy() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithPlayReadyOptionAndOpenRestriction"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteAKeyPolicy() { console.log(result); } -deleteAKeyPolicy().catch(console.error); +async function main() { + deleteAKeyPolicy(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesGetPolicyPropertiesWithSecretsSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesGetPolicyPropertiesWithSecretsSample.ts index dd862308ce25..028c315ae2cf 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesGetPolicyPropertiesWithSecretsSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesGetPolicyPropertiesWithSecretsSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a Content Key Policy including secret values * * @summary Get a Content Key Policy including secret values - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-get-with-secrets.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-get-with-secrets.json */ async function getAnContentKeyPolicyWithSecrets() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithMultipleOptions"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAnContentKeyPolicyWithSecrets() { console.log(result); } -getAnContentKeyPolicyWithSecrets().catch(console.error); +async function main() { + getAnContentKeyPolicyWithSecrets(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesGetSample.ts index c51400e976fc..d711d1f3d157 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the details of a Content Key Policy in the Media Services account * * @summary Get the details of a Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-get-by-name.json */ async function getAContentKeyPolicyByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithMultipleOptions"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAContentKeyPolicyByName() { console.log(result); } -getAContentKeyPolicyByName().catch(console.error); +async function main() { + getAContentKeyPolicyByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesListSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesListSample.ts index c50363c77f6a..a38fb07898ce 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesListSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the Content Key Policies in the account * * @summary Lists the Content Key Policies in the account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-list-by-lastModified.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-list-by-lastModified.json */ async function listsContentKeyPoliciesOrderedByLastModified() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const orderby = "properties/lastModified"; const options: ContentKeyPoliciesListOptionalParams = { orderby }; @@ -39,17 +45,18 @@ async function listsContentKeyPoliciesOrderedByLastModified() { console.log(resArray); } -listsContentKeyPoliciesOrderedByLastModified().catch(console.error); - /** * This sample demonstrates how to Lists the Content Key Policies in the account * * @summary Lists the Content Key Policies in the account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-list-in-date-range.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-list-in-date-range.json */ async function listsContentKeyPoliciesWithCreatedAndLastModifiedFilters() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const filter = "properties/lastModified gt 2016-06-01 and properties/created lt 2013-07-01"; @@ -67,17 +74,18 @@ async function listsContentKeyPoliciesWithCreatedAndLastModifiedFilters() { console.log(resArray); } -listsContentKeyPoliciesWithCreatedAndLastModifiedFilters().catch(console.error); - /** * This sample demonstrates how to Lists the Content Key Policies in the account * * @summary Lists the Content Key Policies in the account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-list-all.json */ async function listsAllContentKeyPolicies() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -91,4 +99,10 @@ async function listsAllContentKeyPolicies() { console.log(resArray); } -listsAllContentKeyPolicies().catch(console.error); +async function main() { + listsContentKeyPoliciesOrderedByLastModified(); + listsContentKeyPoliciesWithCreatedAndLastModifiedFilters(); + listsAllContentKeyPolicies(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesUpdateSample.ts index dcd8b09c260f..5f3943da0c20 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/contentKeyPoliciesUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { ContentKeyPolicy, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates an existing Content Key Policy in the Media Services account * * @summary Updates an existing Content Key Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/content-key-policies-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/content-key-policies-update.json */ async function updateAContentKeyPolicy() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const contentKeyPolicyName = "PolicyWithClearKeyOptionAndTokenRestriction"; const parameters: ContentKeyPolicy = { @@ -47,4 +53,8 @@ async function updateAContentKeyPolicy() { console.log(result); } -updateAContentKeyPolicy().catch(console.error); +async function main() { + updateAContentKeyPolicy(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsCancelJobSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsCancelJobSample.ts index 0afea373a95f..39747e3fabff 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsCancelJobSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsCancelJobSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Cancel a Job. * * @summary Cancel a Job. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-cancel.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-cancel.json */ async function cancelAJob() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const jobName = "job1"; @@ -34,4 +40,8 @@ async function cancelAJob() { console.log(result); } -cancelAJob().catch(console.error); +async function main() { + cancelAJob(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsCreateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsCreateSample.ts index b12a6b8f0e08..08d3cd66411d 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsCreateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsCreateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { Job, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates a Job. * * @summary Creates a Job. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-create.json */ async function createAJob() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const jobName = "job1"; @@ -48,4 +54,8 @@ async function createAJob() { console.log(result); } -createAJob().catch(console.error); +async function main() { + createAJob(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsDeleteSample.ts index 26a971e905d2..bba6f3c032bd 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Job. * * @summary Deletes a Job. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-delete.json */ async function deleteAJob() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const jobName = "jobToDelete"; @@ -34,4 +40,8 @@ async function deleteAJob() { console.log(result); } -deleteAJob().catch(console.error); +async function main() { + deleteAJob(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsGetSample.ts index 35fcccb0be92..982937a2d945 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a Job. * * @summary Gets a Job. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-get-by-name.json */ async function getAJobByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const jobName = "job1"; @@ -34,4 +40,8 @@ async function getAJobByName() { console.log(result); } -getAJobByName().catch(console.error); +async function main() { + getAJobByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsListSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsListSample.ts index ee54add4577b..f4122a0c6a44 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsListSample.ts @@ -13,20 +13,26 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-created.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-created.json */ async function listsJobsForTheTransformFilterByCreated() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const filter = - "properties/created ge 2021-11-01T00:00:10.0000000Z and properties/created le 2021-11-01T00:00:20.0000000Z"; + "properties/created ge 2021-06-01T00:00:10.0000000Z and properties/created le 2021-06-01T00:00:20.0000000Z"; const orderby = "properties/created"; const options: JobsListOptionalParams = { filter, orderby }; const credential = new DefaultAzureCredential(); @@ -43,21 +49,22 @@ async function listsJobsForTheTransformFilterByCreated() { console.log(resArray); } -listsJobsForTheTransformFilterByCreated().catch(console.error); - /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-lastmodified.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-lastmodified.json */ async function listsJobsForTheTransformFilterByLastmodified() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const filter = - "properties/lastmodified ge 2021-11-01T00:00:10.0000000Z and properties/lastmodified le 2021-11-01T00:00:20.0000000Z"; + "properties/lastmodified ge 2021-06-01T00:00:10.0000000Z and properties/lastmodified le 2021-06-01T00:00:20.0000000Z"; const orderby = "properties/lastmodified desc"; const options: JobsListOptionalParams = { filter, orderby }; const credential = new DefaultAzureCredential(); @@ -74,17 +81,18 @@ async function listsJobsForTheTransformFilterByLastmodified() { console.log(resArray); } -listsJobsForTheTransformFilterByLastmodified().catch(console.error); - /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-name-and-state.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-name-and-state.json */ async function listsJobsForTheTransformFilterByNameAndState() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const filter = @@ -104,17 +112,18 @@ async function listsJobsForTheTransformFilterByNameAndState() { console.log(resArray); } -listsJobsForTheTransformFilterByNameAndState().catch(console.error); - /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-name.json */ async function listsJobsForTheTransformFilterByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const filter = "name eq 'job1' or name eq 'job2'"; @@ -134,17 +143,18 @@ async function listsJobsForTheTransformFilterByName() { console.log(resArray); } -listsJobsForTheTransformFilterByName().catch(console.error); - /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-state-eq.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-state-eq.json */ async function listsJobsForTheTransformFilterByStateEqual() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const filter = "properties/state eq Microsoft.Media.JobState'Processing'"; @@ -163,17 +173,18 @@ async function listsJobsForTheTransformFilterByStateEqual() { console.log(resArray); } -listsJobsForTheTransformFilterByStateEqual().catch(console.error); - /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all-filter-by-state-ne.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all-filter-by-state-ne.json */ async function listsJobsForTheTransformFilterByStateNotEqual() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const filter = "properties/state ne Microsoft.Media.JobState'processing'"; @@ -192,17 +203,18 @@ async function listsJobsForTheTransformFilterByStateNotEqual() { console.log(resArray); } -listsJobsForTheTransformFilterByStateNotEqual().catch(console.error); - /** * This sample demonstrates how to Lists all of the Jobs for the Transform. * * @summary Lists all of the Jobs for the Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-list-all.json */ async function listsAllOfTheJobsForTheTransform() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const credential = new DefaultAzureCredential(); @@ -218,4 +230,14 @@ async function listsAllOfTheJobsForTheTransform() { console.log(resArray); } -listsAllOfTheJobsForTheTransform().catch(console.error); +async function main() { + listsJobsForTheTransformFilterByCreated(); + listsJobsForTheTransformFilterByLastmodified(); + listsJobsForTheTransformFilterByNameAndState(); + listsJobsForTheTransformFilterByName(); + listsJobsForTheTransformFilterByStateEqual(); + listsJobsForTheTransformFilterByStateNotEqual(); + listsAllOfTheJobsForTheTransform(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsUpdateSample.ts index 7c506309017d..c19d69a51599 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/jobsUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { Job, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Update is only supported for description and priority. Updating Priority will take effect when the Job state is Queued or Scheduled and depending on the timing the priority update may be ignored. * * @summary Update is only supported for description and priority. Updating Priority will take effect when the Job state is Queued or Scheduled and depending on the timing the priority update may be ignored. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/jobs-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/jobs-update.json */ async function updateAJob() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "exampleTransform"; const jobName = "job1"; @@ -49,4 +55,8 @@ async function updateAJob() { console.log(result); } -updateAJob().catch(console.error); +async function main() { + updateAJob(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsAllocateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsAllocateSample.ts index 4bbd4a3ee080..f83d735f9422 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsAllocateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsAllocateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to A live event is in StandBy state after allocation completes, and is ready to start. * * @summary A live event is in StandBy state after allocation completes, and is ready to start. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-allocate.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-allocate.json */ async function allocateALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function allocateALiveEvent() { console.log(result); } -allocateALiveEvent().catch(console.error); +async function main() { + allocateALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsAsyncOperationSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsAsyncOperationSample.ts index 5a4daae18121..c1530195bd53 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsAsyncOperationSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsAsyncOperationSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a live event operation status. * * @summary Get a live event operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/async-operation-result.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json */ async function getTheLiveEventOperationStatus() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const operationId = "62e4d893-d233-4005-988e-a428d9f77076"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getTheLiveEventOperationStatus() { console.log(result); } -getTheLiveEventOperationStatus().catch(console.error); +async function main() { + getTheLiveEventOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsCreateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsCreateSample.ts index 242bef561220..f7f1d5188cdc 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsCreateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsCreateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { LiveEvent, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates a new live event. * * @summary Creates a new live event. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-create.json */ async function createALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const parameters: LiveEvent = { @@ -58,4 +64,8 @@ async function createALiveEvent() { console.log(result); } -createALiveEvent().catch(console.error); +async function main() { + createALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsDeleteSample.ts index 920ca8775f79..78e5e5349b07 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a live event. * * @summary Deletes a live event. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-delete.json */ async function deleteALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteALiveEvent() { console.log(result); } -deleteALiveEvent().catch(console.error); +async function main() { + deleteALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsGetSample.ts index 83371da957b3..1f542582e55a 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets properties of a live event. * * @summary Gets properties of a live event. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-list-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-list-by-name.json */ async function getALiveEventByName() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getALiveEventByName() { console.log(result); } -getALiveEventByName().catch(console.error); +async function main() { + getALiveEventByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsListSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsListSample.ts index efbf0a1b156c..476de48ba313 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all the live events in the account. * * @summary Lists all the live events in the account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-list-all.json */ async function listAllLiveEvents() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listAllLiveEvents() { console.log(resArray); } -listAllLiveEvents().catch(console.error); +async function main() { + listAllLiveEvents(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsOperationLocationSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsOperationLocationSample.ts index 12f0233220d5..3fbfa8c8a2ef 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsOperationLocationSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsOperationLocationSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a live event operation status. * * @summary Get a live event operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-operation-location.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-operation-location.json */ async function getTheLiveEventOperationStatus() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const operationId = "62e4d893-d233-4005-988e-a428d9f77076"; @@ -34,4 +40,8 @@ async function getTheLiveEventOperationStatus() { console.log(result); } -getTheLiveEventOperationStatus().catch(console.error); +async function main() { + getTheLiveEventOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsResetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsResetSample.ts index 259cc8f9e73f..54750d2fd2b0 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsResetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsResetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and will be started again. All assets used by the live outputs and streaming locators created on these assets are unaffected. * * @summary Resets an existing live event. All live outputs for the live event are deleted and the live event is stopped and will be started again. All assets used by the live outputs and streaming locators created on these assets are unaffected. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-reset.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-reset.json */ async function resetALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function resetALiveEvent() { console.log(result); } -resetALiveEvent().catch(console.error); +async function main() { + resetALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsStartSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsStartSample.ts index 2a1df1f5cce1..3bdcd67b1afb 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsStartSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsStartSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to A live event in Stopped or StandBy state will be in Running state after the start operation completes. * * @summary A live event in Stopped or StandBy state will be in Running state after the start operation completes. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-start.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-start.json */ async function startALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function startALiveEvent() { console.log(result); } -startALiveEvent().catch(console.error); +async function main() { + startALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsStopSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsStopSample.ts index ab04223575f7..d64446a141ba 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsStopSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsStopSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Stops a running live event. * * @summary Stops a running live event. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-stop.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-stop.json */ async function stopALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const parameters: LiveEventActionInput = { removeOutputsOnStop: false }; @@ -37,4 +43,8 @@ async function stopALiveEvent() { console.log(result); } -stopALiveEvent().catch(console.error); +async function main() { + stopALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsUpdateSample.ts index e290681a1d28..6a170dc47c91 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveEventsUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { LiveEvent, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates settings on an existing live event. * * @summary Updates settings on an existing live event. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveevent-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveevent-update.json */ async function updateALiveEvent() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const parameters: LiveEvent = { @@ -50,4 +56,8 @@ async function updateALiveEvent() { console.log(result); } -updateALiveEvent().catch(console.error); +async function main() { + updateALiveEvent(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsAsyncOperationSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsAsyncOperationSample.ts index eebe139233c3..3320015aa386 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsAsyncOperationSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsAsyncOperationSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a Live Output operation status. * * @summary Get a Live Output operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/async-operation-result.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json */ async function getTheLiveOutputOperationStatus() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const operationId = "62e4d893-d233-4005-988e-a428d9f77076"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getTheLiveOutputOperationStatus() { console.log(result); } -getTheLiveOutputOperationStatus().catch(console.error); +async function main() { + getTheLiveOutputOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsCreateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsCreateSample.ts index ea077b119f9f..16c1be02786b 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsCreateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsCreateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { LiveOutput, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates a new live output. * * @summary Creates a new live output. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-create.json */ async function createALiveOutput() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const liveOutputName = "myLiveOutput1"; @@ -43,4 +49,8 @@ async function createALiveOutput() { console.log(result); } -createALiveOutput().catch(console.error); +async function main() { + createALiveOutput(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsDeleteSample.ts index fb65a6f3a77b..cd6923502357 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. * * @summary Deletes a live output. Deleting a live output does not delete the asset the live output is writing to. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-delete.json */ async function deleteALiveOutput() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const liveOutputName = "myLiveOutput1"; @@ -34,4 +40,8 @@ async function deleteALiveOutput() { console.log(result); } -deleteALiveOutput().catch(console.error); +async function main() { + deleteALiveOutput(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsGetSample.ts index 448e278b277d..b103aa3a3d32 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a live output. * * @summary Gets a live output. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-list-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-list-by-name.json */ async function getALiveOutputByName() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const liveOutputName = "myLiveOutput1"; @@ -34,4 +40,8 @@ async function getALiveOutputByName() { console.log(result); } -getALiveOutputByName().catch(console.error); +async function main() { + getALiveOutputByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsListSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsListSample.ts index e779c2374e5f..a5bbbbc61704 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the live outputs of a live event. * * @summary Lists the live outputs of a live event. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-list-all.json */ async function listAllLiveOutputs() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function listAllLiveOutputs() { console.log(resArray); } -listAllLiveOutputs().catch(console.error); +async function main() { + listAllLiveOutputs(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsOperationLocationSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsOperationLocationSample.ts index 3547a3caf465..1901050e93e9 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsOperationLocationSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/liveOutputsOperationLocationSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a Live Output operation status. * * @summary Get a Live Output operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/liveoutput-operation-location.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/liveoutput-operation-location.json */ async function getTheLiveOutputOperationStatus() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const liveEventName = "myLiveEvent1"; const liveOutputName = "myLiveOutput1"; @@ -36,4 +42,8 @@ async function getTheLiveOutputOperationStatus() { console.log(result); } -getTheLiveOutputOperationStatus().catch(console.error); +async function main() { + getTheLiveOutputOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/locationsCheckNameAvailabilitySample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/locationsCheckNameAvailabilitySample.ts index 97865b2b68ba..a118d2d54aef 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/locationsCheckNameAvailabilitySample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/locationsCheckNameAvailabilitySample.ts @@ -13,15 +13,20 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Checks whether the Media Service resource name is available. * * @summary Checks whether the Media Service resource name is available. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-check-name-availability.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-check-name-availability.json */ async function checkNameAvailability() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const locationName = "japanwest"; const parameters: CheckNameAvailabilityInput = { name: "contosotv", @@ -36,4 +41,8 @@ async function checkNameAvailability() { console.log(result); } -checkNameAvailability().catch(console.error); +async function main() { + checkNameAvailability(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaServicesOperationResultsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaServicesOperationResultsGetSample.ts index 708adc92a64b..31a65bacc2ec 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaServicesOperationResultsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaServicesOperationResultsGetSample.ts @@ -10,15 +10,20 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get media service operation result. * * @summary Get media service operation result. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/media-service-operation-result-by-id.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-result-by-id.json */ async function getStatusOfAsynchronousOperation() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const locationName = "westus"; const operationId = "6FBA62C4-99B5-4FF8-9826-FC4744A8864F"; const credential = new DefaultAzureCredential(); @@ -30,4 +35,8 @@ async function getStatusOfAsynchronousOperation() { console.log(result); } -getStatusOfAsynchronousOperation().catch(console.error); +async function main() { + getStatusOfAsynchronousOperation(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaServicesOperationStatusesGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaServicesOperationStatusesGetSample.ts index 6e411d105d37..9acf839ea6b1 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaServicesOperationStatusesGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaServicesOperationStatusesGetSample.ts @@ -10,15 +10,20 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get media service operation status. * * @summary Get media service operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state-failed.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state-failed.json */ async function getStatusOfAsynchronousOperationWhenItIsCompletedWithError() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const locationName = "westus"; const operationId = "D612C429-2526-49D5-961B-885AE11406FD"; const credential = new DefaultAzureCredential(); @@ -30,18 +35,16 @@ async function getStatusOfAsynchronousOperationWhenItIsCompletedWithError() { console.log(result); } -getStatusOfAsynchronousOperationWhenItIsCompletedWithError().catch( - console.error -); - /** * This sample demonstrates how to Get media service operation status. * * @summary Get media service operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/media-service-operation-status-by-id-terminal-state.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-status-by-id-terminal-state.json */ async function getStatusOfAsynchronousOperationWhenItIsCompleted() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const locationName = "westus"; const operationId = "D612C429-2526-49D5-961B-885AE11406FD"; const credential = new DefaultAzureCredential(); @@ -53,16 +56,16 @@ async function getStatusOfAsynchronousOperationWhenItIsCompleted() { console.log(result); } -getStatusOfAsynchronousOperationWhenItIsCompleted().catch(console.error); - /** * This sample demonstrates how to Get media service operation status. * * @summary Get media service operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/media-service-operation-status-by-id-non-terminal-state.json */ async function getStatusOfAsynchronousOperationWhenItIsOngoing() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const locationName = "westus"; const operationId = "D612C429-2526-49D5-961B-885AE11406FD"; const credential = new DefaultAzureCredential(); @@ -74,4 +77,10 @@ async function getStatusOfAsynchronousOperationWhenItIsOngoing() { console.log(result); } -getStatusOfAsynchronousOperationWhenItIsOngoing().catch(console.error); +async function main() { + getStatusOfAsynchronousOperationWhenItIsCompletedWithError(); + getStatusOfAsynchronousOperationWhenItIsCompleted(); + getStatusOfAsynchronousOperationWhenItIsOngoing(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesCreateOrUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesCreateOrUpdateSample.ts index 957af57cc1f0..e219c943c697 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesCreateOrUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesCreateOrUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { MediaService, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a Media Services account * * @summary Creates or updates a Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/async-accounts-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/async-accounts-create.json */ async function createAMediaServicesAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const parameters: MediaService = { encryption: { @@ -65,4 +71,8 @@ async function createAMediaServicesAccount() { console.log(result); } -createAMediaServicesAccount().catch(console.error); +async function main() { + createAMediaServicesAccount(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesDeleteSample.ts index a4e04c6a0351..197a894ae5c7 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Media Services account * * @summary Deletes a Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-delete.json */ async function deleteAMediaServicesAccount() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -30,4 +36,8 @@ async function deleteAMediaServicesAccount() { console.log(result); } -deleteAMediaServicesAccount().catch(console.error); +async function main() { + deleteAMediaServicesAccount(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesGetSample.ts index a8b55a60257d..03400c7109b0 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the details of a Media Services account * * @summary Get the details of a Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-get-by-name.json */ async function getAMediaServicesAccountByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosotv"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -27,4 +33,8 @@ async function getAMediaServicesAccountByName() { console.log(result); } -getAMediaServicesAccountByName().catch(console.error); +async function main() { + getAMediaServicesAccountByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesListBySubscriptionSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesListBySubscriptionSample.ts index b764b456170a..e668335e2ecb 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesListBySubscriptionSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesListBySubscriptionSample.ts @@ -10,15 +10,20 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List Media Services accounts in the subscription. * * @summary List Media Services accounts in the subscription. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-subscription-list-all-accounts.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-subscription-list-all-accounts.json */ async function listAllMediaServicesAccounts() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); const resArray = new Array(); @@ -28,4 +33,8 @@ async function listAllMediaServicesAccounts() { console.log(resArray); } -listAllMediaServicesAccounts().catch(console.error); +async function main() { + listAllMediaServicesAccounts(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesListEdgePoliciesSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesListEdgePoliciesSample.ts index 812563f07b94..81b65cd134b8 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesListEdgePoliciesSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesListEdgePoliciesSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List all the media edge policies associated with the Media Services account. * * @summary List all the media edge policies associated with the Media Services account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-list-media-edge-policies.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-list-media-edge-policies.json */ async function listTheMediaEdgePolicies() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const parameters: ListEdgePoliciesInput = { deviceId: "contosiothubhost_contosoiotdevice" @@ -37,4 +43,8 @@ async function listTheMediaEdgePolicies() { console.log(result); } -listTheMediaEdgePolicies().catch(console.error); +async function main() { + listTheMediaEdgePolicies(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesListSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesListSample.ts index a24336b5c2d9..d8996614d607 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List Media Services accounts in the resource group * * @summary List Media Services accounts in the resource group - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-list-all-accounts.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-list-all-accounts.json */ async function listAllMediaServicesAccounts() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); const resArray = new Array(); @@ -29,4 +35,8 @@ async function listAllMediaServicesAccounts() { console.log(resArray); } -listAllMediaServicesAccounts().catch(console.error); +async function main() { + listAllMediaServicesAccounts(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesSyncStorageKeysSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesSyncStorageKeysSample.ts index d1a4238f9700..0c119d9c27f9 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesSyncStorageKeysSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesSyncStorageKeysSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Synchronizes storage account keys for a storage account associated with the Media Service account. * * @summary Synchronizes storage account keys for a storage account associated with the Media Service account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/accounts-sync-storage-keys.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/accounts-sync-storage-keys.json */ async function synchronizesStorageAccountKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const parameters: SyncStorageKeysInput = { id: "contososportsstore" }; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function synchronizesStorageAccountKeys() { console.log(result); } -synchronizesStorageAccountKeys().catch(console.error); +async function main() { + synchronizesStorageAccountKeys(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesUpdateSample.ts index 8f123beddf45..59d86facf94e 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/mediaservicesUpdateSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates an existing Media Services account * * @summary Updates an existing Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/async-accounts-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/async-accounts-update.json */ async function updateAMediaServicesAccounts() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const parameters: MediaServiceUpdate = { tags: { key1: "value3" } }; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function updateAMediaServicesAccounts() { console.log(result); } -updateAMediaServicesAccounts().catch(console.error); +async function main() { + updateAMediaServicesAccounts(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/operationResultsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/operationResultsGetSample.ts index 611af1e46671..6bf725d0b399 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/operationResultsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/operationResultsGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get asset track operation result. * * @summary Get asset track operation result. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-operation-result-by-id.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-result-by-id.json */ async function getResultOfAsynchronousOperation() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text1"; @@ -36,4 +42,8 @@ async function getResultOfAsynchronousOperation() { console.log(result); } -getResultOfAsynchronousOperation().catch(console.error); +async function main() { + getResultOfAsynchronousOperation(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/operationStatusesGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/operationStatusesGetSample.ts index 33823685b196..2ed9a59e254f 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/operationStatusesGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/operationStatusesGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get asset track operation status. * * @summary Get asset track operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state-failed.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state-failed.json */ async function getStatusOfAsynchronousOperationWhenItIsCompletedWithError() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text1"; @@ -36,19 +42,18 @@ async function getStatusOfAsynchronousOperationWhenItIsCompletedWithError() { console.log(result); } -getStatusOfAsynchronousOperationWhenItIsCompletedWithError().catch( - console.error -); - /** * This sample demonstrates how to Get asset track operation status. * * @summary Get asset track operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-terminal-state.json */ async function getStatusOfAsynchronousOperationWhenItIsCompleted() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text1"; @@ -65,17 +70,18 @@ async function getStatusOfAsynchronousOperationWhenItIsCompleted() { console.log(result); } -getStatusOfAsynchronousOperationWhenItIsCompleted().catch(console.error); - /** * This sample demonstrates how to Get asset track operation status. * * @summary Get asset track operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-non-terminal-state.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-operation-status-by-id-non-terminal-state.json */ async function getStatusOfAsynchronousOperationWhenItIsOngoing() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text1"; @@ -92,4 +98,10 @@ async function getStatusOfAsynchronousOperationWhenItIsOngoing() { console.log(result); } -getStatusOfAsynchronousOperationWhenItIsOngoing().catch(console.error); +async function main() { + getStatusOfAsynchronousOperationWhenItIsCompletedWithError(); + getStatusOfAsynchronousOperationWhenItIsCompleted(); + getStatusOfAsynchronousOperationWhenItIsOngoing(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/operationsListSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/operationsListSample.ts index 0872c6d8ce6c..11f3acc29932 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/operationsListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/operationsListSample.ts @@ -10,19 +10,28 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists all the Media Services operations. * * @summary Lists all the Media Services operations. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/operations-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/operations-list-all.json */ async function listOperations() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); const result = await client.operations.list(); console.log(result); } -listOperations().catch(console.error); +async function main() { + listOperations(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts index 31ba18df0a34..022560ccca65 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateEndpointConnectionsCreateOrUpdateSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Update an existing private endpoint connection. * * @summary Update an existing private endpoint connection. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-put.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-put.json */ async function updatePrivateEndpointConnection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const name = "connectionName1"; const parameters: PrivateEndpointConnection = { @@ -42,4 +48,8 @@ async function updatePrivateEndpointConnection() { console.log(result); } -updatePrivateEndpointConnection().catch(console.error); +async function main() { + updatePrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateEndpointConnectionsDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateEndpointConnectionsDeleteSample.ts index 492fd2bc7c11..ce3f77f95d44 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateEndpointConnectionsDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateEndpointConnectionsDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a private endpoint connection. * * @summary Deletes a private endpoint connection. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-delete.json */ async function deletePrivateEndpointConnection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const name = "connectionName1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deletePrivateEndpointConnection() { console.log(result); } -deletePrivateEndpointConnection().catch(console.error); +async function main() { + deletePrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateEndpointConnectionsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateEndpointConnectionsGetSample.ts index 6ecacc3c8d81..41cc2b23ec68 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateEndpointConnectionsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateEndpointConnectionsGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the details of a private endpoint connection. * * @summary Get the details of a private endpoint connection. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-get-by-name.json */ async function getPrivateEndpointConnection() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const name = "connectionName1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getPrivateEndpointConnection() { console.log(result); } -getPrivateEndpointConnection().catch(console.error); +async function main() { + getPrivateEndpointConnection(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateEndpointConnectionsListSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateEndpointConnectionsListSample.ts index 17a970c1fa54..a15a414d9cb4 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateEndpointConnectionsListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateEndpointConnectionsListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List all private endpoint connections. * * @summary List all private endpoint connections. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-endpoint-connection-list.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-endpoint-connection-list.json */ async function getAllPrivateEndpointConnections() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -30,4 +36,8 @@ async function getAllPrivateEndpointConnections() { console.log(result); } -getAllPrivateEndpointConnections().catch(console.error); +async function main() { + getAllPrivateEndpointConnections(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateLinkResourcesGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateLinkResourcesGetSample.ts index 7c1e22a88abe..1fb3e907dbf0 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateLinkResourcesGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateLinkResourcesGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get details of a group ID. * * @summary Get details of a group ID. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-link-resources-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-link-resources-get-by-name.json */ async function getDetailsOfAGroupId() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const name = "keydelivery"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getDetailsOfAGroupId() { console.log(result); } -getDetailsOfAGroupId().catch(console.error); +async function main() { + getDetailsOfAGroupId(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateLinkResourcesListSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateLinkResourcesListSample.ts index 98d3cf2276ba..a92980551c2e 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateLinkResourcesListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/privateLinkResourcesListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List supported group IDs. * * @summary List supported group IDs. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/private-link-resources-list.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Accounts/stable/2021-11-01/examples/private-link-resources-list.json */ async function getListOfAllGroupIDs() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contososports"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -30,4 +36,8 @@ async function getListOfAllGroupIDs() { console.log(result); } -getListOfAllGroupIDs().catch(console.error); +async function main() { + getListOfAllGroupIDs(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsAsyncOperationSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsAsyncOperationSample.ts index bbc26d33eec8..99badfc5ffd5 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsAsyncOperationSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsAsyncOperationSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a streaming endpoint operation status. * * @summary Get a streaming endpoint operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/async-operation-result.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/async-operation-result.json */ async function getTheStreamingEndpointOperationStatus() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const operationId = "62e4d893-d233-4005-988e-a428d9f77076"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getTheStreamingEndpointOperationStatus() { console.log(result); } -getTheStreamingEndpointOperationStatus().catch(console.error); +async function main() { + getTheStreamingEndpointOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsCreateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsCreateSample.ts index 71930345ea21..65826091681a 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsCreateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsCreateSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates a streaming endpoint. * * @summary Creates a streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-create.json */ async function createAStreamingEndpoint() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const parameters: StreamingEndpoint = { @@ -61,4 +67,8 @@ async function createAStreamingEndpoint() { console.log(result); } -createAStreamingEndpoint().catch(console.error); +async function main() { + createAStreamingEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsDeleteSample.ts index f334108abae2..08a47d038291 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a streaming endpoint. * * @summary Deletes a streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-delete.json */ async function deleteAStreamingEndpoint() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteAStreamingEndpoint() { console.log(result); } -deleteAStreamingEndpoint().catch(console.error); +async function main() { + deleteAStreamingEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsGetSample.ts index 0b3984dc5505..ee59b865bca0 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a streaming endpoint. * * @summary Gets a streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-list-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-list-by-name.json */ async function getAStreamingEndpointByName() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAStreamingEndpointByName() { console.log(result); } -getAStreamingEndpointByName().catch(console.error); +async function main() { + getAStreamingEndpointByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsListSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsListSample.ts index 98e6bdbd663a..5bf0c5a3486c 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the streaming endpoints in the account. * * @summary Lists the streaming endpoints in the account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-list-all.json */ async function listAllStreamingEndpoints() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listAllStreamingEndpoints() { console.log(resArray); } -listAllStreamingEndpoints().catch(console.error); +async function main() { + listAllStreamingEndpoints(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsOperationLocationSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsOperationLocationSample.ts index 04783e184e65..4f4d16ec5b24 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsOperationLocationSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsOperationLocationSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get a streaming endpoint operation status. * * @summary Get a streaming endpoint operation status. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-operation-location.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-operation-location.json */ async function getTheStreamingEndpointOperationStatus() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const operationId = "62e4d893-d233-4005-988e-a428d9f77076"; @@ -34,4 +40,8 @@ async function getTheStreamingEndpointOperationStatus() { console.log(result); } -getTheStreamingEndpointOperationStatus().catch(console.error); +async function main() { + getTheStreamingEndpointOperationStatus(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsScaleSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsScaleSample.ts index f0cf0c929d73..285190d70056 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsScaleSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsScaleSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Scales an existing streaming endpoint. * * @summary Scales an existing streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-scale.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-scale.json */ async function scaleAStreamingEndpoint() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const parameters: StreamingEntityScaleUnit = { scaleUnit: 5 }; @@ -37,4 +43,8 @@ async function scaleAStreamingEndpoint() { console.log(result); } -scaleAStreamingEndpoint().catch(console.error); +async function main() { + scaleAStreamingEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsSkusSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsSkusSample.ts index 33743b5aa774..169f5a8dfc86 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsSkusSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsSkusSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List streaming endpoint supported skus. * * @summary List streaming endpoint supported skus. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-list-skus.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-list-skus.json */ async function listAStreamingEndpointSku() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function listAStreamingEndpointSku() { console.log(result); } -listAStreamingEndpointSku().catch(console.error); +async function main() { + listAStreamingEndpointSku(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsStartSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsStartSample.ts index 2b5c003bd75b..d69c2e5e7dd4 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsStartSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsStartSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Starts an existing streaming endpoint. * * @summary Starts an existing streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-start.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-start.json */ async function startAStreamingEndpoint() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function startAStreamingEndpoint() { console.log(result); } -startAStreamingEndpoint().catch(console.error); +async function main() { + startAStreamingEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsStopSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsStopSample.ts index 19d180cb295e..4b866d8d3607 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsStopSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsStopSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Stops an existing streaming endpoint. * * @summary Stops an existing streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-stop.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-stop.json */ async function stopAStreamingEndpoint() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function stopAStreamingEndpoint() { console.log(result); } -stopAStreamingEndpoint().catch(console.error); +async function main() { + stopAStreamingEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsUpdateSample.ts index abe257dc1735..d62b82a7ecc5 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingEndpointsUpdateSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates a existing streaming endpoint. * * @summary Updates a existing streaming endpoint. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streamingendpoint-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Streaming/stable/2022-08-01/examples/streamingendpoint-update.json */ async function updateAStreamingEndpoint() { - const subscriptionId = "0a6ec948-5a62-437d-b9df-934dc7c1b722"; - const resourceGroupName = "mediaresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "0a6ec948-5a62-437d-b9df-934dc7c1b722"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "mediaresources"; const accountName = "slitestmedia10"; const streamingEndpointName = "myStreamingEndpoint1"; const parameters: StreamingEndpoint = { @@ -43,4 +49,8 @@ async function updateAStreamingEndpoint() { console.log(result); } -updateAStreamingEndpoint().catch(console.error); +async function main() { + updateAStreamingEndpoint(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsCreateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsCreateSample.ts index 91fb56111863..a4e8bb7e9cd7 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsCreateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsCreateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { StreamingLocator, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create a Streaming Locator in the Media Services account * * @summary Create a Streaming Locator in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-create-clear.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-create-clear.json */ async function createsAStreamingLocatorWithClearStreaming() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "UserCreatedClearStreamingLocator"; const parameters: StreamingLocator = { @@ -37,17 +43,18 @@ async function createsAStreamingLocatorWithClearStreaming() { console.log(result); } -createsAStreamingLocatorWithClearStreaming().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Locator in the Media Services account * * @summary Create a Streaming Locator in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-create-secure.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-create-secure.json */ async function createsAStreamingLocatorWithSecureStreaming() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "UserCreatedSecureStreamingLocator"; const parameters: StreamingLocator = { @@ -67,17 +74,18 @@ async function createsAStreamingLocatorWithSecureStreaming() { console.log(result); } -createsAStreamingLocatorWithSecureStreaming().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Locator in the Media Services account * * @summary Create a Streaming Locator in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-create-secure-userDefinedContentKeys.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-create-secure-userDefinedContentKeys.json */ async function createsAStreamingLocatorWithUserDefinedContentKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "UserCreatedSecureStreamingLocatorWithUserDefinedContentKeys"; @@ -114,4 +122,10 @@ async function createsAStreamingLocatorWithUserDefinedContentKeys() { console.log(result); } -createsAStreamingLocatorWithUserDefinedContentKeys().catch(console.error); +async function main() { + createsAStreamingLocatorWithClearStreaming(); + createsAStreamingLocatorWithSecureStreaming(); + createsAStreamingLocatorWithUserDefinedContentKeys(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsDeleteSample.ts index 748f898dad49..3050ec03859b 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Streaming Locator in the Media Services account * * @summary Deletes a Streaming Locator in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-delete.json */ async function deleteAStreamingLocator() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "clearStreamingLocator"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteAStreamingLocator() { console.log(result); } -deleteAStreamingLocator().catch(console.error); +async function main() { + deleteAStreamingLocator(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsGetSample.ts index 13a3071fc4b6..5537e15fd438 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the details of a Streaming Locator in the Media Services account * * @summary Get the details of a Streaming Locator in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-get-by-name.json */ async function getAStreamingLocatorByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "clearStreamingLocator"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAStreamingLocatorByName() { console.log(result); } -getAStreamingLocatorByName().catch(console.error); +async function main() { + getAStreamingLocatorByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsListContentKeysSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsListContentKeysSample.ts index 20f08a0c82b8..2c2462aae194 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsListContentKeysSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsListContentKeysSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List Content Keys used by this Streaming Locator * * @summary List Content Keys used by this Streaming Locator - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-list-content-keys.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list-content-keys.json */ async function listContentKeys() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "secureStreamingLocator"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function listContentKeys() { console.log(result); } -listContentKeys().catch(console.error); +async function main() { + listContentKeys(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsListPathsSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsListPathsSample.ts index 6c234c934126..586ab211135d 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsListPathsSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsListPathsSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to List Paths supported by this Streaming Locator * * @summary List Paths supported by this Streaming Locator - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-and-download.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-and-download.json */ async function listPathsWhichHasStreamingPathsAndDownloadPaths() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "clearStreamingLocator"; const credential = new DefaultAzureCredential(); @@ -32,17 +38,18 @@ async function listPathsWhichHasStreamingPathsAndDownloadPaths() { console.log(result); } -listPathsWhichHasStreamingPathsAndDownloadPaths().catch(console.error); - /** * This sample demonstrates how to List Paths supported by this Streaming Locator * * @summary List Paths supported by this Streaming Locator - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-only.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list-paths-streaming-only.json */ async function listPathsWhichHasStreamingPathsOnly() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingLocatorName = "secureStreamingLocator"; const credential = new DefaultAzureCredential(); @@ -55,4 +62,9 @@ async function listPathsWhichHasStreamingPathsOnly() { console.log(result); } -listPathsWhichHasStreamingPathsOnly().catch(console.error); +async function main() { + listPathsWhichHasStreamingPathsAndDownloadPaths(); + listPathsWhichHasStreamingPathsOnly(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsListSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsListSample.ts index 6dcc3df9c3e0..f2f9cf032468 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingLocatorsListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the Streaming Locators in the account * * @summary Lists the Streaming Locators in the account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-locators-list.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-locators-list.json */ async function listsStreamingLocators() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listsStreamingLocators() { console.log(resArray); } -listsStreamingLocators().catch(console.error); +async function main() { + listsStreamingLocators(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingPoliciesCreateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingPoliciesCreateSample.ts index 18e91d60d8c8..bff98ca9bf27 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingPoliciesCreateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingPoliciesCreateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { StreamingPolicy, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-clearKeyEncryption.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-clearKeyEncryption.json */ async function createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCbcs() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedSecureStreamingPolicyWithCommonEncryptionCbcsOnly"; @@ -50,19 +56,18 @@ async function createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCb console.log(result); } -createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCbcs().catch( - console.error -); - /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCenc-clearKeyEncryption.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCenc-clearKeyEncryption.json */ async function createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCenc() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedSecureStreamingPolicyWithCommonEncryptionCencOnly"; @@ -100,19 +105,18 @@ async function createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCe console.log(result); } -createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCenc().catch( - console.error -); - /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-clear.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-clear.json */ async function createsAStreamingPolicyWithClearStreaming() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedClearStreamingPolicy"; const parameters: StreamingPolicy = { @@ -136,17 +140,18 @@ async function createsAStreamingPolicyWithClearStreaming() { console.log(result); } -createsAStreamingPolicyWithClearStreaming().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-only.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCbcs-only.json */ async function createsAStreamingPolicyWithCommonEncryptionCbcsOnly() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedSecureStreamingPolicyWithCommonEncryptionCbcsOnly"; @@ -180,17 +185,18 @@ async function createsAStreamingPolicyWithCommonEncryptionCbcsOnly() { console.log(result); } -createsAStreamingPolicyWithCommonEncryptionCbcsOnly().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCenc-only.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-commonEncryptionCenc-only.json */ async function createsAStreamingPolicyWithCommonEncryptionCencOnly() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedSecureStreamingPolicyWithCommonEncryptionCencOnly"; @@ -235,17 +241,18 @@ async function createsAStreamingPolicyWithCommonEncryptionCencOnly() { console.log(result); } -createsAStreamingPolicyWithCommonEncryptionCencOnly().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-envelopeEncryption-only.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-envelopeEncryption-only.json */ async function createsAStreamingPolicyWithEnvelopeEncryptionOnly() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedSecureStreamingPolicyWithEnvelopeEncryptionOnly"; @@ -274,17 +281,18 @@ async function createsAStreamingPolicyWithEnvelopeEncryptionOnly() { console.log(result); } -createsAStreamingPolicyWithEnvelopeEncryptionOnly().catch(console.error); - /** * This sample demonstrates how to Create a Streaming Policy in the Media Services account * * @summary Create a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-create-secure-streaming.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-create-secure-streaming.json */ async function createsAStreamingPolicyWithSecureStreaming() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "UserCreatedSecureStreamingPolicy"; const parameters: StreamingPolicy = { @@ -355,4 +363,14 @@ async function createsAStreamingPolicyWithSecureStreaming() { console.log(result); } -createsAStreamingPolicyWithSecureStreaming().catch(console.error); +async function main() { + createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCbcs(); + createsAStreamingPolicyWithClearKeyEncryptionInCommonEncryptionCenc(); + createsAStreamingPolicyWithClearStreaming(); + createsAStreamingPolicyWithCommonEncryptionCbcsOnly(); + createsAStreamingPolicyWithCommonEncryptionCencOnly(); + createsAStreamingPolicyWithEnvelopeEncryptionOnly(); + createsAStreamingPolicyWithSecureStreaming(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingPoliciesDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingPoliciesDeleteSample.ts index d63458402c96..3715299083d9 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingPoliciesDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingPoliciesDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Streaming Policy in the Media Services account * * @summary Deletes a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-delete.json */ async function deleteAStreamingPolicy() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "secureStreamingPolicyWithCommonEncryptionCbcsOnly"; @@ -33,4 +39,8 @@ async function deleteAStreamingPolicy() { console.log(result); } -deleteAStreamingPolicy().catch(console.error); +async function main() { + deleteAStreamingPolicy(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingPoliciesGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingPoliciesGetSample.ts index 775e0a1fdffd..520be3237d42 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingPoliciesGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingPoliciesGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the details of a Streaming Policy in the Media Services account * * @summary Get the details of a Streaming Policy in the Media Services account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policy-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policy-get-by-name.json */ async function getAStreamingPolicyByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const streamingPolicyName = "clearStreamingPolicy"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getAStreamingPolicyByName() { console.log(result); } -getAStreamingPolicyByName().catch(console.error); +async function main() { + getAStreamingPolicyByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingPoliciesListSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingPoliciesListSample.ts index 44cf0117eb50..628300048e2a 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingPoliciesListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/streamingPoliciesListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the Streaming Policies in the account * * @summary Lists the Streaming Policies in the account - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/streaming-policies-list.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/streaming-policies-list.json */ async function listsStreamingPolicies() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -33,4 +39,8 @@ async function listsStreamingPolicies() { console.log(resArray); } -listsStreamingPolicies().catch(console.error); +async function main() { + listsStreamingPolicies(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksCreateOrUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksCreateOrUpdateSample.ts index bd5affd1e80d..d636c19a00fe 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksCreateOrUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksCreateOrUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AssetTrack, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Create or update a Track in the asset * * @summary Create or update a Track in the asset - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-create.json */ async function createsATrack() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text3"; @@ -43,4 +49,8 @@ async function createsATrack() { console.log(result); } -createsATrack().catch(console.error); +async function main() { + createsATrack(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksDeleteSample.ts index e1364c23ecb8..b18c92fe49ef 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Track in the asset * * @summary Deletes a Track in the asset - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-delete.json */ async function deleteATrack() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text2"; @@ -34,4 +40,8 @@ async function deleteATrack() { console.log(result); } -deleteATrack().catch(console.error); +async function main() { + deleteATrack(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksGetSample.ts index f5ef414af370..17a5d525770d 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Get the details of a Track in the Asset * * @summary Get the details of a Track in the Asset - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-get-by-name.json */ async function getATrackByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text1"; @@ -34,4 +40,8 @@ async function getATrackByName() { console.log(result); } -getATrackByName().catch(console.error); +async function main() { + getATrackByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksListSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksListSample.ts index 57604abf5638..cae7e573f7b1 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksListSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the Tracks in the asset * * @summary Lists the Tracks in the asset - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-list-all.json */ async function listsAllTracks() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const credential = new DefaultAzureCredential(); @@ -35,4 +41,8 @@ async function listsAllTracks() { console.log(resArray); } -listsAllTracks().catch(console.error); +async function main() { + listsAllTracks(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksUpdateSample.ts index 23d8d0451615..36a99a5850cc 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AssetTrack, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates an existing Track in the asset * * @summary Updates an existing Track in the asset - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-update.json */ async function updateATrack() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text1"; @@ -41,4 +47,8 @@ async function updateATrack() { console.log(result); } -updateATrack().catch(console.error); +async function main() { + updateATrack(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksUpdateTrackDataSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksUpdateTrackDataSample.ts index da358c6300a3..b1cca81bd859 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksUpdateTrackDataSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/tracksUpdateTrackDataSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Update the track data. Call this API after any changes are made to the track data stored in the asset container. For example, you have modified the WebVTT captions file in the Azure blob storage container for the asset, viewers will not see the new version of the captions unless this API is called. Note, the changes may not be reflected immediately. CDN cache may also need to be purged if applicable. * * @summary Update the track data. Call this API after any changes are made to the track data stored in the asset container. For example, you have modified the WebVTT captions file in the Azure blob storage container for the asset, viewers will not see the new version of the captions unless this API is called. Note, the changes may not be reflected immediately. CDN cache may also need to be purged if applicable. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2022-08-01/examples/asset-tracks-update-data.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Metadata/stable/2022-08-01/examples/asset-tracks-update-data.json */ async function updateTheDataForATracks() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contoso"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contoso"; const accountName = "contosomedia"; const assetName = "ClimbingMountRainer"; const trackName = "text2"; @@ -34,4 +40,8 @@ async function updateTheDataForATracks() { console.log(result); } -updateTheDataForATracks().catch(console.error); +async function main() { + updateTheDataForATracks(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsCreateOrUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsCreateOrUpdateSample.ts index d24730c0a487..75a30eff6ddd 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsCreateOrUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsCreateOrUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { Transform, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Creates or updates a new Transform. * * @summary Creates or updates a new Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-create.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-create.json */ async function createOrUpdateATransform() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "createdTransform"; const parameters: Transform = { @@ -44,4 +50,8 @@ async function createOrUpdateATransform() { console.log(result); } -createOrUpdateATransform().catch(console.error); +async function main() { + createOrUpdateATransform(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsDeleteSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsDeleteSample.ts index 025ae1d8e534..a665c173fd18 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsDeleteSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsDeleteSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Deletes a Transform. * * @summary Deletes a Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-delete.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-delete.json */ async function deleteATransform() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "sampleTransform"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function deleteATransform() { console.log(result); } -deleteATransform().catch(console.error); +async function main() { + deleteATransform(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsGetSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsGetSample.ts index cba6589be61c..ca117c40b23e 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsGetSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsGetSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Gets a Transform. * * @summary Gets a Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-get-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-get-by-name.json */ async function getATransformByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "sampleTransform"; const credential = new DefaultAzureCredential(); @@ -32,4 +38,8 @@ async function getATransformByName() { console.log(result); } -getATransformByName().catch(console.error); +async function main() { + getATransformByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsListSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsListSample.ts index adea3ccdf4e5..b111b331961b 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsListSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsListSample.ts @@ -13,16 +13,22 @@ import { AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Lists the Transforms in the account. * * @summary Lists the Transforms in the account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-list-all.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-list-all.json */ async function listsTheTransforms() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const credential = new DefaultAzureCredential(); const client = new AzureMediaServices(credential, subscriptionId); @@ -36,20 +42,21 @@ async function listsTheTransforms() { console.log(resArray); } -listsTheTransforms().catch(console.error); - /** * This sample demonstrates how to Lists the Transforms in the account. * * @summary Lists the Transforms in the account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-list-all-filter-by-created.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-list-all-filter-by-created.json */ async function listsTheTransformsFilterByCreated() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const filter = - "properties/created gt 2021-11-01T00:00:00.0000000Z and properties/created le 2021-11-01T00:00:10.0000000Z"; + "properties/created gt 2021-06-01T00:00:00.0000000Z and properties/created le 2021-06-01T00:00:10.0000000Z"; const orderby = "properties/created"; const options: TransformsListOptionalParams = { filter, orderby }; const credential = new DefaultAzureCredential(); @@ -65,20 +72,21 @@ async function listsTheTransformsFilterByCreated() { console.log(resArray); } -listsTheTransformsFilterByCreated().catch(console.error); - /** * This sample demonstrates how to Lists the Transforms in the account. * * @summary Lists the Transforms in the account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-list-all-filter-by-lastmodified.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-list-all-filter-by-lastmodified.json */ async function listsTheTransformsFilterByLastmodified() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const filter = - "properties/lastmodified gt 2021-11-01T00:00:00.0000000Z and properties/lastmodified le 2021-11-01T00:00:10.0000000Z"; + "properties/lastmodified gt 2021-06-01T00:00:00.0000000Z and properties/lastmodified le 2021-06-01T00:00:10.0000000Z"; const orderby = "properties/lastmodified desc"; const options: TransformsListOptionalParams = { filter, orderby }; const credential = new DefaultAzureCredential(); @@ -94,17 +102,18 @@ async function listsTheTransformsFilterByLastmodified() { console.log(resArray); } -listsTheTransformsFilterByLastmodified().catch(console.error); - /** * This sample demonstrates how to Lists the Transforms in the account. * * @summary Lists the Transforms in the account. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-list-all-filter-by-name.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-list-all-filter-by-name.json */ async function listsTheTransformsFilterByName() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const filter = "(name eq 'sampleEncode') or (name eq 'sampleEncodeAndVideoIndex')"; @@ -123,4 +132,11 @@ async function listsTheTransformsFilterByName() { console.log(resArray); } -listsTheTransformsFilterByName().catch(console.error); +async function main() { + listsTheTransforms(); + listsTheTransformsFilterByCreated(); + listsTheTransformsFilterByLastmodified(); + listsTheTransformsFilterByName(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsUpdateSample.ts b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsUpdateSample.ts index 19f28eb48625..43fcdabd8a90 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsUpdateSample.ts +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/src/transformsUpdateSample.ts @@ -10,16 +10,22 @@ // Licensed under the MIT License. import { Transform, AzureMediaServices } from "@azure/arm-mediaservices"; import { DefaultAzureCredential } from "@azure/identity"; +import * as dotenv from "dotenv"; + +dotenv.config(); /** * This sample demonstrates how to Updates a Transform. * * @summary Updates a Transform. - * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/stable/2021-11-01/examples/transforms-update.json + * x-ms-original-file: specification/mediaservices/resource-manager/Microsoft.Media/Encoding/stable/2022-07-01/examples/transforms-update.json */ async function updateATransform() { - const subscriptionId = "00000000-0000-0000-0000-000000000000"; - const resourceGroupName = "contosoresources"; + const subscriptionId = + process.env["MEDIASERVICES_SUBSCRIPTION_ID"] || + "00000000-0000-0000-0000-000000000000"; + const resourceGroupName = + process.env["MEDIASERVICES_RESOURCE_GROUP"] || "contosoresources"; const accountName = "contosomedia"; const transformName = "transformToUpdate"; const parameters: Transform = { @@ -45,4 +51,8 @@ async function updateATransform() { console.log(result); } -updateATransform().catch(console.error); +async function main() { + updateATransform(); +} + +main().catch(console.error); diff --git a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/tsconfig.json b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/tsconfig.json index 416c2dd82e00..e26ce2a6d8f7 100644 --- a/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/tsconfig.json +++ b/sdk/mediaservices/arm-mediaservices/samples/v13/typescript/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "target": "ES2018", + "target": "ES2020", "module": "commonjs", "moduleResolution": "node", "resolveJsonModule": true, diff --git a/sdk/mediaservices/arm-mediaservices/src/azureMediaServices.ts b/sdk/mediaservices/arm-mediaservices/src/azureMediaServices.ts index 8fcdfce0df58..142244a08f36 100644 --- a/sdk/mediaservices/arm-mediaservices/src/azureMediaServices.ts +++ b/sdk/mediaservices/arm-mediaservices/src/azureMediaServices.ts @@ -88,22 +88,19 @@ export class AzureMediaServices extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-mediaservices/13.0.1`; + const packageDetails = `azsdk-js-arm-mediaservices/13.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - if (!options.credentialScopes) { - options.credentialScopes = ["https://management.azure.com/.default"]; - } const optionsWithDefaults = { ...defaults, ...options, userAgentOptions: { userAgentPrefix }, - baseUri: + endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com" }; super(optionsWithDefaults); @@ -129,7 +126,9 @@ export class AzureMediaServices extends coreClient.ServiceClient { this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ credential: credentials, - scopes: `${optionsWithDefaults.credentialScopes}`, + scopes: + optionsWithDefaults.credentialScopes ?? + `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge diff --git a/sdk/mediaservices/arm-mediaservices/src/index.ts b/sdk/mediaservices/arm-mediaservices/src/index.ts index 1e8ea496bee9..33dc2a556bd8 100644 --- a/sdk/mediaservices/arm-mediaservices/src/index.ts +++ b/sdk/mediaservices/arm-mediaservices/src/index.ts @@ -7,6 +7,7 @@ */ /// +export { getContinuationToken } from "./pagingHelper"; export * from "./models"; export { AzureMediaServices } from "./azureMediaServices"; export * from "./operationsInterfaces"; diff --git a/sdk/mediaservices/arm-mediaservices/src/models/index.ts b/sdk/mediaservices/arm-mediaservices/src/models/index.ts index e56b6bc94bc4..ef617f5b2606 100644 --- a/sdk/mediaservices/arm-mediaservices/src/models/index.ts +++ b/sdk/mediaservices/arm-mediaservices/src/models/index.ts @@ -64,7 +64,7 @@ export type AudioAnalyzerPresetUnion = | AudioAnalyzerPreset | VideoAnalyzerPreset; export type JobInputClipUnion = JobInputClip | JobInputAsset | JobInputHttp; -export type AudioUnion = Audio | AacAudio; +export type AudioUnion = Audio | AacAudio | DDAudio; export type VideoUnion = Video | H265Video | ImageUnion | H264Video; export type AudioTrackDescriptorUnion = | AudioTrackDescriptor @@ -1487,6 +1487,7 @@ export interface Codec { odataType: | "#Microsoft.Media.Audio" | "#Microsoft.Media.AacAudio" + | "#Microsoft.Media.DDAudio" | "#Microsoft.Media.Video" | "#Microsoft.Media.H265Video" | "#Microsoft.Media.CopyVideo" @@ -1499,6 +1500,16 @@ export interface Codec { label?: string; } +/** Describes the properties of a Fade effect applied to the input media. */ +export interface Fade { + /** The Duration of the fade effect in the video. The value can be in ISO 8601 format (For example, PT05S to fade In/Out a color during 5 seconds), or a frame count (For example, 10 to fade 10 frames from the start time), or a relative value to stream duration (For example, 10% to fade 10% of stream duration) */ + duration: string; + /** The Color for the fade In/Out. it can be on the CSS Level1 colors https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/color_keywords or an RGB/hex value: e.g: rgb(255,0,0), 0xFF0000 or #FF0000 */ + fadeColor: string; + /** The position in the input video from where to start fade. The value can be in ISO 8601 format (For example, PT05S to start at 5 seconds), or a frame count (For example, 10 to start at the 10th frame), or a relative value to stream duration (For example, 10% to start at 10% of stream duration). Default is 0 */ + start?: string; +} + /** The encoder can be configured to produce video and/or images (thumbnails) at different resolutions, by specifying a layer for each desired resolution. A layer represents the properties for the video or image at a resolution. */ export interface Layer { /** The width of the output video for this layer. The value can be absolute (in pixels) or relative (in percentage). For example 50% means the output video has half as many pixels in width as the input. */ @@ -1560,7 +1571,7 @@ export interface Format { | "#Microsoft.Media.MultiBitrateFormat" | "#Microsoft.Media.Mp4Format" | "#Microsoft.Media.TransportStreamFormat"; - /** The pattern of the file names for the generated output files. The following macros are supported in the file name: {Basename} - An expansion macro that will use the name of the input video file. If the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of input video files will be used. If the length of base name of the input video file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {Bitrate} - The audio/video bitrate. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename. */ + /** The file naming pattern used for the creation of output files. The following macros are supported in the file name: {Basename} - An expansion macro that will use the name of the input video file. If the base name(the file suffix is not included) of the input video file is less than 32 characters long, the base name of input video files will be used. If the length of base name of the input video file exceeds 32 characters, the base name is truncated to the first 32 characters in total length. {Extension} - The appropriate extension for this format. {Label} - The label assigned to the codec/layer. {Index} - A unique index for thumbnails. Only applicable to thumbnails. {AudioStream} - string "Audio" plus audio stream number(start from 1). {Bitrate} - The audio/video bitrate in kbps. Not applicable to thumbnails. {Codec} - The type of the audio/video codec. {Resolution} - The video resolution. Any unsubstituted macros will be collapsed and removed from the filename. */ filenamePattern: string; } @@ -1592,6 +1603,10 @@ export interface Filters { rotation?: Rotation; /** The parameters for the rectangular window with which to crop the input video. */ crop?: Rectangle; + /** Describes the properties of a Fade effect applied to the input media. */ + fadeIn?: Fade; + /** Describes the properties of a Fade effect applied to the input media. */ + fadeOut?: Fade; /** The properties of overlays to be applied to the input video. These could be audio, image or video overlays. */ overlays?: OverlayUnion[]; } @@ -1757,7 +1772,7 @@ export interface ContentKeyPolicyFairPlayConfiguration extends ContentKeyPolicyConfiguration { /** Polymorphic discriminator, which specifies the different types this object can be */ odataType: "#Microsoft.Media.ContentKeyPolicyFairPlayConfiguration"; - /** The key that must be used as FairPlay Application Secret key. */ + /** The key that must be used as FairPlay Application Secret key. This needs to be base64 encoded. */ ask: Uint8Array | null; /** The password encrypting FairPlay certificate in PKCS 12 (pfx) format. */ fairPlayPfxPassword: string | null; @@ -1848,6 +1863,8 @@ export interface BuiltInStandardEncoderPreset extends Preset { export interface StandardEncoderPreset extends Preset { /** Polymorphic discriminator, which specifies the different types this object can be */ odataType: "#Microsoft.Media.StandardEncoderPreset"; + /** Dictionary containing key value pairs for parameters not exposed in the preset itself */ + experimentalOptions?: { [propertyName: string]: string }; /** One or more filtering operations that are applied to the input media before encoding. */ filters?: Filters; /** The list of codecs to be used when encoding the input video. */ @@ -1947,7 +1964,10 @@ export interface ContentKeyPolicyX509CertificateTokenKey /** Defines the common properties for all audio codecs. */ export interface Audio extends Codec { /** Polymorphic discriminator, which specifies the different types this object can be */ - odataType: "#Microsoft.Media.Audio" | "#Microsoft.Media.AacAudio"; + odataType: + | "#Microsoft.Media.Audio" + | "#Microsoft.Media.AacAudio" + | "#Microsoft.Media.DDAudio"; /** The number of channels in the audio. */ channels?: number; /** The sampling rate to use for encoding in hertz. */ @@ -2568,6 +2588,12 @@ export interface AacAudio extends Audio { profile?: AacAudioProfile; } +/** Describes Dolby Digital Audio Codec (AC3) audio encoding settings. The current implementation for Dolby Digital Audio support are: Audio channel numbers at 1((mono), 2(stereo), 6(5.1side); Audio sampling frequency rates at: 32K/44.1K/48K Hz; Audio bitrate values as AC3 specification supports: 32000, 40000, 48000, 56000, 64000, 80000, 96000, 112000, 128000, 160000, 192000, 224000, 256000, 320000, 384000, 448000, 512000, 576000, 640000 bps. */ +export interface DDAudio extends Audio { + /** Polymorphic discriminator, which specifies the different types this object can be */ + odataType: "#Microsoft.Media.DDAudio"; +} + /** Describes all the properties for encoding a video with the H.265 codec. */ export interface H265Video extends Video { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -3216,7 +3242,9 @@ export enum KnownJobErrorCode { /** There was a problem with the input content (for example: zero byte files, or corrupt/non-decodable files), check the input files. */ ContentMalformed = "ContentMalformed", /** There was a problem with the format of the input (not valid media file, or an unsupported file/codec), check the validity of the input files. */ - ContentUnsupported = "ContentUnsupported" + ContentUnsupported = "ContentUnsupported", + /** There was an error verifying to the account identity. Check and fix the identity configurations and retry. If unsuccessful, please contact support. */ + IdentityUnsupported = "IdentityUnsupported" } /** @@ -3232,7 +3260,8 @@ export enum KnownJobErrorCode { * **UploadTransientError**: While trying to upload the output files, there was an issue during transfer (storage service, network errors), see details and check your destination. \ * **ConfigurationUnsupported**: There was a problem with the combination of input files and the configuration settings applied, fix the configuration settings and retry with the same input, or change input to match the configuration. \ * **ContentMalformed**: There was a problem with the input content (for example: zero byte files, or corrupt\/non-decodable files), check the input files. \ - * **ContentUnsupported**: There was a problem with the format of the input (not valid media file, or an unsupported file\/codec), check the validity of the input files. + * **ContentUnsupported**: There was a problem with the format of the input (not valid media file, or an unsupported file\/codec), check the validity of the input files. \ + * **IdentityUnsupported**: There was an error verifying to the account identity. Check and fix the identity configurations and retry. If unsuccessful, please contact support. */ export type JobErrorCode = string; @@ -3247,7 +3276,9 @@ export enum KnownJobErrorCategory { /** The error is configuration related. */ Configuration = "Configuration", /** The error is related to data in the input files. */ - Content = "Content" + Content = "Content", + /** The error is related to account information. */ + Account = "Account" } /** @@ -3259,7 +3290,8 @@ export enum KnownJobErrorCategory { * **Download**: The error is download related. \ * **Upload**: The error is upload related. \ * **Configuration**: The error is configuration related. \ - * **Content**: The error is related to data in the input files. + * **Content**: The error is related to data in the input files. \ + * **Account**: The error is related to account information. */ export type JobErrorCategory = string; @@ -3832,7 +3864,7 @@ export enum KnownChannelMapping { FrontRight = "FrontRight", /** The Center Channel. */ Center = "Center", - /** Low Frequency Effects Channel. Sometimes referred to as the Subwoofer. */ + /** Low Frequency Effects Channel. Sometimes referred to as the subwoofer. */ LowFrequencyEffects = "LowFrequencyEffects", /** The Back Left Channel. Sometimes referred to as the Left Surround Channel. */ BackLeft = "BackLeft", @@ -3852,7 +3884,7 @@ export enum KnownChannelMapping { * **FrontLeft**: The Front Left Channel. \ * **FrontRight**: The Front Right Channel. \ * **Center**: The Center Channel. \ - * **LowFrequencyEffects**: Low Frequency Effects Channel. Sometimes referred to as the Subwoofer. \ + * **LowFrequencyEffects**: Low Frequency Effects Channel. Sometimes referred to as the subwoofer. \ * **BackLeft**: The Back Left Channel. Sometimes referred to as the Left Surround Channel. \ * **BackRight**: The Back Right Channel. Sometimes referred to as the Right Surround Channel. \ * **StereoLeft**: The Left Stereo channel. Sometimes referred to as Down Mix Left. \ @@ -4194,8 +4226,10 @@ export enum KnownEncoderNamedPreset { H264SingleBitrate1080P = "H264SingleBitrate1080p", /** Produces a set of GOP aligned MP4 files with H.264 video and stereo AAC audio. Auto-generates a bitrate ladder based on the input resolution, bitrate and frame rate. The auto-generated preset will never exceed the input resolution. For example, if the input is 720p, output will remain 720p at best. */ AdaptiveStreaming = "AdaptiveStreaming", - /** Produces a single MP4 file containing only stereo audio encoded at 192 kbps. */ + /** Produces a single MP4 file containing only AAC stereo audio encoded at 192 kbps. */ AACGoodQualityAudio = "AACGoodQualityAudio", + /** Produces a single MP4 file containing only DD(Digital Dolby) stereo audio encoded at 192 kbps. */ + DDGoodQualityAudio = "DDGoodQualityAudio", /** Exposes an experimental preset for content-aware encoding. Given any input content, the service attempts to automatically determine the optimal number of layers, appropriate bitrate and resolution settings for delivery by adaptive streaming. The underlying algorithms will continue to evolve over time. The output will contain MP4 files with video and audio interleaved. */ ContentAwareEncodingExperimental = "ContentAwareEncodingExperimental", /** Produces a set of GOP-aligned MP4s by using content-aware encoding. Given any input content, the service performs an initial lightweight analysis of the input content, and uses the results to determine the optimal number of layers, appropriate bitrate and resolution settings for delivery by adaptive streaming. This preset is particularly effective for low and medium complexity videos, where the output files will be at lower bitrates but at a quality that still delivers a good experience to viewers. The output will contain MP4 files with video and audio interleaved. */ @@ -4229,7 +4263,8 @@ export enum KnownEncoderNamedPreset { * **H264SingleBitrate720p**: Produces an MP4 file where the video is encoded with H.264 codec at 4500 kbps and a picture height of 720 pixels, and the stereo audio is encoded with AAC-LC codec at 128 kbps. \ * **H264SingleBitrate1080p**: Produces an MP4 file where the video is encoded with H.264 codec at 6750 kbps and a picture height of 1080 pixels, and the stereo audio is encoded with AAC-LC codec at 128 kbps. \ * **AdaptiveStreaming**: Produces a set of GOP aligned MP4 files with H.264 video and stereo AAC audio. Auto-generates a bitrate ladder based on the input resolution, bitrate and frame rate. The auto-generated preset will never exceed the input resolution. For example, if the input is 720p, output will remain 720p at best. \ - * **AACGoodQualityAudio**: Produces a single MP4 file containing only stereo audio encoded at 192 kbps. \ + * **AACGoodQualityAudio**: Produces a single MP4 file containing only AAC stereo audio encoded at 192 kbps. \ + * **DDGoodQualityAudio**: Produces a single MP4 file containing only DD(Digital Dolby) stereo audio encoded at 192 kbps. \ * **ContentAwareEncodingExperimental**: Exposes an experimental preset for content-aware encoding. Given any input content, the service attempts to automatically determine the optimal number of layers, appropriate bitrate and resolution settings for delivery by adaptive streaming. The underlying algorithms will continue to evolve over time. The output will contain MP4 files with video and audio interleaved. \ * **ContentAwareEncoding**: Produces a set of GOP-aligned MP4s by using content-aware encoding. Given any input content, the service performs an initial lightweight analysis of the input content, and uses the results to determine the optimal number of layers, appropriate bitrate and resolution settings for delivery by adaptive streaming. This preset is particularly effective for low and medium complexity videos, where the output files will be at lower bitrates but at a quality that still delivers a good experience to viewers. The output will contain MP4 files with video and audio interleaved. \ * **CopyAllBitrateNonInterleaved**: Copy all video and audio streams from the input asset as non-interleaved video and audio output files. This preset can be used to clip an existing asset or convert a group of key frame (GOP) aligned MP4 files as an asset that can be streamed. \ @@ -4507,14 +4542,7 @@ export type AssetsListStreamingLocatorsResponse = ListStreamingLocatorsResponse; /** Optional parameters. */ export interface AssetsListNextOptionalParams - extends coreClient.OperationOptions { - /** Restricts the set of items returned. */ - filter?: string; - /** Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. */ - top?: number; - /** Specifies the key by which the result collection should be ordered. */ - orderby?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type AssetsListNextResponse = AssetCollection; @@ -4681,14 +4709,7 @@ export type ContentKeyPoliciesGetPolicyPropertiesWithSecretsResponse = ContentKe /** Optional parameters. */ export interface ContentKeyPoliciesListNextOptionalParams - extends coreClient.OperationOptions { - /** Restricts the set of items returned. */ - filter?: string; - /** Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. */ - top?: number; - /** Specifies the key by which the result collection should be ordered. */ - orderby?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type ContentKeyPoliciesListNextResponse = ContentKeyPolicyCollection; @@ -4732,12 +4753,7 @@ export type TransformsUpdateResponse = Transform; /** Optional parameters. */ export interface TransformsListNextOptionalParams - extends coreClient.OperationOptions { - /** Restricts the set of items returned. */ - filter?: string; - /** Specifies the key by which the result collection should be ordered. */ - orderby?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type TransformsListNextResponse = TransformCollection; @@ -4780,12 +4796,7 @@ export interface JobsCancelJobOptionalParams /** Optional parameters. */ export interface JobsListNextOptionalParams - extends coreClient.OperationOptions { - /** Restricts the set of items returned. */ - filter?: string; - /** Specifies the key by which the result collection should be ordered. */ - orderby?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type JobsListNextResponse = JobCollection; @@ -4824,14 +4835,7 @@ export interface StreamingPoliciesDeleteOptionalParams /** Optional parameters. */ export interface StreamingPoliciesListNextOptionalParams - extends coreClient.OperationOptions { - /** Restricts the set of items returned. */ - filter?: string; - /** Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. */ - top?: number; - /** Specifies the key by which the result collection should be ordered. */ - orderby?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type StreamingPoliciesListNextResponse = StreamingPolicyCollection; @@ -4884,14 +4888,7 @@ export type StreamingLocatorsListPathsResponse = ListPathsResponse; /** Optional parameters. */ export interface StreamingLocatorsListNextOptionalParams - extends coreClient.OperationOptions { - /** Restricts the set of items returned. */ - filter?: string; - /** Specifies a non-negative integer n that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value n. */ - top?: number; - /** Specifies the key by which the result collection should be ordered. */ - orderby?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type StreamingLocatorsListNextResponse = StreamingLocatorCollection; diff --git a/sdk/mediaservices/arm-mediaservices/src/models/mappers.ts b/sdk/mediaservices/arm-mediaservices/src/models/mappers.ts index 9462d46c7caf..50d3183382ed 100644 --- a/sdk/mediaservices/arm-mediaservices/src/models/mappers.ts +++ b/sdk/mediaservices/arm-mediaservices/src/models/mappers.ts @@ -3713,6 +3713,35 @@ export const Codec: coreClient.CompositeMapper = { } }; +export const Fade: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "Fade", + modelProperties: { + duration: { + serializedName: "duration", + required: true, + type: { + name: "TimeSpan" + } + }, + fadeColor: { + serializedName: "fadeColor", + required: true, + type: { + name: "String" + } + }, + start: { + serializedName: "start", + type: { + name: "String" + } + } + } + } +}; + export const Layer: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3959,6 +3988,20 @@ export const Filters: coreClient.CompositeMapper = { className: "Rectangle" } }, + fadeIn: { + serializedName: "fadeIn", + type: { + name: "Composite", + className: "Fade" + } + }, + fadeOut: { + serializedName: "fadeOut", + type: { + name: "Composite", + className: "Fade" + } + }, overlays: { serializedName: "overlays", type: { @@ -4646,6 +4689,13 @@ export const StandardEncoderPreset: coreClient.CompositeMapper = { polymorphicDiscriminator: Preset.type.polymorphicDiscriminator, modelProperties: { ...Preset.type.modelProperties, + experimentalOptions: { + serializedName: "experimentalOptions", + type: { + name: "Dictionary", + value: { type: { name: "String" } } + } + }, filters: { serializedName: "filters", type: { @@ -6377,6 +6427,19 @@ export const AacAudio: coreClient.CompositeMapper = { } }; +export const DDAudio: coreClient.CompositeMapper = { + serializedName: "#Microsoft.Media.DDAudio", + type: { + name: "Composite", + className: "DDAudio", + uberParent: "Audio", + polymorphicDiscriminator: Audio.type.polymorphicDiscriminator, + modelProperties: { + ...Audio.type.modelProperties + } + } +}; + export const H265Video: coreClient.CompositeMapper = { serializedName: "#Microsoft.Media.H265Video", type: { @@ -7070,6 +7133,7 @@ export let discriminators = { "JobInputClip.#Microsoft.Media.JobInputAsset": JobInputAsset, "JobInputClip.#Microsoft.Media.JobInputHttp": JobInputHttp, "Audio.#Microsoft.Media.AacAudio": AacAudio, + "Audio.#Microsoft.Media.DDAudio": DDAudio, "Video.#Microsoft.Media.H265Video": H265Video, "Video.#Microsoft.Media.Image": Image, "Video.#Microsoft.Media.H264Video": H264Video, diff --git a/sdk/mediaservices/arm-mediaservices/src/models/parameters.ts b/sdk/mediaservices/arm-mediaservices/src/models/parameters.ts index cf0d39025861..20f265ef9557 100644 --- a/sdk/mediaservices/arm-mediaservices/src/models/parameters.ts +++ b/sdk/mediaservices/arm-mediaservices/src/models/parameters.ts @@ -307,6 +307,18 @@ export const parameters11: OperationParameter = { mapper: ContentKeyPolicyMapper }; +export const apiVersion2: OperationQueryParameter = { + parameterPath: "apiVersion", + mapper: { + defaultValue: "2022-07-01", + isConstant: true, + serializedName: "api-version", + type: { + name: "String" + } + } +}; + export const transformName: OperationURLParameter = { parameterPath: "transformName", mapper: { diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/accountFilters.ts b/sdk/mediaservices/arm-mediaservices/src/operations/accountFilters.ts index f7e6b0066517..01b72d1e1ce2 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/accountFilters.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/accountFilters.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { AccountFilters } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -59,8 +60,16 @@ export class AccountFiltersImpl implements AccountFilters { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, accountName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + accountName, + options, + settings + ); } }; } @@ -68,11 +77,18 @@ export class AccountFiltersImpl implements AccountFilters { private async *listPagingPage( resourceGroupName: string, accountName: string, - options?: AccountFiltersListOptionalParams + options?: AccountFiltersListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, accountName, options); - yield result.value || []; - let continuationToken = result.odataNextLink; + let result: AccountFiltersListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, accountName, options); + let page = result.value || []; + continuationToken = result.odataNextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -81,7 +97,9 @@ export class AccountFiltersImpl implements AccountFilters { options ); continuationToken = result.odataNextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -349,7 +367,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/assetFilters.ts b/sdk/mediaservices/arm-mediaservices/src/operations/assetFilters.ts index 815b0bae49a3..062c9ed2a767 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/assetFilters.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/assetFilters.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { AssetFilters } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -66,12 +67,16 @@ export class AssetFiltersImpl implements AssetFilters { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, accountName, assetName, - options + options, + settings ); } }; @@ -81,16 +86,23 @@ export class AssetFiltersImpl implements AssetFilters { resourceGroupName: string, accountName: string, assetName: string, - options?: AssetFiltersListOptionalParams + options?: AssetFiltersListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - accountName, - assetName, - options - ); - yield result.value || []; - let continuationToken = result.odataNextLink; + let result: AssetFiltersListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + accountName, + assetName, + options + ); + let page = result.value || []; + continuationToken = result.odataNextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -100,7 +112,9 @@ export class AssetFiltersImpl implements AssetFilters { options ); continuationToken = result.odataNextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -401,7 +415,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/assets.ts b/sdk/mediaservices/arm-mediaservices/src/operations/assets.ts index 0c374c50dc93..dae84c659055 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/assets.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/assets.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Assets } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -66,8 +67,16 @@ export class AssetsImpl implements Assets { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, accountName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + accountName, + options, + settings + ); } }; } @@ -75,11 +84,18 @@ export class AssetsImpl implements Assets { private async *listPagingPage( resourceGroupName: string, accountName: string, - options?: AssetsListOptionalParams + options?: AssetsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, accountName, options); - yield result.value || []; - let continuationToken = result.odataNextLink; + let result: AssetsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, accountName, options); + let page = result.value || []; + continuationToken = result.odataNextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -88,7 +104,9 @@ export class AssetsImpl implements Assets { options ); continuationToken = result.odataNextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -493,12 +511,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.top, - Parameters.orderby - ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/contentKeyPolicies.ts b/sdk/mediaservices/arm-mediaservices/src/operations/contentKeyPolicies.ts index 976c90abb56e..cb9a5d6901ce 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/contentKeyPolicies.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/contentKeyPolicies.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ContentKeyPolicies } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -61,8 +62,16 @@ export class ContentKeyPoliciesImpl implements ContentKeyPolicies { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, accountName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + accountName, + options, + settings + ); } }; } @@ -70,11 +79,18 @@ export class ContentKeyPoliciesImpl implements ContentKeyPolicies { private async *listPagingPage( resourceGroupName: string, accountName: string, - options?: ContentKeyPoliciesListOptionalParams + options?: ContentKeyPoliciesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, accountName, options); - yield result.value || []; - let continuationToken = result.odataNextLink; + let result: ContentKeyPoliciesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, accountName, options); + let page = result.value || []; + continuationToken = result.odataNextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -83,7 +99,9 @@ export class ContentKeyPoliciesImpl implements ContentKeyPolicies { options ); continuationToken = result.odataNextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -410,12 +428,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.top, - Parameters.orderby - ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/jobs.ts b/sdk/mediaservices/arm-mediaservices/src/operations/jobs.ts index ed939dec2ebf..bba7a2c0415e 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/jobs.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/jobs.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Jobs } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -67,12 +68,16 @@ export class JobsImpl implements Jobs { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, accountName, transformName, - options + options, + settings ); } }; @@ -82,16 +87,23 @@ export class JobsImpl implements Jobs { resourceGroupName: string, accountName: string, transformName: string, - options?: JobsListOptionalParams + options?: JobsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - accountName, - transformName, - options - ); - yield result.value || []; - let continuationToken = result.odataNextLink; + let result: JobsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + accountName, + transformName, + options + ); + let page = result.value || []; + continuationToken = result.odataNextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -101,7 +113,9 @@ export class JobsImpl implements Jobs { options ); continuationToken = result.odataNextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -301,9 +315,9 @@ const listOperationSpec: coreClient.OperationSpec = { } }, queryParameters: [ - Parameters.apiVersion1, Parameters.filter, - Parameters.orderby + Parameters.orderby, + Parameters.apiVersion2 ], urlParameters: [ Parameters.$host, @@ -327,7 +341,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion2], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -352,7 +366,7 @@ const createOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.parameters13, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion2], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -376,7 +390,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion2], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -401,7 +415,7 @@ const updateOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.parameters13, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion2], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -424,7 +438,7 @@ const cancelJobOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion2], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -447,11 +461,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [ - Parameters.apiVersion1, - Parameters.filter, - Parameters.orderby - ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/liveEvents.ts b/sdk/mediaservices/arm-mediaservices/src/operations/liveEvents.ts index 196dd029d5ca..d505b03bb3c3 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/liveEvents.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/liveEvents.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { LiveEvents } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -70,8 +71,16 @@ export class LiveEventsImpl implements LiveEvents { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, accountName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + accountName, + options, + settings + ); } }; } @@ -79,11 +88,18 @@ export class LiveEventsImpl implements LiveEvents { private async *listPagingPage( resourceGroupName: string, accountName: string, - options?: LiveEventsListOptionalParams + options?: LiveEventsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, accountName, options); - yield result.value || []; - let continuationToken = result.odataNextLink; + let result: LiveEventsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, accountName, options); + let page = result.value || []; + continuationToken = result.odataNextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -92,7 +108,9 @@ export class LiveEventsImpl implements LiveEvents { options ); continuationToken = result.odataNextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -1142,7 +1160,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/liveOutputs.ts b/sdk/mediaservices/arm-mediaservices/src/operations/liveOutputs.ts index d02de2d016b3..6bd6c7742cb3 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/liveOutputs.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/liveOutputs.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { LiveOutputs } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -70,12 +71,16 @@ export class LiveOutputsImpl implements LiveOutputs { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, accountName, liveEventName, - options + options, + settings ); } }; @@ -85,16 +90,23 @@ export class LiveOutputsImpl implements LiveOutputs { resourceGroupName: string, accountName: string, liveEventName: string, - options?: LiveOutputsListOptionalParams + options?: LiveOutputsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - accountName, - liveEventName, - options - ); - yield result.value || []; - let continuationToken = result.odataNextLink; + let result: LiveOutputsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + accountName, + liveEventName, + options + ); + let page = result.value || []; + continuationToken = result.odataNextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -104,7 +116,9 @@ export class LiveOutputsImpl implements LiveOutputs { options ); continuationToken = result.odataNextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -619,7 +633,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/mediaservices.ts b/sdk/mediaservices/arm-mediaservices/src/operations/mediaservices.ts index 9bc87d7bb655..47bf9ebca395 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/mediaservices.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/mediaservices.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Mediaservices } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,9 +19,10 @@ import { MediaService, MediaservicesListNextOptionalParams, MediaservicesListOptionalParams, + MediaservicesListResponse, MediaservicesListBySubscriptionNextOptionalParams, MediaservicesListBySubscriptionOptionalParams, - MediaservicesListResponse, + MediaservicesListBySubscriptionResponse, MediaservicesGetOptionalParams, MediaservicesGetResponse, MediaservicesCreateOrUpdateOptionalParams, @@ -34,7 +36,6 @@ import { ListEdgePoliciesInput, MediaservicesListEdgePoliciesOptionalParams, MediaservicesListEdgePoliciesResponse, - MediaservicesListBySubscriptionResponse, MediaservicesListNextResponse, MediaservicesListBySubscriptionNextResponse } from "../models"; @@ -69,19 +70,29 @@ export class MediaservicesImpl implements Mediaservices { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(resourceGroupName, options, settings); } }; } private async *listPagingPage( resourceGroupName: string, - options?: MediaservicesListOptionalParams + options?: MediaservicesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.odataNextLink; + let result: MediaservicesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.odataNextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -89,7 +100,9 @@ export class MediaservicesImpl implements Mediaservices { options ); continuationToken = result.odataNextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -117,22 +130,34 @@ export class MediaservicesImpl implements Mediaservices { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); } }; } private async *listBySubscriptionPagingPage( - options?: MediaservicesListBySubscriptionOptionalParams + options?: MediaservicesListBySubscriptionOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscription(options); - yield result.value || []; - let continuationToken = result.odataNextLink; + let result: MediaservicesListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.odataNextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listBySubscriptionNext(continuationToken, options); continuationToken = result.odataNextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -675,7 +700,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -696,7 +720,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/streamingEndpoints.ts b/sdk/mediaservices/arm-mediaservices/src/operations/streamingEndpoints.ts index ab20f3f408fb..ab677fd3bc45 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/streamingEndpoints.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/streamingEndpoints.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { StreamingEndpoints } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -71,8 +72,16 @@ export class StreamingEndpointsImpl implements StreamingEndpoints { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, accountName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + accountName, + options, + settings + ); } }; } @@ -80,11 +89,18 @@ export class StreamingEndpointsImpl implements StreamingEndpoints { private async *listPagingPage( resourceGroupName: string, accountName: string, - options?: StreamingEndpointsListOptionalParams + options?: StreamingEndpointsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, accountName, options); - yield result.value || []; - let continuationToken = result.odataNextLink; + let result: StreamingEndpointsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, accountName, options); + let page = result.value || []; + continuationToken = result.odataNextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -93,7 +109,9 @@ export class StreamingEndpointsImpl implements StreamingEndpoints { options ); continuationToken = result.odataNextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -1092,7 +1110,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/streamingLocators.ts b/sdk/mediaservices/arm-mediaservices/src/operations/streamingLocators.ts index 6e8d47a1f1fe..8e47a78e889a 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/streamingLocators.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/streamingLocators.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { StreamingLocators } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -61,8 +62,16 @@ export class StreamingLocatorsImpl implements StreamingLocators { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, accountName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + accountName, + options, + settings + ); } }; } @@ -70,11 +79,18 @@ export class StreamingLocatorsImpl implements StreamingLocators { private async *listPagingPage( resourceGroupName: string, accountName: string, - options?: StreamingLocatorsListOptionalParams + options?: StreamingLocatorsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, accountName, options); - yield result.value || []; - let continuationToken = result.odataNextLink; + let result: StreamingLocatorsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, accountName, options); + let page = result.value || []; + continuationToken = result.odataNextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -83,7 +99,9 @@ export class StreamingLocatorsImpl implements StreamingLocators { options ); continuationToken = result.odataNextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -397,12 +415,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.top, - Parameters.orderby - ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/streamingPolicies.ts b/sdk/mediaservices/arm-mediaservices/src/operations/streamingPolicies.ts index 2ed5c44dcd34..3a5908411437 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/streamingPolicies.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/streamingPolicies.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { StreamingPolicies } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -57,8 +58,16 @@ export class StreamingPoliciesImpl implements StreamingPolicies { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, accountName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + accountName, + options, + settings + ); } }; } @@ -66,11 +75,18 @@ export class StreamingPoliciesImpl implements StreamingPolicies { private async *listPagingPage( resourceGroupName: string, accountName: string, - options?: StreamingPoliciesListOptionalParams + options?: StreamingPoliciesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, accountName, options); - yield result.value || []; - let continuationToken = result.odataNextLink; + let result: StreamingPoliciesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, accountName, options); + let page = result.value || []; + continuationToken = result.odataNextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -79,7 +95,9 @@ export class StreamingPoliciesImpl implements StreamingPolicies { options ); continuationToken = result.odataNextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -309,12 +327,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.top, - Parameters.orderby - ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/tracks.ts b/sdk/mediaservices/arm-mediaservices/src/operations/tracks.ts index e891b7f35b1f..a3e3789ca3fe 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/tracks.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/tracks.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { Tracks } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -69,12 +69,16 @@ export class TracksImpl implements Tracks { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, accountName, assetName, - options + options, + settings ); } }; @@ -84,9 +88,11 @@ export class TracksImpl implements Tracks { resourceGroupName: string, accountName: string, assetName: string, - options?: TracksListOptionalParams + options?: TracksListOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( + let result: TracksListResponse; + result = await this._list( resourceGroupName, accountName, assetName, diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/transforms.ts b/sdk/mediaservices/arm-mediaservices/src/operations/transforms.ts index 91c26b41736f..7366d5efa5d6 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/transforms.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/transforms.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Transforms } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -59,8 +60,16 @@ export class TransformsImpl implements Transforms { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, accountName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + accountName, + options, + settings + ); } }; } @@ -68,11 +77,18 @@ export class TransformsImpl implements Transforms { private async *listPagingPage( resourceGroupName: string, accountName: string, - options?: TransformsListOptionalParams + options?: TransformsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, accountName, options); - yield result.value || []; - let continuationToken = result.odataNextLink; + let result: TransformsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, accountName, options); + let page = result.value || []; + continuationToken = result.odataNextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -81,7 +97,9 @@ export class TransformsImpl implements Transforms { options ); continuationToken = result.odataNextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -231,9 +249,9 @@ const listOperationSpec: coreClient.OperationSpec = { } }, queryParameters: [ - Parameters.apiVersion1, Parameters.filter, - Parameters.orderby + Parameters.orderby, + Parameters.apiVersion2 ], urlParameters: [ Parameters.$host, @@ -256,7 +274,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion2], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -283,7 +301,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.parameters12, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion2], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -306,7 +324,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion2], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -330,7 +348,7 @@ const updateOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.parameters12, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion2], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -353,11 +371,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [ - Parameters.apiVersion1, - Parameters.filter, - Parameters.orderby - ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/mediaservices/arm-mediaservices/src/pagingHelper.ts b/sdk/mediaservices/arm-mediaservices/src/pagingHelper.ts new file mode 100644 index 000000000000..269a2b9814b5 --- /dev/null +++ b/sdk/mediaservices/arm-mediaservices/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from + * that point later. + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +}