Skip to content

Commit

Permalink
CodeGen from PR 19891 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge a9e2a9870906dd5c81ff3e5ec6d9eb3baf59420b into 9d67b48d784fb4a47ebe8819a437d5e4d388c9f2
  • Loading branch information
SDKAuto committed Jul 21, 2022
1 parent 51578dc commit 68f4c8c
Show file tree
Hide file tree
Showing 15 changed files with 750 additions and 92 deletions.
40 changes: 32 additions & 8 deletions sdk/mediaservices/arm-mediaservices/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,39 @@
# Release History

## 13.0.0 (2022-07-21)

**Features**

## 12.0.1 (Unreleased)

### Features Added

### Breaking Changes

### Bugs Fixed
- Added operation LiveEvents.asyncOperation
- Added operation LiveEvents.operationLocation
- Added operation LiveOutputs.asyncOperation
- Added operation LiveOutputs.operationLocation
- Added operation StreamingEndpoints.asyncOperation
- Added operation StreamingEndpoints.operationLocation
- Added Interface AsyncOperationErrorDetail
- Added Interface AsyncOperationResult
- Added Interface LiveEventsAsyncOperationOptionalParams
- Added Interface LiveEventsOperationLocationOptionalParams
- Added Interface LiveOutputsAsyncOperationOptionalParams
- Added Interface LiveOutputsOperationLocationOptionalParams
- Added Interface StreamingEndpointsAsyncOperationOptionalParams
- Added Interface StreamingEndpointsOperationLocationOptionalParams
- Added Type Alias AsyncOperationStatus
- Added Type Alias LiveEventsAsyncOperationResponse
- Added Type Alias LiveEventsOperationLocationResponse
- Added Type Alias LiveOutputsAsyncOperationResponse
- Added Type Alias LiveOutputsOperationLocationResponse
- Added Type Alias StreamingEndpointsAsyncOperationResponse
- Added Type Alias StreamingEndpointsOperationLocationResponse
- Type Alias LiveOutput has a new parameter rewindWindowLength
- Added Enum KnownAsyncOperationStatus

### Other Changes
**Breaking Changes**

- Interface AzureMediaServicesOptionalParams no longer has parameter apiVersion
- Class AzureMediaServices no longer has parameter apiVersion


## 12.0.0 (2022-06-24)

**Features**
Expand Down
8 changes: 4 additions & 4 deletions sdk/mediaservices/arm-mediaservices/_meta.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"commit": "d8dd0de9c27c21a3802a780fbef2844fcbbb4daa",
"commit": "0ec9d39bde7a7dfde52d7f9d0fce8b4843e598ad",
"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:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\mediaservices\\resource-manager\\readme.md --use=@autorest/[email protected]beta.20",
"autorest_command": "autorest --version=3.7.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/mediaservices/resource-manager/readme.md --use=@autorest/[email protected]alpha.19.20220425.1",
"repository_url": "https://github.com/Azure/azure-rest-api-specs.git",
"release_tool": "@azure-tools/js-sdk-release-tools@2.3.2",
"use": "@autorest/[email protected]beta.20"
"release_tool": "@azure-tools/js-sdk-release-tools@2.4.0",
"use": "@autorest/[email protected]alpha.19.20220425.1"
}
9 changes: 3 additions & 6 deletions sdk/mediaservices/arm-mediaservices/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"sdk-type": "mgmt",
"author": "Microsoft Corporation",
"description": "A generated SDK for AzureMediaServices.",
"version": "12.0.1",
"version": "13.0.0",
"engines": {
"node": ">=12.0.0"
},
Expand Down Expand Up @@ -43,11 +43,8 @@
"@azure-tools/test-recorder": "^2.0.0",
"@azure-tools/test-credential": "^1.0.0",
"mocha": "^7.1.1",
"@types/chai": "^4.2.8",
"chai": "^4.2.0",
"cross-env": "^7.0.2",
"@azure/dev-tool": "^1.0.0",
"@azure/arm-storage": "^17.2.1"
"@azure/dev-tool": "^1.0.0"
},
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/mediaservices/arm-mediaservices",
"repository": {
Expand Down Expand Up @@ -112,4 +109,4 @@
]
},
"autoPublish": true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,23 @@ export interface AssetTrackOperationStatus {
status: string;
}

