From 29723e624c9681a440b265cc65791cd9c1f22e9a Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 29 Jun 2022 02:13:12 +0000 Subject: [PATCH] CodeGen from PR 19556 in Azure/azure-rest-api-specs Merge 5bbdd43001e965e34bc6f892ee4faa1e0a4cc238 into ac155b972d0619a6e5bf665a863fb05ee7eeb30f --- .../arm-streamanalytics/CHANGELOG.md | 31 +- .../arm-streamanalytics/_meta.json | 12 +- .../arm-streamanalytics/package.json | 22 +- .../review/arm-streamanalytics.api.md | 77 ++- .../arm-streamanalytics/src/models/index.ts | 221 +++++--- .../arm-streamanalytics/src/models/mappers.ts | 489 ++++++++++++------ .../src/streamAnalyticsManagementClient.ts | 36 +- .../arm-streamanalytics/test/sampleTest.ts | 39 +- .../arm-streamanalytics/tsconfig.json | 10 +- 9 files changed, 647 insertions(+), 290 deletions(-) diff --git a/sdk/streamanalytics/arm-streamanalytics/CHANGELOG.md b/sdk/streamanalytics/arm-streamanalytics/CHANGELOG.md index 7b22f5177893..2ad7c27cc7c6 100644 --- a/sdk/streamanalytics/arm-streamanalytics/CHANGELOG.md +++ b/sdk/streamanalytics/arm-streamanalytics/CHANGELOG.md @@ -1,15 +1,26 @@ # Release History + +## 4.1.0 (2022-06-29) + +**Features** -## 4.0.2 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added Interface GatewayMessageBusSourceProperties + - Added Type Alias AggregateFunctionProperties + - Added Type Alias AzureFunctionOutputDataSource + - Added Type Alias FileReferenceInputDataSource + - Added Type Alias GatewayMessageBusOutputDataSource + - Added Type Alias GatewayMessageBusOutputDataSourceProperties + - Added Type Alias GatewayMessageBusStreamInputDataSource + - Added Type Alias GatewayMessageBusStreamInputDataSourceProperties + - Interface BlobDataSourceProperties has a new optional parameter authenticationMode + - Interface FunctionProperties has a new optional parameter binding + - Interface FunctionProperties has a new optional parameter inputs + - Interface FunctionProperties has a new optional parameter output + - Type Alias BlobOutputDataSource has a new parameter blobPathPrefix + - Type Alias BlobOutputDataSourceProperties has a new parameter blobPathPrefix + - Type Alias BlobReferenceInputDataSource has a new parameter authenticationMode + - Type Alias BlobStreamInputDataSource has a new parameter authenticationMode + ## 4.0.1 (2022-05-05) **Features** diff --git a/sdk/streamanalytics/arm-streamanalytics/_meta.json b/sdk/streamanalytics/arm-streamanalytics/_meta.json index eacc0d59e070..b757820c92a5 100644 --- a/sdk/streamanalytics/arm-streamanalytics/_meta.json +++ b/sdk/streamanalytics/arm-streamanalytics/_meta.json @@ -1,8 +1,8 @@ { - "commit": "d600759c3516b61a7c353bc8682bccbab85a6f65", - "readme": "specification\\streamanalytics\\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\\streamanalytics\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-alpha.19.20220408.1 --generate-sample=true", + "commit": "d0d8ebda480e8b57601c3f17ffd5cb1cd7597b44", + "readme": "specification/streamanalytics/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=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/streamanalytics/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.2", + "use": "@autorest/typescript@6.0.0-alpha.19.20220425.1" +} \ No newline at end of file diff --git a/sdk/streamanalytics/arm-streamanalytics/package.json b/sdk/streamanalytics/arm-streamanalytics/package.json index 560af1aec650..33e7fd392361 100644 --- a/sdk/streamanalytics/arm-streamanalytics/package.json +++ b/sdk/streamanalytics/arm-streamanalytics/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for StreamAnalyticsManagementClient.", - "version": "4.0.2", + "version": "4.1.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/streamanalytics/arm-streamanalytics", "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" }, @@ -106,13 +108,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-streamanalytics?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/streamanalytics/arm-streamanalytics/review/arm-streamanalytics.api.md b/sdk/streamanalytics/arm-streamanalytics/review/arm-streamanalytics.api.md index 4500d2df761a..dc538fccee51 100644 --- a/sdk/streamanalytics/arm-streamanalytics/review/arm-streamanalytics.api.md +++ b/sdk/streamanalytics/arm-streamanalytics/review/arm-streamanalytics.api.md @@ -10,6 +10,11 @@ import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { PollerLike } from '@azure/core-lro'; import { PollOperationState } from '@azure/core-lro'; +// @public +export type AggregateFunctionProperties = FunctionProperties & { + type: "Aggregate"; +}; + // @public export type AuthenticationMode = string; @@ -43,6 +48,16 @@ export type AzureDataLakeStoreOutputDataSourceProperties = OAuthBasedDataSourceP authenticationMode?: AuthenticationMode; }; +// @public +export type AzureFunctionOutputDataSource = OutputDataSource & { + type: "Microsoft.AzureFunction"; + functionAppName?: string; + functionName?: string; + apiKey?: string; + maxBatchSize?: number; + maxBatchCount?: number; +}; + // @public export type AzureMachineLearningWebServiceFunctionBinding = FunctionBinding & { type: "Microsoft.MachineLearning/WebService"; @@ -157,6 +172,7 @@ export type AzureTableOutputDataSource = OutputDataSource & { // @public export interface BlobDataSourceProperties { + authenticationMode?: AuthenticationMode; container?: string; dateFormat?: string; pathPattern?: string; @@ -173,11 +189,12 @@ export type BlobOutputDataSource = OutputDataSource & { dateFormat?: string; timeFormat?: string; authenticationMode?: AuthenticationMode; + blobPathPrefix?: string; }; // @public export type BlobOutputDataSourceProperties = BlobDataSourceProperties & { - authenticationMode?: AuthenticationMode; + blobPathPrefix?: string; }; // @public @@ -188,6 +205,7 @@ export type BlobReferenceInputDataSource = ReferenceInputDataSource & { pathPattern?: string; dateFormat?: string; timeFormat?: string; + authenticationMode?: AuthenticationMode; }; // @public @@ -201,6 +219,7 @@ export type BlobStreamInputDataSource = StreamInputDataSource & { pathPattern?: string; dateFormat?: string; timeFormat?: string; + authenticationMode?: AuthenticationMode; sourcePartitionCount?: number; }; @@ -487,6 +506,12 @@ export type EventSerializationType = string; // @public export type EventsOutOfOrderPolicy = string; +// @public +export type FileReferenceInputDataSource = ReferenceInputDataSource & { + type: "File"; + path?: string; +}; + // @public export interface FunctionBinding { type: "Microsoft.MachineLearning/WebService" | "Microsoft.StreamAnalytics/JavascriptUdf"; @@ -519,12 +544,16 @@ export interface FunctionOutput { // @public export interface FunctionProperties { + binding?: FunctionBindingUnion; readonly etag?: string; - type: "Scalar"; + // (undocumented) + inputs?: FunctionInput[]; + output?: FunctionOutput; + type: "Scalar" | "Aggregate"; } // @public (undocumented) -export type FunctionPropertiesUnion = FunctionProperties | ScalarFunctionProperties; +export type FunctionPropertiesUnion = FunctionProperties | ScalarFunctionProperties | AggregateFunctionProperties; // @public export interface FunctionRetrieveDefaultDefinitionParameters { @@ -623,10 +652,33 @@ export interface FunctionsUpdateOptionalParams extends coreClient.OperationOptio // @public export type FunctionsUpdateResponse = FunctionsUpdateHeaders & FunctionModel; +// @public +export type GatewayMessageBusOutputDataSource = OutputDataSource & { + type: "GatewayMessageBus"; + topic?: string; +}; + +// @public +export type GatewayMessageBusOutputDataSourceProperties = GatewayMessageBusSourceProperties & {}; + +// @public +export interface GatewayMessageBusSourceProperties { + topic?: string; +} + +// @public +export type GatewayMessageBusStreamInputDataSource = StreamInputDataSource & { + type: "GatewayMessageBus"; + topic?: string; +}; + +// @public +export type GatewayMessageBusStreamInputDataSourceProperties = GatewayMessageBusSourceProperties & {}; + // @public export interface Identity { - principalId?: string; - tenantId?: string; + readonly principalId?: string; + readonly tenantId?: string; type?: string; } @@ -976,11 +1028,11 @@ export type Output = SubResource & { // @public export interface OutputDataSource { - type: "Microsoft.Storage/Blob" | "Microsoft.Storage/Table" | "Microsoft.ServiceBus/EventHub" | "Microsoft.EventHub/EventHub" | "Microsoft.Sql/Server/Database" | "Microsoft.Sql/Server/DataWarehouse" | "Microsoft.Storage/DocumentDB" | "Microsoft.ServiceBus/Queue" | "Microsoft.ServiceBus/Topic" | "PowerBI" | "Microsoft.DataLake/Accounts"; + type: "Microsoft.Storage/Blob" | "Microsoft.Storage/Table" | "Microsoft.ServiceBus/EventHub" | "Microsoft.EventHub/EventHub" | "Microsoft.Sql/Server/Database" | "Microsoft.Sql/Server/DataWarehouse" | "Microsoft.Storage/DocumentDB" | "Microsoft.AzureFunction" | "Microsoft.ServiceBus/Queue" | "Microsoft.ServiceBus/Topic" | "PowerBI" | "Microsoft.DataLake/Accounts" | "GatewayMessageBus"; } // @public (undocumented) -export type OutputDataSourceUnion = OutputDataSource | BlobOutputDataSource | AzureTableOutputDataSource | EventHubOutputDataSource | EventHubV2OutputDataSource | AzureSqlDatabaseOutputDataSource | AzureSynapseOutputDataSource | DocumentDbOutputDataSource | ServiceBusQueueOutputDataSource | ServiceBusTopicOutputDataSource | PowerBIOutputDataSource | AzureDataLakeStoreOutputDataSource; +export type OutputDataSourceUnion = OutputDataSource | BlobOutputDataSource | AzureTableOutputDataSource | EventHubOutputDataSource | EventHubV2OutputDataSource | AzureSqlDatabaseOutputDataSource | AzureSynapseOutputDataSource | DocumentDbOutputDataSource | AzureFunctionOutputDataSource | ServiceBusQueueOutputDataSource | ServiceBusTopicOutputDataSource | PowerBIOutputDataSource | AzureDataLakeStoreOutputDataSource | GatewayMessageBusOutputDataSource; // @public export type OutputErrorPolicy = string; @@ -1180,11 +1232,11 @@ export type ProxyResource = Resource & {}; // @public export interface ReferenceInputDataSource { - type: "Microsoft.Storage/Blob" | "Microsoft.Sql/Server/Database"; + type: "File" | "Microsoft.Storage/Blob" | "Microsoft.Sql/Server/Database"; } // @public (undocumented) -export type ReferenceInputDataSourceUnion = ReferenceInputDataSource | BlobReferenceInputDataSource | AzureSqlReferenceInputDataSource; +export type ReferenceInputDataSourceUnion = ReferenceInputDataSource | FileReferenceInputDataSource | BlobReferenceInputDataSource | AzureSqlReferenceInputDataSource; // @public export type ReferenceInputProperties = InputProperties & { @@ -1211,9 +1263,6 @@ export interface ResourceTestStatus { // @public export type ScalarFunctionProperties = FunctionProperties & { type: "Scalar"; - inputs?: FunctionInput[]; - output?: FunctionOutput; - binding?: FunctionBindingUnion; }; // @public @@ -1489,11 +1538,11 @@ export type StreamingJobsUpdateResponse = StreamingJobsUpdateHeaders & Streaming // @public export interface StreamInputDataSource { - type: "Microsoft.Storage/Blob" | "Microsoft.ServiceBus/EventHub" | "Microsoft.EventHub/EventHub" | "Microsoft.Devices/IotHubs"; + type: "Microsoft.Storage/Blob" | "Microsoft.ServiceBus/EventHub" | "Microsoft.EventHub/EventHub" | "Microsoft.Devices/IotHubs" | "GatewayMessageBus"; } // @public (undocumented) -export type StreamInputDataSourceUnion = StreamInputDataSource | BlobStreamInputDataSource | EventHubStreamInputDataSource | EventHubV2StreamInputDataSource | IoTHubStreamInputDataSource; +export type StreamInputDataSourceUnion = StreamInputDataSource | BlobStreamInputDataSource | EventHubStreamInputDataSource | EventHubV2StreamInputDataSource | IoTHubStreamInputDataSource | GatewayMessageBusStreamInputDataSource; // @public export type StreamInputProperties = InputProperties & { diff --git a/sdk/streamanalytics/arm-streamanalytics/src/models/index.ts b/sdk/streamanalytics/arm-streamanalytics/src/models/index.ts index a6c6e2ffaa4a..ed254ec7a7e4 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/models/index.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/models/index.ts @@ -27,13 +27,20 @@ export type OutputDataSourceUnion = | AzureSqlDatabaseOutputDataSource | AzureSynapseOutputDataSource | DocumentDbOutputDataSource + | AzureFunctionOutputDataSource | ServiceBusQueueOutputDataSource | ServiceBusTopicOutputDataSource | PowerBIOutputDataSource - | AzureDataLakeStoreOutputDataSource; + | AzureDataLakeStoreOutputDataSource + | GatewayMessageBusOutputDataSource; export type FunctionPropertiesUnion = | FunctionProperties - | ScalarFunctionProperties; + | ScalarFunctionProperties + | AggregateFunctionProperties; +export type FunctionBindingUnion = + | FunctionBinding + | AzureMachineLearningWebServiceFunctionBinding + | JavaScriptFunctionBinding; export type FunctionRetrieveDefaultDefinitionParametersUnion = | FunctionRetrieveDefaultDefinitionParameters | AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters @@ -43,15 +50,13 @@ export type StreamInputDataSourceUnion = | BlobStreamInputDataSource | EventHubStreamInputDataSource | EventHubV2StreamInputDataSource - | IoTHubStreamInputDataSource; + | IoTHubStreamInputDataSource + | GatewayMessageBusStreamInputDataSource; export type ReferenceInputDataSourceUnion = | ReferenceInputDataSource + | FileReferenceInputDataSource | BlobReferenceInputDataSource | AzureSqlReferenceInputDataSource; -export type FunctionBindingUnion = - | FunctionBinding - | AzureMachineLearningWebServiceFunctionBinding - | JavaScriptFunctionBinding; /** Result of the request to list Stream Analytics operations. It contains a list of operations and a URL link to get the next set of results. */ export interface OperationListResult { @@ -230,21 +235,50 @@ export interface OutputDataSource { | "Microsoft.Sql/Server/Database" | "Microsoft.Sql/Server/DataWarehouse" | "Microsoft.Storage/DocumentDB" + | "Microsoft.AzureFunction" | "Microsoft.ServiceBus/Queue" | "Microsoft.ServiceBus/Topic" | "PowerBI" - | "Microsoft.DataLake/Accounts"; + | "Microsoft.DataLake/Accounts" + | "GatewayMessageBus"; } /** The properties that are associated with a function. */ export interface FunctionProperties { /** Polymorphic discriminator, which specifies the different types this object can be */ - type: "Scalar"; + type: "Scalar" | "Aggregate"; /** * The current entity tag for the function. This is an opaque string. You can use it to detect whether the resource has changed between requests. You can also use it in the If-Match or If-None-Match headers for write operations for optimistic concurrency. * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly etag?: string; + inputs?: FunctionInput[]; + /** Describes the output of a function. */ + output?: FunctionOutput; + /** The physical binding of the function. For example, in the Azure Machine Learning web service’s case, this describes the endpoint. */ + binding?: FunctionBindingUnion; +} + +/** Describes one input parameter of a function. */ +export interface FunctionInput { + /** The (Azure Stream Analytics supported) data type of the function input parameter. A list of valid Azure Stream Analytics data types are described at https://msdn.microsoft.com/en-us/library/azure/dn835065.aspx */ + dataType?: string; + /** A flag indicating if the parameter is a configuration parameter. True if this input parameter is expected to be a constant. Default is false. */ + isConfigurationParameter?: boolean; +} + +/** Describes the output of a function. */ +export interface FunctionOutput { + /** The (Azure Stream Analytics supported) data type of the function output. A list of valid Azure Stream Analytics data types are described at https://msdn.microsoft.com/en-us/library/azure/dn835065.aspx */ + dataType?: string; +} + +/** The physical binding of the function. For example, in the Azure Machine Learning web service’s case, this describes the endpoint. */ +export interface FunctionBinding { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: + | "Microsoft.MachineLearning/WebService" + | "Microsoft.StreamAnalytics/JavascriptUdf"; } /** The properties that are associated with an Azure Storage account */ @@ -263,10 +297,16 @@ export interface ClusterInfo { /** Describes how identity is verified */ export interface Identity { - /** The identity tenantId */ - tenantId?: string; - /** The identity principal ID */ - principalId?: string; + /** + * The identity tenantId + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly tenantId?: string; + /** + * The identity principal ID + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly principalId?: string; /** The identity type */ type?: string; } @@ -515,13 +555,14 @@ export interface StreamInputDataSource { | "Microsoft.Storage/Blob" | "Microsoft.ServiceBus/EventHub" | "Microsoft.EventHub/EventHub" - | "Microsoft.Devices/IotHubs"; + | "Microsoft.Devices/IotHubs" + | "GatewayMessageBus"; } /** Describes an input data source that contains reference data. */ export interface ReferenceInputDataSource { /** Polymorphic discriminator, which specifies the different types this object can be */ - type: "Microsoft.Storage/Blob" | "Microsoft.Sql/Server/Database"; + type: "File" | "Microsoft.Storage/Blob" | "Microsoft.Sql/Server/Database"; } /** The properties that are associated with a blob data source. */ @@ -536,6 +577,8 @@ export interface BlobDataSourceProperties { dateFormat?: string; /** The time format. Wherever {time} appears in pathPattern, the value of this property is used as the time format instead. */ timeFormat?: string; + /** Authentication Mode. */ + authenticationMode?: AuthenticationMode; } /** The common properties that are associated with Service Bus data sources (Queues, Topics, Event Hubs, etc.). */ @@ -550,6 +593,12 @@ export interface ServiceBusDataSourceProperties { authenticationMode?: AuthenticationMode; } +/** The properties that are associated with a gateway message bus datasource. */ +export interface GatewayMessageBusSourceProperties { + /** The name of the Service Bus topic. */ + topic?: string; +} + /** The properties that are associated with an Azure SQL database data source. */ export interface AzureSqlDatabaseDataSourceProperties { /** The name of the SQL server containing the Azure SQL database. Required on PUT (CreateOrReplace) requests. */ @@ -594,28 +643,6 @@ export interface OAuthBasedDataSourceProperties { tokenUserDisplayName?: string; } -/** Describes one input parameter of a function. */ -export interface FunctionInput { - /** The (Azure Stream Analytics supported) data type of the function input parameter. A list of valid Azure Stream Analytics data types are described at https://msdn.microsoft.com/en-us/library/azure/dn835065.aspx */ - dataType?: string; - /** A flag indicating if the parameter is a configuration parameter. True if this input parameter is expected to be a constant. Default is false. */ - isConfigurationParameter?: boolean; -} - -/** Describes the output of a function. */ -export interface FunctionOutput { - /** The (Azure Stream Analytics supported) data type of the function output. A list of valid Azure Stream Analytics data types are described at https://msdn.microsoft.com/en-us/library/azure/dn835065.aspx */ - dataType?: string; -} - -/** The physical binding of the function. For example, in the Azure Machine Learning web service’s case, this describes the endpoint. */ -export interface FunctionBinding { - /** Polymorphic discriminator, which specifies the different types this object can be */ - type: - | "Microsoft.MachineLearning/WebService" - | "Microsoft.StreamAnalytics/JavascriptUdf"; -} - /** The inputs for the Azure Machine Learning web service endpoint. */ export interface AzureMachineLearningWebServiceInputs { /** The name of the input. This is the name provided while authoring the endpoint. */ @@ -773,6 +800,8 @@ export type BlobOutputDataSource = OutputDataSource & { timeFormat?: string; /** Authentication Mode. */ authenticationMode?: AuthenticationMode; + /** Blob path prefix. */ + blobPathPrefix?: string; }; /** Describes an Azure Table output data source. */ @@ -891,6 +920,22 @@ export type DocumentDbOutputDataSource = OutputDataSource & { documentId?: string; }; +/** Defines the metadata of AzureFunctionOutputDataSource */ +export type AzureFunctionOutputDataSource = OutputDataSource & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "Microsoft.AzureFunction"; + /** The name of your Azure Functions app. */ + functionAppName?: string; + /** The name of the function in your Azure Functions app. */ + functionName?: string; + /** If you want to use an Azure Function from another subscription, you can do so by providing the key to access your function. */ + apiKey?: string; + /** A property that lets you set the maximum size for each output batch that's sent to your Azure function. The input unit is in bytes. By default, this value is 262,144 bytes (256 KB). */ + maxBatchSize?: number; + /** A property that lets you specify the maximum number of events in each batch that's sent to Azure Functions. The default value is 100. */ + maxBatchCount?: number; +}; + /** Describes a Service Bus Queue output data source. */ export type ServiceBusQueueOutputDataSource = OutputDataSource & { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -977,16 +1022,48 @@ export type AzureDataLakeStoreOutputDataSource = OutputDataSource & { authenticationMode?: AuthenticationMode; }; +/** Describes a Gateway Message Bus output data source. */ +export type GatewayMessageBusOutputDataSource = OutputDataSource & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "GatewayMessageBus"; + /** The name of the Service Bus topic. */ + topic?: string; +}; + /** The properties that are associated with a scalar function. */ export type ScalarFunctionProperties = FunctionProperties & { /** Polymorphic discriminator, which specifies the different types this object can be */ type: "Scalar"; - /** A list of inputs describing the parameters of the function. */ - inputs?: FunctionInput[]; - /** The output of the function. */ - output?: FunctionOutput; - /** The physical binding of the function. For example, in the Azure Machine Learning web service’s case, this describes the endpoint. */ - binding?: FunctionBindingUnion; +}; + +/** The properties that are associated with an aggregate function. */ +export type AggregateFunctionProperties = FunctionProperties & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "Aggregate"; +}; + +/** The binding to an Azure Machine Learning web service. */ +export type AzureMachineLearningWebServiceFunctionBinding = FunctionBinding & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "Microsoft.MachineLearning/WebService"; + /** The Request-Response execute endpoint of the Azure Machine Learning web service. Find out more here: https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-consume-web-services#request-response-service-rrs */ + endpoint?: string; + /** The API key used to authenticate with Request-Response endpoint. */ + apiKey?: string; + /** The inputs for the Azure Machine Learning web service endpoint. */ + inputs?: AzureMachineLearningWebServiceInputs; + /** A list of outputs from the Azure Machine Learning web service endpoint execution. */ + outputs?: AzureMachineLearningWebServiceOutputColumn[]; + /** Number between 1 and 10000 describing maximum number of rows for every Azure ML RRS execute request. Default is 1000. */ + batchSize?: number; +}; + +/** The binding to a JavaScript function. */ +export type JavaScriptFunctionBinding = FunctionBinding & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "Microsoft.StreamAnalytics/JavascriptUdf"; + /** The JavaScript code containing a single function definition. For example: 'function (x, y) { return x + y; }' */ + script?: string; }; /** The properties that are associated with an Azure Storage account with MSI */ @@ -1040,7 +1117,9 @@ export type BlobStreamInputDataSource = StreamInputDataSource & { dateFormat?: string; /** The time format. Wherever {time} appears in pathPattern, the value of this property is used as the time format instead. */ timeFormat?: string; - /** The partition count of the blob input data source. Range 1 - 256. */ + /** Authentication Mode. */ + authenticationMode?: AuthenticationMode; + /** The partition count of the blob input data source. Range 1 - 1024. */ sourcePartitionCount?: number; }; @@ -1096,6 +1175,22 @@ export type IoTHubStreamInputDataSource = StreamInputDataSource & { endpoint?: string; }; +/** Describes a blob input data source that contains stream data. */ +export type GatewayMessageBusStreamInputDataSource = StreamInputDataSource & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "GatewayMessageBus"; + /** The name of the Service Bus topic. */ + topic?: string; +}; + +/** Describes a file input data source that contains reference data. */ +export type FileReferenceInputDataSource = ReferenceInputDataSource & { + /** Polymorphic discriminator, which specifies the different types this object can be */ + type: "File"; + /** The path of the file. */ + path?: string; +}; + /** Describes a blob input data source that contains reference data. */ export type BlobReferenceInputDataSource = ReferenceInputDataSource & { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -1110,6 +1205,8 @@ export type BlobReferenceInputDataSource = ReferenceInputDataSource & { dateFormat?: string; /** The time format. Wherever {time} appears in pathPattern, the value of this property is used as the time format instead. */ timeFormat?: string; + /** Authentication Mode. */ + authenticationMode?: AuthenticationMode; }; /** Describes an Azure SQL database reference input data source. */ @@ -1138,7 +1235,7 @@ export type AzureSqlReferenceInputDataSource = ReferenceInputDataSource & { /** The properties that are associated with a blob input containing stream data. */ export type BlobStreamInputDataSourceProperties = BlobDataSourceProperties & { - /** The partition count of the blob input data source. Range 1 - 256. */ + /** The partition count of the blob input data source. Range 1 - 1024. */ sourcePartitionCount?: number; }; @@ -1147,8 +1244,8 @@ export type BlobReferenceInputDataSourceProperties = BlobDataSourceProperties & /** The properties that are associated with a blob output. */ export type BlobOutputDataSourceProperties = BlobDataSourceProperties & { - /** Authentication Mode. */ - authenticationMode?: AuthenticationMode; + /** Blob path prefix. */ + blobPathPrefix?: string; }; /** The common properties that are associated with Event Hub data sources. */ @@ -1177,6 +1274,12 @@ export type ServiceBusTopicOutputDataSourceProperties = ServiceBusDataSourceProp systemPropertyColumns?: { [propertyName: string]: string }; }; +/** The properties that are associated with a gateway message bus input containing stream data. */ +export type GatewayMessageBusStreamInputDataSourceProperties = GatewayMessageBusSourceProperties & {}; + +/** The properties that are associated with a Gateway Message Bus. */ +export type GatewayMessageBusOutputDataSourceProperties = GatewayMessageBusSourceProperties & {}; + /** The properties that are associated with an Azure SQL database output. */ export type AzureSqlDatabaseOutputDataSourceProperties = AzureSqlDatabaseDataSourceProperties & {}; @@ -1213,30 +1316,6 @@ export type AzureDataLakeStoreOutputDataSourceProperties = OAuthBasedDataSourceP authenticationMode?: AuthenticationMode; }; -/** The binding to an Azure Machine Learning web service. */ -export type AzureMachineLearningWebServiceFunctionBinding = FunctionBinding & { - /** Polymorphic discriminator, which specifies the different types this object can be */ - type: "Microsoft.MachineLearning/WebService"; - /** The Request-Response execute endpoint of the Azure Machine Learning web service. Find out more here: https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-consume-web-services#request-response-service-rrs */ - endpoint?: string; - /** The API key used to authenticate with Request-Response endpoint. */ - apiKey?: string; - /** The inputs for the Azure Machine Learning web service endpoint. */ - inputs?: AzureMachineLearningWebServiceInputs; - /** A list of outputs from the Azure Machine Learning web service endpoint execution. */ - outputs?: AzureMachineLearningWebServiceOutputColumn[]; - /** Number between 1 and 10000 describing maximum number of rows for every Azure ML RRS execute request. Default is 1000. */ - batchSize?: number; -}; - -/** The binding to a JavaScript function. */ -export type JavaScriptFunctionBinding = FunctionBinding & { - /** Polymorphic discriminator, which specifies the different types this object can be */ - type: "Microsoft.StreamAnalytics/JavascriptUdf"; - /** The JavaScript code containing a single function definition. For example: 'function (x, y) { return x + y; }' */ - script?: string; -}; - /** A streaming job object, containing all information associated with the named streaming job. */ export type StreamingJob = TrackedResource & { /** Describes the system-assigned managed identity assigned to this job that can be used to authenticate with inputs and outputs. */ diff --git a/sdk/streamanalytics/arm-streamanalytics/src/models/mappers.ts b/sdk/streamanalytics/arm-streamanalytics/src/models/mappers.ts index 854205becd9d..8e4b077976a0 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/models/mappers.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/models/mappers.ts @@ -334,6 +334,7 @@ export const Compression: coreClient.CompositeMapper = { className: "Compression", modelProperties: { type: { + defaultValue: "None", serializedName: "type", required: true, type: { @@ -417,6 +418,89 @@ export const FunctionProperties: coreClient.CompositeMapper = { type: { name: "String" } + }, + inputs: { + serializedName: "properties.inputs", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FunctionInput" + } + } + } + }, + output: { + serializedName: "properties.output", + type: { + name: "Composite", + className: "FunctionOutput" + } + }, + binding: { + serializedName: "properties.binding", + type: { + name: "Composite", + className: "FunctionBinding" + } + } + } + } +}; + +export const FunctionInput: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FunctionInput", + modelProperties: { + dataType: { + serializedName: "dataType", + type: { + name: "String" + } + }, + isConfigurationParameter: { + serializedName: "isConfigurationParameter", + type: { + name: "Boolean" + } + } + } + } +}; + +export const FunctionOutput: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FunctionOutput", + modelProperties: { + dataType: { + serializedName: "dataType", + type: { + name: "String" + } + } + } + } +}; + +export const FunctionBinding: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "FunctionBinding", + uberParent: "FunctionBinding", + polymorphicDiscriminator: { + serializedName: "type", + clientName: "type" + }, + modelProperties: { + type: { + serializedName: "type", + required: true, + type: { + name: "String" + } } } } @@ -465,12 +549,14 @@ export const Identity: coreClient.CompositeMapper = { modelProperties: { tenantId: { serializedName: "tenantId", + readOnly: true, type: { name: "String" } }, principalId: { serializedName: "principalId", + readOnly: true, type: { name: "String" } @@ -769,7 +855,7 @@ export const ClusterSku: coreClient.CompositeMapper = { }, capacity: { constraints: { - InclusiveMaximum: 216, + InclusiveMaximum: 396, InclusiveMinimum: 36 }, serializedName: "capacity", @@ -1050,6 +1136,13 @@ export const BlobDataSourceProperties: coreClient.CompositeMapper = { type: { name: "String" } + }, + authenticationMode: { + defaultValue: "ConnectionString", + serializedName: "authenticationMode", + type: { + name: "String" + } } } } @@ -1079,6 +1172,7 @@ export const ServiceBusDataSourceProperties: coreClient.CompositeMapper = { } }, authenticationMode: { + defaultValue: "ConnectionString", serializedName: "authenticationMode", type: { name: "String" @@ -1088,6 +1182,21 @@ export const ServiceBusDataSourceProperties: coreClient.CompositeMapper = { } }; +export const GatewayMessageBusSourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GatewayMessageBusSourceProperties", + modelProperties: { + topic: { + serializedName: "topic", + type: { + name: "String" + } + } + } + } +}; + export const AzureSqlDatabaseDataSourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1136,6 +1245,7 @@ export const AzureSqlDatabaseDataSourceProperties: coreClient.CompositeMapper = } }, authenticationMode: { + defaultValue: "ConnectionString", serializedName: "authenticationMode", type: { name: "String" @@ -1211,63 +1321,6 @@ export const OAuthBasedDataSourceProperties: coreClient.CompositeMapper = { } }; -export const FunctionInput: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "FunctionInput", - modelProperties: { - dataType: { - serializedName: "dataType", - type: { - name: "String" - } - }, - isConfigurationParameter: { - serializedName: "isConfigurationParameter", - type: { - name: "Boolean" - } - } - } - } -}; - -export const FunctionOutput: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "FunctionOutput", - modelProperties: { - dataType: { - serializedName: "dataType", - type: { - name: "String" - } - } - } - } -}; - -export const FunctionBinding: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "FunctionBinding", - uberParent: "FunctionBinding", - polymorphicDiscriminator: { - serializedName: "type", - clientName: "type" - }, - modelProperties: { - type: { - serializedName: "type", - required: true, - type: { - name: "String" - } - } - } - } -}; - export const AzureMachineLearningWebServiceInputs: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1497,6 +1550,7 @@ export const Transformation: coreClient.CompositeMapper = { modelProperties: { ...SubResource.type.modelProperties, streamingUnits: { + defaultValue: 3, serializedName: "properties.streamingUnits", type: { name: "Number" @@ -1667,10 +1721,17 @@ export const BlobOutputDataSource: coreClient.CompositeMapper = { } }, authenticationMode: { + defaultValue: "ConnectionString", serializedName: "properties.authenticationMode", type: { name: "String" } + }, + blobPathPrefix: { + serializedName: "properties.blobPathPrefix", + type: { + name: "String" + } } } } @@ -1764,6 +1825,7 @@ export const EventHubOutputDataSource: coreClient.CompositeMapper = { } }, authenticationMode: { + defaultValue: "ConnectionString", serializedName: "properties.authenticationMode", type: { name: "String" @@ -1824,6 +1886,7 @@ export const EventHubV2OutputDataSource: coreClient.CompositeMapper = { } }, authenticationMode: { + defaultValue: "ConnectionString", serializedName: "properties.authenticationMode", type: { name: "String" @@ -1908,6 +1971,7 @@ export const AzureSqlDatabaseOutputDataSource: coreClient.CompositeMapper = { } }, authenticationMode: { + defaultValue: "ConnectionString", serializedName: "properties.authenticationMode", type: { name: "String" @@ -2009,6 +2073,49 @@ export const DocumentDbOutputDataSource: coreClient.CompositeMapper = { } }; +export const AzureFunctionOutputDataSource: coreClient.CompositeMapper = { + serializedName: "Microsoft.AzureFunction", + type: { + name: "Composite", + className: "AzureFunctionOutputDataSource", + uberParent: "OutputDataSource", + polymorphicDiscriminator: OutputDataSource.type.polymorphicDiscriminator, + modelProperties: { + ...OutputDataSource.type.modelProperties, + functionAppName: { + serializedName: "properties.functionAppName", + type: { + name: "String" + } + }, + functionName: { + serializedName: "properties.functionName", + type: { + name: "String" + } + }, + apiKey: { + serializedName: "properties.apiKey", + type: { + name: "String" + } + }, + maxBatchSize: { + serializedName: "properties.maxBatchSize", + type: { + name: "Number" + } + }, + maxBatchCount: { + serializedName: "properties.maxBatchCount", + type: { + name: "Number" + } + } + } + } +}; + export const ServiceBusQueueOutputDataSource: coreClient.CompositeMapper = { serializedName: "Microsoft.ServiceBus/Queue", type: { @@ -2037,6 +2144,7 @@ export const ServiceBusQueueOutputDataSource: coreClient.CompositeMapper = { } }, authenticationMode: { + defaultValue: "ConnectionString", serializedName: "properties.authenticationMode", type: { name: "String" @@ -2098,6 +2206,7 @@ export const ServiceBusTopicOutputDataSource: coreClient.CompositeMapper = { } }, authenticationMode: { + defaultValue: "ConnectionString", serializedName: "properties.authenticationMode", type: { name: "String" @@ -2183,6 +2292,7 @@ export const PowerBIOutputDataSource: coreClient.CompositeMapper = { } }, authenticationMode: { + defaultValue: "ConnectionString", serializedName: "properties.authenticationMode", type: { name: "String" @@ -2250,6 +2360,7 @@ export const AzureDataLakeStoreOutputDataSource: coreClient.CompositeMapper = { } }, authenticationMode: { + defaultValue: "ConnectionString", serializedName: "properties.authenticationMode", type: { name: "String" @@ -2259,6 +2370,25 @@ export const AzureDataLakeStoreOutputDataSource: coreClient.CompositeMapper = { } }; +export const GatewayMessageBusOutputDataSource: coreClient.CompositeMapper = { + serializedName: "GatewayMessageBus", + type: { + name: "Composite", + className: "GatewayMessageBusOutputDataSource", + uberParent: "OutputDataSource", + polymorphicDiscriminator: OutputDataSource.type.polymorphicDiscriminator, + modelProperties: { + ...OutputDataSource.type.modelProperties, + topic: { + serializedName: "properties.topic", + type: { + name: "String" + } + } + } + } +}; + export const ScalarFunctionProperties: coreClient.CompositeMapper = { serializedName: "Scalar", type: { @@ -2267,31 +2397,87 @@ export const ScalarFunctionProperties: coreClient.CompositeMapper = { uberParent: "FunctionProperties", polymorphicDiscriminator: FunctionProperties.type.polymorphicDiscriminator, modelProperties: { - ...FunctionProperties.type.modelProperties, + ...FunctionProperties.type.modelProperties + } + } +}; + +export const AggregateFunctionProperties: coreClient.CompositeMapper = { + serializedName: "Aggregate", + type: { + name: "Composite", + className: "AggregateFunctionProperties", + uberParent: "FunctionProperties", + polymorphicDiscriminator: FunctionProperties.type.polymorphicDiscriminator, + modelProperties: { + ...FunctionProperties.type.modelProperties + } + } +}; + +export const AzureMachineLearningWebServiceFunctionBinding: coreClient.CompositeMapper = { + serializedName: "Microsoft.MachineLearning/WebService", + type: { + name: "Composite", + className: "AzureMachineLearningWebServiceFunctionBinding", + uberParent: "FunctionBinding", + polymorphicDiscriminator: FunctionBinding.type.polymorphicDiscriminator, + modelProperties: { + ...FunctionBinding.type.modelProperties, + endpoint: { + serializedName: "properties.endpoint", + type: { + name: "String" + } + }, + apiKey: { + serializedName: "properties.apiKey", + type: { + name: "String" + } + }, inputs: { serializedName: "properties.inputs", + type: { + name: "Composite", + className: "AzureMachineLearningWebServiceInputs" + } + }, + outputs: { + serializedName: "properties.outputs", type: { name: "Sequence", element: { type: { name: "Composite", - className: "FunctionInput" + className: "AzureMachineLearningWebServiceOutputColumn" } } } }, - output: { - serializedName: "properties.output", + batchSize: { + serializedName: "properties.batchSize", type: { - name: "Composite", - className: "FunctionOutput" + name: "Number" } - }, - binding: { - serializedName: "properties.binding", + } + } + } +}; + +export const JavaScriptFunctionBinding: coreClient.CompositeMapper = { + serializedName: "Microsoft.StreamAnalytics/JavascriptUdf", + type: { + name: "Composite", + className: "JavaScriptFunctionBinding", + uberParent: "FunctionBinding", + polymorphicDiscriminator: FunctionBinding.type.polymorphicDiscriminator, + modelProperties: { + ...FunctionBinding.type.modelProperties, + script: { + serializedName: "properties.script", type: { - name: "Composite", - className: "FunctionBinding" + name: "String" } } } @@ -2305,6 +2491,7 @@ export const JobStorageAccount: coreClient.CompositeMapper = { modelProperties: { ...StorageAccount.type.modelProperties, authenticationMode: { + defaultValue: "ConnectionString", serializedName: "authenticationMode", type: { name: "String" @@ -2450,6 +2637,13 @@ export const BlobStreamInputDataSource: coreClient.CompositeMapper = { name: "String" } }, + authenticationMode: { + defaultValue: "ConnectionString", + serializedName: "properties.authenticationMode", + type: { + name: "String" + } + }, sourcePartitionCount: { serializedName: "properties.sourcePartitionCount", type: { @@ -2489,6 +2683,7 @@ export const EventHubStreamInputDataSource: coreClient.CompositeMapper = { } }, authenticationMode: { + defaultValue: "ConnectionString", serializedName: "properties.authenticationMode", type: { name: "String" @@ -2539,6 +2734,7 @@ export const EventHubV2StreamInputDataSource: coreClient.CompositeMapper = { } }, authenticationMode: { + defaultValue: "ConnectionString", serializedName: "properties.authenticationMode", type: { name: "String" @@ -2604,6 +2800,46 @@ export const IoTHubStreamInputDataSource: coreClient.CompositeMapper = { } }; +export const GatewayMessageBusStreamInputDataSource: coreClient.CompositeMapper = { + serializedName: "GatewayMessageBus", + type: { + name: "Composite", + className: "GatewayMessageBusStreamInputDataSource", + uberParent: "StreamInputDataSource", + polymorphicDiscriminator: + StreamInputDataSource.type.polymorphicDiscriminator, + modelProperties: { + ...StreamInputDataSource.type.modelProperties, + topic: { + serializedName: "properties.topic", + type: { + name: "String" + } + } + } + } +}; + +export const FileReferenceInputDataSource: coreClient.CompositeMapper = { + serializedName: "File", + type: { + name: "Composite", + className: "FileReferenceInputDataSource", + uberParent: "ReferenceInputDataSource", + polymorphicDiscriminator: + ReferenceInputDataSource.type.polymorphicDiscriminator, + modelProperties: { + ...ReferenceInputDataSource.type.modelProperties, + path: { + serializedName: "properties.path", + type: { + name: "String" + } + } + } + } +}; + export const BlobReferenceInputDataSource: coreClient.CompositeMapper = { serializedName: "Microsoft.Storage/Blob", type: { @@ -2649,6 +2885,13 @@ export const BlobReferenceInputDataSource: coreClient.CompositeMapper = { type: { name: "String" } + }, + authenticationMode: { + defaultValue: "ConnectionString", + serializedName: "properties.authenticationMode", + type: { + name: "String" + } } } } @@ -2754,8 +2997,8 @@ export const BlobOutputDataSourceProperties: coreClient.CompositeMapper = { className: "BlobOutputDataSourceProperties", modelProperties: { ...BlobDataSourceProperties.type.modelProperties, - authenticationMode: { - serializedName: "authenticationMode", + blobPathPrefix: { + serializedName: "blobPathPrefix", type: { name: "String" } @@ -2848,6 +3091,26 @@ export const ServiceBusTopicOutputDataSourceProperties: coreClient.CompositeMapp } }; +export const GatewayMessageBusStreamInputDataSourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GatewayMessageBusStreamInputDataSourceProperties", + modelProperties: { + ...GatewayMessageBusSourceProperties.type.modelProperties + } + } +}; + +export const GatewayMessageBusOutputDataSourceProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GatewayMessageBusOutputDataSourceProperties", + modelProperties: { + ...GatewayMessageBusSourceProperties.type.modelProperties + } + } +}; + export const AzureSqlDatabaseOutputDataSourceProperties: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2899,6 +3162,7 @@ export const PowerBIOutputDataSourceProperties: coreClient.CompositeMapper = { } }, authenticationMode: { + defaultValue: "ConnectionString", serializedName: "authenticationMode", type: { name: "String" @@ -2945,6 +3209,7 @@ export const AzureDataLakeStoreOutputDataSourceProperties: coreClient.CompositeM } }, authenticationMode: { + defaultValue: "ConnectionString", serializedName: "authenticationMode", type: { name: "String" @@ -2954,75 +3219,6 @@ export const AzureDataLakeStoreOutputDataSourceProperties: coreClient.CompositeM } }; -export const AzureMachineLearningWebServiceFunctionBinding: coreClient.CompositeMapper = { - serializedName: "Microsoft.MachineLearning/WebService", - type: { - name: "Composite", - className: "AzureMachineLearningWebServiceFunctionBinding", - uberParent: "FunctionBinding", - polymorphicDiscriminator: FunctionBinding.type.polymorphicDiscriminator, - modelProperties: { - ...FunctionBinding.type.modelProperties, - endpoint: { - serializedName: "properties.endpoint", - type: { - name: "String" - } - }, - apiKey: { - serializedName: "properties.apiKey", - type: { - name: "String" - } - }, - inputs: { - serializedName: "properties.inputs", - type: { - name: "Composite", - className: "AzureMachineLearningWebServiceInputs" - } - }, - outputs: { - serializedName: "properties.outputs", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "AzureMachineLearningWebServiceOutputColumn" - } - } - } - }, - batchSize: { - serializedName: "properties.batchSize", - type: { - name: "Number" - } - } - } - } -}; - -export const JavaScriptFunctionBinding: coreClient.CompositeMapper = { - serializedName: "Microsoft.StreamAnalytics/JavascriptUdf", - type: { - name: "Composite", - className: "JavaScriptFunctionBinding", - uberParent: "FunctionBinding", - polymorphicDiscriminator: FunctionBinding.type.polymorphicDiscriminator, - modelProperties: { - ...FunctionBinding.type.modelProperties, - script: { - serializedName: "properties.script", - type: { - name: "String" - } - } - } - } -}; - export const StreamingJob: coreClient.CompositeMapper = { type: { name: "Composite", @@ -3574,10 +3770,10 @@ export let discriminators = { Serialization: Serialization, OutputDataSource: OutputDataSource, FunctionProperties: FunctionProperties, + FunctionBinding: FunctionBinding, FunctionRetrieveDefaultDefinitionParameters: FunctionRetrieveDefaultDefinitionParameters, StreamInputDataSource: StreamInputDataSource, ReferenceInputDataSource: ReferenceInputDataSource, - FunctionBinding: FunctionBinding, "InputProperties.Stream": StreamInputProperties, "InputProperties.Reference": ReferenceInputProperties, "Serialization.Parquet": ParquetSerialization, @@ -3591,19 +3787,24 @@ export let discriminators = { "OutputDataSource.Microsoft.Sql/Server/Database": AzureSqlDatabaseOutputDataSource, "OutputDataSource.Microsoft.Sql/Server/DataWarehouse": AzureSynapseOutputDataSource, "OutputDataSource.Microsoft.Storage/DocumentDB": DocumentDbOutputDataSource, + "OutputDataSource.Microsoft.AzureFunction": AzureFunctionOutputDataSource, "OutputDataSource.Microsoft.ServiceBus/Queue": ServiceBusQueueOutputDataSource, "OutputDataSource.Microsoft.ServiceBus/Topic": ServiceBusTopicOutputDataSource, "OutputDataSource.PowerBI": PowerBIOutputDataSource, "OutputDataSource.Microsoft.DataLake/Accounts": AzureDataLakeStoreOutputDataSource, + "OutputDataSource.GatewayMessageBus": GatewayMessageBusOutputDataSource, "FunctionProperties.Scalar": ScalarFunctionProperties, + "FunctionProperties.Aggregate": AggregateFunctionProperties, + "FunctionBinding.Microsoft.MachineLearning/WebService": AzureMachineLearningWebServiceFunctionBinding, + "FunctionBinding.Microsoft.StreamAnalytics/JavascriptUdf": JavaScriptFunctionBinding, "FunctionRetrieveDefaultDefinitionParameters.Microsoft.MachineLearning/WebService": AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters, "FunctionRetrieveDefaultDefinitionParameters.Microsoft.StreamAnalytics/JavascriptUdf": JavaScriptFunctionRetrieveDefaultDefinitionParameters, "StreamInputDataSource.Microsoft.Storage/Blob": BlobStreamInputDataSource, "StreamInputDataSource.Microsoft.ServiceBus/EventHub": EventHubStreamInputDataSource, "StreamInputDataSource.Microsoft.EventHub/EventHub": EventHubV2StreamInputDataSource, "StreamInputDataSource.Microsoft.Devices/IotHubs": IoTHubStreamInputDataSource, + "StreamInputDataSource.GatewayMessageBus": GatewayMessageBusStreamInputDataSource, + "ReferenceInputDataSource.File": FileReferenceInputDataSource, "ReferenceInputDataSource.Microsoft.Storage/Blob": BlobReferenceInputDataSource, - "ReferenceInputDataSource.Microsoft.Sql/Server/Database": AzureSqlReferenceInputDataSource, - "FunctionBinding.Microsoft.MachineLearning/WebService": AzureMachineLearningWebServiceFunctionBinding, - "FunctionBinding.Microsoft.StreamAnalytics/JavascriptUdf": JavaScriptFunctionBinding + "ReferenceInputDataSource.Microsoft.Sql/Server/Database": AzureSqlReferenceInputDataSource }; diff --git a/sdk/streamanalytics/arm-streamanalytics/src/streamAnalyticsManagementClient.ts b/sdk/streamanalytics/arm-streamanalytics/src/streamAnalyticsManagementClient.ts index fec4aedf1359..8efff6c52884 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/streamAnalyticsManagementClient.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/streamAnalyticsManagementClient.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, @@ -65,7 +70,7 @@ export class StreamAnalyticsManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-streamanalytics/4.0.2`; + const packageDetails = `azsdk-js-arm-streamanalytics/4.1.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` @@ -122,6 +127,35 @@ export class StreamAnalyticsManagementClient extends coreClient.ServiceClient { this.subscriptions = new SubscriptionsImpl(this); this.clusters = new ClustersImpl(this); this.privateEndpoints = new PrivateEndpointsImpl(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/streamanalytics/arm-streamanalytics/test/sampleTest.ts b/sdk/streamanalytics/arm-streamanalytics/test/sampleTest.ts index 7ed89b043e1b..25aeb3ebcc36 100644 --- a/sdk/streamanalytics/arm-streamanalytics/test/sampleTest.ts +++ b/sdk/streamanalytics/arm-streamanalytics/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() { diff --git a/sdk/streamanalytics/arm-streamanalytics/tsconfig.json b/sdk/streamanalytics/arm-streamanalytics/tsconfig.json index b12af4296073..3e6ae96443f3 100644 --- a/sdk/streamanalytics/arm-streamanalytics/tsconfig.json +++ b/sdk/streamanalytics/arm-streamanalytics/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-streamanalytics": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"