From 3c6c357468a707d3654809a9ebaa9fbedb1a1db3 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 7 Jul 2021 03:50:00 +0000 Subject: [PATCH] CodeGen from PR 13322 in Azure/azure-rest-api-specs [Stream Analytics] Add Subscription Level APIs (#13322) * add query testing apis * add operationId and outputURI * fix some linter errors * fix model validation * address some PR comments * address some comments * delete getoperationresults example * try adding raw input datasource wrappers * add inputs * refactor input structure * add outputs * modify some descriptions * address more comments * add 200 response * fix formatting * Delete package-lock.json * restore package-lock.json * address final comments * add compile query * add sample input api * add test input and test output apis * fix validation errors * update testQuery and compileQuery * update sample input and test input/output * final fixes * fix linter errors pt1 * fix small bugs * remove duplicate operations def Co-authored-by: Roslyn Lu --- .../arm-streamanalytics/README.md | 110 +-- .../arm-streamanalytics/package.json | 9 +- .../src/models/clustersMappers.ts | 6 + .../src/models/functionsMappers.ts | 10 +- .../arm-streamanalytics/src/models/index.ts | 745 +++++++++++++--- .../src/models/inputsMappers.ts | 10 +- .../arm-streamanalytics/src/models/mappers.ts | 836 ++++++++++++++---- .../src/models/operationsMappers.ts | 9 +- .../src/models/outputsMappers.ts | 10 +- .../src/models/privateEndpointsMappers.ts | 6 + .../src/models/streamingJobsMappers.ts | 10 +- .../src/models/subscriptionsMappers.ts | 20 +- .../src/models/transformationsMappers.ts | 10 +- .../src/operations/functions.ts | 18 +- .../src/operations/inputs.ts | 14 +- .../src/operations/operations.ts | 4 +- .../src/operations/outputs.ts | 14 +- .../src/operations/streamingJobs.ts | 20 +- .../src/operations/subscriptions.ts | 344 ++++++- .../src/operations/transformations.ts | 6 +- .../src/streamAnalyticsManagementClient.ts | 10 +- .../streamAnalyticsManagementClientContext.ts | 18 +- 22 files changed, 1858 insertions(+), 381 deletions(-) diff --git a/sdk/streamanalytics/arm-streamanalytics/README.md b/sdk/streamanalytics/arm-streamanalytics/README.md index 9a7ba43bf422..84fd670d77c4 100644 --- a/sdk/streamanalytics/arm-streamanalytics/README.md +++ b/sdk/streamanalytics/arm-streamanalytics/README.md @@ -1,95 +1,103 @@ ## Azure StreamAnalyticsManagementClient SDK for JavaScript -This package contains an isomorphic SDK for StreamAnalyticsManagementClient. +This package contains an isomorphic SDK (runs both in node.js and in browsers) for StreamAnalyticsManagementClient. ### Currently supported environments -- Node.js version 6.x.x or higher -- Browser JavaScript +- [LTS versions of Node.js](https://nodejs.org/about/releases/) +- Latest versions of Safari, Chrome, Edge and Firefox. -### How to Install +### Prerequisites +You must have an [Azure subscription](https://azure.microsoft.com/free/). + +### How to install + +To use this SDK in your project, you will need to install two packages. +- `@azure/arm-streamanalytics` that contains the client. +- `@azure/identity` that provides different mechanisms for the client to authenticate your requests using Azure Active Directory. + +Install both packages using the below command: ```bash -npm install @azure/arm-streamanalytics +npm install --save @azure/arm-streamanalytics @azure/identity ``` +> **Note**: You may have used either `@azure/ms-rest-nodeauth` or `@azure/ms-rest-browserauth` in the past. These packages are in maintenance mode receiving critical bug fixes, but no new features. +If you are on a [Node.js that has LTS status](https://nodejs.org/about/releases/), or are writing a client side browser application, we strongly encourage you to upgrade to `@azure/identity` which uses the latest versions of Azure Active Directory and MSAL APIs and provides more authentication options. ### How to use -#### nodejs - client creation and get functions as an example written in TypeScript. +- If you are writing a client side browser application, + - Follow the instructions in the section on Authenticating client side browser applications in [Azure Identity examples](https://aka.ms/azsdk/js/identity/examples) to register your application in the Microsoft identity platform and set the right permissions. + - Copy the client ID and tenant ID from the Overview section of your app registration in Azure portal and use it in the browser sample below. +- If you are writing a server side application, + - [Select a credential from `@azure/identity` based on the authentication method of your choice](https://aka.ms/azsdk/js/identity/examples) + - Complete the set up steps required by the credential if any. + - Use the credential you picked in the place of `DefaultAzureCredential` in the Node.js sample below. -##### Install @azure/ms-rest-nodeauth - -- Please install minimum version of `"@azure/ms-rest-nodeauth": "^3.0.0"`. -```bash -npm install @azure/ms-rest-nodeauth@"^3.0.0" -``` +In the below samples, we pass the credential and the Azure subscription id to instantiate the client. +Once the client is created, explore the operations on it either in your favorite editor or in our [API reference documentation](https://docs.microsoft.com/javascript/api) to get started. +#### nodejs - Authentication, client creation, and get functions as an example written in JavaScript. ##### Sample code -While the below sample uses the interactive login, other authentication options can be found in the [README.md file of @azure/ms-rest-nodeauth](https://www.npmjs.com/package/@azure/ms-rest-nodeauth) package -```typescript -const msRestNodeAuth = require("@azure/ms-rest-nodeauth"); +```javascript +const { DefaultAzureCredential } = require("@azure/identity"); const { StreamAnalyticsManagementClient } = require("@azure/arm-streamanalytics"); const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; -msRestNodeAuth.interactiveLogin().then((creds) => { - const client = new StreamAnalyticsManagementClient(creds, subscriptionId); - const resourceGroupName = "testresourceGroupName"; - const jobName = "testjobName"; - const functionName = "testfunctionName"; - client.functions.get(resourceGroupName, jobName, functionName).then((result) => { - console.log("The result is:"); - console.log(result); - }); +// Use `DefaultAzureCredential` or any other credential of your choice based on https://aka.ms/azsdk/js/identity/examples +// Please note that you can also use credentials from the `@azure/ms-rest-nodeauth` package instead. +const creds = new DefaultAzureCredential(); +const client = new StreamAnalyticsManagementClient(creds, subscriptionId); +const resourceGroupName = "testresourceGroupName"; +const jobName = "testjobName"; +const functionName = "testfunctionName"; +client.functions.get(resourceGroupName, jobName, functionName).then((result) => { + console.log("The result is:"); + console.log(result); }).catch((err) => { + console.log("An error occurred:"); console.error(err); }); ``` -#### browser - Authentication, client creation and get functions as an example written in JavaScript. +#### browser - Authentication, client creation, and get functions as an example written in JavaScript. -##### Install @azure/ms-rest-browserauth - -```bash -npm install @azure/ms-rest-browserauth -``` +In browser applications, we recommend using the `InteractiveBrowserCredential` that interactively authenticates using the default system browser. + - See [Single-page application: App registration guide](https://docs.microsoft.com/azure/active-directory/develop/scenario-spa-app-registration) to configure your app registration for the browser. + - Note down the client Id from the previous step and use it in the browser sample below. ##### Sample code -See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. - - index.html + ```html @azure/arm-streamanalytics sample - - + diff --git a/sdk/streamanalytics/arm-streamanalytics/package.json b/sdk/streamanalytics/arm-streamanalytics/package.json index e5246c121745..ba2285895fc6 100644 --- a/sdk/streamanalytics/arm-streamanalytics/package.json +++ b/sdk/streamanalytics/arm-streamanalytics/package.json @@ -4,8 +4,9 @@ "description": "StreamAnalyticsManagementClient Library with typescript type definitions for node.js and browser.", "version": "2.0.0", "dependencies": { - "@azure/ms-rest-azure-js": "^2.0.1", - "@azure/ms-rest-js": "^2.0.4", + "@azure/ms-rest-azure-js": "^2.1.0", + "@azure/ms-rest-js": "^2.2.0", + "@azure/core-auth": "^1.1.4", "tslib": "^1.10.0" }, "keywords": [ @@ -20,13 +21,13 @@ "module": "./esm/streamAnalyticsManagementClient.js", "types": "./esm/streamAnalyticsManagementClient.d.ts", "devDependencies": { - "typescript": "^3.5.3", + "typescript": "^3.6.0", "rollup": "^1.18.0", "rollup-plugin-node-resolve": "^5.2.0", "rollup-plugin-sourcemaps": "^0.4.2", "uglify-js": "^3.6.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/streamanalytics/arm-streamanalytics", + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/streamanalytics/arm-streamanalytics", "repository": { "type": "git", "url": "https://github.com/Azure/azure-sdk-for-js.git" diff --git a/sdk/streamanalytics/arm-streamanalytics/src/models/clustersMappers.ts b/sdk/streamanalytics/arm-streamanalytics/src/models/clustersMappers.ts index 5b7ba13d4529..e13b52c8fb99 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/models/clustersMappers.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/models/clustersMappers.ts @@ -71,9 +71,14 @@ export { PrivateLinkConnectionState, PrivateLinkServiceConnection, ProxyResource, + QueryTestingResult, + RawOutputDatasource, + RawReferenceInputDataSource, + RawStreamInputDataSource, ReferenceInputDataSource, ReferenceInputProperties, Resource, + SampleInputResult, ScalarFunctionProperties, Serialization, ServiceBusQueueOutputDataSource, @@ -85,6 +90,7 @@ export { StreamInputProperties, SubResource, SubscriptionQuota, + TestDatasourceResult, TrackedResource, Transformation } from "../models/mappers"; diff --git a/sdk/streamanalytics/arm-streamanalytics/src/models/functionsMappers.ts b/sdk/streamanalytics/arm-streamanalytics/src/models/functionsMappers.ts index df53151085b8..9fb06ebcf9e1 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/models/functionsMappers.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/models/functionsMappers.ts @@ -30,7 +30,6 @@ export { BlobOutputDataSource, BlobReferenceInputDataSource, BlobStreamInputDataSource, - CloudError, Cluster, ClusterInfo, ClusterProperties, @@ -43,6 +42,9 @@ export { DiagnosticCondition, Diagnostics, DocumentDbOutputDataSource, + ErrorDetails, + ErrorError, + ErrorModel, ErrorResponse, EventHubOutputDataSource, EventHubStreamInputDataSource, @@ -76,10 +78,15 @@ export { PrivateLinkConnectionState, PrivateLinkServiceConnection, ProxyResource, + QueryTestingResult, + RawOutputDatasource, + RawReferenceInputDataSource, + RawStreamInputDataSource, ReferenceInputDataSource, ReferenceInputProperties, Resource, ResourceTestStatus, + SampleInputResult, ScalarFunctionProperties, Serialization, ServiceBusQueueOutputDataSource, @@ -91,6 +98,7 @@ export { StreamInputProperties, SubResource, SubscriptionQuota, + TestDatasourceResult, TrackedResource, Transformation } from "../models/mappers"; diff --git a/sdk/streamanalytics/arm-streamanalytics/src/models/index.ts b/sdk/streamanalytics/arm-streamanalytics/src/models/index.ts index 774507c085a7..e93435a232ef 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/models/index.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/models/index.ts @@ -454,6 +454,56 @@ export interface AggregateFunctionProperties { binding?: FunctionBindingUnion; } +/** + * Common error details representation. + */ +export interface ErrorDetails { + /** + * Error code. + */ + code?: string; + /** + * Error target. + */ + target?: string; + /** + * Error message. + */ + message?: string; +} + +/** + * Error definition properties. + */ +export interface ErrorError { + /** + * Error code. + */ + code?: string; + /** + * Error message. + */ + message?: string; + /** + * Error target. + */ + target?: string; + /** + * Error details. + */ + details?: ErrorDetails[]; +} + +/** + * Common error representation. + */ +export interface ErrorModel { + /** + * Error definition properties. + */ + error?: ErrorError; +} + /** * Describes the error that occurred. */ @@ -597,7 +647,7 @@ export interface Input extends SubResource { /** * Contains the possible cases for StreamInputDataSource. */ -export type StreamInputDataSourceUnion = StreamInputDataSource | BlobStreamInputDataSource | EventHubStreamInputDataSource | EventHubV2StreamInputDataSource | IoTHubStreamInputDataSource; +export type StreamInputDataSourceUnion = StreamInputDataSource | BlobStreamInputDataSource | EventHubStreamInputDataSource | EventHubV2StreamInputDataSource | IoTHubStreamInputDataSource | RawStreamInputDataSource; /** * Describes an input data source that contains stream data. @@ -650,7 +700,7 @@ export interface StreamInputProperties { /** * Contains the possible cases for ReferenceInputDataSource. */ -export type ReferenceInputDataSourceUnion = ReferenceInputDataSource | BlobReferenceInputDataSource | AzureSqlReferenceInputDataSource; +export type ReferenceInputDataSourceUnion = ReferenceInputDataSource | BlobReferenceInputDataSource | RawReferenceInputDataSource | AzureSqlReferenceInputDataSource; /** * Describes an input data source that contains reference data. @@ -856,6 +906,28 @@ export interface IoTHubStreamInputDataSource { endpoint?: string; } +/** + * Describes a raw input data source that contains stream data. This data source type is only + * applicable/usable when using the query testing API. You cannot create a job with this data + * source type or add an input of this data source type to an existing job. + */ +export interface RawStreamInputDataSource { + /** + * Polymorphic Discriminator + */ + type: "Raw"; + /** + * The JSON serialized content of the input data. Either payload or payloadUri must be set, but + * not both. + */ + payload?: string; + /** + * The SAS URL to a blob containing the JSON serialized content of the input data. Either payload + * or payloadUri must be set, but not both. + */ + payloadUri?: string; +} + /** * Describes a blob input data source that contains reference data. */ @@ -894,6 +966,28 @@ export interface BlobReferenceInputDataSource { timeFormat?: string; } +/** + * Describes a raw input data source that contains reference data. This data source type is only + * applicable/usable when using the query testing API. You cannot create a job with this data + * source type or add an input of this data source type to an existing job. + */ +export interface RawReferenceInputDataSource { + /** + * Polymorphic Discriminator + */ + type: "Raw"; + /** + * The JSON serialized content of the input data. Either payload or payloadUri must be set, but + * not both. + */ + payload?: string; + /** + * The SAS URL to a blob containing the JSON serialized content of the input data. Either payload + * or payloadUri must be set, but not both. + */ + payloadUri?: string; +} + /** * The properties that are associated with an Azure Storage account */ @@ -1089,7 +1183,7 @@ export interface Identity { } /** - * An interface representing AzureSqlReferenceInputDataSourceProperties. + * Describes Azure SQL database reference input data source properties. */ export interface AzureSqlReferenceInputDataSourceProperties { /** @@ -1155,7 +1249,7 @@ export interface AzureSqlReferenceInputDataSource { /** * Contains the possible cases for OutputDataSource. */ -export type OutputDataSourceUnion = OutputDataSource | BlobOutputDataSource | AzureTableOutputDataSource | EventHubOutputDataSource | EventHubV2OutputDataSource | AzureSqlDatabaseOutputDataSource | AzureSynapseOutputDataSource | DocumentDbOutputDataSource | AzureFunctionOutputDataSource | ServiceBusQueueOutputDataSource | ServiceBusTopicOutputDataSource | PowerBIOutputDataSource | AzureDataLakeStoreOutputDataSource; +export type OutputDataSourceUnion = OutputDataSource | RawOutputDatasource | BlobOutputDataSource | AzureTableOutputDataSource | EventHubOutputDataSource | EventHubV2OutputDataSource | AzureSqlDatabaseOutputDataSource | AzureSynapseOutputDataSource | DocumentDbOutputDataSource | AzureFunctionOutputDataSource | ServiceBusQueueOutputDataSource | ServiceBusTopicOutputDataSource | PowerBIOutputDataSource | AzureDataLakeStoreOutputDataSource; /** * Describes the data source that output will be written to. @@ -1199,6 +1293,24 @@ export interface Output extends SubResource { readonly etag?: string; } +/** + * Describes a raw output data source. This data source type is only applicable/usable when using + * the query testing API. You cannot create a job with this data source type or add an output of + * this data source type to an existing job. + */ +export interface RawOutputDatasource { + /** + * Polymorphic Discriminator + */ + type: "Raw"; + /** + * The SAS URL to a blob where the output should be written. If this property is not set, output + * data will be written into a temporary storage, and a SAS URL to that temporary storage will be + * included in the result. + */ + payloadUri?: string; +} + /** * Describes a blob output data source. */ @@ -1802,48 +1914,6 @@ export interface External { path?: string; } -/** - * Contains the localized display information for this particular operation / action. - */ -export interface OperationDisplay { - /** - * The localized friendly form of the resource provider name. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly provider?: string; - /** - * The localized friendly form of the resource type related to this action/operation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly resource?: string; - /** - * The localized friendly name for the operation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly operation?: string; - /** - * The localized friendly description for the operation. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly description?: string; -} - -/** - * A Stream Analytics REST API operation - */ -export interface Operation { - /** - * The name of the operation being performed on this particular object. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly name?: string; - /** - * Contains the localized display information for this particular operation / action. - * **NOTE: This property will not be serialized. It can only be populated by the server.** - */ - readonly display?: OperationDisplay; -} - /** * The properties that are associated with a SKU. */ @@ -1900,7 +1970,7 @@ export interface ClusterInfo { } /** - * An interface representing Resource. + * The base resource definition */ export interface Resource extends BaseResource { /** @@ -2108,31 +2178,334 @@ export interface ProxyResource extends Resource { } /** - * Describes the current quota for the subscription. + * Describes the current quota for the subscription. + */ +export interface SubscriptionQuota extends SubResource { + /** + * The max permitted usage of this resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly maxCount?: number; + /** + * The current usage of this resource. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly currentCount?: number; +} + +/** + * Result of the GetQuotas operation. It contains a list of quotas for the subscription in a + * particular region. + */ +export interface SubscriptionQuotasListResult { + /** + * List of quotas for the subscription in a particular region. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly value?: SubscriptionQuota[]; +} + +/** + * Diagnostics information related to query testing. + */ +export interface TestQueryDiagnostics { + /** + * The SAS URI to the container or directory. + */ + writeUri: string; + /** + * The path to the subdirectory. + */ + path?: string; +} + +/** + * The request object for query testing. + */ +export interface TestQuery { + /** + * Diagnostics information related to query testing. + */ + diagnostics?: TestQueryDiagnostics; + /** + * Stream analytics job object which defines the input, output, and transformation for the query + * testing. + */ + streamingJob: StreamingJob; +} + +/** + * The result of the query testing request. + */ +export interface QueryTestingResult extends ErrorModel { + /** + * The status of the query testing request. Possible values include: 'Started', 'Success', + * 'CompilerError', 'RuntimeError', 'Timeout', 'UnknownError' + */ + status?: QueryTestingResultStatus; + /** + * The SAS URL to the outputs payload. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly outputUri?: string; +} + +/** + * An input for the query compilation. + */ +export interface QueryInput { + /** + * The name of the input. + */ + name: string; + /** + * The type of the input, can be Stream or Reference. + */ + type: string; +} + +/** + * A function for the query compilation. + */ +export interface QueryFunction { + /** + * The name of the function. + */ + name: string; + /** + * The type of the function. + */ + type: string; + /** + * The type of the function binding. + */ + bindingType: string; + /** + * The inputs for the function. + */ + inputs: FunctionInput[]; + /** + * An output for the function. + */ + output: FunctionOutput; +} + +/** + * The query compilation object which defines the input, output, and transformation for the query + * compilation. + */ +export interface CompileQuery { + /** + * The query to compile. + */ + query: string; + /** + * The inputs for the query compilation. + */ + inputs?: QueryInput[]; + /** + * The functions for the query compilation. + */ + functions?: QueryFunction[]; + /** + * Describes the type of the job. Valid values are `Cloud` and 'Edge'. Possible values include: + * 'Cloud', 'Edge' + */ + jobType: JobType; + /** + * The query to compile. Possible values include: '1.0' + */ + compatibilityLevel?: CompatibilityLevel; +} + +/** + * An error produced by the compiler. + */ +export interface QueryCompilationError { + /** + * The content of the error message. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly message?: string; + /** + * Describes the error location in the original query. Not set if isGlobal is true. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly startLine?: number; + /** + * Describes the error location in the original query. Not set if isGlobal is true. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly startColumn?: number; + /** + * Describes the error location in the original query. Not set if isGlobal is true. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly endLine?: number; + /** + * Describes the error location in the original query. Not set if isGlobal is true. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly endColumn?: number; + /** + * Whether the error is not for a specific part but for the entire query. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly isGlobal?: boolean; +} + +/** + * The result of the query compilation request. + */ +export interface QueryCompilationResult { + /** + * Error messages produced by the compiler. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly errors?: QueryCompilationError[]; + /** + * Warning messages produced by the compiler. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly warnings?: string[]; + /** + * All input names used by the query. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly inputs?: string[]; + /** + * All output names used by the query. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly outputs?: string[]; + /** + * All function names used by the query. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly functions?: string[]; +} + +/** + * The stream analytics input to sample. + */ +export interface SampleInput { + /** + * The stream analytics input to sample. + */ + input?: Input; + /** + * Defaults to the default ASA job compatibility level. Today it is 1.2 + */ + compatibilityLevel?: string; + /** + * The SAS URI of the storage blob for service to write the sampled events to. If this parameter + * is not provided, service will write events to he system account and share a temporary SAS URI + * to it. + */ + eventsUri?: string; + /** + * Defaults to en-US. + */ + dataLocale?: string; +} + +/** + * The result of the sample input request. + */ +export interface SampleInputResult extends ErrorModel { + /** + * The status of the sample input request. Possible values include: 'ReadAllEventsInRange', + * 'NoEventsFoundInRange', 'ErrorConnectingToInput' + */ + status?: SampleInputResultStatus; + /** + * Diagnostics messages. E.g. message indicating some partitions from the input have no data. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly diagnostics?: string[]; + /** + * A SAS URL to download the sampled input data. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly eventsDownloadUrl?: string; + /** + * The timestamp for the last event in the data. It is in DateTime format. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly lastArrivalTime?: string; +} + +/** + * A stream analytics input. + */ +export interface TestInput { + /** + * The stream analytics input to test. + */ + input: Input; +} + +/** + * A stream analytics output. + */ +export interface TestOutput { + /** + * The stream analytics output to test. + */ + output: Output; +} + +/** + * The result of the test input or output request. + */ +export interface TestDatasourceResult extends ErrorModel { + /** + * The status of the sample output request. Possible values include: 'TestSucceeded', + * 'TestFailed' + */ + status?: TestDatasourceResultStatus; +} + +/** + * Contains the localized display information for this particular operation / action. */ -export interface SubscriptionQuota extends SubResource { +export interface OperationDisplay { /** - * The max permitted usage of this resource. + * The localized friendly form of the resource provider name. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly maxCount?: number; + readonly provider?: string; /** - * The current usage of this resource. + * The localized friendly form of the resource type related to this action/operation. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly currentCount?: number; + readonly resource?: string; + /** + * The localized friendly name for the operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly operation?: string; + /** + * The localized friendly description for the operation. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly description?: string; } /** - * Result of the GetQuotas operation. It contains a list of quotas for the subscription in a - * particular region. + * A Stream Analytics REST API operation */ -export interface SubscriptionQuotasListResult { +export interface Operation { /** - * List of quotas for the subscription in a particular region. + * The name of the operation being performed on this particular object. * **NOTE: This property will not be serialized. It can only be populated by the server.** */ - readonly value?: SubscriptionQuota[]; + readonly name?: string; + /** + * Contains the localized display information for this particular operation / action. + * **NOTE: This property will not be serialized. It can only be populated by the server.** + */ + readonly display?: OperationDisplay; } /** @@ -2223,56 +2596,6 @@ export interface ClusterJob { jobState?: JobState; } -/** - * Common error details representation. - */ -export interface ErrorDetails { - /** - * Error code. - */ - code?: string; - /** - * Error target. - */ - target?: string; - /** - * Error message. - */ - message?: string; -} - -/** - * Error definition properties. - */ -export interface ErrorError { - /** - * Error code. - */ - code?: string; - /** - * Error message. - */ - message?: string; - /** - * Error target. - */ - target?: string; - /** - * Error details. - */ - details?: ErrorDetails[]; -} - -/** - * Common error representation. - */ -export interface ErrorModel { - /** - * Error definition properties. - */ - error?: ErrorError; -} - /** * A collection of read-only information about the state of the connection to the private remote * resource. @@ -3215,6 +3538,32 @@ export type CompatibilityLevel = '1.0'; */ export type ContentStoragePolicy = 'SystemAccount' | 'JobStorageAccount'; +/** + * Defines values for QueryTestingResultStatus. + * Possible values include: 'Started', 'Success', 'CompilerError', 'RuntimeError', 'Timeout', + * 'UnknownError' + * @readonly + * @enum {string} + */ +export type QueryTestingResultStatus = 'Started' | 'Success' | 'CompilerError' | 'RuntimeError' | 'Timeout' | 'UnknownError'; + +/** + * Defines values for SampleInputResultStatus. + * Possible values include: 'ReadAllEventsInRange', 'NoEventsFoundInRange', + * 'ErrorConnectingToInput' + * @readonly + * @enum {string} + */ +export type SampleInputResultStatus = 'ReadAllEventsInRange' | 'NoEventsFoundInRange' | 'ErrorConnectingToInput'; + +/** + * Defines values for TestDatasourceResultStatus. + * Possible values include: 'TestSucceeded', 'TestFailed' + * @readonly + * @enum {string} + */ +export type TestDatasourceResultStatus = 'TestSucceeded' | 'TestFailed'; + /** * Defines values for ClusterSkuName. * Possible values include: 'Default' @@ -3900,6 +4249,186 @@ export type SubscriptionsListQuotasResponse = SubscriptionQuotasListResult & { }; }; +/** + * Contains response data for the testQueryMethod operation. + */ +export type SubscriptionsTestQueryMethodResponse = QueryTestingResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: QueryTestingResult; + }; +}; + +/** + * Contains response data for the compileQueryMethod operation. + */ +export type SubscriptionsCompileQueryMethodResponse = QueryCompilationResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: QueryCompilationResult; + }; +}; + +/** + * Contains response data for the sampleInputMethod operation. + */ +export type SubscriptionsSampleInputMethodResponse = SampleInputResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SampleInputResult; + }; +}; + +/** + * Contains response data for the testInputMethod operation. + */ +export type SubscriptionsTestInputMethodResponse = TestDatasourceResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TestDatasourceResult; + }; +}; + +/** + * Contains response data for the testOutputMethod operation. + */ +export type SubscriptionsTestOutputMethodResponse = TestDatasourceResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TestDatasourceResult; + }; +}; + +/** + * Contains response data for the beginTestQueryMethod operation. + */ +export type SubscriptionsBeginTestQueryMethodResponse = QueryTestingResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: QueryTestingResult; + }; +}; + +/** + * Contains response data for the beginSampleInputMethod operation. + */ +export type SubscriptionsBeginSampleInputMethodResponse = SampleInputResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: SampleInputResult; + }; +}; + +/** + * Contains response data for the beginTestInputMethod operation. + */ +export type SubscriptionsBeginTestInputMethodResponse = TestDatasourceResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TestDatasourceResult; + }; +}; + +/** + * Contains response data for the beginTestOutputMethod operation. + */ +export type SubscriptionsBeginTestOutputMethodResponse = TestDatasourceResult & { + /** + * The underlying HTTP response. + */ + _response: msRest.HttpResponse & { + /** + * The response body as text (string format) + */ + bodyAsText: string; + + /** + * The response body as parsed JSON or XML + */ + parsedBody: TestDatasourceResult; + }; +}; + /** * Contains response data for the createOrReplace operation. */ diff --git a/sdk/streamanalytics/arm-streamanalytics/src/models/inputsMappers.ts b/sdk/streamanalytics/arm-streamanalytics/src/models/inputsMappers.ts index 307adf85834f..716f007c0cb3 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/models/inputsMappers.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/models/inputsMappers.ts @@ -28,7 +28,6 @@ export { BlobOutputDataSource, BlobReferenceInputDataSource, BlobStreamInputDataSource, - CloudError, Cluster, ClusterInfo, ClusterProperties, @@ -40,6 +39,9 @@ export { DiagnosticCondition, Diagnostics, DocumentDbOutputDataSource, + ErrorDetails, + ErrorError, + ErrorModel, ErrorResponse, EventHubOutputDataSource, EventHubStreamInputDataSource, @@ -71,10 +73,15 @@ export { PrivateLinkConnectionState, PrivateLinkServiceConnection, ProxyResource, + QueryTestingResult, + RawOutputDatasource, + RawReferenceInputDataSource, + RawStreamInputDataSource, ReferenceInputDataSource, ReferenceInputProperties, Resource, ResourceTestStatus, + SampleInputResult, ScalarFunctionProperties, Serialization, ServiceBusQueueOutputDataSource, @@ -86,6 +93,7 @@ export { StreamInputProperties, SubResource, SubscriptionQuota, + TestDatasourceResult, TrackedResource, Transformation } from "../models/mappers"; diff --git a/sdk/streamanalytics/arm-streamanalytics/src/models/mappers.ts b/sdk/streamanalytics/arm-streamanalytics/src/models/mappers.ts index c80dfa931abb..4168bccaf12e 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/models/mappers.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/models/mappers.ts @@ -664,6 +664,91 @@ export const AggregateFunctionProperties: msRest.CompositeMapper = { } }; +export const ErrorDetails: msRest.CompositeMapper = { + serializedName: "ErrorDetails", + type: { + name: "Composite", + className: "ErrorDetails", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + target: { + serializedName: "target", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + } + } + } +}; + +export const ErrorError: msRest.CompositeMapper = { + serializedName: "Error_error", + type: { + name: "Composite", + className: "ErrorError", + modelProperties: { + code: { + serializedName: "code", + type: { + name: "String" + } + }, + message: { + serializedName: "message", + type: { + name: "String" + } + }, + target: { + serializedName: "target", + type: { + name: "String" + } + }, + details: { + serializedName: "details", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "ErrorDetails" + } + } + } + } + } + } +}; + +export const ErrorModel: msRest.CompositeMapper = { + serializedName: "Error", + type: { + name: "Composite", + className: "ErrorModel", + modelProperties: { + error: { + serializedName: "error", + type: { + name: "Composite", + className: "ErrorError" + } + } + } + } +}; + export const ErrorResponse: msRest.CompositeMapper = { serializedName: "ErrorResponse", type: { @@ -1161,6 +1246,31 @@ export const IoTHubStreamInputDataSource: msRest.CompositeMapper = { } }; +export const RawStreamInputDataSource: msRest.CompositeMapper = { + serializedName: "Raw", + type: { + name: "Composite", + polymorphicDiscriminator: StreamInputDataSource.type.polymorphicDiscriminator, + uberParent: "StreamInputDataSource", + className: "RawStreamInputDataSource", + modelProperties: { + ...StreamInputDataSource.type.modelProperties, + payload: { + serializedName: "properties.payload", + type: { + name: "String" + } + }, + payloadUri: { + serializedName: "properties.payloadUri", + type: { + name: "String" + } + } + } + } +}; + export const BlobReferenceInputDataSource: msRest.CompositeMapper = { serializedName: "Microsoft.Storage/Blob", type: { @@ -1210,6 +1320,31 @@ export const BlobReferenceInputDataSource: msRest.CompositeMapper = { } }; +export const RawReferenceInputDataSource: msRest.CompositeMapper = { + serializedName: "Raw", + type: { + name: "Composite", + polymorphicDiscriminator: ReferenceInputDataSource.type.polymorphicDiscriminator, + uberParent: "ReferenceInputDataSource", + className: "RawReferenceInputDataSource", + modelProperties: { + ...ReferenceInputDataSource.type.modelProperties, + payload: { + serializedName: "properties.payload", + type: { + name: "String" + } + }, + payloadUri: { + serializedName: "properties.payloadUri", + type: { + name: "String" + } + } + } + } +}; + export const StorageAccount: msRest.CompositeMapper = { serializedName: "StorageAccount", type: { @@ -1628,6 +1763,25 @@ export const Output: msRest.CompositeMapper = { } }; +export const RawOutputDatasource: msRest.CompositeMapper = { + serializedName: "Raw", + type: { + name: "Composite", + polymorphicDiscriminator: OutputDataSource.type.polymorphicDiscriminator, + uberParent: "OutputDataSource", + className: "RawOutputDatasource", + modelProperties: { + ...OutputDataSource.type.modelProperties, + payloadUri: { + serializedName: "properties.payloadUri", + type: { + name: "String" + } + } + } + } +}; + export const BlobOutputDataSource: msRest.CompositeMapper = { serializedName: "Microsoft.Storage/Blob", type: { @@ -2472,69 +2626,6 @@ export const External: msRest.CompositeMapper = { } }; -export const OperationDisplay: msRest.CompositeMapper = { - serializedName: "Operation_display", - type: { - name: "Composite", - className: "OperationDisplay", - modelProperties: { - provider: { - readOnly: true, - serializedName: "provider", - type: { - name: "String" - } - }, - resource: { - readOnly: true, - serializedName: "resource", - type: { - name: "String" - } - }, - operation: { - readOnly: true, - serializedName: "operation", - type: { - name: "String" - } - }, - description: { - readOnly: true, - serializedName: "description", - type: { - name: "String" - } - } - } - } -}; - -export const Operation: msRest.CompositeMapper = { - serializedName: "Operation", - type: { - name: "Composite", - className: "Operation", - modelProperties: { - name: { - readOnly: true, - serializedName: "name", - type: { - name: "String" - } - }, - display: { - readOnly: true, - serializedName: "display", - type: { - name: "Composite", - className: "OperationDisplay" - } - } - } - } -}; - export const StreamingJobSku: msRest.CompositeMapper = { serializedName: "StreamingJobSku", type: { @@ -2945,217 +3036,651 @@ export const SubscriptionQuotasListResult: msRest.CompositeMapper = { } }; -export const ClusterSku: msRest.CompositeMapper = { - serializedName: "ClusterSku", +export const TestQueryDiagnostics: msRest.CompositeMapper = { + serializedName: "TestQuery_diagnostics", type: { name: "Composite", - className: "ClusterSku", + className: "TestQueryDiagnostics", modelProperties: { - name: { - serializedName: "name", + writeUri: { + required: true, + serializedName: "writeUri", type: { name: "String" } }, - capacity: { - serializedName: "capacity", - constraints: { - InclusiveMaximum: 216, - InclusiveMinimum: 36 - }, + path: { + serializedName: "path", type: { - name: "Number" + name: "String" } } } } }; -export const ClusterProperties: msRest.CompositeMapper = { - serializedName: "ClusterProperties", +export const TestQuery: msRest.CompositeMapper = { + serializedName: "TestQuery", type: { name: "Composite", - className: "ClusterProperties", + className: "TestQuery", modelProperties: { - createdDate: { - readOnly: true, - serializedName: "createdDate", + diagnostics: { + serializedName: "diagnostics", type: { - name: "DateTime" + name: "Composite", + className: "TestQueryDiagnostics" } }, - clusterId: { - readOnly: true, - serializedName: "clusterId", + streamingJob: { + required: true, + serializedName: "streamingJob", type: { - name: "String" + name: "Composite", + className: "StreamingJob" } - }, - provisioningState: { - serializedName: "provisioningState", + } + } + } +}; + +export const QueryTestingResult: msRest.CompositeMapper = { + serializedName: "QueryTestingResult", + type: { + name: "Composite", + className: "QueryTestingResult", + modelProperties: { + ...ErrorModel.type.modelProperties, + status: { + serializedName: "status", type: { name: "String" } }, - capacityAllocated: { - readOnly: true, - serializedName: "capacityAllocated", - type: { - name: "Number" - } - }, - capacityAssigned: { + outputUri: { readOnly: true, - serializedName: "capacityAssigned", + serializedName: "outputUri", type: { - name: "Number" + name: "String" } } } } }; -export const Cluster: msRest.CompositeMapper = { - serializedName: "Cluster", +export const QueryInput: msRest.CompositeMapper = { + serializedName: "QueryInput", type: { name: "Composite", - className: "Cluster", + className: "QueryInput", modelProperties: { - ...TrackedResource.type.modelProperties, - sku: { - serializedName: "sku", + name: { + required: true, + serializedName: "name", type: { - name: "Composite", - className: "ClusterSku" + name: "String" } }, - etag: { - readOnly: true, - serializedName: "etag", + type: { + required: true, + serializedName: "type", + type: { + name: "String" + } + } + } + } +}; + +export const QueryFunction: msRest.CompositeMapper = { + serializedName: "QueryFunction", + type: { + name: "Composite", + className: "QueryFunction", + modelProperties: { + name: { + required: true, + serializedName: "name", type: { name: "String" } }, - properties: { - serializedName: "properties", + type: { + required: true, + serializedName: "type", + type: { + name: "String" + } + }, + bindingType: { + required: true, + serializedName: "bindingType", + type: { + name: "String" + } + }, + inputs: { + required: true, + serializedName: "inputs", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "FunctionInput" + } + } + } + }, + output: { + required: true, + serializedName: "output", type: { name: "Composite", - className: "ClusterProperties" + className: "FunctionOutput" } } } } }; -export const ClusterJob: msRest.CompositeMapper = { - serializedName: "ClusterJob", +export const CompileQuery: msRest.CompositeMapper = { + serializedName: "CompileQuery", type: { name: "Composite", - className: "ClusterJob", + className: "CompileQuery", modelProperties: { - id: { + query: { + required: true, + serializedName: "query", + type: { + name: "String" + } + }, + inputs: { + serializedName: "inputs", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "QueryInput" + } + } + } + }, + functions: { + serializedName: "functions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "QueryFunction" + } + } + } + }, + jobType: { + required: true, + serializedName: "jobType", + type: { + name: "String" + } + }, + compatibilityLevel: { + serializedName: "compatibilityLevel", + type: { + name: "String" + } + } + } + } +}; + +export const QueryCompilationError: msRest.CompositeMapper = { + serializedName: "QueryCompilationError", + type: { + name: "Composite", + className: "QueryCompilationError", + modelProperties: { + message: { readOnly: true, - serializedName: "id", + serializedName: "message", type: { name: "String" } }, - streamingUnits: { + startLine: { readOnly: true, - serializedName: "streamingUnits", + serializedName: "startLine", type: { name: "Number" } }, - jobState: { - serializedName: "jobState", + startColumn: { + readOnly: true, + serializedName: "startColumn", type: { - name: "String" + name: "Number" + } + }, + endLine: { + readOnly: true, + serializedName: "endLine", + type: { + name: "Number" + } + }, + endColumn: { + readOnly: true, + serializedName: "endColumn", + type: { + name: "Number" + } + }, + isGlobal: { + readOnly: true, + serializedName: "isGlobal", + type: { + name: "Boolean" } } } } }; -export const ErrorDetails: msRest.CompositeMapper = { - serializedName: "ErrorDetails", +export const QueryCompilationResult: msRest.CompositeMapper = { + serializedName: "QueryCompilationResult", type: { name: "Composite", - className: "ErrorDetails", + className: "QueryCompilationResult", modelProperties: { - code: { - serializedName: "code", + errors: { + readOnly: true, + serializedName: "errors", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "Composite", + className: "QueryCompilationError" + } + } } }, - target: { - serializedName: "target", + warnings: { + readOnly: true, + serializedName: "warnings", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } } }, - message: { - serializedName: "message", + inputs: { + readOnly: true, + serializedName: "inputs", type: { - name: "String" + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + outputs: { + readOnly: true, + serializedName: "outputs", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } + } + }, + functions: { + readOnly: true, + serializedName: "functions", + type: { + name: "Sequence", + element: { + type: { + name: "String" + } + } } } } } }; -export const ErrorError: msRest.CompositeMapper = { - serializedName: "Error_error", +export const SampleInput: msRest.CompositeMapper = { + serializedName: "SampleInput", type: { name: "Composite", - className: "ErrorError", + className: "SampleInput", modelProperties: { - code: { - serializedName: "code", + input: { + serializedName: "input", + type: { + name: "Composite", + className: "Input" + } + }, + compatibilityLevel: { + serializedName: "compatibilityLevel", type: { name: "String" } }, - message: { - serializedName: "message", + eventsUri: { + serializedName: "eventsUri", type: { name: "String" } }, - target: { - serializedName: "target", + dataLocale: { + serializedName: "dataLocale", + type: { + name: "String" + } + } + } + } +}; + +export const SampleInputResult: msRest.CompositeMapper = { + serializedName: "SampleInputResult", + type: { + name: "Composite", + className: "SampleInputResult", + modelProperties: { + ...ErrorModel.type.modelProperties, + status: { + serializedName: "status", type: { name: "String" } }, - details: { - serializedName: "details", + diagnostics: { + readOnly: true, + serializedName: "diagnostics", type: { name: "Sequence", element: { type: { - name: "Composite", - className: "ErrorDetails" + name: "String" } } } + }, + eventsDownloadUrl: { + readOnly: true, + serializedName: "eventsDownloadUrl", + type: { + name: "String" + } + }, + lastArrivalTime: { + readOnly: true, + serializedName: "lastArrivalTime", + type: { + name: "String" + } } } } }; -export const ErrorModel: msRest.CompositeMapper = { - serializedName: "Error", +export const TestInput: msRest.CompositeMapper = { + serializedName: "TestInput", type: { name: "Composite", - className: "ErrorModel", + className: "TestInput", modelProperties: { - error: { - serializedName: "error", + input: { + required: true, + serializedName: "input", type: { name: "Composite", - className: "ErrorError" + className: "Input" + } + } + } + } +}; + +export const TestOutput: msRest.CompositeMapper = { + serializedName: "TestOutput", + type: { + name: "Composite", + className: "TestOutput", + modelProperties: { + output: { + required: true, + serializedName: "output", + type: { + name: "Composite", + className: "Output" + } + } + } + } +}; + +export const TestDatasourceResult: msRest.CompositeMapper = { + serializedName: "TestDatasourceResult", + type: { + name: "Composite", + className: "TestDatasourceResult", + modelProperties: { + ...ErrorModel.type.modelProperties, + status: { + serializedName: "status", + type: { + name: "String" + } + } + } + } +}; + +export const OperationDisplay: msRest.CompositeMapper = { + serializedName: "Operation_display", + type: { + name: "Composite", + className: "OperationDisplay", + modelProperties: { + provider: { + readOnly: true, + serializedName: "provider", + type: { + name: "String" + } + }, + resource: { + readOnly: true, + serializedName: "resource", + type: { + name: "String" + } + }, + operation: { + readOnly: true, + serializedName: "operation", + type: { + name: "String" + } + }, + description: { + readOnly: true, + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + +export const Operation: msRest.CompositeMapper = { + serializedName: "Operation", + type: { + name: "Composite", + className: "Operation", + modelProperties: { + name: { + readOnly: true, + serializedName: "name", + type: { + name: "String" + } + }, + display: { + readOnly: true, + serializedName: "display", + type: { + name: "Composite", + className: "OperationDisplay" + } + } + } + } +}; + +export const ClusterSku: msRest.CompositeMapper = { + serializedName: "ClusterSku", + type: { + name: "Composite", + className: "ClusterSku", + modelProperties: { + name: { + serializedName: "name", + type: { + name: "String" + } + }, + capacity: { + serializedName: "capacity", + constraints: { + InclusiveMaximum: 216, + InclusiveMinimum: 36 + }, + type: { + name: "Number" + } + } + } + } +}; + +export const ClusterProperties: msRest.CompositeMapper = { + serializedName: "ClusterProperties", + type: { + name: "Composite", + className: "ClusterProperties", + modelProperties: { + createdDate: { + readOnly: true, + serializedName: "createdDate", + type: { + name: "DateTime" + } + }, + clusterId: { + readOnly: true, + serializedName: "clusterId", + type: { + name: "String" + } + }, + provisioningState: { + serializedName: "provisioningState", + type: { + name: "String" + } + }, + capacityAllocated: { + readOnly: true, + serializedName: "capacityAllocated", + type: { + name: "Number" + } + }, + capacityAssigned: { + readOnly: true, + serializedName: "capacityAssigned", + type: { + name: "Number" + } + } + } + } +}; + +export const Cluster: msRest.CompositeMapper = { + serializedName: "Cluster", + type: { + name: "Composite", + className: "Cluster", + modelProperties: { + ...TrackedResource.type.modelProperties, + sku: { + serializedName: "sku", + type: { + name: "Composite", + className: "ClusterSku" + } + }, + etag: { + readOnly: true, + serializedName: "etag", + type: { + name: "String" + } + }, + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "ClusterProperties" + } + } + } + } +}; + +export const ClusterJob: msRest.CompositeMapper = { + serializedName: "ClusterJob", + type: { + name: "Composite", + className: "ClusterJob", + modelProperties: { + id: { + readOnly: true, + serializedName: "id", + type: { + name: "String" + } + }, + streamingUnits: { + readOnly: true, + serializedName: "streamingUnits", + type: { + name: "Number" + } + }, + jobState: { + serializedName: "jobState", + type: { + name: "String" } } } @@ -3791,7 +4316,9 @@ export const discriminators = { 'StreamInputDataSource.Microsoft.ServiceBus/EventHub' : EventHubStreamInputDataSource, 'StreamInputDataSource.Microsoft.EventHub/EventHub' : EventHubV2StreamInputDataSource, 'StreamInputDataSource.Microsoft.Devices/IotHubs' : IoTHubStreamInputDataSource, + 'StreamInputDataSource.Raw' : RawStreamInputDataSource, 'ReferenceInputDataSource.Microsoft.Storage/Blob' : BlobReferenceInputDataSource, + 'ReferenceInputDataSource.Raw' : RawReferenceInputDataSource, 'Serialization.Parquet' : ParquetSerialization, 'Serialization.CustomClr' : CustomClrSerialization, 'Serialization.Csv' : CsvSerialization, @@ -3799,6 +4326,7 @@ export const discriminators = { 'Serialization.Avro' : AvroSerialization, 'ReferenceInputDataSource.Microsoft.Sql/Server/Database' : AzureSqlReferenceInputDataSource, 'OutputDataSource' : OutputDataSource, + 'OutputDataSource.Raw' : RawOutputDatasource, 'OutputDataSource.Microsoft.Storage/Blob' : BlobOutputDataSource, 'OutputDataSource.Microsoft.Storage/Table' : AzureTableOutputDataSource, 'OutputDataSource.Microsoft.ServiceBus/EventHub' : EventHubOutputDataSource, diff --git a/sdk/streamanalytics/arm-streamanalytics/src/models/operationsMappers.ts b/sdk/streamanalytics/arm-streamanalytics/src/models/operationsMappers.ts index 1cf01eeef205..94f28c97d8bb 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/models/operationsMappers.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/models/operationsMappers.ts @@ -8,8 +8,13 @@ export { discriminators, - CloudError, + ErrorDetails, + ErrorError, + ErrorModel, Operation, OperationDisplay, - OperationListResult + OperationListResult, + QueryTestingResult, + SampleInputResult, + TestDatasourceResult } from "../models/mappers"; diff --git a/sdk/streamanalytics/arm-streamanalytics/src/models/outputsMappers.ts b/sdk/streamanalytics/arm-streamanalytics/src/models/outputsMappers.ts index b6e62ffa6cf4..602ec46e57e3 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/models/outputsMappers.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/models/outputsMappers.ts @@ -28,7 +28,6 @@ export { BlobOutputDataSource, BlobReferenceInputDataSource, BlobStreamInputDataSource, - CloudError, Cluster, ClusterInfo, ClusterProperties, @@ -40,6 +39,9 @@ export { DiagnosticCondition, Diagnostics, DocumentDbOutputDataSource, + ErrorDetails, + ErrorError, + ErrorModel, ErrorResponse, EventHubOutputDataSource, EventHubStreamInputDataSource, @@ -71,10 +73,15 @@ export { PrivateLinkConnectionState, PrivateLinkServiceConnection, ProxyResource, + QueryTestingResult, + RawOutputDatasource, + RawReferenceInputDataSource, + RawStreamInputDataSource, ReferenceInputDataSource, ReferenceInputProperties, Resource, ResourceTestStatus, + SampleInputResult, ScalarFunctionProperties, Serialization, ServiceBusQueueOutputDataSource, @@ -86,6 +93,7 @@ export { StreamInputProperties, SubResource, SubscriptionQuota, + TestDatasourceResult, TrackedResource, Transformation } from "../models/mappers"; diff --git a/sdk/streamanalytics/arm-streamanalytics/src/models/privateEndpointsMappers.ts b/sdk/streamanalytics/arm-streamanalytics/src/models/privateEndpointsMappers.ts index a78d71313130..6e120da65dcf 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/models/privateEndpointsMappers.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/models/privateEndpointsMappers.ts @@ -69,9 +69,14 @@ export { PrivateLinkConnectionState, PrivateLinkServiceConnection, ProxyResource, + QueryTestingResult, + RawOutputDatasource, + RawReferenceInputDataSource, + RawStreamInputDataSource, ReferenceInputDataSource, ReferenceInputProperties, Resource, + SampleInputResult, ScalarFunctionProperties, Serialization, ServiceBusQueueOutputDataSource, @@ -83,6 +88,7 @@ export { StreamInputProperties, SubResource, SubscriptionQuota, + TestDatasourceResult, TrackedResource, Transformation } from "../models/mappers"; diff --git a/sdk/streamanalytics/arm-streamanalytics/src/models/streamingJobsMappers.ts b/sdk/streamanalytics/arm-streamanalytics/src/models/streamingJobsMappers.ts index 707c1ef3bdad..dc66f3bc33bd 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/models/streamingJobsMappers.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/models/streamingJobsMappers.ts @@ -28,7 +28,6 @@ export { BlobOutputDataSource, BlobReferenceInputDataSource, BlobStreamInputDataSource, - CloudError, Cluster, ClusterInfo, ClusterProperties, @@ -40,6 +39,9 @@ export { DiagnosticCondition, Diagnostics, DocumentDbOutputDataSource, + ErrorDetails, + ErrorError, + ErrorModel, EventHubOutputDataSource, EventHubStreamInputDataSource, EventHubV2OutputDataSource, @@ -66,9 +68,14 @@ export { PrivateLinkConnectionState, PrivateLinkServiceConnection, ProxyResource, + QueryTestingResult, + RawOutputDatasource, + RawReferenceInputDataSource, + RawStreamInputDataSource, ReferenceInputDataSource, ReferenceInputProperties, Resource, + SampleInputResult, ScalarFunctionProperties, Serialization, ServiceBusQueueOutputDataSource, @@ -85,6 +92,7 @@ export { StreamInputProperties, SubResource, SubscriptionQuota, + TestDatasourceResult, TrackedResource, Transformation } from "../models/mappers"; diff --git a/sdk/streamanalytics/arm-streamanalytics/src/models/subscriptionsMappers.ts b/sdk/streamanalytics/arm-streamanalytics/src/models/subscriptionsMappers.ts index fa584c6bd5fd..3c623f970b8c 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/models/subscriptionsMappers.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/models/subscriptionsMappers.ts @@ -28,11 +28,11 @@ export { BlobOutputDataSource, BlobReferenceInputDataSource, BlobStreamInputDataSource, - CloudError, Cluster, ClusterInfo, ClusterProperties, ClusterSku, + CompileQuery, Compression, CSharpFunctionBinding, CsvSerialization, @@ -40,6 +40,9 @@ export { DiagnosticCondition, Diagnostics, DocumentDbOutputDataSource, + ErrorDetails, + ErrorError, + ErrorModel, EventHubOutputDataSource, EventHubStreamInputDataSource, EventHubV2OutputDataSource, @@ -66,9 +69,19 @@ export { PrivateLinkConnectionState, PrivateLinkServiceConnection, ProxyResource, + QueryCompilationError, + QueryCompilationResult, + QueryFunction, + QueryInput, + QueryTestingResult, + RawOutputDatasource, + RawReferenceInputDataSource, + RawStreamInputDataSource, ReferenceInputDataSource, ReferenceInputProperties, Resource, + SampleInput, + SampleInputResult, ScalarFunctionProperties, Serialization, ServiceBusQueueOutputDataSource, @@ -81,6 +94,11 @@ export { SubResource, SubscriptionQuota, SubscriptionQuotasListResult, + TestDatasourceResult, + TestInput, + TestOutput, + TestQuery, + TestQueryDiagnostics, TrackedResource, Transformation } from "../models/mappers"; diff --git a/sdk/streamanalytics/arm-streamanalytics/src/models/transformationsMappers.ts b/sdk/streamanalytics/arm-streamanalytics/src/models/transformationsMappers.ts index b985cb821ba5..f21d4b79f18a 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/models/transformationsMappers.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/models/transformationsMappers.ts @@ -28,7 +28,6 @@ export { BlobOutputDataSource, BlobReferenceInputDataSource, BlobStreamInputDataSource, - CloudError, Cluster, ClusterInfo, ClusterProperties, @@ -40,6 +39,9 @@ export { DiagnosticCondition, Diagnostics, DocumentDbOutputDataSource, + ErrorDetails, + ErrorError, + ErrorModel, EventHubOutputDataSource, EventHubStreamInputDataSource, EventHubV2OutputDataSource, @@ -66,9 +68,14 @@ export { PrivateLinkConnectionState, PrivateLinkServiceConnection, ProxyResource, + QueryTestingResult, + RawOutputDatasource, + RawReferenceInputDataSource, + RawStreamInputDataSource, ReferenceInputDataSource, ReferenceInputProperties, Resource, + SampleInputResult, ScalarFunctionProperties, Serialization, ServiceBusQueueOutputDataSource, @@ -80,6 +87,7 @@ export { StreamInputProperties, SubResource, SubscriptionQuota, + TestDatasourceResult, TrackedResource, Transformation, TransformationsCreateOrReplaceHeaders, diff --git a/sdk/streamanalytics/arm-streamanalytics/src/operations/functions.ts b/sdk/streamanalytics/arm-streamanalytics/src/operations/functions.ts index 98b7a81f248b..e556b6b3d5ef 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/operations/functions.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/operations/functions.ts @@ -362,7 +362,7 @@ const createOrReplaceOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.FunctionsCreateOrReplaceHeaders }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorModel, headersMapper: Mappers.FunctionsCreateOrReplaceHeaders } }, @@ -398,7 +398,7 @@ const updateOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.FunctionsUpdateHeaders }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorModel, headersMapper: Mappers.FunctionsUpdateHeaders } }, @@ -424,7 +424,7 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer @@ -451,7 +451,7 @@ const getOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.FunctionsGetHeaders }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorModel, headersMapper: Mappers.FunctionsGetHeaders } }, @@ -478,7 +478,7 @@ const listByStreamingJobOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.FunctionListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer @@ -486,7 +486,7 @@ const listByStreamingJobOperationSpec: msRest.OperationSpec = { const retrieveDefaultDefinitionOperationSpec: msRest.OperationSpec = { httpMethod: "POST", - path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/functions/{functionName}/RetrieveDefaultDefinition", + path: "subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/functions/{functionName}/retrieveDefaultDefinition", urlParameters: [ Parameters.subscriptionId, Parameters.resourceGroupName, @@ -511,7 +511,7 @@ const retrieveDefaultDefinitionOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.FunctionModel }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer @@ -545,7 +545,7 @@ const beginTestOperationSpec: msRest.OperationSpec = { }, 202: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer @@ -570,7 +570,7 @@ const listByStreamingJobNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.FunctionListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer diff --git a/sdk/streamanalytics/arm-streamanalytics/src/operations/inputs.ts b/sdk/streamanalytics/arm-streamanalytics/src/operations/inputs.ts index a8ab680d6f2f..ad1ca8c9be7b 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/operations/inputs.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/operations/inputs.ts @@ -324,7 +324,7 @@ const createOrReplaceOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.InputsCreateOrReplaceHeaders }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorModel, headersMapper: Mappers.InputsCreateOrReplaceHeaders } }, @@ -360,7 +360,7 @@ const updateOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.InputsUpdateHeaders }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorModel, headersMapper: Mappers.InputsUpdateHeaders } }, @@ -386,7 +386,7 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer @@ -413,7 +413,7 @@ const getOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.InputsGetHeaders }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorModel, headersMapper: Mappers.InputsGetHeaders } }, @@ -440,7 +440,7 @@ const listByStreamingJobOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.InputListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer @@ -474,7 +474,7 @@ const beginTestOperationSpec: msRest.OperationSpec = { }, 202: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer @@ -499,7 +499,7 @@ const listByStreamingJobNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.InputListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer diff --git a/sdk/streamanalytics/arm-streamanalytics/src/operations/operations.ts b/sdk/streamanalytics/arm-streamanalytics/src/operations/operations.ts index 1d5b82af8451..8d2282b001af 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/operations/operations.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/operations/operations.ts @@ -94,7 +94,7 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.OperationListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer @@ -118,7 +118,7 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.OperationListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer diff --git a/sdk/streamanalytics/arm-streamanalytics/src/operations/outputs.ts b/sdk/streamanalytics/arm-streamanalytics/src/operations/outputs.ts index 010e28d56d11..ada6e7754a4f 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/operations/outputs.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/operations/outputs.ts @@ -324,7 +324,7 @@ const createOrReplaceOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.OutputsCreateOrReplaceHeaders }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorModel, headersMapper: Mappers.OutputsCreateOrReplaceHeaders } }, @@ -360,7 +360,7 @@ const updateOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.OutputsUpdateHeaders }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorModel, headersMapper: Mappers.OutputsUpdateHeaders } }, @@ -386,7 +386,7 @@ const deleteMethodOperationSpec: msRest.OperationSpec = { 200: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer @@ -413,7 +413,7 @@ const getOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.OutputsGetHeaders }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorModel, headersMapper: Mappers.OutputsGetHeaders } }, @@ -440,7 +440,7 @@ const listByStreamingJobOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.OutputListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer @@ -474,7 +474,7 @@ const beginTestOperationSpec: msRest.OperationSpec = { }, 202: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer @@ -499,7 +499,7 @@ const listByStreamingJobNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.OutputListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer diff --git a/sdk/streamanalytics/arm-streamanalytics/src/operations/streamingJobs.ts b/sdk/streamanalytics/arm-streamanalytics/src/operations/streamingJobs.ts index 4d3beadf7014..5af28384766d 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/operations/streamingJobs.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/operations/streamingJobs.ts @@ -372,7 +372,7 @@ const updateOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.StreamingJobsUpdateHeaders }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorModel, headersMapper: Mappers.StreamingJobsUpdateHeaders } }, @@ -400,7 +400,7 @@ const getOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.StreamingJobsGetHeaders }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorModel, headersMapper: Mappers.StreamingJobsGetHeaders } }, @@ -426,7 +426,7 @@ const listByResourceGroupOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StreamingJobListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer @@ -450,7 +450,7 @@ const listOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StreamingJobListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer @@ -489,7 +489,7 @@ const beginCreateOrReplaceOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.StreamingJobsCreateOrReplaceHeaders }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorModel, headersMapper: Mappers.StreamingJobsCreateOrReplaceHeaders } }, @@ -515,7 +515,7 @@ const beginDeleteMethodOperationSpec: msRest.OperationSpec = { 202: {}, 204: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer @@ -546,7 +546,7 @@ const beginStartOperationSpec: msRest.OperationSpec = { 200: {}, 202: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer @@ -570,7 +570,7 @@ const beginStopOperationSpec: msRest.OperationSpec = { 200: {}, 202: {}, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer @@ -595,7 +595,7 @@ const listByResourceGroupNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StreamingJobListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer @@ -620,7 +620,7 @@ const listNextOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.StreamingJobListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel } }, serializer diff --git a/sdk/streamanalytics/arm-streamanalytics/src/operations/subscriptions.ts b/sdk/streamanalytics/arm-streamanalytics/src/operations/subscriptions.ts index ad6d97775975..430626c42efd 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/operations/subscriptions.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/operations/subscriptions.ts @@ -8,6 +8,7 @@ */ import * as msRest from "@azure/ms-rest-js"; +import * as msRestAzure from "@azure/ms-rest-azure-js"; import * as Models from "../models"; import * as Mappers from "../models/subscriptionsMappers"; import * as Parameters from "../models/parameters"; @@ -27,24 +28,21 @@ export class Subscriptions { /** * Retrieves the subscription's current quota information in a particular region. - * @param location The region in which to retrieve the subscription's quota information. You can - * find out which regions Azure Stream Analytics is supported in here: - * https://azure.microsoft.com/en-us/regions/ + * @param location The region to which the request is sent. You can find out which regions Azure + * Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/ * @param [options] The optional parameters * @returns Promise */ listQuotas(location: string, options?: msRest.RequestOptionsBase): Promise; /** - * @param location The region in which to retrieve the subscription's quota information. You can - * find out which regions Azure Stream Analytics is supported in here: - * https://azure.microsoft.com/en-us/regions/ + * @param location The region to which the request is sent. You can find out which regions Azure + * Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/ * @param callback The callback */ listQuotas(location: string, callback: msRest.ServiceCallback): void; /** - * @param location The region in which to retrieve the subscription's quota information. You can - * find out which regions Azure Stream Analytics is supported in here: - * https://azure.microsoft.com/en-us/regions/ + * @param location The region to which the request is sent. You can find out which regions Azure + * Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/ * @param options The optional parameters * @param callback The callback */ @@ -58,6 +56,176 @@ export class Subscriptions { listQuotasOperationSpec, callback) as Promise; } + + /** + * Test the Stream Analytics query on a sample input. + * @param testQuery The query testing object that defines the input, output, and transformation for + * the query testing. + * @param location The region to which the request is sent. You can find out which regions Azure + * Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/ + * @param [options] The optional parameters + * @returns Promise + */ + testQueryMethod(testQuery: Models.TestQuery, location: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginTestQueryMethod(testQuery,location,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Compile the Stream Analytics query. + * @param compileQuery The query compilation object which defines the input, output, and + * transformation for the query compilation. + * @param location The region to which the request is sent. You can find out which regions Azure + * Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/ + * @param [options] The optional parameters + * @returns Promise + */ + compileQueryMethod(compileQuery: Models.CompileQuery, location: string, options?: msRest.RequestOptionsBase): Promise; + /** + * @param compileQuery The query compilation object which defines the input, output, and + * transformation for the query compilation. + * @param location The region to which the request is sent. You can find out which regions Azure + * Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/ + * @param callback The callback + */ + compileQueryMethod(compileQuery: Models.CompileQuery, location: string, callback: msRest.ServiceCallback): void; + /** + * @param compileQuery The query compilation object which defines the input, output, and + * transformation for the query compilation. + * @param location The region to which the request is sent. You can find out which regions Azure + * Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/ + * @param options The optional parameters + * @param callback The callback + */ + compileQueryMethod(compileQuery: Models.CompileQuery, location: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback): void; + compileQueryMethod(compileQuery: Models.CompileQuery, location: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback, callback?: msRest.ServiceCallback): Promise { + return this.client.sendOperationRequest( + { + compileQuery, + location, + options + }, + compileQueryMethodOperationSpec, + callback) as Promise; + } + + /** + * Sample the Stream Analytics input data. + * @param sampleInput Defines the necessary parameters for sampling the Stream Analytics input + * data. + * @param location The region to which the request is sent. You can find out which regions Azure + * Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/ + * @param [options] The optional parameters + * @returns Promise + */ + sampleInputMethod(sampleInput: Models.SampleInput, location: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginSampleInputMethod(sampleInput,location,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Test the Stream Analytics input. + * @param testInput Defines the necessary parameters for testing the Stream Analytics input. + * @param location The region to which the request is sent. You can find out which regions Azure + * Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/ + * @param [options] The optional parameters + * @returns Promise + */ + testInputMethod(testInput: Models.TestInput, location: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginTestInputMethod(testInput,location,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Test the Stream Analytics output. + * @param testOutput Defines the necessary parameters for testing the Stream Analytics output. + * @param location The region to which the request is sent. You can find out which regions Azure + * Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/ + * @param [options] The optional parameters + * @returns Promise + */ + testOutputMethod(testOutput: Models.TestOutput, location: string, options?: msRest.RequestOptionsBase): Promise { + return this.beginTestOutputMethod(testOutput,location,options) + .then(lroPoller => lroPoller.pollUntilFinished()) as Promise; + } + + /** + * Test the Stream Analytics query on a sample input. + * @param testQuery The query testing object that defines the input, output, and transformation for + * the query testing. + * @param location The region to which the request is sent. You can find out which regions Azure + * Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/ + * @param [options] The optional parameters + * @returns Promise + */ + beginTestQueryMethod(testQuery: Models.TestQuery, location: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + testQuery, + location, + options + }, + beginTestQueryMethodOperationSpec, + options); + } + + /** + * Sample the Stream Analytics input data. + * @param sampleInput Defines the necessary parameters for sampling the Stream Analytics input + * data. + * @param location The region to which the request is sent. You can find out which regions Azure + * Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/ + * @param [options] The optional parameters + * @returns Promise + */ + beginSampleInputMethod(sampleInput: Models.SampleInput, location: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + sampleInput, + location, + options + }, + beginSampleInputMethodOperationSpec, + options); + } + + /** + * Test the Stream Analytics input. + * @param testInput Defines the necessary parameters for testing the Stream Analytics input. + * @param location The region to which the request is sent. You can find out which regions Azure + * Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/ + * @param [options] The optional parameters + * @returns Promise + */ + beginTestInputMethod(testInput: Models.TestInput, location: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + testInput, + location, + options + }, + beginTestInputMethodOperationSpec, + options); + } + + /** + * Test the Stream Analytics output. + * @param testOutput Defines the necessary parameters for testing the Stream Analytics output. + * @param location The region to which the request is sent. You can find out which regions Azure + * Stream Analytics is supported in here: https://azure.microsoft.com/en-us/regions/ + * @param [options] The optional parameters + * @returns Promise + */ + beginTestOutputMethod(testOutput: Models.TestOutput, location: string, options?: msRest.RequestOptionsBase): Promise { + return this.client.sendLRORequest( + { + testOutput, + location, + options + }, + beginTestOutputMethodOperationSpec, + options); + } } // Operation Specifications @@ -80,7 +248,163 @@ const listQuotasOperationSpec: msRest.OperationSpec = { bodyMapper: Mappers.SubscriptionQuotasListResult }, default: { - bodyMapper: Mappers.CloudError + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; + +const compileQueryMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/compileQuery", + urlParameters: [ + Parameters.location, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "compileQuery", + mapper: { + ...Mappers.CompileQuery, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.QueryCompilationResult + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; + +const beginTestQueryMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/testQuery", + urlParameters: [ + Parameters.location, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "testQuery", + mapper: { + ...Mappers.TestQuery, + required: true + } + }, + responses: { + 200: { + bodyMapper: Mappers.QueryTestingResult + }, + 202: {}, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; + +const beginSampleInputMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/sampleInput", + urlParameters: [ + Parameters.location, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "sampleInput", + mapper: { + ...Mappers.SampleInput, + required: true + } + }, + responses: { + 202: { + bodyMapper: Mappers.SampleInputResult + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; + +const beginTestInputMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/testInput", + urlParameters: [ + Parameters.location, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "testInput", + mapper: { + ...Mappers.TestInput, + required: true + } + }, + responses: { + 202: { + bodyMapper: Mappers.TestDatasourceResult + }, + default: { + bodyMapper: Mappers.ErrorModel + } + }, + serializer +}; + +const beginTestOutputMethodOperationSpec: msRest.OperationSpec = { + httpMethod: "POST", + path: "subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/testOutput", + urlParameters: [ + Parameters.location, + Parameters.subscriptionId + ], + queryParameters: [ + Parameters.apiVersion0 + ], + headerParameters: [ + Parameters.acceptLanguage + ], + requestBody: { + parameterPath: "testOutput", + mapper: { + ...Mappers.TestOutput, + required: true + } + }, + responses: { + 202: { + bodyMapper: Mappers.TestDatasourceResult + }, + default: { + bodyMapper: Mappers.ErrorModel } }, serializer diff --git a/sdk/streamanalytics/arm-streamanalytics/src/operations/transformations.ts b/sdk/streamanalytics/arm-streamanalytics/src/operations/transformations.ts index 1ff76b4ca508..efa0f6e1b68d 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/operations/transformations.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/operations/transformations.ts @@ -193,7 +193,7 @@ const createOrReplaceOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.TransformationsCreateOrReplaceHeaders }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorModel, headersMapper: Mappers.TransformationsCreateOrReplaceHeaders } }, @@ -229,7 +229,7 @@ const updateOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.TransformationsUpdateHeaders }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorModel, headersMapper: Mappers.TransformationsUpdateHeaders } }, @@ -257,7 +257,7 @@ const getOperationSpec: msRest.OperationSpec = { headersMapper: Mappers.TransformationsGetHeaders }, default: { - bodyMapper: Mappers.CloudError, + bodyMapper: Mappers.ErrorModel, headersMapper: Mappers.TransformationsGetHeaders } }, diff --git a/sdk/streamanalytics/arm-streamanalytics/src/streamAnalyticsManagementClient.ts b/sdk/streamanalytics/arm-streamanalytics/src/streamAnalyticsManagementClient.ts index 64d4307d04e4..38328160afb4 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/streamAnalyticsManagementClient.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/streamAnalyticsManagementClient.ts @@ -8,6 +8,7 @@ */ import * as msRest from "@azure/ms-rest-js"; +import { TokenCredential } from "@azure/core-auth"; import * as Models from "./models"; import * as Mappers from "./models/mappers"; import * as operations from "./operations"; @@ -28,11 +29,16 @@ class StreamAnalyticsManagementClient extends StreamAnalyticsManagementClientCon /** * Initializes a new instance of the StreamAnalyticsManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. + * @param credentials Credentials needed for the client to connect to Azure. Credentials + * implementing the TokenCredential interface from the @azure/identity package are recommended. For + * more information about these credentials, see + * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the + * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and + * @azure/ms-rest-browserauth are also supported. * @param subscriptionId The ID of the target subscription. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.StreamAnalyticsManagementClientOptions) { + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.StreamAnalyticsManagementClientOptions) { super(credentials, subscriptionId, options); this.functions = new operations.Functions(this); this.inputs = new operations.Inputs(this); diff --git a/sdk/streamanalytics/arm-streamanalytics/src/streamAnalyticsManagementClientContext.ts b/sdk/streamanalytics/arm-streamanalytics/src/streamAnalyticsManagementClientContext.ts index 752d8b339deb..5609a014c8f6 100644 --- a/sdk/streamanalytics/arm-streamanalytics/src/streamAnalyticsManagementClientContext.ts +++ b/sdk/streamanalytics/arm-streamanalytics/src/streamAnalyticsManagementClientContext.ts @@ -10,21 +10,27 @@ import * as Models from "./models"; import * as msRest from "@azure/ms-rest-js"; import * as msRestAzure from "@azure/ms-rest-azure-js"; +import { TokenCredential } from "@azure/core-auth"; const packageName = "@azure/arm-streamanalytics"; const packageVersion = "2.0.0"; export class StreamAnalyticsManagementClientContext extends msRestAzure.AzureServiceClient { - credentials: msRest.ServiceClientCredentials; + credentials: msRest.ServiceClientCredentials | TokenCredential; subscriptionId: string; /** * Initializes a new instance of the StreamAnalyticsManagementClient class. - * @param credentials Credentials needed for the client to connect to Azure. + * @param credentials Credentials needed for the client to connect to Azure. Credentials + * implementing the TokenCredential interface from the @azure/identity package are recommended. For + * more information about these credentials, see + * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the + * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and + * @azure/ms-rest-browserauth are also supported. * @param subscriptionId The ID of the target subscription. * @param [options] The parameter options */ - constructor(credentials: msRest.ServiceClientCredentials, subscriptionId: string, options?: Models.StreamAnalyticsManagementClientOptions) { + constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.StreamAnalyticsManagementClientOptions) { if (credentials == undefined) { throw new Error('\'credentials\' cannot be null.'); } @@ -35,7 +41,7 @@ export class StreamAnalyticsManagementClientContext extends msRestAzure.AzureSer if (!options) { options = {}; } - if(!options.userAgent) { + if (!options.userAgent) { const defaultUserAgent = msRestAzure.getDefaultUserAgentValue(); options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`; } @@ -49,10 +55,10 @@ export class StreamAnalyticsManagementClientContext extends msRestAzure.AzureSer this.credentials = credentials; this.subscriptionId = subscriptionId; - if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) { this.acceptLanguage = options.acceptLanguage; } - if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; } }