diff --git a/sdk/datafactory/arm-datafactory/CHANGELOG.md b/sdk/datafactory/arm-datafactory/CHANGELOG.md index 6a31eaa9a0e7..f07edc3ce82a 100644 --- a/sdk/datafactory/arm-datafactory/CHANGELOG.md +++ b/sdk/datafactory/arm-datafactory/CHANGELOG.md @@ -1,15 +1,35 @@ # Release History + +## 10.6.0 (2022-05-27) + +**Features** -## 10.5.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation group GlobalParameters + - Added Interface GlobalParameterListResponse + - Added Interface GlobalParametersCreateOrUpdateOptionalParams + - Added Interface GlobalParametersDeleteOptionalParams + - Added Interface GlobalParametersGetOptionalParams + - Added Interface GlobalParametersListByFactoryNextOptionalParams + - Added Interface GlobalParametersListByFactoryOptionalParams + - Added Interface PurviewConfiguration + - Added Type Alias GlobalParameterResource + - Added Type Alias GlobalParametersCreateOrUpdateResponse + - Added Type Alias GlobalParametersGetResponse + - Added Type Alias GlobalParametersListByFactoryNextResponse + - Added Type Alias GlobalParametersListByFactoryResponse + - Interface ExecuteDataFlowActivityTypeProperties has a new optional parameter sourceStagingConcurrency + - Class DataFactoryManagementClient has a new parameter globalParameters + - Type Alias ExecuteDataFlowActivity has a new parameter sourceStagingConcurrency + - Type Alias ExecuteWranglingDataflowActivity has a new parameter sourceStagingConcurrency + - Type Alias Factory has a new parameter purviewConfiguration + - Type Alias RestServiceLinkedService has a new parameter clientId + - Type Alias RestServiceLinkedService has a new parameter clientSecret + - Type Alias RestServiceLinkedService has a new parameter tokenEndpoint + - Type Alias RestServiceLinkedService has a new parameter resource + - Type Alias RestServiceLinkedService has a new parameter scope + - Enum KnownRestServiceAuthenticationType has a new value OAuth2ClientCredential + + ## 10.5.0 (2022-05-09) **Features** diff --git a/sdk/datafactory/arm-datafactory/_meta.json b/sdk/datafactory/arm-datafactory/_meta.json index 8996df746dbb..8842dd9bb2ec 100644 --- a/sdk/datafactory/arm-datafactory/_meta.json +++ b/sdk/datafactory/arm-datafactory/_meta.json @@ -1,8 +1,8 @@ { - "commit": "ee15422a60409285806e1673e191fe69333a7743", + "commit": "0103b10be26486c6cbae83ae44641069f92da0fe", "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.3.0", - "use": "@autorest/typescript@6.0.0-alpha.19.20220408.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.3.1", + "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 05b943db24fc..a96fa5c7df4d 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.5.1", + "version": "10.6.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 d9d6d4a8cbec..19d6e6ab320d 100644 --- a/sdk/datafactory/arm-datafactory/review/arm-datafactory.api.md +++ b/sdk/datafactory/arm-datafactory/review/arm-datafactory.api.md @@ -1610,6 +1610,8 @@ export class DataFactoryManagementClient extends coreClient.ServiceClient { // (undocumented) factories: Factories; // (undocumented) + globalParameters: GlobalParameters; + // (undocumented) integrationRuntimeNodes: IntegrationRuntimeNodes; // (undocumented) integrationRuntimeObjectMetadata: IntegrationRuntimeObjectMetadata; @@ -2404,6 +2406,7 @@ export type ExecuteDataFlowActivity = ExecutionActivity & { traceLevel?: Record; continueOnError?: Record; runConcurrently?: Record; + sourceStagingConcurrency?: Record; }; // @public @@ -2413,6 +2416,7 @@ export interface ExecuteDataFlowActivityTypeProperties { dataFlow: DataFlowReference; integrationRuntime?: IntegrationRuntimeReference; runConcurrently?: Record; + sourceStagingConcurrency?: Record; staging?: DataFlowStagingInfo; traceLevel?: Record; } @@ -2490,6 +2494,7 @@ export type ExecuteWranglingDataflowActivity = Activity & { traceLevel?: Record; continueOnError?: Record; runConcurrently?: Record; + sourceStagingConcurrency?: Record; sinks?: { [propertyName: string]: PowerQuerySink; }; @@ -2667,6 +2672,7 @@ export type Factory = Resource & { readonly provisioningState?: string; readonly createTime?: Date; readonly version?: string; + purviewConfiguration?: PurviewConfiguration; repoConfiguration?: FactoryRepoConfigurationUnion; globalParameters?: { [propertyName: string]: GlobalParameterSpecification; @@ -2921,6 +2927,59 @@ export interface GitHubClientSecret { byoaSecretName?: string; } +// @public +export interface GlobalParameterListResponse { + nextLink?: string; + value: GlobalParameterResource[]; +} + +// @public +export type GlobalParameterResource = SubResource & { + properties: { + [propertyName: string]: GlobalParameterSpecification; + }; +}; + +// @public +export interface GlobalParameters { + createOrUpdate(resourceGroupName: string, factoryName: string, globalParameterName: string, defaultParam: GlobalParameterResource, options?: GlobalParametersCreateOrUpdateOptionalParams): Promise; + delete(resourceGroupName: string, factoryName: string, globalParameterName: string, options?: GlobalParametersDeleteOptionalParams): Promise; + get(resourceGroupName: string, factoryName: string, globalParameterName: string, options?: GlobalParametersGetOptionalParams): Promise; + listByFactory(resourceGroupName: string, factoryName: string, options?: GlobalParametersListByFactoryOptionalParams): PagedAsyncIterableIterator; +} + +// @public +export interface GlobalParametersCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GlobalParametersCreateOrUpdateResponse = GlobalParameterResource; + +// @public +export interface GlobalParametersDeleteOptionalParams extends coreClient.OperationOptions { +} + +// @public +export interface GlobalParametersGetOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GlobalParametersGetResponse = GlobalParameterResource; + +// @public +export interface GlobalParametersListByFactoryNextOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GlobalParametersListByFactoryNextResponse = GlobalParameterListResponse; + +// @public +export interface GlobalParametersListByFactoryOptionalParams extends coreClient.OperationOptions { +} + +// @public +export type GlobalParametersListByFactoryResponse = GlobalParameterListResponse; + // @public export interface GlobalParameterSpecification { type: GlobalParameterType; @@ -4592,7 +4651,9 @@ export enum KnownRestServiceAuthenticationType { // (undocumented) Basic = "Basic", // (undocumented) - ManagedServiceIdentity = "ManagedServiceIdentity" + ManagedServiceIdentity = "ManagedServiceIdentity", + // (undocumented) + OAuth2ClientCredential = "OAuth2ClientCredential" } // @public @@ -6444,6 +6505,11 @@ export interface PrivateLinkResourcesWrapper { // @public export type PublicNetworkAccess = string; +// @public +export interface PurviewConfiguration { + purviewResourceId?: string; +} + // @public export interface QueryDataFlowDebugSessionsResponse { nextLink?: string; @@ -6611,6 +6677,11 @@ export type RestServiceLinkedService = LinkedService & { aadResourceId?: Record; encryptedCredential?: Record; credential?: CredentialReference; + clientId?: Record; + clientSecret?: SecretBaseUnion; + tokenEndpoint?: Record; + resource?: Record; + scope?: Record; }; // @public diff --git a/sdk/datafactory/arm-datafactory/src/dataFactoryManagementClient.ts b/sdk/datafactory/arm-datafactory/src/dataFactoryManagementClient.ts index a4e52a573cca..8ecc89a57ed2 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, @@ -29,7 +34,8 @@ import { ManagedPrivateEndpointsImpl, PrivateEndPointConnectionsImpl, PrivateEndpointConnectionImpl, - PrivateLinkResourcesImpl + PrivateLinkResourcesImpl, + GlobalParametersImpl } from "./operations"; import { Operations, @@ -51,7 +57,8 @@ import { ManagedPrivateEndpoints, PrivateEndPointConnections, PrivateEndpointConnection, - PrivateLinkResources + PrivateLinkResources, + GlobalParameters } from "./operationsInterfaces"; import { DataFactoryManagementClientOptionalParams } from "./models"; @@ -87,7 +94,7 @@ export class DataFactoryManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-datafactory/10.5.1`; + const packageDetails = `azsdk-js-arm-datafactory/10.6.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -157,6 +164,36 @@ export class DataFactoryManagementClient extends coreClient.ServiceClient { this.privateEndPointConnections = new PrivateEndPointConnectionsImpl(this); this.privateEndpointConnection = new PrivateEndpointConnectionImpl(this); this.privateLinkResources = new PrivateLinkResourcesImpl(this); + this.globalParameters = new GlobalParametersImpl(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; @@ -179,4 +216,5 @@ export class DataFactoryManagementClient extends coreClient.ServiceClient { privateEndPointConnections: PrivateEndPointConnections; privateEndpointConnection: PrivateEndpointConnection; privateLinkResources: PrivateLinkResources; + globalParameters: GlobalParameters; } diff --git a/sdk/datafactory/arm-datafactory/src/models/index.ts b/sdk/datafactory/arm-datafactory/src/models/index.ts index f426b7cf27e0..62c38ce9eca8 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 */ @@ -2295,6 +2301,14 @@ export interface PrivateLinkResourceProperties { readonly requiredZoneNames?: string[]; } +/** A list of Global parameters. */ +export interface GlobalParameterListResponse { + /** List of global parameters. */ + value: GlobalParameterResource[]; + /** The link to the next page of results, if any remaining results exist. */ + nextLink?: string; +} + /** Azure Data Factory expression definition. */ export interface Expression { /** Expression type. */ @@ -3518,6 +3532,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. */ @@ -3680,6 +3696,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. */ @@ -3801,6 +3819,12 @@ export type PrivateLinkResource = SubResource & { properties?: PrivateLinkResourceProperties; }; +/** Global parameters resource type. */ +export type GlobalParameterResource = SubResource & { + /** Properties of the global parameter. */ + properties: { [propertyName: string]: GlobalParameterSpecification }; +}; + /** Credential resource type. */ export type CredentialResource = SubResource & { /** Properties of credentials. */ @@ -4923,6 +4947,16 @@ export type RestServiceLinkedService = LinkedService & { encryptedCredential?: Record; /** The credential reference containing authentication information. */ credential?: CredentialReference; + /** The client ID associated with your application. Type: string (or Expression with resultType string). */ + clientId?: Record; + /** The client secret associated with your application. */ + clientSecret?: SecretBaseUnion; + /** The token endpoint of the authorization server to acquire access token. Type: string (or Expression with resultType string). */ + tokenEndpoint?: Record; + /** The target service or resource to which the access will be requested. Type: string (or Expression with resultType string). */ + resource?: Record; + /** The scope of the access required. It describes what kind of access will be requested. Type: string (or Expression with resultType string). */ + scope?: Record; }; /** Linked service for Amazon S3. */ @@ -7239,6 +7273,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). */ @@ -9799,6 +9835,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. */ @@ -11260,7 +11298,8 @@ export enum KnownRestServiceAuthenticationType { Anonymous = "Anonymous", Basic = "Basic", AadServicePrincipal = "AadServicePrincipal", - ManagedServiceIdentity = "ManagedServiceIdentity" + ManagedServiceIdentity = "ManagedServiceIdentity", + OAuth2ClientCredential = "OAuth2ClientCredential" } /** @@ -11271,7 +11310,8 @@ export enum KnownRestServiceAuthenticationType { * **Anonymous** \ * **Basic** \ * **AadServicePrincipal** \ - * **ManagedServiceIdentity** + * **ManagedServiceIdentity** \ + * **OAuth2ClientCredential** */ export type RestServiceAuthenticationType = string; @@ -13183,6 +13223,38 @@ export interface PrivateLinkResourcesGetOptionalParams /** Contains response data for the get operation. */ export type PrivateLinkResourcesGetResponse = PrivateLinkResourcesWrapper; +/** Optional parameters. */ +export interface GlobalParametersListByFactoryOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByFactory operation. */ +export type GlobalParametersListByFactoryResponse = GlobalParameterListResponse; + +/** Optional parameters. */ +export interface GlobalParametersGetOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the get operation. */ +export type GlobalParametersGetResponse = GlobalParameterResource; + +/** Optional parameters. */ +export interface GlobalParametersCreateOrUpdateOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the createOrUpdate operation. */ +export type GlobalParametersCreateOrUpdateResponse = GlobalParameterResource; + +/** Optional parameters. */ +export interface GlobalParametersDeleteOptionalParams + extends coreClient.OperationOptions {} + +/** Optional parameters. */ +export interface GlobalParametersListByFactoryNextOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the listByFactoryNext operation. */ +export type GlobalParametersListByFactoryNextResponse = GlobalParameterListResponse; + /** Optional parameters. */ export interface DataFactoryManagementClientOptionalParams extends coreClient.ServiceClientOptions { diff --git a/sdk/datafactory/arm-datafactory/src/models/mappers.ts b/sdk/datafactory/arm-datafactory/src/models/mappers.ts index fb890e4b1a39..e43b46afe78a 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", @@ -3730,6 +3745,34 @@ export const PrivateLinkResourceProperties: coreClient.CompositeMapper = { } }; +export const GlobalParameterListResponse: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GlobalParameterListResponse", + modelProperties: { + value: { + serializedName: "value", + required: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GlobalParameterResource" + } + } + } + }, + nextLink: { + serializedName: "nextLink", + type: { + name: "String" + } + } + } + } +}; + export const Expression: coreClient.CompositeMapper = { type: { name: "Composite", @@ -6688,6 +6731,13 @@ export const ExecuteDataFlowActivityTypeProperties: coreClient.CompositeMapper = name: "Dictionary", value: { type: { name: "any" } } } + }, + sourceStagingConcurrency: { + serializedName: "sourceStagingConcurrency", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } } } } @@ -7161,6 +7211,13 @@ export const Factory: coreClient.CompositeMapper = { name: "String" } }, + purviewConfiguration: { + serializedName: "properties.purviewConfiguration", + type: { + name: "Composite", + className: "PurviewConfiguration" + } + }, repoConfiguration: { serializedName: "properties.repoConfiguration", type: { @@ -7528,6 +7585,29 @@ export const PrivateLinkResource: coreClient.CompositeMapper = { } }; +export const GlobalParameterResource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GlobalParameterResource", + modelProperties: { + ...SubResource.type.modelProperties, + properties: { + serializedName: "properties", + required: true, + type: { + name: "Dictionary", + value: { + type: { + name: "Composite", + className: "GlobalParameterSpecification" + } + } + } + } + } + } +}; + export const CredentialResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -10946,6 +11026,41 @@ export const RestServiceLinkedService: coreClient.CompositeMapper = { name: "Composite", className: "CredentialReference" } + }, + clientId: { + serializedName: "typeProperties.clientId", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + clientSecret: { + serializedName: "typeProperties.clientSecret", + type: { + name: "Composite", + className: "SecretBase" + } + }, + tokenEndpoint: { + serializedName: "typeProperties.tokenEndpoint", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + resource: { + serializedName: "typeProperties.resource", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } + }, + scope: { + serializedName: "typeProperties.scope", + type: { + name: "Dictionary", + value: { type: { name: "any" } } + } } } } @@ -17893,6 +18008,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: { @@ -25561,6 +25683,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/src/models/parameters.ts b/sdk/datafactory/arm-datafactory/src/models/parameters.ts index 19107e6b1f9d..82cba7b9a072 100644 --- a/sdk/datafactory/arm-datafactory/src/models/parameters.ts +++ b/sdk/datafactory/arm-datafactory/src/models/parameters.ts @@ -39,7 +39,8 @@ import { DataFlowDebugCommandRequest as DataFlowDebugCommandRequestMapper, ManagedVirtualNetworkResource as ManagedVirtualNetworkResourceMapper, ManagedPrivateEndpointResource as ManagedPrivateEndpointResourceMapper, - PrivateLinkConnectionApprovalRequestResource as PrivateLinkConnectionApprovalRequestResourceMapper + PrivateLinkConnectionApprovalRequestResource as PrivateLinkConnectionApprovalRequestResourceMapper, + GlobalParameterResource as GlobalParameterResourceMapper } from "../models/mappers"; export const accept: OperationParameter = { @@ -546,3 +547,24 @@ export const privateEndpointConnectionName: OperationURLParameter = { } } }; + +export const globalParameterName: OperationURLParameter = { + parameterPath: "globalParameterName", + mapper: { + constraints: { + Pattern: new RegExp("^[A-Za-z0-9_][^<>*#.%&:\\\\+?/]*$"), + MaxLength: 260, + MinLength: 1 + }, + serializedName: "globalParameterName", + required: true, + type: { + name: "String" + } + } +}; + +export const defaultParam: OperationParameter = { + parameterPath: "defaultParam", + mapper: GlobalParameterResourceMapper +}; diff --git a/sdk/datafactory/arm-datafactory/src/operations/globalParameters.ts b/sdk/datafactory/arm-datafactory/src/operations/globalParameters.ts new file mode 100644 index 000000000000..4699ac471a98 --- /dev/null +++ b/sdk/datafactory/arm-datafactory/src/operations/globalParameters.ts @@ -0,0 +1,329 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { GlobalParameters } from "../operationsInterfaces"; +import * as coreClient from "@azure/core-client"; +import * as Mappers from "../models/mappers"; +import * as Parameters from "../models/parameters"; +import { DataFactoryManagementClient } from "../dataFactoryManagementClient"; +import { + GlobalParameterResource, + GlobalParametersListByFactoryNextOptionalParams, + GlobalParametersListByFactoryOptionalParams, + GlobalParametersListByFactoryResponse, + GlobalParametersGetOptionalParams, + GlobalParametersGetResponse, + GlobalParametersCreateOrUpdateOptionalParams, + GlobalParametersCreateOrUpdateResponse, + GlobalParametersDeleteOptionalParams, + GlobalParametersListByFactoryNextResponse +} from "../models"; + +/// +/** Class containing GlobalParameters operations. */ +export class GlobalParametersImpl implements GlobalParameters { + private readonly client: DataFactoryManagementClient; + + /** + * Initialize a new instance of the class GlobalParameters class. + * @param client Reference to the service client + */ + constructor(client: DataFactoryManagementClient) { + this.client = client; + } + + /** + * Lists Global parameters + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param options The options parameters. + */ + public listByFactory( + resourceGroupName: string, + factoryName: string, + options?: GlobalParametersListByFactoryOptionalParams + ): PagedAsyncIterableIterator { + const iter = this.listByFactoryPagingAll( + resourceGroupName, + factoryName, + options + ); + return { + next() { + return iter.next(); + }, + [Symbol.asyncIterator]() { + return this; + }, + byPage: () => { + return this.listByFactoryPagingPage( + resourceGroupName, + factoryName, + options + ); + } + }; + } + + private async *listByFactoryPagingPage( + resourceGroupName: string, + factoryName: string, + options?: GlobalParametersListByFactoryOptionalParams + ): AsyncIterableIterator { + let result = await this._listByFactory( + resourceGroupName, + factoryName, + options + ); + yield result.value || []; + let continuationToken = result.nextLink; + while (continuationToken) { + result = await this._listByFactoryNext( + resourceGroupName, + factoryName, + continuationToken, + options + ); + continuationToken = result.nextLink; + yield result.value || []; + } + } + + private async *listByFactoryPagingAll( + resourceGroupName: string, + factoryName: string, + options?: GlobalParametersListByFactoryOptionalParams + ): AsyncIterableIterator { + for await (const page of this.listByFactoryPagingPage( + resourceGroupName, + factoryName, + options + )) { + yield* page; + } + } + + /** + * Lists Global parameters + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param options The options parameters. + */ + private _listByFactory( + resourceGroupName: string, + factoryName: string, + options?: GlobalParametersListByFactoryOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, factoryName, options }, + listByFactoryOperationSpec + ); + } + + /** + * Gets a Global parameter + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + factoryName: string, + globalParameterName: string, + options?: GlobalParametersGetOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, factoryName, globalParameterName, options }, + getOperationSpec + ); + } + + /** + * Creates or updates a Global parameter + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @param defaultParam Global parameter resource definition. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + factoryName: string, + globalParameterName: string, + defaultParam: GlobalParameterResource, + options?: GlobalParametersCreateOrUpdateOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { + resourceGroupName, + factoryName, + globalParameterName, + defaultParam, + options + }, + createOrUpdateOperationSpec + ); + } + + /** + * Deletes a Global parameter + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + factoryName: string, + globalParameterName: string, + options?: GlobalParametersDeleteOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, factoryName, globalParameterName, options }, + deleteOperationSpec + ); + } + + /** + * ListByFactoryNext + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param nextLink The nextLink from the previous successful call to the ListByFactory method. + * @param options The options parameters. + */ + private _listByFactoryNext( + resourceGroupName: string, + factoryName: string, + nextLink: string, + options?: GlobalParametersListByFactoryNextOptionalParams + ): Promise { + return this.client.sendOperationRequest( + { resourceGroupName, factoryName, nextLink, options }, + listByFactoryNextOperationSpec + ); + } +} +// Operation Specifications +const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); + +const listByFactoryOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/globalParameters", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GlobalParameterListResponse + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.factoryName + ], + headerParameters: [Parameters.accept], + serializer +}; +const getOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/globalParameters/{globalParameterName}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GlobalParameterResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.factoryName, + Parameters.globalParameterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const createOrUpdateOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/globalParameters/{globalParameterName}", + httpMethod: "PUT", + responses: { + 200: { + bodyMapper: Mappers.GlobalParameterResource + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + requestBody: Parameters.defaultParam, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.factoryName, + Parameters.globalParameterName + ], + headerParameters: [Parameters.accept, Parameters.contentType], + mediaType: "json", + serializer +}; +const deleteOperationSpec: coreClient.OperationSpec = { + path: + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataFactory/factories/{factoryName}/globalParameters/{globalParameterName}", + httpMethod: "DELETE", + responses: { + 200: {}, + 204: {}, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.factoryName, + Parameters.globalParameterName + ], + headerParameters: [Parameters.accept], + serializer +}; +const listByFactoryNextOperationSpec: coreClient.OperationSpec = { + path: "{nextLink}", + httpMethod: "GET", + responses: { + 200: { + bodyMapper: Mappers.GlobalParameterListResponse + }, + default: { + bodyMapper: Mappers.CloudError + } + }, + queryParameters: [Parameters.apiVersion], + urlParameters: [ + Parameters.$host, + Parameters.nextLink, + Parameters.subscriptionId, + Parameters.resourceGroupName, + Parameters.factoryName + ], + headerParameters: [Parameters.accept], + serializer +}; diff --git a/sdk/datafactory/arm-datafactory/src/operations/index.ts b/sdk/datafactory/arm-datafactory/src/operations/index.ts index 69f4138b971a..b877568ac19c 100644 --- a/sdk/datafactory/arm-datafactory/src/operations/index.ts +++ b/sdk/datafactory/arm-datafactory/src/operations/index.ts @@ -26,3 +26,4 @@ export * from "./managedPrivateEndpoints"; export * from "./privateEndPointConnections"; export * from "./privateEndpointConnection"; export * from "./privateLinkResources"; +export * from "./globalParameters"; diff --git a/sdk/datafactory/arm-datafactory/src/operationsInterfaces/globalParameters.ts b/sdk/datafactory/arm-datafactory/src/operationsInterfaces/globalParameters.ts new file mode 100644 index 000000000000..76c479e4b5fd --- /dev/null +++ b/sdk/datafactory/arm-datafactory/src/operationsInterfaces/globalParameters.ts @@ -0,0 +1,75 @@ +/* + * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { + GlobalParameterResource, + GlobalParametersListByFactoryOptionalParams, + GlobalParametersGetOptionalParams, + GlobalParametersGetResponse, + GlobalParametersCreateOrUpdateOptionalParams, + GlobalParametersCreateOrUpdateResponse, + GlobalParametersDeleteOptionalParams +} from "../models"; + +/// +/** Interface representing a GlobalParameters. */ +export interface GlobalParameters { + /** + * Lists Global parameters + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param options The options parameters. + */ + listByFactory( + resourceGroupName: string, + factoryName: string, + options?: GlobalParametersListByFactoryOptionalParams + ): PagedAsyncIterableIterator; + /** + * Gets a Global parameter + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @param options The options parameters. + */ + get( + resourceGroupName: string, + factoryName: string, + globalParameterName: string, + options?: GlobalParametersGetOptionalParams + ): Promise; + /** + * Creates or updates a Global parameter + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @param defaultParam Global parameter resource definition. + * @param options The options parameters. + */ + createOrUpdate( + resourceGroupName: string, + factoryName: string, + globalParameterName: string, + defaultParam: GlobalParameterResource, + options?: GlobalParametersCreateOrUpdateOptionalParams + ): Promise; + /** + * Deletes a Global parameter + * @param resourceGroupName The resource group name. + * @param factoryName The factory name. + * @param globalParameterName The global parameter name. + * @param options The options parameters. + */ + delete( + resourceGroupName: string, + factoryName: string, + globalParameterName: string, + options?: GlobalParametersDeleteOptionalParams + ): Promise; +} diff --git a/sdk/datafactory/arm-datafactory/src/operationsInterfaces/index.ts b/sdk/datafactory/arm-datafactory/src/operationsInterfaces/index.ts index 69f4138b971a..b877568ac19c 100644 --- a/sdk/datafactory/arm-datafactory/src/operationsInterfaces/index.ts +++ b/sdk/datafactory/arm-datafactory/src/operationsInterfaces/index.ts @@ -26,3 +26,4 @@ export * from "./managedPrivateEndpoints"; export * from "./privateEndPointConnections"; export * from "./privateEndpointConnection"; export * from "./privateLinkResources"; +export * from "./globalParameters"; 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() {