From f78912e9961f2e5602c2e56b848603cad5eeac4a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 11 May 2022 05:53:36 +0000 Subject: [PATCH] CodeGen from PR 18956 in Azure/azure-rest-api-specs Merge 3b478489713c1ee63461752bc987d8b2e1ad9f23 into ac286e05bedd69d301e1dc94ec70f66e8536686b --- sdk/datafactory/arm-datafactory/CHANGELOG.md | 14 ++++ sdk/datafactory/arm-datafactory/_meta.json | 8 +-- sdk/datafactory/arm-datafactory/package.json | 12 ++-- .../review/arm-datafactory.api.md | 16 +++++ .../src/dataFactoryManagementClient.ts | 36 +++++++++- .../arm-datafactory/src/models/index.ts | 24 +++++++ .../arm-datafactory/src/models/mappers.ts | 72 +++++++++++++++++++ .../arm-datafactory/test/sampleTest.ts | 39 +++++----- 8 files changed, 189 insertions(+), 32 deletions(-) diff --git a/sdk/datafactory/arm-datafactory/CHANGELOG.md b/sdk/datafactory/arm-datafactory/CHANGELOG.md index a29f027686e7..93f2f73651f4 100644 --- a/sdk/datafactory/arm-datafactory/CHANGELOG.md +++ b/sdk/datafactory/arm-datafactory/CHANGELOG.md @@ -1,5 +1,19 @@ # Release History +## 10.5.0 (2022-05-11) + +**Features** + + - Added Interface PrivateEndpoint + - Added Interface PurviewConfiguration + - Interface ExecuteDataFlowActivityTypeProperties has a new optional parameter sourceStagingConcurrency + - Interface PrivateLinkConnectionApprovalRequest has a new optional parameter privateEndpoint + - Type Alias DataFlowSink has a new parameter rejectedDataLinkedService + - Type Alias ExecuteDataFlowActivity has a new parameter sourceStagingConcurrency + - Type Alias ExecuteWranglingDataflowActivity has a new parameter sourceStagingConcurrency + - Type Alias Factory has a new parameter purviewConfiguration + + ## 10.4.0 (2022-04-20) **Features** diff --git a/sdk/datafactory/arm-datafactory/_meta.json b/sdk/datafactory/arm-datafactory/_meta.json index a0c15da10399..ab37f7425125 100644 --- a/sdk/datafactory/arm-datafactory/_meta.json +++ b/sdk/datafactory/arm-datafactory/_meta.json @@ -1,8 +1,8 @@ { - "commit": "8a9bd9c5b65e5c3e5a8536f3c5b2b15bf9920b5d", + "commit": "b6bd290cd8c34e33387bd0bcf6cdaf9b03fecddd", "readme": "specification/datafactory/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\\datafactory\\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/datafactory/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.0", + "use": "@autorest/typescript@6.0.0-alpha.19.20220425.1" } \ No newline at end of file diff --git a/sdk/datafactory/arm-datafactory/package.json b/sdk/datafactory/arm-datafactory/package.json index e6ad8434229d..cd92149c3078 100644 --- a/sdk/datafactory/arm-datafactory/package.json +++ b/sdk/datafactory/arm-datafactory/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for DataFactoryManagementClient.", - "version": "10.4.0", + "version": "10.5.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/datafactory/arm-datafactory", "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/datafactory/arm-datafactory/review/arm-datafactory.api.md b/sdk/datafactory/arm-datafactory/review/arm-datafactory.api.md index e6806f922158..52182c75d08c 100644 --- a/sdk/datafactory/arm-datafactory/review/arm-datafactory.api.md +++ b/sdk/datafactory/arm-datafactory/review/arm-datafactory.api.md @@ -1848,6 +1848,7 @@ export type DataFlowsGetResponse = DataFlowResource; // @public export type DataFlowSink = Transformation & { schemaLinkedService?: LinkedServiceReference; + rejectedDataLinkedService?: LinkedServiceReference; }; // @public @@ -2403,6 +2404,7 @@ export type ExecuteDataFlowActivity = ExecutionActivity & { traceLevel?: Record; continueOnError?: Record; runConcurrently?: Record; + sourceStagingConcurrency?: Record; }; // @public @@ -2412,6 +2414,7 @@ export interface ExecuteDataFlowActivityTypeProperties { dataFlow: DataFlowReference; integrationRuntime?: IntegrationRuntimeReference; runConcurrently?: Record; + sourceStagingConcurrency?: Record; staging?: DataFlowStagingInfo; traceLevel?: Record; } @@ -2489,6 +2492,7 @@ export type ExecuteWranglingDataflowActivity = Activity & { traceLevel?: Record; continueOnError?: Record; runConcurrently?: Record; + sourceStagingConcurrency?: Record; sinks?: { [propertyName: string]: PowerQuerySink; }; @@ -2666,6 +2670,7 @@ export type Factory = Resource & { readonly provisioningState?: string; readonly createTime?: Date; readonly version?: string; + purviewConfiguration?: PurviewConfiguration; repoConfiguration?: FactoryRepoConfigurationUnion; globalParameters?: { [propertyName: string]: GlobalParameterSpecification; @@ -6330,6 +6335,11 @@ export type PrestoSource = TabularSource & { query?: Record; }; +// @public +export interface PrivateEndpoint { + id?: string; +} + // @public export interface PrivateEndpointConnection { createOrUpdate(resourceGroupName: string, factoryName: string, privateEndpointConnectionName: string, privateEndpointWrapper: PrivateLinkConnectionApprovalRequestResource, options?: PrivateEndpointConnectionCreateOrUpdateOptionalParams): Promise; @@ -6389,6 +6399,7 @@ export type PrivateEndPointConnectionsListByFactoryResponse = PrivateEndpointCon // @public export interface PrivateLinkConnectionApprovalRequest { + privateEndpoint?: PrivateEndpoint; privateLinkServiceConnectionState?: PrivateLinkConnectionState; } @@ -6437,6 +6448,11 @@ export interface PrivateLinkResourcesWrapper { // @public export type PublicNetworkAccess = string; +// @public +export interface PurviewConfiguration { + purviewResourceId?: string; +} + // @public export interface QueryDataFlowDebugSessionsResponse { nextLink?: string; diff --git a/sdk/datafactory/arm-datafactory/src/dataFactoryManagementClient.ts b/sdk/datafactory/arm-datafactory/src/dataFactoryManagementClient.ts index b76a0a0ef1d6..00ada2381a37 100644 --- a/sdk/datafactory/arm-datafactory/src/dataFactoryManagementClient.ts +++ b/sdk/datafactory/arm-datafactory/src/dataFactoryManagementClient.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 { OperationsImpl, @@ -87,7 +92,7 @@ export class DataFactoryManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-datafactory/10.4.0`; + const packageDetails = `azsdk-js-arm-datafactory/10.5.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -157,6 +162,35 @@ export class DataFactoryManagementClient extends coreClient.ServiceClient { this.privateEndPointConnections = new PrivateEndPointConnectionsImpl(this); this.privateEndpointConnection = new PrivateEndpointConnectionImpl(this); this.privateLinkResources = new PrivateLinkResourcesImpl(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); } operations: Operations; diff --git a/sdk/datafactory/arm-datafactory/src/models/index.ts b/sdk/datafactory/arm-datafactory/src/models/index.ts index 4efef14cdc31..f50ab498d881 100644 --- a/sdk/datafactory/arm-datafactory/src/models/index.ts +++ b/sdk/datafactory/arm-datafactory/src/models/index.ts @@ -670,6 +670,12 @@ export interface FactoryIdentity { userAssignedIdentities?: { [propertyName: string]: Record }; } +/** Purview configuration. */ +export interface PurviewConfiguration { + /** Purview resource id. */ + purviewResourceId?: string; +} + /** Factory's git repo information. */ export interface FactoryRepoConfiguration { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -2261,6 +2267,14 @@ export interface PrivateLinkConnectionState { export interface PrivateLinkConnectionApprovalRequest { /** The state of a private link connection */ privateLinkServiceConnectionState?: PrivateLinkConnectionState; + /** The resource of private endpoint. */ + privateEndpoint?: PrivateEndpoint; +} + +/** Private endpoint which a connection belongs to. */ +export interface PrivateEndpoint { + /** The resource Id for private endpoint */ + id?: string; } /** Wrapper for a collection of private link resources */ @@ -3510,6 +3524,8 @@ export interface ExecuteDataFlowActivityTypeProperties { continueOnError?: Record; /** Concurrent run setting used for data flow execution. Allows sinks with the same save order to be processed concurrently. Type: boolean (or Expression with resultType boolean) */ runConcurrently?: Record; + /** Specify number of parallel staging for sources applicable to the sink. Type: integer (or Expression with resultType integer) */ + sourceStagingConcurrency?: Record; } /** Compute properties for data flow activity. */ @@ -3672,6 +3688,8 @@ export type Factory = Resource & { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly version?: string; + /** Purview information of the factory. */ + purviewConfiguration?: PurviewConfiguration; /** Git repo information of the factory. */ repoConfiguration?: FactoryRepoConfigurationUnion; /** List of parameters for factory. */ @@ -7231,6 +7249,8 @@ export type ExecuteWranglingDataflowActivity = Activity & { continueOnError?: Record; /** Concurrent run setting used for data flow execution. Allows sinks with the same save order to be processed concurrently. Type: boolean (or Expression with resultType boolean) */ runConcurrently?: Record; + /** Specify number of parallel staging for sources applicable to the sink. Type: integer (or Expression with resultType integer) */ + sourceStagingConcurrency?: Record; /** (Deprecated. Please use Queries). List of Power Query activity sinks mapped to a queryName. */ sinks?: { [propertyName: string]: PowerQuerySink }; /** List of mapping for Power Query mashup query to sink dataset(s). */ @@ -7418,6 +7438,8 @@ export type DataFlowSource = Transformation & { export type DataFlowSink = Transformation & { /** Schema linked service reference. */ schemaLinkedService?: LinkedServiceReference; + /** Rejected data linked service reference. */ + rejectedDataLinkedService?: LinkedServiceReference; }; /** The location of azure blob dataset. */ @@ -9789,6 +9811,8 @@ export type ExecuteDataFlowActivity = ExecutionActivity & { continueOnError?: Record; /** Concurrent run setting used for data flow execution. Allows sinks with the same save order to be processed concurrently. Type: boolean (or Expression with resultType boolean) */ runConcurrently?: Record; + /** Specify number of parallel staging for sources applicable to the sink. Type: integer (or Expression with resultType integer) */ + sourceStagingConcurrency?: Record; }; /** Script activity type. */ diff --git a/sdk/datafactory/arm-datafactory/src/models/mappers.ts b/sdk/datafactory/arm-datafactory/src/models/mappers.ts index 0da0102f5043..ffb167ebd3ef 100644 --- a/sdk/datafactory/arm-datafactory/src/models/mappers.ts +++ b/sdk/datafactory/arm-datafactory/src/models/mappers.ts @@ -400,6 +400,21 @@ export const FactoryIdentity: coreClient.CompositeMapper = { } }; +export const PurviewConfiguration: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PurviewConfiguration", + modelProperties: { + purviewResourceId: { + serializedName: "purviewResourceId", + type: { + name: "String" + } + } + } + } +}; + export const FactoryRepoConfiguration: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3641,6 +3656,28 @@ export const PrivateLinkConnectionApprovalRequest: coreClient.CompositeMapper = name: "Composite", className: "PrivateLinkConnectionState" } + }, + privateEndpoint: { + serializedName: "privateEndpoint", + type: { + name: "Composite", + className: "PrivateEndpoint" + } + } + } + } +}; + +export const PrivateEndpoint: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PrivateEndpoint", + modelProperties: { + id: { + serializedName: "id", + type: { + name: "String" + } } } } @@ -6666,6 +6703,13 @@ export const ExecuteDataFlowActivityTypeProperties: coreClient.CompositeMapper = name: "Dictionary", value: { type: { name: "any" } } } + }, + sourceStagingConcurrency: { + serializedName: "sourceStagingConcurrency", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } } } } @@ -7139,6 +7183,13 @@ export const Factory: coreClient.CompositeMapper = { name: "String" } }, + purviewConfiguration: { + serializedName: "properties.purviewConfiguration", + type: { + name: "Composite", + className: "PurviewConfiguration" + } + }, repoConfiguration: { serializedName: "properties.repoConfiguration", type: { @@ -17871,6 +17922,13 @@ export const ExecuteWranglingDataflowActivity: coreClient.CompositeMapper = { value: { type: { name: "any" } } } }, + sourceStagingConcurrency: { + serializedName: "typeProperties.sourceStagingConcurrency", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, sinks: { serializedName: "typeProperties.sinks", type: { @@ -18472,6 +18530,13 @@ export const DataFlowSink: coreClient.CompositeMapper = { name: "Composite", className: "LinkedServiceReference" } + }, + rejectedDataLinkedService: { + serializedName: "rejectedDataLinkedService", + type: { + name: "Composite", + className: "LinkedServiceReference" + } } } } @@ -25532,6 +25597,13 @@ export const ExecuteDataFlowActivity: coreClient.CompositeMapper = { name: "Dictionary", value: { type: { name: "any" } } } + }, + sourceStagingConcurrency: { + serializedName: "typeProperties.sourceStagingConcurrency", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } } } } diff --git a/sdk/datafactory/arm-datafactory/test/sampleTest.ts b/sdk/datafactory/arm-datafactory/test/sampleTest.ts index 7ed89b043e1b..25aeb3ebcc36 100644 --- a/sdk/datafactory/arm-datafactory/test/sampleTest.ts +++ b/sdk/datafactory/arm-datafactory/test/sampleTest.ts @@ -7,35 +7,30 @@ */ import { - env, - record, - RecorderEnvironmentSetup, - Recorder + Recorder, + RecorderStartOptions, + env } from "@azure-tools/test-recorder"; -import * as assert from "assert"; +import { assert } from "chai"; +import { Context } from "mocha"; -const recorderEnvSetup: RecorderEnvironmentSetup = { - replaceableVariables: { - 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" - }, - customizationsOnRecordings: [ - (recording: any): any => - recording.replace( - /"access_token":"[^"]*"/g, - `"access_token":"access_token"` - ) - ], - queryParametersToSkip: [] +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() { - recorder = record(this, recorderEnvSetup); + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); }); afterEach(async function() {