// @public
export interface AsyncOperationErrorDetail {
code?: string;
message?: string;
target?: string;
}

// @public
export interface AsyncOperationResult {
error?: AsyncOperationErrorDetail;
name?: string;
status?: AsyncOperationStatus;
}

// @public
export type AsyncOperationStatus = string;

// @public
export type AttributeFilter = string;

Expand Down Expand Up @@ -417,8 +434,6 @@ export class AzureMediaServices extends coreClient.ServiceClient {
// (undocumented)
accountFilters: AccountFilters;
// (undocumented)
apiVersion: string;
// (undocumented)
assetFilters: AssetFilters;
// (undocumented)
assets: Assets;
Expand Down Expand Up @@ -465,7 +480,6 @@ export class AzureMediaServices extends coreClient.ServiceClient {
// @public
export interface AzureMediaServicesOptionalParams extends coreClient.ServiceClientOptions {
$host?: string;
apiVersion?: string;
endpoint?: string;
}

Expand Down Expand Up @@ -1357,6 +1371,16 @@ export enum KnownAssetStorageEncryptionFormat {
None = "None"
}

// @public
export enum KnownAsyncOperationStatus {
// (undocumented)
Failed = "Failed",
// (undocumented)
InProgress = "InProgress",
// (undocumented)
Succeeded = "Succeeded"
}

// @public
export enum KnownAttributeFilter {
All = "All",
Expand Down Expand Up @@ -1933,6 +1957,7 @@ export type LiveEventResourceState = string;

// @public
export interface LiveEvents {
asyncOperation(resourceGroupName: string, accountName: string, operationId: string, options?: LiveEventsAsyncOperationOptionalParams): Promise<LiveEventsAsyncOperationResponse>;
beginAllocate(resourceGroupName: string, accountName: string, liveEventName: string, options?: LiveEventsAllocateOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
beginAllocateAndWait(resourceGroupName: string, accountName: string, liveEventName: string, options?: LiveEventsAllocateOptionalParams): Promise<void>;
beginCreate(resourceGroupName: string, accountName: string, liveEventName: string, parameters: LiveEvent, options?: LiveEventsCreateOptionalParams): Promise<PollerLike<PollOperationState<LiveEventsCreateResponse>, LiveEventsCreateResponse>>;
Expand All @@ -1949,6 +1974,7 @@ export interface LiveEvents {
beginUpdateAndWait(resourceGroupName: string, accountName: string, liveEventName: string, parameters: LiveEvent, options?: LiveEventsUpdateOptionalParams): Promise<LiveEventsUpdateResponse>;
get(resourceGroupName: string, accountName: string, liveEventName: string, options?: LiveEventsGetOptionalParams): Promise<LiveEventsGetResponse>;
list(resourceGroupName: string, accountName: string, options?: LiveEventsListOptionalParams): PagedAsyncIterableIterator<LiveEvent>;
operationLocation(resourceGroupName: string, accountName: string, liveEventName: string, operationId: string, options?: LiveEventsOperationLocationOptionalParams): Promise<LiveEventsOperationLocationResponse>;
}

// @public
Expand All @@ -1957,6 +1983,13 @@ export interface LiveEventsAllocateOptionalParams extends coreClient.OperationOp
updateIntervalInMs?: number;
}

// @public
export interface LiveEventsAsyncOperationOptionalParams extends coreClient.OperationOptions {
}

// @public
export type LiveEventsAsyncOperationResponse = AsyncOperationResult;

// @public
export interface LiveEventsCreateOptionalParams extends coreClient.OperationOptions {
autoStart?: boolean;
Expand Down Expand Up @@ -1994,6 +2027,13 @@ export interface LiveEventsListOptionalParams extends coreClient.OperationOption
// @public
export type LiveEventsListResponse = LiveEventListResult;

// @public
export interface LiveEventsOperationLocationOptionalParams extends coreClient.OperationOptions {
}

// @public
export type LiveEventsOperationLocationResponse = LiveEvent;

// @public
export interface LiveEventsResetOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
Expand Down Expand Up @@ -2034,6 +2074,7 @@ export type LiveOutput = ProxyResource & {
description?: string;
assetName?: string;
archiveWindowLength?: string;
rewindWindowLength?: string;
manifestName?: string;
hls?: Hls;
outputSnapTime?: number;
Expand All @@ -2055,14 +2096,23 @@ export type LiveOutputResourceState = string;

// @public
export interface LiveOutputs {
asyncOperation(resourceGroupName: string, accountName: string, operationId: string, options?: LiveOutputsAsyncOperationOptionalParams): Promise<LiveOutputsAsyncOperationResponse>;
beginCreate(resourceGroupName: string, accountName: string, liveEventName: string, liveOutputName: string, parameters: LiveOutput, options?: LiveOutputsCreateOptionalParams): Promise<PollerLike<PollOperationState<LiveOutputsCreateResponse>, LiveOutputsCreateResponse>>;
beginCreateAndWait(resourceGroupName: string, accountName: string, liveEventName: string, liveOutputName: string, parameters: LiveOutput, options?: LiveOutputsCreateOptionalParams): Promise<LiveOutputsCreateResponse>;
beginDelete(resourceGroupName: string, accountName: string, liveEventName: string, liveOutputName: string, options?: LiveOutputsDeleteOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
beginDeleteAndWait(resourceGroupName: string, accountName: string, liveEventName: string, liveOutputName: string, options?: LiveOutputsDeleteOptionalParams): Promise<void>;
get(resourceGroupName: string, accountName: string, liveEventName: string, liveOutputName: string, options?: LiveOutputsGetOptionalParams): Promise<LiveOutputsGetResponse>;
list(resourceGroupName: string, accountName: string, liveEventName: string, options?: LiveOutputsListOptionalParams): PagedAsyncIterableIterator<LiveOutput>;
operationLocation(resourceGroupName: string, accountName: string, liveEventName: string, liveOutputName: string, operationId: string, options?: LiveOutputsOperationLocationOptionalParams): Promise<LiveOutputsOperationLocationResponse>;
}

// @public
export interface LiveOutputsAsyncOperationOptionalParams extends coreClient.OperationOptions {
}

// @public
export type LiveOutputsAsyncOperationResponse = AsyncOperationResult;

// @public
export interface LiveOutputsCreateOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
Expand Down Expand Up @@ -2099,6 +2149,13 @@ export interface LiveOutputsListOptionalParams extends coreClient.OperationOptio
// @public
export type LiveOutputsListResponse = LiveOutputListResult;

// @public
export interface LiveOutputsOperationLocationOptionalParams extends coreClient.OperationOptions {
}

// @public
export type LiveOutputsOperationLocationResponse = LiveOutput;

// @public
export interface Locations {
checkNameAvailability(locationName: string, parameters: CheckNameAvailabilityInput, options?: LocationsCheckNameAvailabilityOptionalParams): Promise<LocationsCheckNameAvailabilityResponse>;
Expand Down Expand Up @@ -2450,7 +2507,7 @@ export type PngImage = Image_2 & {
};

// @public
export type PngLayer = Layer;
export type PngLayer = Layer & {};

// @public
export interface PresentationTimeRange {
Expand Down Expand Up @@ -2589,7 +2646,7 @@ export interface Properties {
export type ProvisioningState = string;

// @public
export type ProxyResource = Resource;
export type ProxyResource = Resource & {};

// @public
export type PublicNetworkAccess = string;
Expand Down Expand Up @@ -2720,6 +2777,7 @@ export type StreamingEndpointResourceState = string;

// @public
export interface StreamingEndpoints {
asyncOperation(resourceGroupName: string, accountName: string, operationId: string, options?: StreamingEndpointsAsyncOperationOptionalParams): Promise<StreamingEndpointsAsyncOperationResponse>;
beginCreate(resourceGroupName: string, accountName: string, streamingEndpointName: string, parameters: StreamingEndpoint, options?: StreamingEndpointsCreateOptionalParams): Promise<PollerLike<PollOperationState<StreamingEndpointsCreateResponse>, StreamingEndpointsCreateResponse>>;
beginCreateAndWait(resourceGroupName: string, accountName: string, streamingEndpointName: string, parameters: StreamingEndpoint, options?: StreamingEndpointsCreateOptionalParams): Promise<StreamingEndpointsCreateResponse>;
beginDelete(resourceGroupName: string, accountName: string, streamingEndpointName: string, options?: StreamingEndpointsDeleteOptionalParams): Promise<PollerLike<PollOperationState<void>, void>>;
Expand All @@ -2734,9 +2792,17 @@ export interface StreamingEndpoints {
beginUpdateAndWait(resourceGroupName: string, accountName: string, streamingEndpointName: string, parameters: StreamingEndpoint, options?: StreamingEndpointsUpdateOptionalParams): Promise<StreamingEndpointsUpdateResponse>;
get(resourceGroupName: string, accountName: string, streamingEndpointName: string, options?: StreamingEndpointsGetOptionalParams): Promise<StreamingEndpointsGetResponse>;
list(resourceGroupName: string, accountName: string, options?: StreamingEndpointsListOptionalParams): PagedAsyncIterableIterator<StreamingEndpoint>;
operationLocation(resourceGroupName: string, accountName: string, streamingEndpointName: string, operationId: string, options?: StreamingEndpointsOperationLocationOptionalParams): Promise<StreamingEndpointsOperationLocationResponse>;
skus(resourceGroupName: string, accountName: string, streamingEndpointName: string, options?: StreamingEndpointsSkusOptionalParams): Promise<StreamingEndpointsSkusResponse>;
}

// @public
export interface StreamingEndpointsAsyncOperationOptionalParams extends coreClient.OperationOptions {
}

// @public
export type StreamingEndpointsAsyncOperationResponse = AsyncOperationResult;

// @public
export interface StreamingEndpointsCreateOptionalParams extends coreClient.OperationOptions {
autoStart?: boolean;
Expand Down Expand Up @@ -2779,6 +2845,13 @@ export interface StreamingEndpointsListOptionalParams extends coreClient.Operati
// @public
export type StreamingEndpointsListResponse = StreamingEndpointListResult;

// @public
export interface StreamingEndpointsOperationLocationOptionalParams extends coreClient.OperationOptions {
}

// @public
export type StreamingEndpointsOperationLocationResponse = StreamingEndpoint;

// @public
export interface StreamingEndpointsScaleOptionalParams extends coreClient.OperationOptions {
resumeFrom?: string;
Expand Down
38 changes: 1 addition & 37 deletions sdk/mediaservices/arm-mediaservices/src/azureMediaServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@

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,
Expand Down Expand Up @@ -65,7 +60,6 @@ import { AzureMediaServicesOptionalParams } from "./models";
export class AzureMediaServices extends coreClient.ServiceClient {
$host: string;
subscriptionId: string;
apiVersion: string;

/**
* Initializes a new instance of the AzureMediaServices class.
Expand Down Expand Up @@ -94,7 +88,7 @@ export class AzureMediaServices extends coreClient.ServiceClient {
credential: credentials
};

const packageDetails = `azsdk-js-arm-mediaservices/12.0.1`;
const packageDetails = `azsdk-js-arm-mediaservices/13.0.0`;
const userAgentPrefix =
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
Expand Down Expand Up @@ -141,7 +135,6 @@ 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);
Expand All @@ -167,35 +160,6 @@ 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<PipelineResponse> {
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;
Expand Down
Loading

0 comments on commit 68f4c8c

Please sign in to comment.