Skip to content

Commit

Permalink
CodeGen from PR 18435 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 6b538788c3ca7847442bc83f87310e8e8a2e38e7 into c2d25c0f023edd1fea753a89d6409f3e7a9f8956
  • Loading branch information
SDKAuto committed Jun 16, 2022
1 parent e6d1f7a commit a32b57a
Show file tree
Hide file tree
Showing 26 changed files with 1,088 additions and 228 deletions.
45 changes: 37 additions & 8 deletions sdk/mediaservices/arm-mediaservices/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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**
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": "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/[email protected].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/[email protected].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/[email protected].20220408.1"
"release_tool": "@azure-tools/js-sdk-release-tools@2.3.2",
"use": "@autorest/[email protected].20220425.1"
}
12 changes: 7 additions & 5 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": "11.0.1",
"version": "12.0.0",
"engines": {
"node": ">=12.0.0"
},
Expand Down Expand Up @@ -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": {
Expand Down Expand Up @@ -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"
},
Expand All @@ -107,4 +109,4 @@
]
},
"autoPublish": true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ export class AzureMediaServices extends coreClient.ServiceClient {
// (undocumented)
accountFilters: AccountFilters;
// (undocumented)
apiVersion: string;
// (undocumented)
assetFilters: AssetFilters;
// (undocumented)
assets: Assets;
Expand All @@ -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;
Expand Down Expand Up @@ -459,6 +465,7 @@ export class AzureMediaServices extends coreClient.ServiceClient {
// @public
export interface AzureMediaServicesOptionalParams extends coreClient.ServiceClientOptions {
$host?: string;
apiVersion?: string;
endpoint?: string;
}

Expand Down Expand Up @@ -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
Expand All @@ -2139,24 +2148,76 @@ export interface MediaServiceIdentity {
};
}

// @public
export interface MediaServiceOperationResults {
get(locationName: string, operationId: string, options?: MediaServiceOperationResultsGetOptionalParams): Promise<MediaServiceOperationResultsGetResponse>;
}

// @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<MediaServiceOperationStatusesGetResponse>;
}

// @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<MediaservicesCreateOrUpdateResponse>;
beginCreateOrUpdate(resourceGroupName: string, accountName: string, parameters: MediaService, options?: MediaservicesCreateOrUpdateOptionalParams): Promise<PollerLike<PollOperationState<MediaservicesCreateOrUpdateResponse>, MediaservicesCreateOrUpdateResponse>>;
beginCreateOrUpdateAndWait(resourceGroupName: string, accountName: string, parameters: MediaService, options?: MediaservicesCreateOrUpdateOptionalParams): Promise<MediaservicesCreateOrUpdateResponse>;
beginUpdate(resourceGroupName: string, accountName: string, parameters: MediaServiceUpdate, options?: MediaservicesUpdateOptionalParams): Promise<PollerLike<PollOperationState<MediaservicesUpdateResponse>, MediaservicesUpdateResponse>>;
beginUpdateAndWait(resourceGroupName: string, accountName: string, parameters: MediaServiceUpdate, options?: MediaservicesUpdateOptionalParams): Promise<MediaservicesUpdateResponse>;
delete(resourceGroupName: string, accountName: string, options?: MediaservicesDeleteOptionalParams): Promise<void>;
get(resourceGroupName: string, accountName: string, options?: MediaservicesGetOptionalParams): Promise<MediaservicesGetResponse>;
list(resourceGroupName: string, options?: MediaservicesListOptionalParams): PagedAsyncIterableIterator<MediaService>;
listBySubscription(options?: MediaservicesListBySubscriptionOptionalParams): PagedAsyncIterableIterator<MediaService>;
listEdgePolicies(resourceGroupName: string, accountName: string, parameters: ListEdgePoliciesInput, options?: MediaservicesListEdgePoliciesOptionalParams): Promise<MediaservicesListEdgePoliciesResponse>;
syncStorageKeys(resourceGroupName: string, accountName: string, parameters: SyncStorageKeysInput, options?: MediaservicesSyncStorageKeysOptionalParams): Promise<void>;
update(resourceGroupName: string, accountName: string, parameters: MediaServiceUpdate, options?: MediaservicesUpdateOptionalParams): Promise<MediaservicesUpdateResponse>;
}

// @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 {
Expand Down Expand Up @@ -2208,19 +2269,30 @@ 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 {
encryption?: AccountEncryption;
identity?: MediaServiceIdentity;
keyDelivery?: KeyDelivery;
readonly mediaServiceId?: string;
readonly privateEndpointConnections?: PrivateEndpointConnection[];
readonly provisioningState?: ProvisioningState;
publicNetworkAccess?: PublicNetworkAccess;
storageAccounts?: StorageAccount[];
// (undocumented)
Expand Down
50 changes: 49 additions & 1 deletion sdk/mediaservices/arm-mediaservices/src/azureMediaServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -16,6 +21,8 @@ import {
PrivateLinkResourcesImpl,
PrivateEndpointConnectionsImpl,
LocationsImpl,
MediaServiceOperationStatusesImpl,
MediaServiceOperationResultsImpl,
AssetsImpl,
AssetFiltersImpl,
TracksImpl,
Expand All @@ -37,6 +44,8 @@ import {
PrivateLinkResources,
PrivateEndpointConnections,
Locations,
MediaServiceOperationStatuses,
MediaServiceOperationResults,
Assets,
AssetFilters,
Tracks,
Expand All @@ -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.
Expand Down Expand Up @@ -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}`
Expand Down Expand Up @@ -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);
Expand All @@ -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<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 All @@ -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;
Expand Down
Loading

0 comments on commit a32b57a

Please sign in to comment.