From a32b57a30934cd02d7b7454b385e458592a38375 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 16 Jun 2022 17:23:07 +0000 Subject: [PATCH] CodeGen from PR 18435 in Azure/azure-rest-api-specs Merge 6b538788c3ca7847442bc83f87310e8e8a2e38e7 into c2d25c0f023edd1fea753a89d6409f3e7a9f8956 --- .../arm-mediaservices/CHANGELOG.md | 45 ++- .../arm-mediaservices/_meta.json | 8 +- .../arm-mediaservices/package.json | 12 +- .../review/arm-mediaservices.api.md | 82 ++++- .../src/azureMediaServices.ts | 50 ++- .../arm-mediaservices/src/models/index.ts | 212 ++++++++---- .../arm-mediaservices/src/models/mappers.ts | 317 ++++++++++++++---- .../src/models/parameters.ts | 34 +- .../arm-mediaservices/src/operations/index.ts | 2 + .../src/operations/locations.ts | 4 +- .../mediaServiceOperationResults.ts | 76 +++++ .../mediaServiceOperationStatuses.ts | 73 ++++ .../src/operations/mediaservices.ts | 211 ++++++++++-- .../src/operations/operationResults.ts | 4 +- .../src/operations/operationStatuses.ts | 4 +- .../src/operations/operations.ts | 2 +- .../operations/privateEndpointConnections.ts | 16 +- .../src/operations/privateLinkResources.ts | 8 +- .../src/operationsInterfaces/index.ts | 2 + .../src/operationsInterfaces/locations.ts | 2 +- .../mediaServiceOperationResults.ts | 27 ++ .../mediaServiceOperationStatuses.ts | 27 ++ .../src/operationsInterfaces/mediaservices.ts | 43 ++- .../privateEndpointConnections.ts | 8 +- .../privateLinkResources.ts | 4 +- .../arm-mediaservices/test/sampleTest.ts | 43 +++ 26 files changed, 1088 insertions(+), 228 deletions(-) create mode 100644 sdk/mediaservices/arm-mediaservices/src/operations/mediaServiceOperationResults.ts create mode 100644 sdk/mediaservices/arm-mediaservices/src/operations/mediaServiceOperationStatuses.ts create mode 100644 sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/mediaServiceOperationResults.ts create mode 100644 sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/mediaServiceOperationStatuses.ts create mode 100644 sdk/mediaservices/arm-mediaservices/test/sampleTest.ts diff --git a/sdk/mediaservices/arm-mediaservices/CHANGELOG.md b/sdk/mediaservices/arm-mediaservices/CHANGELOG.md index de6f971fd1ce..4cf7ea087657 100644 --- a/sdk/mediaservices/arm-mediaservices/CHANGELOG.md +++ b/sdk/mediaservices/arm-mediaservices/CHANGELOG.md @@ -1,15 +1,44 @@ # Release History + +## 12.0.0 (2022-06-16) + +**Features** -## 11.0.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added operation group MediaServiceOperationResults + - Added operation group MediaServiceOperationStatuses + - Added operation Mediaservices.beginCreateOrUpdate + - Added operation Mediaservices.beginCreateOrUpdateAndWait + - Added operation Mediaservices.beginUpdate + - Added operation Mediaservices.beginUpdateAndWait + - Added Interface MediaServiceOperationResultsGetHeaders + - Added Interface MediaServiceOperationResultsGetOptionalParams + - Added Interface MediaServiceOperationStatus + - Added Interface MediaServiceOperationStatusesGetOptionalParams + - Added Interface MediaservicesCreateOrUpdateHeaders + - Added Interface MediaservicesUpdateHeaders + - Added Type Alias MediaServiceOperationResultsGetResponse + - Added Type Alias MediaServiceOperationStatusesGetResponse + - Interface AzureMediaServicesOptionalParams has a new optional parameter apiVersion + - Interface MediaservicesCreateOrUpdateOptionalParams has a new optional parameter resumeFrom + - Interface MediaservicesCreateOrUpdateOptionalParams has a new optional parameter updateIntervalInMs + - Interface MediaservicesUpdateOptionalParams has a new optional parameter resumeFrom + - Interface MediaservicesUpdateOptionalParams has a new optional parameter updateIntervalInMs + - Interface MediaServiceUpdate has a new optional parameter privateEndpointConnections + - Interface MediaServiceUpdate has a new optional parameter provisioningState + - Class AzureMediaServices has a new parameter apiVersion + - Class AzureMediaServices has a new parameter mediaServiceOperationResults + - Class AzureMediaServices has a new parameter mediaServiceOperationStatuses + - Add parameters of MediaservicesCreateOrUpdateHeaders to TypeAlias MediaservicesCreateOrUpdateResponse + - Add parameters of MediaservicesUpdateHeaders to TypeAlias MediaservicesUpdateResponse + - Type Alias MediaService has a new parameter provisioningState + - Type Alias MediaService has a new parameter privateEndpointConnections -### Other Changes +**Breaking Changes** + - Removed operation Mediaservices.createOrUpdate + - Removed operation Mediaservices.update + + ## 11.0.0 (2022-04-14) **Features** diff --git a/sdk/mediaservices/arm-mediaservices/_meta.json b/sdk/mediaservices/arm-mediaservices/_meta.json index 5159d1dabcbd..37cf0599f575 100644 --- a/sdk/mediaservices/arm-mediaservices/_meta.json +++ b/sdk/mediaservices/arm-mediaservices/_meta.json @@ -1,8 +1,8 @@ { - "commit": "cb00f6da00f783f26204f30ef4d57478cdccbeba", + "commit": "3deff60ad24c1a88d74df95689abe42b26debd87", "readme": "specification/mediaservices/resource-manager/readme.md", - "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\work\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\mediaservices\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1", + "autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/mediaservices/resource-manager/readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220425.1", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.2.6", - "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.3.2", + "use": "@autorest/typescript@6.0.0-alpha.19.20220425.1" } \ No newline at end of file diff --git a/sdk/mediaservices/arm-mediaservices/package.json b/sdk/mediaservices/arm-mediaservices/package.json index cdd2eca1b7e7..c157afe321c4 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": "11.0.1", + "version": "12.0.0", "engines": { "node": ">=12.0.0" }, @@ -40,9 +40,11 @@ "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", - "@azure-tools/test-recorder": "^1.0.0", + "@azure-tools/test-recorder": "^2.0.0", + "@azure-tools/test-credential": "^1.0.0", "mocha": "^7.1.1", - "cross-env": "^7.0.2" + "cross-env": "^7.0.2", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mediaservices/arm-mediaservices", "repository": { @@ -93,7 +95,7 @@ "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", "integration-test:browser": "echo skipped", "docs": "echo skipped" }, @@ -107,4 +109,4 @@ ] }, "autoPublish": true -} +} \ No newline at end of file diff --git a/sdk/mediaservices/arm-mediaservices/review/arm-mediaservices.api.md b/sdk/mediaservices/arm-mediaservices/review/arm-mediaservices.api.md index 93543b6b322c..55370b946256 100644 --- a/sdk/mediaservices/arm-mediaservices/review/arm-mediaservices.api.md +++ b/sdk/mediaservices/arm-mediaservices/review/arm-mediaservices.api.md @@ -417,6 +417,8 @@ export class AzureMediaServices extends coreClient.ServiceClient { // (undocumented) accountFilters: AccountFilters; // (undocumented) + apiVersion: string; + // (undocumented) assetFilters: AssetFilters; // (undocumented) assets: Assets; @@ -431,6 +433,10 @@ export class AzureMediaServices extends coreClient.ServiceClient { // (undocumented) locations: Locations; // (undocumented) + mediaServiceOperationResults: MediaServiceOperationResults; + // (undocumented) + mediaServiceOperationStatuses: MediaServiceOperationStatuses; + // (undocumented) mediaservices: Mediaservices; // (undocumented) operationResults: OperationResults; @@ -459,6 +465,7 @@ export class AzureMediaServices extends coreClient.ServiceClient { // @public export interface AzureMediaServicesOptionalParams extends coreClient.ServiceClientOptions { $host?: string; + apiVersion?: string; endpoint?: string; } @@ -2113,14 +2120,16 @@ export interface LogSpecification { // @public export type MediaService = TrackedResource & { - identity?: MediaServiceIdentity; readonly systemData?: SystemData; + identity?: MediaServiceIdentity; readonly mediaServiceId?: string; storageAccounts?: StorageAccount[]; storageAuthentication?: StorageAuthentication; encryption?: AccountEncryption; keyDelivery?: KeyDelivery; publicNetworkAccess?: PublicNetworkAccess; + readonly provisioningState?: ProvisioningState; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; }; // @public @@ -2139,24 +2148,76 @@ export interface MediaServiceIdentity { }; } +// @public +export interface MediaServiceOperationResults { + get(locationName: string, operationId: string, options?: MediaServiceOperationResultsGetOptionalParams): Promise; +} + +// @public +export interface MediaServiceOperationResultsGetHeaders { + azureAsyncOperation?: string; + location?: string; + retryAfter?: number; +} + +// @public +export interface MediaServiceOperationResultsGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MediaServiceOperationResultsGetResponse = MediaService; + +// @public +export interface MediaServiceOperationStatus { + endTime?: Date; + error?: ErrorDetail; + id?: string; + name: string; + startTime?: Date; + status: string; +} + +// @public +export interface MediaServiceOperationStatuses { + get(locationName: string, operationId: string, options?: MediaServiceOperationStatusesGetOptionalParams): Promise; +} + +// @public +export interface MediaServiceOperationStatusesGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type MediaServiceOperationStatusesGetResponse = MediaServiceOperationStatus; + // @public export interface Mediaservices { - createOrUpdate(resourceGroupName: string, accountName: string, parameters: MediaService, options?: MediaservicesCreateOrUpdateOptionalParams): Promise; + beginCreateOrUpdate(resourceGroupName: string, accountName: string, parameters: MediaService, options?: MediaservicesCreateOrUpdateOptionalParams): Promise, MediaservicesCreateOrUpdateResponse>>; + beginCreateOrUpdateAndWait(resourceGroupName: string, accountName: string, parameters: MediaService, options?: MediaservicesCreateOrUpdateOptionalParams): Promise; + beginUpdate(resourceGroupName: string, accountName: string, parameters: MediaServiceUpdate, options?: MediaservicesUpdateOptionalParams): Promise, MediaservicesUpdateResponse>>; + beginUpdateAndWait(resourceGroupName: string, accountName: string, parameters: MediaServiceUpdate, options?: MediaservicesUpdateOptionalParams): Promise; delete(resourceGroupName: string, accountName: string, options?: MediaservicesDeleteOptionalParams): Promise; get(resourceGroupName: string, accountName: string, options?: MediaservicesGetOptionalParams): Promise; list(resourceGroupName: string, options?: MediaservicesListOptionalParams): PagedAsyncIterableIterator; listBySubscription(options?: MediaservicesListBySubscriptionOptionalParams): PagedAsyncIterableIterator; listEdgePolicies(resourceGroupName: string, accountName: string, parameters: ListEdgePoliciesInput, options?: MediaservicesListEdgePoliciesOptionalParams): Promise; syncStorageKeys(resourceGroupName: string, accountName: string, parameters: SyncStorageKeysInput, options?: MediaservicesSyncStorageKeysOptionalParams): Promise; - update(resourceGroupName: string, accountName: string, parameters: MediaServiceUpdate, options?: MediaservicesUpdateOptionalParams): Promise; +} + +// @public +export interface MediaservicesCreateOrUpdateHeaders { + azureAsyncOperation?: string; + location?: string; + retryAfter?: number; } // @public export interface MediaservicesCreateOrUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public -export type MediaservicesCreateOrUpdateResponse = MediaService; +export type MediaservicesCreateOrUpdateResponse = MediaservicesCreateOrUpdateHeaders & MediaService; // @public export interface MediaservicesDeleteOptionalParams extends coreClient.OperationOptions { @@ -2208,12 +2269,21 @@ export type MediaservicesListResponse = MediaServiceCollection; export interface MediaservicesSyncStorageKeysOptionalParams extends coreClient.OperationOptions { } +// @public +export interface MediaservicesUpdateHeaders { + azureAsyncOperation?: string; + location?: string; + retryAfter?: number; +} + // @public export interface MediaservicesUpdateOptionalParams extends coreClient.OperationOptions { + resumeFrom?: string; + updateIntervalInMs?: number; } // @public -export type MediaservicesUpdateResponse = MediaService; +export type MediaservicesUpdateResponse = MediaservicesUpdateHeaders & MediaService; // @public export interface MediaServiceUpdate { @@ -2221,6 +2291,8 @@ export interface MediaServiceUpdate { identity?: MediaServiceIdentity; keyDelivery?: KeyDelivery; readonly mediaServiceId?: string; + readonly privateEndpointConnections?: PrivateEndpointConnection[]; + readonly provisioningState?: ProvisioningState; publicNetworkAccess?: PublicNetworkAccess; storageAccounts?: StorageAccount[]; // (undocumented) diff --git a/sdk/mediaservices/arm-mediaservices/src/azureMediaServices.ts b/sdk/mediaservices/arm-mediaservices/src/azureMediaServices.ts index c35cf90c9850..66e72617ba88 100644 --- a/sdk/mediaservices/arm-mediaservices/src/azureMediaServices.ts +++ b/sdk/mediaservices/arm-mediaservices/src/azureMediaServices.ts @@ -8,6 +8,11 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest +} from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { AccountFiltersImpl, @@ -16,6 +21,8 @@ import { PrivateLinkResourcesImpl, PrivateEndpointConnectionsImpl, LocationsImpl, + MediaServiceOperationStatusesImpl, + MediaServiceOperationResultsImpl, AssetsImpl, AssetFiltersImpl, TracksImpl, @@ -37,6 +44,8 @@ import { PrivateLinkResources, PrivateEndpointConnections, Locations, + MediaServiceOperationStatuses, + MediaServiceOperationResults, Assets, AssetFilters, Tracks, @@ -56,6 +65,7 @@ import { AzureMediaServicesOptionalParams } from "./models"; export class AzureMediaServices extends coreClient.ServiceClient { $host: string; subscriptionId: string; + apiVersion: string; /** * Initializes a new instance of the AzureMediaServices class. @@ -84,7 +94,7 @@ export class AzureMediaServices extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-mediaservices/11.0.1`; + const packageDetails = `azsdk-js-arm-mediaservices/12.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -131,12 +141,19 @@ export class AzureMediaServices extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-11-01"; this.accountFilters = new AccountFiltersImpl(this); this.operations = new OperationsImpl(this); this.mediaservices = new MediaservicesImpl(this); this.privateLinkResources = new PrivateLinkResourcesImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); this.locations = new LocationsImpl(this); + this.mediaServiceOperationStatuses = new MediaServiceOperationStatusesImpl( + this + ); + this.mediaServiceOperationResults = new MediaServiceOperationResultsImpl( + this + ); this.assets = new AssetsImpl(this); this.assetFilters = new AssetFiltersImpl(this); this.tracks = new TracksImpl(this); @@ -150,6 +167,35 @@ export class AzureMediaServices extends coreClient.ServiceClient { this.liveEvents = new LiveEventsImpl(this); this.liveOutputs = new LiveOutputsImpl(this); this.streamingEndpoints = new StreamingEndpointsImpl(this); + this.addCustomApiVersionPolicy(options.apiVersion); + } + + /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */ + private addCustomApiVersionPolicy(apiVersion?: string) { + if (!apiVersion) { + return; + } + const apiVersionPolicy = { + name: "CustomApiVersionPolicy", + async sendRequest( + request: PipelineRequest, + next: SendRequest + ): Promise { + const param = request.url.split("?"); + if (param.length > 1) { + const newParams = param[1].split("&").map((item) => { + if (item.indexOf("api-version") > -1) { + return item.replace(/(?<==).*$/, apiVersion); + } else { + return item; + } + }); + request.url = param[0] + "?" + newParams.join("&"); + } + return next(request); + } + }; + this.pipeline.addPolicy(apiVersionPolicy); } accountFilters: AccountFilters; @@ -158,6 +204,8 @@ export class AzureMediaServices extends coreClient.ServiceClient { privateLinkResources: PrivateLinkResources; privateEndpointConnections: PrivateEndpointConnections; locations: Locations; + mediaServiceOperationStatuses: MediaServiceOperationStatuses; + mediaServiceOperationResults: MediaServiceOperationResults; assets: Assets; assetFilters: AssetFilters; tracks: Tracks; diff --git a/sdk/mediaservices/arm-mediaservices/src/models/index.ts b/sdk/mediaservices/arm-mediaservices/src/models/index.ts index a8860973794d..eadb01722851 100644 --- a/sdk/mediaservices/arm-mediaservices/src/models/index.ts +++ b/sdk/mediaservices/arm-mediaservices/src/models/index.ts @@ -433,6 +433,25 @@ export interface AccessControl { ipAllowList?: string[]; } +/** The Private Endpoint resource. */ +export interface PrivateEndpoint { + /** + * The ARM identifier for Private Endpoint + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly id?: string; +} + +/** A collection of information about the state of the connection between service consumer and provider. */ +export interface PrivateLinkServiceConnectionState { + /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ + status?: PrivateEndpointServiceConnectionStatus; + /** The reason for approval/rejection of the connection. */ + description?: string; + /** A message indicating if changes on the service provider require any updates on the consumer. */ + actionsRequired?: string; +} + export interface MediaServiceIdentity { /** The identity type. */ type: string; @@ -485,6 +504,16 @@ export interface MediaServiceUpdate { keyDelivery?: KeyDelivery; /** Whether or not public network access is allowed for resources under the Media Services account. */ publicNetworkAccess?: PublicNetworkAccess; + /** + * Provisioning state of the Media Services account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** + * The Private Endpoint Connections created for the Media Service account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; } /** The input to the sync storage keys request. */ @@ -534,25 +563,6 @@ export interface PrivateEndpointConnectionListResult { value?: PrivateEndpointConnection[]; } -/** The Private Endpoint resource. */ -export interface PrivateEndpoint { - /** - * The ARM identifier for Private Endpoint - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly id?: string; -} - -/** A collection of information about the state of the connection between service consumer and provider. */ -export interface PrivateLinkServiceConnectionState { - /** Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. */ - status?: PrivateEndpointServiceConnectionStatus; - /** The reason for approval/rejection of the connection. */ - description?: string; - /** A message indicating if changes on the service provider require any updates on the consumer. */ - actionsRequired?: string; -} - /** The input to the check name availability request. */ export interface CheckNameAvailabilityInput { /** The account name. */ @@ -571,6 +581,22 @@ export interface EntityNameAvailabilityCheckOutput { message?: string; } +/** Status of media service operation. */ +export interface MediaServiceOperationStatus { + /** Operation identifier. */ + name: string; + /** Operation resource ID. */ + id?: string; + /** Operation start time. */ + startTime?: Date; + /** Operation end time. */ + endTime?: Date; + /** Operation status. */ + status: string; + /** The error detail. */ + error?: ErrorDetail; +} + /** A collection of Asset items. */ export interface AssetCollection { /** A collection of Asset items. */ @@ -1579,6 +1605,19 @@ export interface ClipTime { /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ export type ProxyResource = Resource & {}; +/** The Private Endpoint Connection resource. */ +export type PrivateEndpointConnection = Resource & { + /** The resource of private end point. */ + privateEndpoint?: PrivateEndpoint; + /** A collection of information about the state of the connection between service consumer and provider. */ + privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; + /** + * The provisioning state of the private endpoint connection resource. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: PrivateEndpointConnectionProvisioningState; +}; + /** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ export type TrackedResource = Resource & { /** Resource tags. */ @@ -1603,19 +1642,6 @@ export type PrivateLinkResource = Resource & { requiredZoneNames?: string[]; }; -/** The Private Endpoint Connection resource. */ -export type PrivateEndpointConnection = Resource & { - /** The resource of private end point. */ - privateEndpoint?: PrivateEndpoint; - /** A collection of information about the state of the connection between service consumer and provider. */ - privateLinkServiceConnectionState?: PrivateLinkServiceConnectionState; - /** - * The provisioning state of the private endpoint connection resource. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: PrivateEndpointConnectionProvisioningState; -}; - /** Represents an audio track in the asset. */ export type AudioTrack = TrackBase & { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -2309,13 +2335,13 @@ export type LiveOutput = ProxyResource & { /** A Media Services account. */ export type MediaService = TrackedResource & { - /** The Managed Identity for the Media Services account. */ - identity?: MediaServiceIdentity; /** * The system metadata relating to this resource. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly systemData?: SystemData; + /** The Managed Identity for the Media Services account. */ + identity?: MediaServiceIdentity; /** * The Media Services account ID. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -2330,6 +2356,16 @@ export type MediaService = TrackedResource & { keyDelivery?: KeyDelivery; /** Whether or not public network access is allowed for resources under the Media Services account. */ publicNetworkAccess?: PublicNetworkAccess; + /** + * Provisioning state of the Media Services account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: ProvisioningState; + /** + * The Private Endpoint Connections created for the Media Service account. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly privateEndpointConnections?: PrivateEndpointConnection[]; }; /** The live event. */ @@ -2625,6 +2661,36 @@ export type PngImage = Image & { layers?: PngLayer[]; }; +/** Defines headers for Mediaservices_createOrUpdate operation. */ +export interface MediaservicesCreateOrUpdateHeaders { + /** The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation. */ + retryAfter?: number; + /** The URI to poll for completion status. */ + location?: string; + /** The URI to poll for completion status. */ + azureAsyncOperation?: string; +} + +/** Defines headers for Mediaservices_update operation. */ +export interface MediaservicesUpdateHeaders { + /** The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation. */ + retryAfter?: number; + /** The URI to poll for completion status. */ + location?: string; + /** The URI to poll for completion status. */ + azureAsyncOperation?: string; +} + +/** Defines headers for MediaServiceOperationResults_get operation. */ +export interface MediaServiceOperationResultsGetHeaders { + /** The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation. */ + retryAfter?: number; + /** The URI to poll for completion status. */ + location?: string; + /** The URI to poll for completion status. */ + azureAsyncOperation?: string; +} + /** Defines headers for Tracks_createOrUpdate operation. */ export interface TracksCreateOrUpdateHeaders { /** The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation. */ @@ -2890,6 +2956,27 @@ export enum KnownPublicNetworkAccess { */ export type PublicNetworkAccess = string; +/** Known values of {@link ProvisioningState} that the service accepts. */ +export enum KnownProvisioningState { + /** Provisioning state failed. */ + Failed = "Failed", + /** Provisioning state in progress. */ + InProgress = "InProgress", + /** Provisioning state succeeded. */ + Succeeded = "Succeeded" +} + +/** + * Defines values for ProvisioningState. \ + * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Failed**: Provisioning state failed. \ + * **InProgress**: Provisioning state in progress. \ + * **Succeeded**: Provisioning state succeeded. + */ +export type ProvisioningState = string; + /** Known values of {@link PrivateEndpointServiceConnectionStatus} that the service accepts. */ export enum KnownPrivateEndpointServiceConnectionStatus { Pending = "Pending", @@ -2967,27 +3054,6 @@ export enum KnownAssetContainerPermission { */ export type AssetContainerPermission = string; -/** Known values of {@link ProvisioningState} that the service accepts. */ -export enum KnownProvisioningState { - /** Provisioning state failed. */ - Failed = "Failed", - /** Provisioning state in progress. */ - InProgress = "InProgress", - /** Provisioning state succeeded. */ - Succeeded = "Succeeded" -} - -/** - * Defines values for ProvisioningState. \ - * {@link KnownProvisioningState} can be used interchangeably with ProvisioningState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Failed**: Provisioning state failed. \ - * **InProgress**: Provisioning state in progress. \ - * **Succeeded**: Provisioning state succeeded. - */ -export type ProvisioningState = string; - /** Known values of {@link OnErrorType} that the service accepts. */ export enum KnownOnErrorType { /** Tells the service that if this TransformOutput fails, then any other incomplete TransformOutputs can be stopped. */ @@ -4143,10 +4209,16 @@ export type MediaservicesGetResponse = MediaService; /** Optional parameters. */ export interface MediaservicesCreateOrUpdateOptionalParams - extends coreClient.OperationOptions {} + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} /** Contains response data for the createOrUpdate operation. */ -export type MediaservicesCreateOrUpdateResponse = MediaService; +export type MediaservicesCreateOrUpdateResponse = MediaservicesCreateOrUpdateHeaders & + MediaService; /** Optional parameters. */ export interface MediaservicesDeleteOptionalParams @@ -4154,10 +4226,16 @@ export interface MediaservicesDeleteOptionalParams /** Optional parameters. */ export interface MediaservicesUpdateOptionalParams - extends coreClient.OperationOptions {} + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} /** Contains response data for the update operation. */ -export type MediaservicesUpdateResponse = MediaService; +export type MediaservicesUpdateResponse = MediaservicesUpdateHeaders & + MediaService; /** Optional parameters. */ export interface MediaservicesSyncStorageKeysOptionalParams @@ -4237,6 +4315,20 @@ export interface LocationsCheckNameAvailabilityOptionalParams /** Contains response data for the checkNameAvailability operation. */ export type LocationsCheckNameAvailabilityResponse = EntityNameAvailabilityCheckOutput; +/** Optional parameters. */ +export interface MediaServiceOperationStatusesGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type MediaServiceOperationStatusesGetResponse = MediaServiceOperationStatus; + +/** Optional parameters. */ +export interface MediaServiceOperationResultsGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type MediaServiceOperationResultsGetResponse = MediaService; + /** Optional parameters. */ export interface AssetsListOptionalParams extends coreClient.OperationOptions { /** Restricts the set of items returned. */ @@ -4915,6 +5007,8 @@ export interface AzureMediaServicesOptionalParams extends coreClient.ServiceClientOptions { /** server parameter */ $host?: string; + /** Api Version */ + apiVersion?: string; /** Overrides client endpoint. */ endpoint?: string; } diff --git a/sdk/mediaservices/arm-mediaservices/src/models/mappers.ts b/sdk/mediaservices/arm-mediaservices/src/models/mappers.ts index 8e83da0c9e83..24064957a3f7 100644 --- a/sdk/mediaservices/arm-mediaservices/src/models/mappers.ts +++ b/sdk/mediaservices/arm-mediaservices/src/models/mappers.ts @@ -829,6 +829,49 @@ export const AccessControl: coreClient.CompositeMapper = { } }; +export const PrivateEndpoint: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpoint", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + +export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState", + modelProperties: { + status: { + serializedName: "status", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + actionsRequired: { + serializedName: "actionsRequired", + type: { + name: "String" + } + } + } + } +}; + export const MediaServiceIdentity: coreClient.CompositeMapper = { type: { name: "Composite", @@ -963,6 +1006,26 @@ export const MediaServiceUpdate: coreClient.CompositeMapper = { type: { name: "String" } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + privateEndpointConnections: { + serializedName: "properties.privateEndpointConnections", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } } } } @@ -1117,14 +1180,19 @@ export const PrivateEndpointConnectionListResult: coreClient.CompositeMapper = { } }; -export const PrivateEndpoint: coreClient.CompositeMapper = { +export const CheckNameAvailabilityInput: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateEndpoint", + className: "CheckNameAvailabilityInput", modelProperties: { - id: { - serializedName: "id", - readOnly: true, + name: { + serializedName: "name", + type: { + name: "String" + } + }, + type: { + serializedName: "type", type: { name: "String" } @@ -1133,25 +1201,26 @@ export const PrivateEndpoint: coreClient.CompositeMapper = { } }; -export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { +export const EntityNameAvailabilityCheckOutput: coreClient.CompositeMapper = { type: { name: "Composite", - className: "PrivateLinkServiceConnectionState", + className: "EntityNameAvailabilityCheckOutput", modelProperties: { - status: { - serializedName: "status", + nameAvailable: { + serializedName: "nameAvailable", + required: true, type: { - name: "String" + name: "Boolean" } }, - description: { - serializedName: "description", + reason: { + serializedName: "reason", type: { name: "String" } }, - actionsRequired: { - serializedName: "actionsRequired", + message: { + serializedName: "message", type: { name: "String" } @@ -1160,50 +1229,49 @@ export const PrivateLinkServiceConnectionState: coreClient.CompositeMapper = { } }; -export const CheckNameAvailabilityInput: coreClient.CompositeMapper = { +export const MediaServiceOperationStatus: coreClient.CompositeMapper = { type: { name: "Composite", - className: "CheckNameAvailabilityInput", + className: "MediaServiceOperationStatus", modelProperties: { name: { serializedName: "name", + required: true, type: { name: "String" } }, - type: { - serializedName: "type", + id: { + serializedName: "id", type: { name: "String" } - } - } - } -}; - -export const EntityNameAvailabilityCheckOutput: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "EntityNameAvailabilityCheckOutput", - modelProperties: { - nameAvailable: { - serializedName: "nameAvailable", - required: true, + }, + startTime: { + serializedName: "startTime", type: { - name: "Boolean" + name: "DateTime" } }, - reason: { - serializedName: "reason", + endTime: { + serializedName: "endTime", type: { - name: "String" + name: "DateTime" } }, - message: { - serializedName: "message", + status: { + serializedName: "status", + required: true, type: { name: "String" } + }, + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorDetail" + } } } } @@ -3938,6 +4006,37 @@ export const ProxyResource: coreClient.CompositeMapper = { } }; +export const PrivateEndpointConnection: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpointConnection", + modelProperties: { + ...Resource.type.modelProperties, + privateEndpoint: { + serializedName: "properties.privateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint" + } + }, + privateLinkServiceConnectionState: { + serializedName: "properties.privateLinkServiceConnectionState", + type: { + name: "Composite", + className: "PrivateLinkServiceConnectionState" + } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + } + } + } +}; + export const TrackedResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -4002,37 +4101,6 @@ export const PrivateLinkResource: coreClient.CompositeMapper = { } }; -export const PrivateEndpointConnection: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "PrivateEndpointConnection", - modelProperties: { - ...Resource.type.modelProperties, - privateEndpoint: { - serializedName: "properties.privateEndpoint", - type: { - name: "Composite", - className: "PrivateEndpoint" - } - }, - privateLinkServiceConnectionState: { - serializedName: "properties.privateLinkServiceConnectionState", - type: { - name: "Composite", - className: "PrivateLinkServiceConnectionState" - } - }, - provisioningState: { - serializedName: "properties.provisioningState", - readOnly: true, - type: { - name: "String" - } - } - } - } -}; - export const AudioTrack: coreClient.CompositeMapper = { serializedName: "#Microsoft.Media.AudioTrack", type: { @@ -5770,18 +5838,18 @@ export const MediaService: coreClient.CompositeMapper = { className: "MediaService", modelProperties: { ...TrackedResource.type.modelProperties, - identity: { - serializedName: "identity", + systemData: { + serializedName: "systemData", type: { name: "Composite", - className: "MediaServiceIdentity" + className: "SystemData" } }, - systemData: { - serializedName: "systemData", + identity: { + serializedName: "identity", type: { name: "Composite", - className: "SystemData" + className: "MediaServiceIdentity" } }, mediaServiceId: { @@ -5830,6 +5898,26 @@ export const MediaService: coreClient.CompositeMapper = { type: { name: "String" } + }, + provisioningState: { + serializedName: "properties.provisioningState", + readOnly: true, + type: { + name: "String" + } + }, + privateEndpointConnections: { + serializedName: "properties.privateEndpointConnections", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PrivateEndpointConnection" + } + } + } } } } @@ -6574,6 +6662,87 @@ export const PngImage: coreClient.CompositeMapper = { } }; +export const MediaservicesCreateOrUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MediaservicesCreateOrUpdateHeaders", + modelProperties: { + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const MediaservicesUpdateHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MediaservicesUpdateHeaders", + modelProperties: { + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + +export const MediaServiceOperationResultsGetHeaders: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "MediaServiceOperationResultsGetHeaders", + modelProperties: { + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + }, + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String" + } + } + } + } +}; + export const TracksCreateOrUpdateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", diff --git a/sdk/mediaservices/arm-mediaservices/src/models/parameters.ts b/sdk/mediaservices/arm-mediaservices/src/models/parameters.ts index 93d529512882..4e65ba76b313 100644 --- a/sdk/mediaservices/arm-mediaservices/src/models/parameters.ts +++ b/sdk/mediaservices/arm-mediaservices/src/models/parameters.ts @@ -144,18 +144,6 @@ export const nextLink: OperationURLParameter = { skipEncoding: true }; -export const apiVersion1: OperationQueryParameter = { - parameterPath: "apiVersion", - mapper: { - defaultValue: "2021-06-01", - isConstant: true, - serializedName: "api-version", - type: { - name: "String" - } - } -}; - export const parameters1: OperationParameter = { parameterPath: "parameters", mapper: MediaServiceMapper @@ -208,6 +196,17 @@ export const locationName: OperationURLParameter = { } }; +export const operationId: OperationURLParameter = { + parameterPath: "operationId", + mapper: { + serializedName: "operationId", + required: true, + type: { + name: "String" + } + } +}; + export const filter: OperationQueryParameter = { parameterPath: ["options", "filter"], mapper: { @@ -280,17 +279,6 @@ export const parameters10: OperationParameter = { mapper: AssetTrackMapper }; -export const operationId: OperationURLParameter = { - parameterPath: "operationId", - mapper: { - serializedName: "operationId", - required: true, - type: { - name: "String" - } - } -}; - export const contentKeyPolicyName: OperationURLParameter = { parameterPath: "contentKeyPolicyName", mapper: { diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/index.ts b/sdk/mediaservices/arm-mediaservices/src/operations/index.ts index 1d4fcf201112..88496fe72530 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/index.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/index.ts @@ -12,6 +12,8 @@ export * from "./mediaservices"; export * from "./privateLinkResources"; export * from "./privateEndpointConnections"; export * from "./locations"; +export * from "./mediaServiceOperationStatuses"; +export * from "./mediaServiceOperationResults"; export * from "./assets"; export * from "./assetFilters"; export * from "./tracks"; diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/locations.ts b/sdk/mediaservices/arm-mediaservices/src/operations/locations.ts index 3cc0a18e8df2..f167708200d2 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/locations.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/locations.ts @@ -31,7 +31,7 @@ export class LocationsImpl implements Locations { /** * Checks whether the Media Service resource name is available. - * @param locationName The name of the location + * @param locationName Location name. * @param parameters The request parameters * @param options The options parameters. */ @@ -62,7 +62,7 @@ const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.parameters6, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/mediaServiceOperationResults.ts b/sdk/mediaservices/arm-mediaservices/src/operations/mediaServiceOperationResults.ts new file mode 100644 index 000000000000..1110c539663f --- /dev/null +++ b/sdk/mediaservices/arm-mediaservices/src/operations/mediaServiceOperationResults.ts @@ -0,0 +1,76 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { MediaServiceOperationResults } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureMediaServices } from "../azureMediaServices"; +import { + MediaServiceOperationResultsGetOptionalParams, + MediaServiceOperationResultsGetResponse +} from "../models"; + +/** Class containing MediaServiceOperationResults operations. */ +export class MediaServiceOperationResultsImpl + implements MediaServiceOperationResults { + private readonly client: AzureMediaServices; + + /** + * Initialize a new instance of the class MediaServiceOperationResults class. + * @param client Reference to the service client + */ + constructor(client: AzureMediaServices) { + this.client = client; + } + + /** + * Get media service operation result. + * @param locationName Location name. + * @param operationId Operation Id. + * @param options The options parameters. + */ + get( + locationName: string, + operationId: string, + options?: MediaServiceOperationResultsGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { locationName, operationId, options }, + getOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/mediaServiceOperationResults/{operationId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MediaService + }, + 202: { + headersMapper: Mappers.MediaServiceOperationResultsGetHeaders + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.locationName, + Parameters.operationId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/mediaServiceOperationStatuses.ts b/sdk/mediaservices/arm-mediaservices/src/operations/mediaServiceOperationStatuses.ts new file mode 100644 index 000000000000..fc39dc16f19c --- /dev/null +++ b/sdk/mediaservices/arm-mediaservices/src/operations/mediaServiceOperationStatuses.ts @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { MediaServiceOperationStatuses } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { AzureMediaServices } from "../azureMediaServices"; +import { + MediaServiceOperationStatusesGetOptionalParams, + MediaServiceOperationStatusesGetResponse +} from "../models"; + +/** Class containing MediaServiceOperationStatuses operations. */ +export class MediaServiceOperationStatusesImpl + implements MediaServiceOperationStatuses { + private readonly client: AzureMediaServices; + + /** + * Initialize a new instance of the class MediaServiceOperationStatuses class. + * @param client Reference to the service client + */ + constructor(client: AzureMediaServices) { + this.client = client; + } + + /** + * Get media service operation status. + * @param locationName Location name. + * @param operationId Operation ID. + * @param options The options parameters. + */ + get( + locationName: string, + operationId: string, + options?: MediaServiceOperationStatusesGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { locationName, operationId, options }, + getOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/providers/Microsoft.Media/locations/{locationName}/mediaServiceOperationStatuses/{operationId}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.MediaServiceOperationStatus + }, + default: { + bodyMapper: Mappers.ErrorResponse + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.locationName, + Parameters.operationId + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/mediaservices.ts b/sdk/mediaservices/arm-mediaservices/src/operations/mediaservices.ts index 01d31efd8e00..1c95ab075d80 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/mediaservices.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/mediaservices.ts @@ -12,6 +12,8 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { AzureMediaServices } from "../azureMediaServices"; +import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; +import { LroImpl } from "../lroImpl"; import { MediaService, MediaservicesListNextOptionalParams, @@ -181,16 +183,89 @@ export class MediaservicesImpl implements Mediaservices { * @param parameters The request parameters * @param options The options parameters. */ - createOrUpdate( + async beginCreateOrUpdate( resourceGroupName: string, accountName: string, parameters: MediaService, options?: MediaservicesCreateOrUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( + ): Promise< + PollerLike< + PollOperationState, + MediaservicesCreateOrUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { resourceGroupName, accountName, parameters, options }, createOrUpdateOperationSpec ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Creates or updates a Media Services account + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @param options The options parameters. + */ + async beginCreateOrUpdateAndWait( + resourceGroupName: string, + accountName: string, + parameters: MediaService, + options?: MediaservicesCreateOrUpdateOptionalParams + ): Promise { + const poller = await this.beginCreateOrUpdate( + resourceGroupName, + accountName, + parameters, + options + ); + return poller.pollUntilDone(); } /** @@ -217,16 +292,89 @@ export class MediaservicesImpl implements Mediaservices { * @param parameters The request parameters * @param options The options parameters. */ - update( + async beginUpdate( resourceGroupName: string, accountName: string, parameters: MediaServiceUpdate, options?: MediaservicesUpdateOptionalParams - ): Promise { - return this.client.sendOperationRequest( + ): Promise< + PollerLike< + PollOperationState, + MediaservicesUpdateResponse + > + > { + const directSendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ): Promise => { + return this.client.sendOperationRequest(args, spec); + }; + const sendOperation = async ( + args: coreClient.OperationArguments, + spec: coreClient.OperationSpec + ) => { + let currentRawResponse: + | coreClient.FullOperationResponse + | undefined = undefined; + const providedCallback = args.options?.onResponse; + const callback: coreClient.RawResponseCallback = ( + rawResponse: coreClient.FullOperationResponse, + flatResponse: unknown + ) => { + currentRawResponse = rawResponse; + providedCallback?.(rawResponse, flatResponse); + }; + const updatedArgs = { + ...args, + options: { + ...args.options, + onResponse: callback + } + }; + const flatResponse = await directSendOperation(updatedArgs, spec); + return { + flatResponse, + rawResponse: { + statusCode: currentRawResponse!.status, + body: currentRawResponse!.parsedBody, + headers: currentRawResponse!.headers.toJSON() + } + }; + }; + + const lro = new LroImpl( + sendOperation, { resourceGroupName, accountName, parameters, options }, updateOperationSpec ); + const poller = new LroEngine(lro, { + resumeFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs + }); + await poller.poll(); + return poller; + } + + /** + * Updates an existing Media Services account + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @param options The options parameters. + */ + async beginUpdateAndWait( + resourceGroupName: string, + accountName: string, + parameters: MediaServiceUpdate, + options?: MediaservicesUpdateOptionalParams + ): Promise { + const poller = await this.beginUpdate( + resourceGroupName, + accountName, + parameters, + options + ); + return poller.pollUntilDone(); } /** @@ -249,7 +397,7 @@ export class MediaservicesImpl implements Mediaservices { } /** - * List the media edge policies associated with the Media Services account. + * List all the media edge policies associated with the Media Services account. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param parameters The request parameters @@ -327,7 +475,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -348,7 +496,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -364,17 +512,27 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { httpMethod: "PUT", responses: { 200: { - bodyMapper: Mappers.MediaService + bodyMapper: Mappers.MediaService, + headersMapper: Mappers.MediaservicesCreateOrUpdateHeaders }, 201: { - bodyMapper: Mappers.MediaService + bodyMapper: Mappers.MediaService, + headersMapper: Mappers.MediaservicesCreateOrUpdateHeaders + }, + 202: { + bodyMapper: Mappers.MediaService, + headersMapper: Mappers.MediaservicesCreateOrUpdateHeaders + }, + 204: { + bodyMapper: Mappers.MediaService, + headersMapper: Mappers.MediaservicesCreateOrUpdateHeaders }, default: { bodyMapper: Mappers.ErrorResponse } }, requestBody: Parameters.parameters1, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -396,7 +554,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -412,14 +570,27 @@ const updateOperationSpec: coreClient.OperationSpec = { httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.MediaService + bodyMapper: Mappers.MediaService, + headersMapper: Mappers.MediaservicesUpdateHeaders + }, + 201: { + bodyMapper: Mappers.MediaService, + headersMapper: Mappers.MediaservicesUpdateHeaders + }, + 202: { + bodyMapper: Mappers.MediaService, + headersMapper: Mappers.MediaservicesUpdateHeaders + }, + 204: { + bodyMapper: Mappers.MediaService, + headersMapper: Mappers.MediaservicesUpdateHeaders }, default: { bodyMapper: Mappers.ErrorResponse } }, requestBody: Parameters.parameters2, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -441,7 +612,7 @@ const syncStorageKeysOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.parameters3, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -465,7 +636,7 @@ const listEdgePoliciesOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.parameters4, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -488,7 +659,7 @@ const listBySubscriptionOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host, Parameters.subscriptionId], headerParameters: [Parameters.accept], serializer @@ -504,7 +675,7 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -525,7 +696,7 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/operationResults.ts b/sdk/mediaservices/arm-mediaservices/src/operations/operationResults.ts index e7d6c962f131..906bad92d420 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/operationResults.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/operationResults.ts @@ -83,9 +83,9 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, + Parameters.operationId, Parameters.assetName, - Parameters.trackName, - Parameters.operationId + Parameters.trackName ], headerParameters: [Parameters.accept], serializer diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/operationStatuses.ts b/sdk/mediaservices/arm-mediaservices/src/operations/operationStatuses.ts index 1c8cfe74fcca..3f72de69bfb0 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/operationStatuses.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/operationStatuses.ts @@ -79,9 +79,9 @@ const getOperationSpec: coreClient.OperationSpec = { Parameters.subscriptionId, Parameters.resourceGroupName, Parameters.accountName, + Parameters.operationId, Parameters.assetName, - Parameters.trackName, - Parameters.operationId + Parameters.trackName ], headerParameters: [Parameters.accept], serializer diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/operations.ts b/sdk/mediaservices/arm-mediaservices/src/operations/operations.ts index dc6ce7f44e8d..cc4a1f076723 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/operations.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/operations.ts @@ -52,7 +52,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [Parameters.$host], headerParameters: [Parameters.accept], serializer diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/privateEndpointConnections.ts b/sdk/mediaservices/arm-mediaservices/src/operations/privateEndpointConnections.ts index b5e3d0443810..aa557e7bdecb 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/privateEndpointConnections.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/privateEndpointConnections.ts @@ -36,7 +36,7 @@ export class PrivateEndpointConnectionsImpl } /** - * Get all private endpoint connections. + * List all private endpoint connections. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param options The options parameters. @@ -53,7 +53,7 @@ export class PrivateEndpointConnectionsImpl } /** - * Get private endpoint connection. + * Get the details of a private endpoint connection. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param name @@ -72,7 +72,7 @@ export class PrivateEndpointConnectionsImpl } /** - * Update private endpoint connection. + * Update an existing private endpoint connection. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param name @@ -93,7 +93,7 @@ export class PrivateEndpointConnectionsImpl } /** - * Delete private endpoint connection. + * Deletes a private endpoint connection. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param name @@ -126,7 +126,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -148,7 +148,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -172,7 +172,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { } }, requestBody: Parameters.parameters5, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -195,7 +195,7 @@ const deleteOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/mediaservices/arm-mediaservices/src/operations/privateLinkResources.ts b/sdk/mediaservices/arm-mediaservices/src/operations/privateLinkResources.ts index 2aadf3c45b4e..182ad828259c 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operations/privateLinkResources.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operations/privateLinkResources.ts @@ -31,7 +31,7 @@ export class PrivateLinkResourcesImpl implements PrivateLinkResources { } /** - * Get list of group IDs. + * List supported group IDs. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param options The options parameters. @@ -48,7 +48,7 @@ export class PrivateLinkResourcesImpl implements PrivateLinkResources { } /** - * Get group ID. + * Get details of a group ID. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param name @@ -81,7 +81,7 @@ const listOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -103,7 +103,7 @@ const getOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse } }, - queryParameters: [Parameters.apiVersion1], + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/index.ts b/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/index.ts index 1d4fcf201112..88496fe72530 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/index.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/index.ts @@ -12,6 +12,8 @@ export * from "./mediaservices"; export * from "./privateLinkResources"; export * from "./privateEndpointConnections"; export * from "./locations"; +export * from "./mediaServiceOperationStatuses"; +export * from "./mediaServiceOperationResults"; export * from "./assets"; export * from "./assetFilters"; export * from "./tracks"; diff --git a/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/locations.ts b/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/locations.ts index a0136428a5fb..a1cbf30d755a 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/locations.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/locations.ts @@ -16,7 +16,7 @@ import { export interface Locations { /** * Checks whether the Media Service resource name is available. - * @param locationName The name of the location + * @param locationName Location name. * @param parameters The request parameters * @param options The options parameters. */ diff --git a/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/mediaServiceOperationResults.ts b/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/mediaServiceOperationResults.ts new file mode 100644 index 000000000000..a6907e02cff2 --- /dev/null +++ b/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/mediaServiceOperationResults.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + MediaServiceOperationResultsGetOptionalParams, + MediaServiceOperationResultsGetResponse +} from "../models"; + +/** Interface representing a MediaServiceOperationResults. */ +export interface MediaServiceOperationResults { + /** + * Get media service operation result. + * @param locationName Location name. + * @param operationId Operation Id. + * @param options The options parameters. + */ + get( + locationName: string, + operationId: string, + options?: MediaServiceOperationResultsGetOptionalParams + ): Promise; +} diff --git a/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/mediaServiceOperationStatuses.ts b/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/mediaServiceOperationStatuses.ts new file mode 100644 index 000000000000..a1b129d8b17e --- /dev/null +++ b/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/mediaServiceOperationStatuses.ts @@ -0,0 +1,27 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + MediaServiceOperationStatusesGetOptionalParams, + MediaServiceOperationStatusesGetResponse +} from "../models"; + +/** Interface representing a MediaServiceOperationStatuses. */ +export interface MediaServiceOperationStatuses { + /** + * Get media service operation status. + * @param locationName Location name. + * @param operationId Operation ID. + * @param options The options parameters. + */ + get( + locationName: string, + operationId: string, + options?: MediaServiceOperationStatusesGetOptionalParams + ): Promise; +} diff --git a/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/mediaservices.ts b/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/mediaservices.ts index 2e9a6601680b..d619e85c1d59 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/mediaservices.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/mediaservices.ts @@ -7,6 +7,7 @@ */ import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PollerLike, PollOperationState } from "@azure/core-lro"; import { MediaService, MediaservicesListOptionalParams, @@ -63,7 +64,25 @@ export interface Mediaservices { * @param parameters The request parameters * @param options The options parameters. */ - createOrUpdate( + beginCreateOrUpdate( + resourceGroupName: string, + accountName: string, + parameters: MediaService, + options?: MediaservicesCreateOrUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + MediaservicesCreateOrUpdateResponse + > + >; + /** + * Creates or updates a Media Services account + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @param options The options parameters. + */ + beginCreateOrUpdateAndWait( resourceGroupName: string, accountName: string, parameters: MediaService, @@ -87,7 +106,25 @@ export interface Mediaservices { * @param parameters The request parameters * @param options The options parameters. */ - update( + beginUpdate( + resourceGroupName: string, + accountName: string, + parameters: MediaServiceUpdate, + options?: MediaservicesUpdateOptionalParams + ): Promise< + PollerLike< + PollOperationState, + MediaservicesUpdateResponse + > + >; + /** + * Updates an existing Media Services account + * @param resourceGroupName The name of the resource group within the Azure subscription. + * @param accountName The Media Services account name. + * @param parameters The request parameters + * @param options The options parameters. + */ + beginUpdateAndWait( resourceGroupName: string, accountName: string, parameters: MediaServiceUpdate, @@ -107,7 +144,7 @@ export interface Mediaservices { options?: MediaservicesSyncStorageKeysOptionalParams ): Promise; /** - * List the media edge policies associated with the Media Services account. + * List all the media edge policies associated with the Media Services account. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param parameters The request parameters diff --git a/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/privateEndpointConnections.ts b/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/privateEndpointConnections.ts index a3c10ed2afbf..677777ba1c9c 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/privateEndpointConnections.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/privateEndpointConnections.ts @@ -20,7 +20,7 @@ import { /** Interface representing a PrivateEndpointConnections. */ export interface PrivateEndpointConnections { /** - * Get all private endpoint connections. + * List all private endpoint connections. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param options The options parameters. @@ -31,7 +31,7 @@ export interface PrivateEndpointConnections { options?: PrivateEndpointConnectionsListOptionalParams ): Promise; /** - * Get private endpoint connection. + * Get the details of a private endpoint connection. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param name @@ -44,7 +44,7 @@ export interface PrivateEndpointConnections { options?: PrivateEndpointConnectionsGetOptionalParams ): Promise; /** - * Update private endpoint connection. + * Update an existing private endpoint connection. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param name @@ -59,7 +59,7 @@ export interface PrivateEndpointConnections { options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams ): Promise; /** - * Delete private endpoint connection. + * Deletes a private endpoint connection. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param name diff --git a/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/privateLinkResources.ts b/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/privateLinkResources.ts index 15a6530d6f4d..756adfc7a560 100644 --- a/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/privateLinkResources.ts +++ b/sdk/mediaservices/arm-mediaservices/src/operationsInterfaces/privateLinkResources.ts @@ -16,7 +16,7 @@ import { /** Interface representing a PrivateLinkResources. */ export interface PrivateLinkResources { /** - * Get list of group IDs. + * List supported group IDs. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param options The options parameters. @@ -27,7 +27,7 @@ export interface PrivateLinkResources { options?: PrivateLinkResourcesListOptionalParams ): Promise; /** - * Get group ID. + * Get details of a group ID. * @param resourceGroupName The name of the resource group within the Azure subscription. * @param accountName The Media Services account name. * @param name diff --git a/sdk/mediaservices/arm-mediaservices/test/sampleTest.ts b/sdk/mediaservices/arm-mediaservices/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/mediaservices/arm-mediaservices/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +});