From 72a60b45d0c17f82b0f0cf69e4d2071897ca651d Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 7 Jul 2021 03:51: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 --- .../streamanalytics/CHANGELOG.md | 150 +++- .../streamanalytics/_meta.json | 2 +- .../streamanalytics/enums.go | 67 +- .../streamanalytics/functions.go | 2 +- .../streamanalytics/models.go | 835 +++++++++++++++++- .../streamanalyticsapi/interfaces.go | 5 + .../streamanalytics/subscriptions.go | 444 +++++++++- .../2016-03-01/streamanalytics/CHANGELOG.md | 43 +- .../2016-03-01/streamanalytics/_meta.json | 2 +- .../mgmt/2016-03-01/streamanalytics/enums.go | 17 + .../2016-03-01/streamanalytics/functions.go | 2 +- .../mgmt/2016-03-01/streamanalytics/models.go | 145 ++- 12 files changed, 1606 insertions(+), 108 deletions(-) diff --git a/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/CHANGELOG.md b/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/CHANGELOG.md index 7e2441416df6..3c16335de190 100644 --- a/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/CHANGELOG.md +++ b/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/CHANGELOG.md @@ -1,25 +1,135 @@ -# Change History +# Unreleased ## Additive Changes +### New Constants + +1. QueryTestingResultStatus.CompilerError +1. QueryTestingResultStatus.RuntimeError +1. QueryTestingResultStatus.Started +1. QueryTestingResultStatus.Success +1. QueryTestingResultStatus.Timeout +1. QueryTestingResultStatus.UnknownError +1. SampleInputResultStatus.ErrorConnectingToInput +1. SampleInputResultStatus.NoEventsFoundInRange +1. SampleInputResultStatus.ReadAllEventsInRange +1. TestDatasourceResultStatus.TestFailed +1. TestDatasourceResultStatus.TestSucceeded +1. TypeBasicOutputDataSource.TypeRaw +1. TypeBasicReferenceInputDataSource.TypeBasicReferenceInputDataSourceTypeRaw +1. TypeBasicStreamInputDataSource.TypeBasicStreamInputDataSourceTypeRaw + ### New Funcs -1. ClusterJobListResult.MarshalJSON() ([]byte, error) -1. ClusterListResult.MarshalJSON() ([]byte, error) -1. DiagnosticCondition.MarshalJSON() ([]byte, error) -1. Diagnostics.MarshalJSON() ([]byte, error) -1. ErrorResponse.MarshalJSON() ([]byte, error) -1. FunctionListResult.MarshalJSON() ([]byte, error) -1. InputListResult.MarshalJSON() ([]byte, error) -1. Operation.MarshalJSON() ([]byte, error) -1. OperationDisplay.MarshalJSON() ([]byte, error) -1. OperationListResult.MarshalJSON() ([]byte, error) -1. OutputListResult.MarshalJSON() ([]byte, error) -1. PrivateEndpointListResult.MarshalJSON() ([]byte, error) -1. PrivateLinkConnectionState.MarshalJSON() ([]byte, error) -1. ProxyResource.MarshalJSON() ([]byte, error) -1. Resource.MarshalJSON() ([]byte, error) -1. ResourceTestStatus.MarshalJSON() ([]byte, error) -1. StreamingJobListResult.MarshalJSON() ([]byte, error) -1. SubscriptionQuotaProperties.MarshalJSON() ([]byte, error) -1. SubscriptionQuotasListResult.MarshalJSON() ([]byte, error) +1. *RawOutputDatasource.UnmarshalJSON([]byte) error +1. *RawReferenceInputDataSource.UnmarshalJSON([]byte) error +1. *RawStreamInputDataSource.UnmarshalJSON([]byte) error +1. *SubscriptionsSampleInputMethodFuture.UnmarshalJSON([]byte) error +1. *SubscriptionsTestInputMethodFuture.UnmarshalJSON([]byte) error +1. *SubscriptionsTestOutputMethodFuture.UnmarshalJSON([]byte) error +1. *SubscriptionsTestQueryMethodFuture.UnmarshalJSON([]byte) error +1. AzureDataLakeStoreOutputDataSource.AsRawOutputDatasource() (*RawOutputDatasource, bool) +1. AzureFunctionOutputDataSource.AsRawOutputDatasource() (*RawOutputDatasource, bool) +1. AzureSQLDatabaseOutputDataSource.AsRawOutputDatasource() (*RawOutputDatasource, bool) +1. AzureSQLReferenceInputDataSource.AsRawReferenceInputDataSource() (*RawReferenceInputDataSource, bool) +1. AzureSynapseOutputDataSource.AsRawOutputDatasource() (*RawOutputDatasource, bool) +1. AzureTableOutputDataSource.AsRawOutputDatasource() (*RawOutputDatasource, bool) +1. BlobOutputDataSource.AsRawOutputDatasource() (*RawOutputDatasource, bool) +1. BlobReferenceInputDataSource.AsRawReferenceInputDataSource() (*RawReferenceInputDataSource, bool) +1. BlobStreamInputDataSource.AsRawStreamInputDataSource() (*RawStreamInputDataSource, bool) +1. DocumentDbOutputDataSource.AsRawOutputDatasource() (*RawOutputDatasource, bool) +1. EventHubOutputDataSource.AsRawOutputDatasource() (*RawOutputDatasource, bool) +1. EventHubStreamInputDataSource.AsRawStreamInputDataSource() (*RawStreamInputDataSource, bool) +1. EventHubV2OutputDataSource.AsRawOutputDatasource() (*RawOutputDatasource, bool) +1. EventHubV2StreamInputDataSource.AsRawStreamInputDataSource() (*RawStreamInputDataSource, bool) +1. IoTHubStreamInputDataSource.AsRawStreamInputDataSource() (*RawStreamInputDataSource, bool) +1. OutputDataSource.AsRawOutputDatasource() (*RawOutputDatasource, bool) +1. PossibleQueryTestingResultStatusValues() []QueryTestingResultStatus +1. PossibleSampleInputResultStatusValues() []SampleInputResultStatus +1. PossibleTestDatasourceResultStatusValues() []TestDatasourceResultStatus +1. PowerBIOutputDataSource.AsRawOutputDatasource() (*RawOutputDatasource, bool) +1. QueryCompilationError.MarshalJSON() ([]byte, error) +1. QueryCompilationResult.MarshalJSON() ([]byte, error) +1. QueryTestingResult.MarshalJSON() ([]byte, error) +1. RawOutputDatasource.AsAzureDataLakeStoreOutputDataSource() (*AzureDataLakeStoreOutputDataSource, bool) +1. RawOutputDatasource.AsAzureFunctionOutputDataSource() (*AzureFunctionOutputDataSource, bool) +1. RawOutputDatasource.AsAzureSQLDatabaseOutputDataSource() (*AzureSQLDatabaseOutputDataSource, bool) +1. RawOutputDatasource.AsAzureSynapseOutputDataSource() (*AzureSynapseOutputDataSource, bool) +1. RawOutputDatasource.AsAzureTableOutputDataSource() (*AzureTableOutputDataSource, bool) +1. RawOutputDatasource.AsBasicOutputDataSource() (BasicOutputDataSource, bool) +1. RawOutputDatasource.AsBlobOutputDataSource() (*BlobOutputDataSource, bool) +1. RawOutputDatasource.AsDocumentDbOutputDataSource() (*DocumentDbOutputDataSource, bool) +1. RawOutputDatasource.AsEventHubOutputDataSource() (*EventHubOutputDataSource, bool) +1. RawOutputDatasource.AsEventHubV2OutputDataSource() (*EventHubV2OutputDataSource, bool) +1. RawOutputDatasource.AsOutputDataSource() (*OutputDataSource, bool) +1. RawOutputDatasource.AsPowerBIOutputDataSource() (*PowerBIOutputDataSource, bool) +1. RawOutputDatasource.AsRawOutputDatasource() (*RawOutputDatasource, bool) +1. RawOutputDatasource.AsServiceBusQueueOutputDataSource() (*ServiceBusQueueOutputDataSource, bool) +1. RawOutputDatasource.AsServiceBusTopicOutputDataSource() (*ServiceBusTopicOutputDataSource, bool) +1. RawOutputDatasource.MarshalJSON() ([]byte, error) +1. RawReferenceInputDataSource.AsAzureSQLReferenceInputDataSource() (*AzureSQLReferenceInputDataSource, bool) +1. RawReferenceInputDataSource.AsBasicReferenceInputDataSource() (BasicReferenceInputDataSource, bool) +1. RawReferenceInputDataSource.AsBlobReferenceInputDataSource() (*BlobReferenceInputDataSource, bool) +1. RawReferenceInputDataSource.AsRawReferenceInputDataSource() (*RawReferenceInputDataSource, bool) +1. RawReferenceInputDataSource.AsReferenceInputDataSource() (*ReferenceInputDataSource, bool) +1. RawReferenceInputDataSource.MarshalJSON() ([]byte, error) +1. RawStreamInputDataSource.AsBasicStreamInputDataSource() (BasicStreamInputDataSource, bool) +1. RawStreamInputDataSource.AsBlobStreamInputDataSource() (*BlobStreamInputDataSource, bool) +1. RawStreamInputDataSource.AsEventHubStreamInputDataSource() (*EventHubStreamInputDataSource, bool) +1. RawStreamInputDataSource.AsEventHubV2StreamInputDataSource() (*EventHubV2StreamInputDataSource, bool) +1. RawStreamInputDataSource.AsIoTHubStreamInputDataSource() (*IoTHubStreamInputDataSource, bool) +1. RawStreamInputDataSource.AsRawStreamInputDataSource() (*RawStreamInputDataSource, bool) +1. RawStreamInputDataSource.AsStreamInputDataSource() (*StreamInputDataSource, bool) +1. RawStreamInputDataSource.MarshalJSON() ([]byte, error) +1. ReferenceInputDataSource.AsRawReferenceInputDataSource() (*RawReferenceInputDataSource, bool) +1. SampleInputResult.MarshalJSON() ([]byte, error) +1. ServiceBusQueueOutputDataSource.AsRawOutputDatasource() (*RawOutputDatasource, bool) +1. ServiceBusTopicOutputDataSource.AsRawOutputDatasource() (*RawOutputDatasource, bool) +1. StreamInputDataSource.AsRawStreamInputDataSource() (*RawStreamInputDataSource, bool) +1. SubscriptionsClient.CompileQueryMethod(context.Context, CompileQuery, string) (QueryCompilationResult, error) +1. SubscriptionsClient.CompileQueryMethodPreparer(context.Context, CompileQuery, string) (*http.Request, error) +1. SubscriptionsClient.CompileQueryMethodResponder(*http.Response) (QueryCompilationResult, error) +1. SubscriptionsClient.CompileQueryMethodSender(*http.Request) (*http.Response, error) +1. SubscriptionsClient.SampleInputMethod(context.Context, SampleInput, string) (SubscriptionsSampleInputMethodFuture, error) +1. SubscriptionsClient.SampleInputMethodPreparer(context.Context, SampleInput, string) (*http.Request, error) +1. SubscriptionsClient.SampleInputMethodResponder(*http.Response) (SampleInputResult, error) +1. SubscriptionsClient.SampleInputMethodSender(*http.Request) (SubscriptionsSampleInputMethodFuture, error) +1. SubscriptionsClient.TestInputMethod(context.Context, TestInput, string) (SubscriptionsTestInputMethodFuture, error) +1. SubscriptionsClient.TestInputMethodPreparer(context.Context, TestInput, string) (*http.Request, error) +1. SubscriptionsClient.TestInputMethodResponder(*http.Response) (TestDatasourceResult, error) +1. SubscriptionsClient.TestInputMethodSender(*http.Request) (SubscriptionsTestInputMethodFuture, error) +1. SubscriptionsClient.TestOutputMethod(context.Context, TestOutput, string) (SubscriptionsTestOutputMethodFuture, error) +1. SubscriptionsClient.TestOutputMethodPreparer(context.Context, TestOutput, string) (*http.Request, error) +1. SubscriptionsClient.TestOutputMethodResponder(*http.Response) (TestDatasourceResult, error) +1. SubscriptionsClient.TestOutputMethodSender(*http.Request) (SubscriptionsTestOutputMethodFuture, error) +1. SubscriptionsClient.TestQueryMethod(context.Context, TestQuery, string) (SubscriptionsTestQueryMethodFuture, error) +1. SubscriptionsClient.TestQueryMethodPreparer(context.Context, TestQuery, string) (*http.Request, error) +1. SubscriptionsClient.TestQueryMethodResponder(*http.Response) (QueryTestingResult, error) +1. SubscriptionsClient.TestQueryMethodSender(*http.Request) (SubscriptionsTestQueryMethodFuture, error) + +### Struct Changes + +#### New Structs + +1. CompileQuery +1. QueryCompilationError +1. QueryCompilationResult +1. QueryFunction +1. QueryInput +1. QueryTestingResult +1. RawInputDatasourceProperties +1. RawOutputDatasource +1. RawOutputDatasourceProperties +1. RawReferenceInputDataSource +1. RawStreamInputDataSource +1. SampleInput +1. SampleInputResult +1. SubscriptionsSampleInputMethodFuture +1. SubscriptionsTestInputMethodFuture +1. SubscriptionsTestOutputMethodFuture +1. SubscriptionsTestQueryMethodFuture +1. TestDatasourceResult +1. TestInput +1. TestOutput +1. TestQuery +1. TestQueryDiagnostics diff --git a/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/_meta.json b/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/_meta.json index a14339b8da0d..cdf5d3a81468 100644 --- a/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/_meta.json +++ b/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "b5a24940312f09a613f422f71ab6dc404546260e", "readme": "/_/azure-rest-api-specs/specification/streamanalytics/resource-manager/readme.md", "tag": "package-2020-03-preview", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/enums.go b/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/enums.go index f2da195cff45..67e3eb0ee5cf 100644 --- a/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/enums.go +++ b/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/enums.go @@ -246,6 +246,46 @@ func PossibleOutputStartModeValues() []OutputStartMode { return []OutputStartMode{CustomTime, JobStartTime, LastOutputEventTime} } +// QueryTestingResultStatus enumerates the values for query testing result status. +type QueryTestingResultStatus string + +const ( + // CompilerError The query testing operation failed due to a compiler error. + CompilerError QueryTestingResultStatus = "CompilerError" + // RuntimeError The query testing operation failed due to a runtime error. + RuntimeError QueryTestingResultStatus = "RuntimeError" + // Started The query testing operation was initiated. + Started QueryTestingResultStatus = "Started" + // Success The query testing operation succeeded. + Success QueryTestingResultStatus = "Success" + // Timeout The query testing operation failed due to a timeout. + Timeout QueryTestingResultStatus = "Timeout" + // UnknownError The query testing operation failed due to an unknown error . + UnknownError QueryTestingResultStatus = "UnknownError" +) + +// PossibleQueryTestingResultStatusValues returns an array of possible values for the QueryTestingResultStatus const type. +func PossibleQueryTestingResultStatusValues() []QueryTestingResultStatus { + return []QueryTestingResultStatus{CompilerError, RuntimeError, Started, Success, Timeout, UnknownError} +} + +// SampleInputResultStatus enumerates the values for sample input result status. +type SampleInputResultStatus string + +const ( + // ErrorConnectingToInput The sample input operation failed to connect to the input. + ErrorConnectingToInput SampleInputResultStatus = "ErrorConnectingToInput" + // NoEventsFoundInRange The sample input operation found no events in the range. + NoEventsFoundInRange SampleInputResultStatus = "NoEventsFoundInRange" + // ReadAllEventsInRange The sample input operation successfully read all the events in the range. + ReadAllEventsInRange SampleInputResultStatus = "ReadAllEventsInRange" +) + +// PossibleSampleInputResultStatusValues returns an array of possible values for the SampleInputResultStatus const type. +func PossibleSampleInputResultStatusValues() []SampleInputResultStatus { + return []SampleInputResultStatus{ErrorConnectingToInput, NoEventsFoundInRange, ReadAllEventsInRange} +} + // StreamingJobSkuName enumerates the values for streaming job sku name. type StreamingJobSkuName string @@ -259,6 +299,21 @@ func PossibleStreamingJobSkuNameValues() []StreamingJobSkuName { return []StreamingJobSkuName{Standard} } +// TestDatasourceResultStatus enumerates the values for test datasource result status. +type TestDatasourceResultStatus string + +const ( + // TestFailed The test datasource operation failed. + TestFailed TestDatasourceResultStatus = "TestFailed" + // TestSucceeded The test datasource operation succeeded. + TestSucceeded TestDatasourceResultStatus = "TestSucceeded" +) + +// PossibleTestDatasourceResultStatusValues returns an array of possible values for the TestDatasourceResultStatus const type. +func PossibleTestDatasourceResultStatusValues() []TestDatasourceResultStatus { + return []TestDatasourceResultStatus{TestFailed, TestSucceeded} +} + // Type enumerates the values for type. type Type string @@ -344,11 +399,13 @@ const ( TypeOutputDataSource TypeBasicOutputDataSource = "OutputDataSource" // TypePowerBI ... TypePowerBI TypeBasicOutputDataSource = "PowerBI" + // TypeRaw ... + TypeRaw TypeBasicOutputDataSource = "Raw" ) // PossibleTypeBasicOutputDataSourceValues returns an array of possible values for the TypeBasicOutputDataSource const type. func PossibleTypeBasicOutputDataSourceValues() []TypeBasicOutputDataSource { - return []TypeBasicOutputDataSource{TypeMicrosoftAzureFunction, TypeMicrosoftDataLakeAccounts, TypeMicrosoftEventHubEventHub, TypeMicrosoftServiceBusEventHub, TypeMicrosoftServiceBusQueue, TypeMicrosoftServiceBusTopic, TypeMicrosoftSQLServerDatabase, TypeMicrosoftSQLServerDataWarehouse, TypeMicrosoftStorageBlob, TypeMicrosoftStorageDocumentDB, TypeMicrosoftStorageTable, TypeOutputDataSource, TypePowerBI} + return []TypeBasicOutputDataSource{TypeMicrosoftAzureFunction, TypeMicrosoftDataLakeAccounts, TypeMicrosoftEventHubEventHub, TypeMicrosoftServiceBusEventHub, TypeMicrosoftServiceBusQueue, TypeMicrosoftServiceBusTopic, TypeMicrosoftSQLServerDatabase, TypeMicrosoftSQLServerDataWarehouse, TypeMicrosoftStorageBlob, TypeMicrosoftStorageDocumentDB, TypeMicrosoftStorageTable, TypeOutputDataSource, TypePowerBI, TypeRaw} } // TypeBasicReferenceInputDataSource enumerates the values for type basic reference input data source. @@ -359,13 +416,15 @@ const ( TypeBasicReferenceInputDataSourceTypeMicrosoftSQLServerDatabase TypeBasicReferenceInputDataSource = "Microsoft.Sql/Server/Database" // TypeBasicReferenceInputDataSourceTypeMicrosoftStorageBlob ... TypeBasicReferenceInputDataSourceTypeMicrosoftStorageBlob TypeBasicReferenceInputDataSource = "Microsoft.Storage/Blob" + // TypeBasicReferenceInputDataSourceTypeRaw ... + TypeBasicReferenceInputDataSourceTypeRaw TypeBasicReferenceInputDataSource = "Raw" // TypeBasicReferenceInputDataSourceTypeReferenceInputDataSource ... TypeBasicReferenceInputDataSourceTypeReferenceInputDataSource TypeBasicReferenceInputDataSource = "ReferenceInputDataSource" ) // PossibleTypeBasicReferenceInputDataSourceValues returns an array of possible values for the TypeBasicReferenceInputDataSource const type. func PossibleTypeBasicReferenceInputDataSourceValues() []TypeBasicReferenceInputDataSource { - return []TypeBasicReferenceInputDataSource{TypeBasicReferenceInputDataSourceTypeMicrosoftSQLServerDatabase, TypeBasicReferenceInputDataSourceTypeMicrosoftStorageBlob, TypeBasicReferenceInputDataSourceTypeReferenceInputDataSource} + return []TypeBasicReferenceInputDataSource{TypeBasicReferenceInputDataSourceTypeMicrosoftSQLServerDatabase, TypeBasicReferenceInputDataSourceTypeMicrosoftStorageBlob, TypeBasicReferenceInputDataSourceTypeRaw, TypeBasicReferenceInputDataSourceTypeReferenceInputDataSource} } // TypeBasicSerialization enumerates the values for type basic serialization. @@ -403,13 +462,15 @@ const ( TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub TypeBasicStreamInputDataSource = "Microsoft.ServiceBus/EventHub" // TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob ... TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob TypeBasicStreamInputDataSource = "Microsoft.Storage/Blob" + // TypeBasicStreamInputDataSourceTypeRaw ... + TypeBasicStreamInputDataSourceTypeRaw TypeBasicStreamInputDataSource = "Raw" // TypeBasicStreamInputDataSourceTypeStreamInputDataSource ... TypeBasicStreamInputDataSourceTypeStreamInputDataSource TypeBasicStreamInputDataSource = "StreamInputDataSource" ) // PossibleTypeBasicStreamInputDataSourceValues returns an array of possible values for the TypeBasicStreamInputDataSource const type. func PossibleTypeBasicStreamInputDataSourceValues() []TypeBasicStreamInputDataSource { - return []TypeBasicStreamInputDataSource{TypeBasicStreamInputDataSourceTypeMicrosoftDevicesIotHubs, TypeBasicStreamInputDataSourceTypeMicrosoftEventHubEventHub, TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub, TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob, TypeBasicStreamInputDataSourceTypeStreamInputDataSource} + return []TypeBasicStreamInputDataSource{TypeBasicStreamInputDataSourceTypeMicrosoftDevicesIotHubs, TypeBasicStreamInputDataSourceTypeMicrosoftEventHubEventHub, TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub, TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob, TypeBasicStreamInputDataSourceTypeRaw, TypeBasicStreamInputDataSourceTypeStreamInputDataSource} } // UdfType enumerates the values for udf type. diff --git a/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/functions.go b/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/functions.go index ea7e28f6341a..6dc05f067909 100644 --- a/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/functions.go +++ b/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/functions.go @@ -512,7 +512,7 @@ func (client FunctionsClient) RetrieveDefaultDefinitionPreparer(ctx context.Cont autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/functions/{functionName}/RetrieveDefaultDefinition", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/functions/{functionName}/retrieveDefaultDefinition", pathParameters), autorest.WithQueryParameters(queryParameters)) if functionRetrieveDefaultDefinitionParameters != nil { preparer = autorest.DecoratePreparer(preparer, diff --git a/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/models.go b/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/models.go index 95376fe4d118..f6a228ed1156 100644 --- a/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/models.go +++ b/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/models.go @@ -165,7 +165,7 @@ func (as AvroSerialization) AsBasicSerialization() (BasicSerialization, bool) { type AzureDataLakeStoreOutputDataSource struct { // AzureDataLakeStoreOutputDataSourceProperties - The properties that are associated with an Azure Data Lake Store output. Required on PUT (CreateOrReplace) requests. *AzureDataLakeStoreOutputDataSourceProperties `json:"properties,omitempty"` - // Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' + // Type - Possible values include: 'TypeOutputDataSource', 'TypeRaw', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' Type TypeBasicOutputDataSource `json:"type,omitempty"` } @@ -182,6 +182,11 @@ func (adlsods AzureDataLakeStoreOutputDataSource) MarshalJSON() ([]byte, error) return json.Marshal(objectMap) } +// AsRawOutputDatasource is the BasicOutputDataSource implementation for AzureDataLakeStoreOutputDataSource. +func (adlsods AzureDataLakeStoreOutputDataSource) AsRawOutputDatasource() (*RawOutputDatasource, bool) { + return nil, false +} + // AsBlobOutputDataSource is the BasicOutputDataSource implementation for AzureDataLakeStoreOutputDataSource. func (adlsods AzureDataLakeStoreOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) { return nil, false @@ -312,7 +317,7 @@ type AzureDataLakeStoreOutputDataSourceProperties struct { type AzureFunctionOutputDataSource struct { // AzureFunctionOutputDataSourceProperties - The properties that are associated with a Azure Function output. Required on PUT (CreateOrReplace) requests. *AzureFunctionOutputDataSourceProperties `json:"properties,omitempty"` - // Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' + // Type - Possible values include: 'TypeOutputDataSource', 'TypeRaw', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' Type TypeBasicOutputDataSource `json:"type,omitempty"` } @@ -329,6 +334,11 @@ func (afods AzureFunctionOutputDataSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsRawOutputDatasource is the BasicOutputDataSource implementation for AzureFunctionOutputDataSource. +func (afods AzureFunctionOutputDataSource) AsRawOutputDatasource() (*RawOutputDatasource, bool) { + return nil, false +} + // AsBlobOutputDataSource is the BasicOutputDataSource implementation for AzureFunctionOutputDataSource. func (afods AzureFunctionOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) { return nil, false @@ -917,7 +927,7 @@ type AzureSQLDatabaseDataSourceProperties struct { type AzureSQLDatabaseOutputDataSource struct { // AzureSQLDatabaseOutputDataSourceProperties - The properties that are associated with an Azure SQL database output. Required on PUT (CreateOrReplace) requests. *AzureSQLDatabaseOutputDataSourceProperties `json:"properties,omitempty"` - // Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' + // Type - Possible values include: 'TypeOutputDataSource', 'TypeRaw', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' Type TypeBasicOutputDataSource `json:"type,omitempty"` } @@ -934,6 +944,11 @@ func (asdods AzureSQLDatabaseOutputDataSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsRawOutputDatasource is the BasicOutputDataSource implementation for AzureSQLDatabaseOutputDataSource. +func (asdods AzureSQLDatabaseOutputDataSource) AsRawOutputDatasource() (*RawOutputDatasource, bool) { + return nil, false +} + // AsBlobOutputDataSource is the BasicOutputDataSource implementation for AzureSQLDatabaseOutputDataSource. func (asdods AzureSQLDatabaseOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) { return nil, false @@ -1061,7 +1076,7 @@ type AzureSQLDatabaseOutputDataSourceProperties struct { // AzureSQLReferenceInputDataSource describes an Azure SQL database reference input data source. type AzureSQLReferenceInputDataSource struct { Properties *AzureSQLReferenceInputDataSourceProperties `json:"properties,omitempty"` - // Type - Possible values include: 'TypeBasicReferenceInputDataSourceTypeReferenceInputDataSource', 'TypeBasicReferenceInputDataSourceTypeMicrosoftStorageBlob', 'TypeBasicReferenceInputDataSourceTypeMicrosoftSQLServerDatabase' + // Type - Possible values include: 'TypeBasicReferenceInputDataSourceTypeReferenceInputDataSource', 'TypeBasicReferenceInputDataSourceTypeMicrosoftStorageBlob', 'TypeBasicReferenceInputDataSourceTypeRaw', 'TypeBasicReferenceInputDataSourceTypeMicrosoftSQLServerDatabase' Type TypeBasicReferenceInputDataSource `json:"type,omitempty"` } @@ -1083,6 +1098,11 @@ func (asrids AzureSQLReferenceInputDataSource) AsBlobReferenceInputDataSource() return nil, false } +// AsRawReferenceInputDataSource is the BasicReferenceInputDataSource implementation for AzureSQLReferenceInputDataSource. +func (asrids AzureSQLReferenceInputDataSource) AsRawReferenceInputDataSource() (*RawReferenceInputDataSource, bool) { + return nil, false +} + // AsAzureSQLReferenceInputDataSource is the BasicReferenceInputDataSource implementation for AzureSQLReferenceInputDataSource. func (asrids AzureSQLReferenceInputDataSource) AsAzureSQLReferenceInputDataSource() (*AzureSQLReferenceInputDataSource, bool) { return &asrids, true @@ -1098,7 +1118,8 @@ func (asrids AzureSQLReferenceInputDataSource) AsBasicReferenceInputDataSource() return &asrids, true } -// AzureSQLReferenceInputDataSourceProperties ... +// AzureSQLReferenceInputDataSourceProperties describes Azure SQL database reference input data source +// properties. type AzureSQLReferenceInputDataSourceProperties struct { // Server - This element is associated with the datasource element. This is the name of the server that contains the database that will be written to. Server *string `json:"server,omitempty"` @@ -1139,7 +1160,7 @@ type AzureSynapseDataSourceProperties struct { type AzureSynapseOutputDataSource struct { // AzureSynapseOutputDataSourceProperties - The properties that are associated with an Azure Synapse output. Required on PUT (CreateOrReplace) requests. *AzureSynapseOutputDataSourceProperties `json:"properties,omitempty"` - // Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' + // Type - Possible values include: 'TypeOutputDataSource', 'TypeRaw', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' Type TypeBasicOutputDataSource `json:"type,omitempty"` } @@ -1156,6 +1177,11 @@ func (asods AzureSynapseOutputDataSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsRawOutputDatasource is the BasicOutputDataSource implementation for AzureSynapseOutputDataSource. +func (asods AzureSynapseOutputDataSource) AsRawOutputDatasource() (*RawOutputDatasource, bool) { + return nil, false +} + // AsBlobOutputDataSource is the BasicOutputDataSource implementation for AzureSynapseOutputDataSource. func (asods AzureSynapseOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) { return nil, false @@ -1277,7 +1303,7 @@ type AzureSynapseOutputDataSourceProperties struct { type AzureTableOutputDataSource struct { // AzureTableOutputDataSourceProperties - The properties that are associated with an Azure Table output. Required on PUT (CreateOrReplace) requests. *AzureTableOutputDataSourceProperties `json:"properties,omitempty"` - // Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' + // Type - Possible values include: 'TypeOutputDataSource', 'TypeRaw', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' Type TypeBasicOutputDataSource `json:"type,omitempty"` } @@ -1294,6 +1320,11 @@ func (atods AzureTableOutputDataSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsRawOutputDatasource is the BasicOutputDataSource implementation for AzureTableOutputDataSource. +func (atods AzureTableOutputDataSource) AsRawOutputDatasource() (*RawOutputDatasource, bool) { + return nil, false +} + // AsBlobOutputDataSource is the BasicOutputDataSource implementation for AzureTableOutputDataSource. func (atods AzureTableOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) { return nil, false @@ -1433,7 +1464,7 @@ type BlobDataSourceProperties struct { type BlobOutputDataSource struct { // BlobOutputDataSourceProperties - The properties that are associated with a blob output. Required on PUT (CreateOrReplace) requests. *BlobOutputDataSourceProperties `json:"properties,omitempty"` - // Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' + // Type - Possible values include: 'TypeOutputDataSource', 'TypeRaw', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' Type TypeBasicOutputDataSource `json:"type,omitempty"` } @@ -1450,6 +1481,11 @@ func (bods BlobOutputDataSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsRawOutputDatasource is the BasicOutputDataSource implementation for BlobOutputDataSource. +func (bods BlobOutputDataSource) AsRawOutputDatasource() (*RawOutputDatasource, bool) { + return nil, false +} + // AsBlobOutputDataSource is the BasicOutputDataSource implementation for BlobOutputDataSource. func (bods BlobOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) { return &bods, true @@ -1573,7 +1609,7 @@ type BlobOutputDataSourceProperties struct { type BlobReferenceInputDataSource struct { // BlobReferenceInputDataSourceProperties - The properties that are associated with a blob input containing reference data. Required on PUT (CreateOrReplace) requests. *BlobReferenceInputDataSourceProperties `json:"properties,omitempty"` - // Type - Possible values include: 'TypeBasicReferenceInputDataSourceTypeReferenceInputDataSource', 'TypeBasicReferenceInputDataSourceTypeMicrosoftStorageBlob', 'TypeBasicReferenceInputDataSourceTypeMicrosoftSQLServerDatabase' + // Type - Possible values include: 'TypeBasicReferenceInputDataSourceTypeReferenceInputDataSource', 'TypeBasicReferenceInputDataSourceTypeMicrosoftStorageBlob', 'TypeBasicReferenceInputDataSourceTypeRaw', 'TypeBasicReferenceInputDataSourceTypeMicrosoftSQLServerDatabase' Type TypeBasicReferenceInputDataSource `json:"type,omitempty"` } @@ -1595,6 +1631,11 @@ func (brids BlobReferenceInputDataSource) AsBlobReferenceInputDataSource() (*Blo return &brids, true } +// AsRawReferenceInputDataSource is the BasicReferenceInputDataSource implementation for BlobReferenceInputDataSource. +func (brids BlobReferenceInputDataSource) AsRawReferenceInputDataSource() (*RawReferenceInputDataSource, bool) { + return nil, false +} + // AsAzureSQLReferenceInputDataSource is the BasicReferenceInputDataSource implementation for BlobReferenceInputDataSource. func (brids BlobReferenceInputDataSource) AsAzureSQLReferenceInputDataSource() (*AzureSQLReferenceInputDataSource, bool) { return nil, false @@ -1662,7 +1703,7 @@ type BlobReferenceInputDataSourceProperties struct { type BlobStreamInputDataSource struct { // BlobStreamInputDataSourceProperties - The properties that are associated with a blob input containing stream data. Required on PUT (CreateOrReplace) requests. *BlobStreamInputDataSourceProperties `json:"properties,omitempty"` - // Type - Possible values include: 'TypeBasicStreamInputDataSourceTypeStreamInputDataSource', 'TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob', 'TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftEventHubEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftDevicesIotHubs' + // Type - Possible values include: 'TypeBasicStreamInputDataSourceTypeStreamInputDataSource', 'TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob', 'TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftEventHubEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftDevicesIotHubs', 'TypeBasicStreamInputDataSourceTypeRaw' Type TypeBasicStreamInputDataSource `json:"type,omitempty"` } @@ -1699,6 +1740,11 @@ func (bsids BlobStreamInputDataSource) AsIoTHubStreamInputDataSource() (*IoTHubS return nil, false } +// AsRawStreamInputDataSource is the BasicStreamInputDataSource implementation for BlobStreamInputDataSource. +func (bsids BlobStreamInputDataSource) AsRawStreamInputDataSource() (*RawStreamInputDataSource, bool) { + return nil, false +} + // AsStreamInputDataSource is the BasicStreamInputDataSource implementation for BlobStreamInputDataSource. func (bsids BlobStreamInputDataSource) AsStreamInputDataSource() (*StreamInputDataSource, bool) { return nil, false @@ -2307,6 +2353,21 @@ func (future *ClustersUpdateFuture) result(client ClustersClient) (c Cluster, er return } +// CompileQuery the query compilation object which defines the input, output, and transformation for the +// query compilation. +type CompileQuery struct { + // Query - The query to compile. + Query *string `json:"query,omitempty"` + // Inputs - The inputs for the query compilation. + Inputs *[]QueryInput `json:"inputs,omitempty"` + // Functions - The functions for the query compilation. + Functions *[]QueryFunction `json:"functions,omitempty"` + // JobType - Describes the type of the job. Valid values are `Cloud` and 'Edge'. Possible values include: 'Cloud', 'Edge' + JobType JobType `json:"jobType,omitempty"` + // CompatibilityLevel - The query to compile. Possible values include: 'OneFullStopZero' + CompatibilityLevel CompatibilityLevel `json:"compatibilityLevel,omitempty"` +} + // Compression describes how input data is compressed type Compression struct { Type *string `json:"type,omitempty"` @@ -2733,7 +2794,7 @@ func (d Diagnostics) MarshalJSON() ([]byte, error) { type DocumentDbOutputDataSource struct { // DocumentDbOutputDataSourceProperties - The properties that are associated with a DocumentDB output. Required on PUT (CreateOrReplace) requests. *DocumentDbOutputDataSourceProperties `json:"properties,omitempty"` - // Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' + // Type - Possible values include: 'TypeOutputDataSource', 'TypeRaw', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' Type TypeBasicOutputDataSource `json:"type,omitempty"` } @@ -2750,6 +2811,11 @@ func (ddods DocumentDbOutputDataSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsRawOutputDatasource is the BasicOutputDataSource implementation for DocumentDbOutputDataSource. +func (ddods DocumentDbOutputDataSource) AsRawOutputDatasource() (*RawOutputDatasource, bool) { + return nil, false +} + // AsBlobOutputDataSource is the BasicOutputDataSource implementation for DocumentDbOutputDataSource. func (ddods DocumentDbOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) { return nil, false @@ -2929,7 +2995,7 @@ type EventHubDataSourceProperties struct { type EventHubOutputDataSource struct { // EventHubOutputDataSourceProperties - The properties that are associated with an Event Hub output. Required on PUT (CreateOrReplace) requests. *EventHubOutputDataSourceProperties `json:"properties,omitempty"` - // Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' + // Type - Possible values include: 'TypeOutputDataSource', 'TypeRaw', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' Type TypeBasicOutputDataSource `json:"type,omitempty"` } @@ -2946,6 +3012,11 @@ func (ehods EventHubOutputDataSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsRawOutputDatasource is the BasicOutputDataSource implementation for EventHubOutputDataSource. +func (ehods EventHubOutputDataSource) AsRawOutputDatasource() (*RawOutputDatasource, bool) { + return nil, false +} + // AsBlobOutputDataSource is the BasicOutputDataSource implementation for EventHubOutputDataSource. func (ehods EventHubOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) { return nil, false @@ -3070,7 +3141,7 @@ type EventHubOutputDataSourceProperties struct { type EventHubStreamInputDataSource struct { // EventHubStreamInputDataSourceProperties - The properties that are associated with an Event Hub input containing stream data. Required on PUT (CreateOrReplace) requests. *EventHubStreamInputDataSourceProperties `json:"properties,omitempty"` - // Type - Possible values include: 'TypeBasicStreamInputDataSourceTypeStreamInputDataSource', 'TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob', 'TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftEventHubEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftDevicesIotHubs' + // Type - Possible values include: 'TypeBasicStreamInputDataSourceTypeStreamInputDataSource', 'TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob', 'TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftEventHubEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftDevicesIotHubs', 'TypeBasicStreamInputDataSourceTypeRaw' Type TypeBasicStreamInputDataSource `json:"type,omitempty"` } @@ -3107,6 +3178,11 @@ func (ehsids EventHubStreamInputDataSource) AsIoTHubStreamInputDataSource() (*Io return nil, false } +// AsRawStreamInputDataSource is the BasicStreamInputDataSource implementation for EventHubStreamInputDataSource. +func (ehsids EventHubStreamInputDataSource) AsRawStreamInputDataSource() (*RawStreamInputDataSource, bool) { + return nil, false +} + // AsStreamInputDataSource is the BasicStreamInputDataSource implementation for EventHubStreamInputDataSource. func (ehsids EventHubStreamInputDataSource) AsStreamInputDataSource() (*StreamInputDataSource, bool) { return nil, false @@ -3171,7 +3247,7 @@ type EventHubStreamInputDataSourceProperties struct { type EventHubV2OutputDataSource struct { // EventHubOutputDataSourceProperties - The properties that are associated with an Event Hub output. Required on PUT (CreateOrReplace) requests. *EventHubOutputDataSourceProperties `json:"properties,omitempty"` - // Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' + // Type - Possible values include: 'TypeOutputDataSource', 'TypeRaw', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' Type TypeBasicOutputDataSource `json:"type,omitempty"` } @@ -3188,6 +3264,11 @@ func (ehvods EventHubV2OutputDataSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsRawOutputDatasource is the BasicOutputDataSource implementation for EventHubV2OutputDataSource. +func (ehvods EventHubV2OutputDataSource) AsRawOutputDatasource() (*RawOutputDatasource, bool) { + return nil, false +} + // AsBlobOutputDataSource is the BasicOutputDataSource implementation for EventHubV2OutputDataSource. func (ehvods EventHubV2OutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) { return nil, false @@ -3295,7 +3376,7 @@ func (ehvods *EventHubV2OutputDataSource) UnmarshalJSON(body []byte) error { type EventHubV2StreamInputDataSource struct { // EventHubStreamInputDataSourceProperties - The properties that are associated with an Event Hub input containing stream data. Required on PUT (CreateOrReplace) requests. *EventHubStreamInputDataSourceProperties `json:"properties,omitempty"` - // Type - Possible values include: 'TypeBasicStreamInputDataSourceTypeStreamInputDataSource', 'TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob', 'TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftEventHubEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftDevicesIotHubs' + // Type - Possible values include: 'TypeBasicStreamInputDataSourceTypeStreamInputDataSource', 'TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob', 'TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftEventHubEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftDevicesIotHubs', 'TypeBasicStreamInputDataSourceTypeRaw' Type TypeBasicStreamInputDataSource `json:"type,omitempty"` } @@ -3332,6 +3413,11 @@ func (ehvsids EventHubV2StreamInputDataSource) AsIoTHubStreamInputDataSource() ( return nil, false } +// AsRawStreamInputDataSource is the BasicStreamInputDataSource implementation for EventHubV2StreamInputDataSource. +func (ehvsids EventHubV2StreamInputDataSource) AsRawStreamInputDataSource() (*RawStreamInputDataSource, bool) { + return nil, false +} + // AsStreamInputDataSource is the BasicStreamInputDataSource implementation for EventHubV2StreamInputDataSource. func (ehvsids EventHubV2StreamInputDataSource) AsStreamInputDataSource() (*StreamInputDataSource, bool) { return nil, false @@ -4530,7 +4616,7 @@ func (future *InputsTestFuture) result(client InputsClient) (rts ResourceTestSta type IoTHubStreamInputDataSource struct { // IoTHubStreamInputDataSourceProperties - The properties that are associated with an IoT Hub input containing stream data. Required on PUT (CreateOrReplace) requests. *IoTHubStreamInputDataSourceProperties `json:"properties,omitempty"` - // Type - Possible values include: 'TypeBasicStreamInputDataSourceTypeStreamInputDataSource', 'TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob', 'TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftEventHubEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftDevicesIotHubs' + // Type - Possible values include: 'TypeBasicStreamInputDataSourceTypeStreamInputDataSource', 'TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob', 'TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftEventHubEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftDevicesIotHubs', 'TypeBasicStreamInputDataSourceTypeRaw' Type TypeBasicStreamInputDataSource `json:"type,omitempty"` } @@ -4567,6 +4653,11 @@ func (ithsids IoTHubStreamInputDataSource) AsIoTHubStreamInputDataSource() (*IoT return &ithsids, true } +// AsRawStreamInputDataSource is the BasicStreamInputDataSource implementation for IoTHubStreamInputDataSource. +func (ithsids IoTHubStreamInputDataSource) AsRawStreamInputDataSource() (*RawStreamInputDataSource, bool) { + return nil, false +} + // AsStreamInputDataSource is the BasicStreamInputDataSource implementation for IoTHubStreamInputDataSource. func (ithsids IoTHubStreamInputDataSource) AsStreamInputDataSource() (*StreamInputDataSource, bool) { return nil, false @@ -5205,6 +5296,7 @@ func (o *Output) UnmarshalJSON(body []byte) error { // BasicOutputDataSource describes the data source that output will be written to. type BasicOutputDataSource interface { + AsRawOutputDatasource() (*RawOutputDatasource, bool) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) AsAzureTableOutputDataSource() (*AzureTableOutputDataSource, bool) AsEventHubOutputDataSource() (*EventHubOutputDataSource, bool) @@ -5222,7 +5314,7 @@ type BasicOutputDataSource interface { // OutputDataSource describes the data source that output will be written to. type OutputDataSource struct { - // Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' + // Type - Possible values include: 'TypeOutputDataSource', 'TypeRaw', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' Type TypeBasicOutputDataSource `json:"type,omitempty"` } @@ -5234,6 +5326,10 @@ func unmarshalBasicOutputDataSource(body []byte) (BasicOutputDataSource, error) } switch m["type"] { + case string(TypeRaw): + var rod RawOutputDatasource + err := json.Unmarshal(body, &rod) + return rod, err case string(TypeMicrosoftStorageBlob): var bods BlobOutputDataSource err := json.Unmarshal(body, &bods) @@ -5317,6 +5413,11 @@ func (ods OutputDataSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsRawOutputDatasource is the BasicOutputDataSource implementation for OutputDataSource. +func (ods OutputDataSource) AsRawOutputDatasource() (*RawOutputDatasource, bool) { + return nil, false +} + // AsBlobOutputDataSource is the BasicOutputDataSource implementation for OutputDataSource. func (ods OutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) { return nil, false @@ -5750,7 +5851,7 @@ func (ps ParquetSerialization) AsBasicSerialization() (BasicSerialization, bool) type PowerBIOutputDataSource struct { // PowerBIOutputDataSourceProperties - The properties that are associated with a Power BI output. Required on PUT (CreateOrReplace) requests. *PowerBIOutputDataSourceProperties `json:"properties,omitempty"` - // Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' + // Type - Possible values include: 'TypeOutputDataSource', 'TypeRaw', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' Type TypeBasicOutputDataSource `json:"type,omitempty"` } @@ -5767,6 +5868,11 @@ func (pbods PowerBIOutputDataSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsRawOutputDatasource is the BasicOutputDataSource implementation for PowerBIOutputDataSource. +func (pbods PowerBIOutputDataSource) AsRawOutputDatasource() (*RawOutputDatasource, bool) { + return nil, false +} + // AsBlobOutputDataSource is the BasicOutputDataSource implementation for PowerBIOutputDataSource. func (pbods PowerBIOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) { return nil, false @@ -6218,16 +6324,422 @@ func (pr ProxyResource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// QueryCompilationError an error produced by the compiler. +type QueryCompilationError struct { + // Message - READ-ONLY; The content of the error message. + Message *string `json:"message,omitempty"` + // StartLine - READ-ONLY; Describes the error location in the original query. Not set if isGlobal is true. + StartLine *int32 `json:"startLine,omitempty"` + // StartColumn - READ-ONLY; Describes the error location in the original query. Not set if isGlobal is true. + StartColumn *int32 `json:"startColumn,omitempty"` + // EndLine - READ-ONLY; Describes the error location in the original query. Not set if isGlobal is true. + EndLine *int32 `json:"endLine,omitempty"` + // EndColumn - READ-ONLY; Describes the error location in the original query. Not set if isGlobal is true. + EndColumn *int32 `json:"endColumn,omitempty"` + // IsGlobal - READ-ONLY; Whether the error is not for a specific part but for the entire query. + IsGlobal *bool `json:"isGlobal,omitempty"` +} + +// MarshalJSON is the custom marshaler for QueryCompilationError. +func (qce QueryCompilationError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// QueryCompilationResult the result of the query compilation request. +type QueryCompilationResult struct { + autorest.Response `json:"-"` + // Errors - READ-ONLY; Error messages produced by the compiler. + Errors *[]QueryCompilationError `json:"errors,omitempty"` + // Warnings - READ-ONLY; Warning messages produced by the compiler. + Warnings *[]string `json:"warnings,omitempty"` + // Inputs - READ-ONLY; All input names used by the query. + Inputs *[]string `json:"inputs,omitempty"` + // Outputs - READ-ONLY; All output names used by the query. + Outputs *[]string `json:"outputs,omitempty"` + // Functions - READ-ONLY; All function names used by the query. + Functions *[]string `json:"functions,omitempty"` +} + +// MarshalJSON is the custom marshaler for QueryCompilationResult. +func (qcr QueryCompilationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// QueryFunction a function for the query compilation. +type QueryFunction struct { + // Name - The name of the function. + Name *string `json:"name,omitempty"` + // Type - The type of the function. + Type *string `json:"type,omitempty"` + // BindingType - The type of the function binding. + BindingType *string `json:"bindingType,omitempty"` + // Inputs - The inputs for the function. + Inputs *[]FunctionInput `json:"inputs,omitempty"` + // Output - An output for the function. + Output *FunctionOutput `json:"output,omitempty"` +} + +// QueryInput an input for the query compilation. +type QueryInput struct { + // Name - The name of the input. + Name *string `json:"name,omitempty"` + // Type - The type of the input, can be Stream or Reference. + Type *string `json:"type,omitempty"` +} + +// QueryTestingResult the result of the query testing request. +type QueryTestingResult struct { + autorest.Response `json:"-"` + // Status - The status of the query testing request. Possible values include: 'Started', 'Success', 'CompilerError', 'RuntimeError', 'Timeout', 'UnknownError' + Status QueryTestingResultStatus `json:"status,omitempty"` + // OutputURI - READ-ONLY; The SAS URL to the outputs payload. + OutputURI *string `json:"outputUri,omitempty"` + // Error - Error definition properties. + Error *ErrorError `json:"error,omitempty"` +} + +// MarshalJSON is the custom marshaler for QueryTestingResult. +func (qtr QueryTestingResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if qtr.Status != "" { + objectMap["status"] = qtr.Status + } + if qtr.Error != nil { + objectMap["error"] = qtr.Error + } + return json.Marshal(objectMap) +} + +// RawInputDatasourceProperties the properties that are associated with a raw input. +type RawInputDatasourceProperties struct { + // Payload - The JSON serialized content of the input data. Either payload or payloadUri must be set, but not both. + Payload *string `json:"payload,omitempty"` + // PayloadURI - 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 `json:"payloadUri,omitempty"` +} + +// RawOutputDatasource 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. +type RawOutputDatasource struct { + // RawOutputDatasourceProperties - The properties that are associated with a raw output. Required on PUT (CreateOrReplace) requests. + *RawOutputDatasourceProperties `json:"properties,omitempty"` + // Type - Possible values include: 'TypeOutputDataSource', 'TypeRaw', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' + Type TypeBasicOutputDataSource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RawOutputDatasource. +func (rod RawOutputDatasource) MarshalJSON() ([]byte, error) { + rod.Type = TypeRaw + objectMap := make(map[string]interface{}) + if rod.RawOutputDatasourceProperties != nil { + objectMap["properties"] = rod.RawOutputDatasourceProperties + } + if rod.Type != "" { + objectMap["type"] = rod.Type + } + return json.Marshal(objectMap) +} + +// AsRawOutputDatasource is the BasicOutputDataSource implementation for RawOutputDatasource. +func (rod RawOutputDatasource) AsRawOutputDatasource() (*RawOutputDatasource, bool) { + return &rod, true +} + +// AsBlobOutputDataSource is the BasicOutputDataSource implementation for RawOutputDatasource. +func (rod RawOutputDatasource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) { + return nil, false +} + +// AsAzureTableOutputDataSource is the BasicOutputDataSource implementation for RawOutputDatasource. +func (rod RawOutputDatasource) AsAzureTableOutputDataSource() (*AzureTableOutputDataSource, bool) { + return nil, false +} + +// AsEventHubOutputDataSource is the BasicOutputDataSource implementation for RawOutputDatasource. +func (rod RawOutputDatasource) AsEventHubOutputDataSource() (*EventHubOutputDataSource, bool) { + return nil, false +} + +// AsEventHubV2OutputDataSource is the BasicOutputDataSource implementation for RawOutputDatasource. +func (rod RawOutputDatasource) AsEventHubV2OutputDataSource() (*EventHubV2OutputDataSource, bool) { + return nil, false +} + +// AsAzureSQLDatabaseOutputDataSource is the BasicOutputDataSource implementation for RawOutputDatasource. +func (rod RawOutputDatasource) AsAzureSQLDatabaseOutputDataSource() (*AzureSQLDatabaseOutputDataSource, bool) { + return nil, false +} + +// AsAzureSynapseOutputDataSource is the BasicOutputDataSource implementation for RawOutputDatasource. +func (rod RawOutputDatasource) AsAzureSynapseOutputDataSource() (*AzureSynapseOutputDataSource, bool) { + return nil, false +} + +// AsDocumentDbOutputDataSource is the BasicOutputDataSource implementation for RawOutputDatasource. +func (rod RawOutputDatasource) AsDocumentDbOutputDataSource() (*DocumentDbOutputDataSource, bool) { + return nil, false +} + +// AsAzureFunctionOutputDataSource is the BasicOutputDataSource implementation for RawOutputDatasource. +func (rod RawOutputDatasource) AsAzureFunctionOutputDataSource() (*AzureFunctionOutputDataSource, bool) { + return nil, false +} + +// AsServiceBusQueueOutputDataSource is the BasicOutputDataSource implementation for RawOutputDatasource. +func (rod RawOutputDatasource) AsServiceBusQueueOutputDataSource() (*ServiceBusQueueOutputDataSource, bool) { + return nil, false +} + +// AsServiceBusTopicOutputDataSource is the BasicOutputDataSource implementation for RawOutputDatasource. +func (rod RawOutputDatasource) AsServiceBusTopicOutputDataSource() (*ServiceBusTopicOutputDataSource, bool) { + return nil, false +} + +// AsPowerBIOutputDataSource is the BasicOutputDataSource implementation for RawOutputDatasource. +func (rod RawOutputDatasource) AsPowerBIOutputDataSource() (*PowerBIOutputDataSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreOutputDataSource is the BasicOutputDataSource implementation for RawOutputDatasource. +func (rod RawOutputDatasource) AsAzureDataLakeStoreOutputDataSource() (*AzureDataLakeStoreOutputDataSource, bool) { + return nil, false +} + +// AsOutputDataSource is the BasicOutputDataSource implementation for RawOutputDatasource. +func (rod RawOutputDatasource) AsOutputDataSource() (*OutputDataSource, bool) { + return nil, false +} + +// AsBasicOutputDataSource is the BasicOutputDataSource implementation for RawOutputDatasource. +func (rod RawOutputDatasource) AsBasicOutputDataSource() (BasicOutputDataSource, bool) { + return &rod, true +} + +// UnmarshalJSON is the custom unmarshaler for RawOutputDatasource struct. +func (rod *RawOutputDatasource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var rawOutputDatasourceProperties RawOutputDatasourceProperties + err = json.Unmarshal(*v, &rawOutputDatasourceProperties) + if err != nil { + return err + } + rod.RawOutputDatasourceProperties = &rawOutputDatasourceProperties + } + case "type": + if v != nil { + var typeVar TypeBasicOutputDataSource + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rod.Type = typeVar + } + } + } + + return nil +} + +// RawOutputDatasourceProperties the properties that are associated with a raw output. +type RawOutputDatasourceProperties struct { + // PayloadURI - 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 `json:"payloadUri,omitempty"` +} + +// RawReferenceInputDataSource 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. +type RawReferenceInputDataSource struct { + // RawInputDatasourceProperties - The properties that are associated with a raw input containing reference data. Required on PUT (CreateOrReplace) requests. + *RawInputDatasourceProperties `json:"properties,omitempty"` + // Type - Possible values include: 'TypeBasicReferenceInputDataSourceTypeReferenceInputDataSource', 'TypeBasicReferenceInputDataSourceTypeMicrosoftStorageBlob', 'TypeBasicReferenceInputDataSourceTypeRaw', 'TypeBasicReferenceInputDataSourceTypeMicrosoftSQLServerDatabase' + Type TypeBasicReferenceInputDataSource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RawReferenceInputDataSource. +func (rrids RawReferenceInputDataSource) MarshalJSON() ([]byte, error) { + rrids.Type = TypeBasicReferenceInputDataSourceTypeRaw + objectMap := make(map[string]interface{}) + if rrids.RawInputDatasourceProperties != nil { + objectMap["properties"] = rrids.RawInputDatasourceProperties + } + if rrids.Type != "" { + objectMap["type"] = rrids.Type + } + return json.Marshal(objectMap) +} + +// AsBlobReferenceInputDataSource is the BasicReferenceInputDataSource implementation for RawReferenceInputDataSource. +func (rrids RawReferenceInputDataSource) AsBlobReferenceInputDataSource() (*BlobReferenceInputDataSource, bool) { + return nil, false +} + +// AsRawReferenceInputDataSource is the BasicReferenceInputDataSource implementation for RawReferenceInputDataSource. +func (rrids RawReferenceInputDataSource) AsRawReferenceInputDataSource() (*RawReferenceInputDataSource, bool) { + return &rrids, true +} + +// AsAzureSQLReferenceInputDataSource is the BasicReferenceInputDataSource implementation for RawReferenceInputDataSource. +func (rrids RawReferenceInputDataSource) AsAzureSQLReferenceInputDataSource() (*AzureSQLReferenceInputDataSource, bool) { + return nil, false +} + +// AsReferenceInputDataSource is the BasicReferenceInputDataSource implementation for RawReferenceInputDataSource. +func (rrids RawReferenceInputDataSource) AsReferenceInputDataSource() (*ReferenceInputDataSource, bool) { + return nil, false +} + +// AsBasicReferenceInputDataSource is the BasicReferenceInputDataSource implementation for RawReferenceInputDataSource. +func (rrids RawReferenceInputDataSource) AsBasicReferenceInputDataSource() (BasicReferenceInputDataSource, bool) { + return &rrids, true +} + +// UnmarshalJSON is the custom unmarshaler for RawReferenceInputDataSource struct. +func (rrids *RawReferenceInputDataSource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var rawInputDatasourceProperties RawInputDatasourceProperties + err = json.Unmarshal(*v, &rawInputDatasourceProperties) + if err != nil { + return err + } + rrids.RawInputDatasourceProperties = &rawInputDatasourceProperties + } + case "type": + if v != nil { + var typeVar TypeBasicReferenceInputDataSource + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rrids.Type = typeVar + } + } + } + + return nil +} + +// RawStreamInputDataSource 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. +type RawStreamInputDataSource struct { + // RawInputDatasourceProperties - The properties that are associated with a raw input. Required on PUT (CreateOrReplace) requests. + *RawInputDatasourceProperties `json:"properties,omitempty"` + // Type - Possible values include: 'TypeBasicStreamInputDataSourceTypeStreamInputDataSource', 'TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob', 'TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftEventHubEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftDevicesIotHubs', 'TypeBasicStreamInputDataSourceTypeRaw' + Type TypeBasicStreamInputDataSource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RawStreamInputDataSource. +func (rsids RawStreamInputDataSource) MarshalJSON() ([]byte, error) { + rsids.Type = TypeBasicStreamInputDataSourceTypeRaw + objectMap := make(map[string]interface{}) + if rsids.RawInputDatasourceProperties != nil { + objectMap["properties"] = rsids.RawInputDatasourceProperties + } + if rsids.Type != "" { + objectMap["type"] = rsids.Type + } + return json.Marshal(objectMap) +} + +// AsBlobStreamInputDataSource is the BasicStreamInputDataSource implementation for RawStreamInputDataSource. +func (rsids RawStreamInputDataSource) AsBlobStreamInputDataSource() (*BlobStreamInputDataSource, bool) { + return nil, false +} + +// AsEventHubStreamInputDataSource is the BasicStreamInputDataSource implementation for RawStreamInputDataSource. +func (rsids RawStreamInputDataSource) AsEventHubStreamInputDataSource() (*EventHubStreamInputDataSource, bool) { + return nil, false +} + +// AsEventHubV2StreamInputDataSource is the BasicStreamInputDataSource implementation for RawStreamInputDataSource. +func (rsids RawStreamInputDataSource) AsEventHubV2StreamInputDataSource() (*EventHubV2StreamInputDataSource, bool) { + return nil, false +} + +// AsIoTHubStreamInputDataSource is the BasicStreamInputDataSource implementation for RawStreamInputDataSource. +func (rsids RawStreamInputDataSource) AsIoTHubStreamInputDataSource() (*IoTHubStreamInputDataSource, bool) { + return nil, false +} + +// AsRawStreamInputDataSource is the BasicStreamInputDataSource implementation for RawStreamInputDataSource. +func (rsids RawStreamInputDataSource) AsRawStreamInputDataSource() (*RawStreamInputDataSource, bool) { + return &rsids, true +} + +// AsStreamInputDataSource is the BasicStreamInputDataSource implementation for RawStreamInputDataSource. +func (rsids RawStreamInputDataSource) AsStreamInputDataSource() (*StreamInputDataSource, bool) { + return nil, false +} + +// AsBasicStreamInputDataSource is the BasicStreamInputDataSource implementation for RawStreamInputDataSource. +func (rsids RawStreamInputDataSource) AsBasicStreamInputDataSource() (BasicStreamInputDataSource, bool) { + return &rsids, true +} + +// UnmarshalJSON is the custom unmarshaler for RawStreamInputDataSource struct. +func (rsids *RawStreamInputDataSource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var rawInputDatasourceProperties RawInputDatasourceProperties + err = json.Unmarshal(*v, &rawInputDatasourceProperties) + if err != nil { + return err + } + rsids.RawInputDatasourceProperties = &rawInputDatasourceProperties + } + case "type": + if v != nil { + var typeVar TypeBasicStreamInputDataSource + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rsids.Type = typeVar + } + } + } + + return nil +} + // BasicReferenceInputDataSource describes an input data source that contains reference data. type BasicReferenceInputDataSource interface { AsBlobReferenceInputDataSource() (*BlobReferenceInputDataSource, bool) + AsRawReferenceInputDataSource() (*RawReferenceInputDataSource, bool) AsAzureSQLReferenceInputDataSource() (*AzureSQLReferenceInputDataSource, bool) AsReferenceInputDataSource() (*ReferenceInputDataSource, bool) } // ReferenceInputDataSource describes an input data source that contains reference data. type ReferenceInputDataSource struct { - // Type - Possible values include: 'TypeBasicReferenceInputDataSourceTypeReferenceInputDataSource', 'TypeBasicReferenceInputDataSourceTypeMicrosoftStorageBlob', 'TypeBasicReferenceInputDataSourceTypeMicrosoftSQLServerDatabase' + // Type - Possible values include: 'TypeBasicReferenceInputDataSourceTypeReferenceInputDataSource', 'TypeBasicReferenceInputDataSourceTypeMicrosoftStorageBlob', 'TypeBasicReferenceInputDataSourceTypeRaw', 'TypeBasicReferenceInputDataSourceTypeMicrosoftSQLServerDatabase' Type TypeBasicReferenceInputDataSource `json:"type,omitempty"` } @@ -6243,6 +6755,10 @@ func unmarshalBasicReferenceInputDataSource(body []byte) (BasicReferenceInputDat var brids BlobReferenceInputDataSource err := json.Unmarshal(body, &brids) return brids, err + case string(TypeBasicReferenceInputDataSourceTypeRaw): + var rrids RawReferenceInputDataSource + err := json.Unmarshal(body, &rrids) + return rrids, err case string(TypeBasicReferenceInputDataSourceTypeMicrosoftSQLServerDatabase): var asrids AzureSQLReferenceInputDataSource err := json.Unmarshal(body, &asrids) @@ -6287,6 +6803,11 @@ func (rids ReferenceInputDataSource) AsBlobReferenceInputDataSource() (*BlobRefe return nil, false } +// AsRawReferenceInputDataSource is the BasicReferenceInputDataSource implementation for ReferenceInputDataSource. +func (rids ReferenceInputDataSource) AsRawReferenceInputDataSource() (*RawReferenceInputDataSource, bool) { + return nil, false +} + // AsAzureSQLReferenceInputDataSource is the BasicReferenceInputDataSource implementation for ReferenceInputDataSource. func (rids ReferenceInputDataSource) AsAzureSQLReferenceInputDataSource() (*AzureSQLReferenceInputDataSource, bool) { return nil, false @@ -6433,7 +6954,7 @@ func (rip *ReferenceInputProperties) UnmarshalJSON(body []byte) error { return nil } -// Resource ... +// Resource the base resource definition type Resource struct { // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` @@ -6465,6 +6986,45 @@ func (rts ResourceTestStatus) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// SampleInput the stream analytics input to sample. +type SampleInput struct { + // Input - The stream analytics input to sample. + Input *Input `json:"input,omitempty"` + // CompatibilityLevel - Defaults to the default ASA job compatibility level. Today it is 1.2 + CompatibilityLevel *string `json:"compatibilityLevel,omitempty"` + // EventsURI - 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 `json:"eventsUri,omitempty"` + // DataLocale - Defaults to en-US. + DataLocale *string `json:"dataLocale,omitempty"` +} + +// SampleInputResult the result of the sample input request. +type SampleInputResult struct { + autorest.Response `json:"-"` + // Status - The status of the sample input request. Possible values include: 'ReadAllEventsInRange', 'NoEventsFoundInRange', 'ErrorConnectingToInput' + Status SampleInputResultStatus `json:"status,omitempty"` + // Diagnostics - READ-ONLY; Diagnostics messages. E.g. message indicating some partitions from the input have no data. + Diagnostics *[]string `json:"diagnostics,omitempty"` + // EventsDownloadURL - READ-ONLY; A SAS URL to download the sampled input data. + EventsDownloadURL *string `json:"eventsDownloadUrl,omitempty"` + // LastArrivalTime - READ-ONLY; The timestamp for the last event in the data. It is in DateTime format. + LastArrivalTime *string `json:"lastArrivalTime,omitempty"` + // Error - Error definition properties. + Error *ErrorError `json:"error,omitempty"` +} + +// MarshalJSON is the custom marshaler for SampleInputResult. +func (sir SampleInputResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sir.Status != "" { + objectMap["status"] = sir.Status + } + if sir.Error != nil { + objectMap["error"] = sir.Error + } + return json.Marshal(objectMap) +} + // ScalarFunctionProperties the properties that are associated with a scalar function. type ScalarFunctionProperties struct { // Etag - READ-ONLY; 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. @@ -6682,7 +7242,7 @@ type ServiceBusDataSourceProperties struct { type ServiceBusQueueOutputDataSource struct { // ServiceBusQueueOutputDataSourceProperties - The properties that are associated with a Service Bus Queue output. Required on PUT (CreateOrReplace) requests. *ServiceBusQueueOutputDataSourceProperties `json:"properties,omitempty"` - // Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' + // Type - Possible values include: 'TypeOutputDataSource', 'TypeRaw', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' Type TypeBasicOutputDataSource `json:"type,omitempty"` } @@ -6699,6 +7259,11 @@ func (sbqods ServiceBusQueueOutputDataSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsRawOutputDatasource is the BasicOutputDataSource implementation for ServiceBusQueueOutputDataSource. +func (sbqods ServiceBusQueueOutputDataSource) AsRawOutputDatasource() (*RawOutputDatasource, bool) { + return nil, false +} + // AsBlobOutputDataSource is the BasicOutputDataSource implementation for ServiceBusQueueOutputDataSource. func (sbqods ServiceBusQueueOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) { return nil, false @@ -6851,7 +7416,7 @@ func (sbqodsp ServiceBusQueueOutputDataSourceProperties) MarshalJSON() ([]byte, type ServiceBusTopicOutputDataSource struct { // ServiceBusTopicOutputDataSourceProperties - The properties that are associated with a Service Bus Topic output. Required on PUT (CreateOrReplace) requests. *ServiceBusTopicOutputDataSourceProperties `json:"properties,omitempty"` - // Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' + // Type - Possible values include: 'TypeOutputDataSource', 'TypeRaw', 'TypeMicrosoftStorageBlob', 'TypeMicrosoftStorageTable', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftEventHubEventHub', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftSQLServerDataWarehouse', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftAzureFunction', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftServiceBusTopic', 'TypePowerBI', 'TypeMicrosoftDataLakeAccounts' Type TypeBasicOutputDataSource `json:"type,omitempty"` } @@ -6868,6 +7433,11 @@ func (sbtods ServiceBusTopicOutputDataSource) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsRawOutputDatasource is the BasicOutputDataSource implementation for ServiceBusTopicOutputDataSource. +func (sbtods ServiceBusTopicOutputDataSource) AsRawOutputDatasource() (*RawOutputDatasource, bool) { + return nil, false +} + // AsBlobOutputDataSource is the BasicOutputDataSource implementation for ServiceBusTopicOutputDataSource. func (sbtods ServiceBusTopicOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) { return nil, false @@ -7589,12 +8159,13 @@ type BasicStreamInputDataSource interface { AsEventHubStreamInputDataSource() (*EventHubStreamInputDataSource, bool) AsEventHubV2StreamInputDataSource() (*EventHubV2StreamInputDataSource, bool) AsIoTHubStreamInputDataSource() (*IoTHubStreamInputDataSource, bool) + AsRawStreamInputDataSource() (*RawStreamInputDataSource, bool) AsStreamInputDataSource() (*StreamInputDataSource, bool) } // StreamInputDataSource describes an input data source that contains stream data. type StreamInputDataSource struct { - // Type - Possible values include: 'TypeBasicStreamInputDataSourceTypeStreamInputDataSource', 'TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob', 'TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftEventHubEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftDevicesIotHubs' + // Type - Possible values include: 'TypeBasicStreamInputDataSourceTypeStreamInputDataSource', 'TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob', 'TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftEventHubEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftDevicesIotHubs', 'TypeBasicStreamInputDataSourceTypeRaw' Type TypeBasicStreamInputDataSource `json:"type,omitempty"` } @@ -7622,6 +8193,10 @@ func unmarshalBasicStreamInputDataSource(body []byte) (BasicStreamInputDataSourc var ithsids IoTHubStreamInputDataSource err := json.Unmarshal(body, &ithsids) return ithsids, err + case string(TypeBasicStreamInputDataSourceTypeRaw): + var rsids RawStreamInputDataSource + err := json.Unmarshal(body, &rsids) + return rsids, err default: var sids StreamInputDataSource err := json.Unmarshal(body, &sids) @@ -7677,6 +8252,11 @@ func (sids StreamInputDataSource) AsIoTHubStreamInputDataSource() (*IoTHubStream return nil, false } +// AsRawStreamInputDataSource is the BasicStreamInputDataSource implementation for StreamInputDataSource. +func (sids StreamInputDataSource) AsRawStreamInputDataSource() (*RawStreamInputDataSource, bool) { + return nil, false +} + // AsStreamInputDataSource is the BasicStreamInputDataSource implementation for StreamInputDataSource. func (sids StreamInputDataSource) AsStreamInputDataSource() (*StreamInputDataSource, bool) { return &sids, true @@ -7937,6 +8517,215 @@ func (sqlr SubscriptionQuotasListResult) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// SubscriptionsSampleInputMethodFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SubscriptionsSampleInputMethodFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SubscriptionsClient) (SampleInputResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SubscriptionsSampleInputMethodFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SubscriptionsSampleInputMethodFuture.Result. +func (future *SubscriptionsSampleInputMethodFuture) result(client SubscriptionsClient) (sir SampleInputResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "streamanalytics.SubscriptionsSampleInputMethodFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + sir.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("streamanalytics.SubscriptionsSampleInputMethodFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sir.Response.Response, err = future.GetResult(sender); err == nil && sir.Response.Response.StatusCode != http.StatusNoContent { + sir, err = client.SampleInputMethodResponder(sir.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "streamanalytics.SubscriptionsSampleInputMethodFuture", "Result", sir.Response.Response, "Failure responding to request") + } + } + return +} + +// SubscriptionsTestInputMethodFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SubscriptionsTestInputMethodFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SubscriptionsClient) (TestDatasourceResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SubscriptionsTestInputMethodFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SubscriptionsTestInputMethodFuture.Result. +func (future *SubscriptionsTestInputMethodFuture) result(client SubscriptionsClient) (tdr TestDatasourceResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "streamanalytics.SubscriptionsTestInputMethodFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tdr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("streamanalytics.SubscriptionsTestInputMethodFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tdr.Response.Response, err = future.GetResult(sender); err == nil && tdr.Response.Response.StatusCode != http.StatusNoContent { + tdr, err = client.TestInputMethodResponder(tdr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "streamanalytics.SubscriptionsTestInputMethodFuture", "Result", tdr.Response.Response, "Failure responding to request") + } + } + return +} + +// SubscriptionsTestOutputMethodFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SubscriptionsTestOutputMethodFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SubscriptionsClient) (TestDatasourceResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SubscriptionsTestOutputMethodFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SubscriptionsTestOutputMethodFuture.Result. +func (future *SubscriptionsTestOutputMethodFuture) result(client SubscriptionsClient) (tdr TestDatasourceResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "streamanalytics.SubscriptionsTestOutputMethodFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tdr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("streamanalytics.SubscriptionsTestOutputMethodFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tdr.Response.Response, err = future.GetResult(sender); err == nil && tdr.Response.Response.StatusCode != http.StatusNoContent { + tdr, err = client.TestOutputMethodResponder(tdr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "streamanalytics.SubscriptionsTestOutputMethodFuture", "Result", tdr.Response.Response, "Failure responding to request") + } + } + return +} + +// SubscriptionsTestQueryMethodFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type SubscriptionsTestQueryMethodFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SubscriptionsClient) (QueryTestingResult, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SubscriptionsTestQueryMethodFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SubscriptionsTestQueryMethodFuture.Result. +func (future *SubscriptionsTestQueryMethodFuture) result(client SubscriptionsClient) (qtr QueryTestingResult, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "streamanalytics.SubscriptionsTestQueryMethodFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + qtr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("streamanalytics.SubscriptionsTestQueryMethodFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if qtr.Response.Response, err = future.GetResult(sender); err == nil && qtr.Response.Response.StatusCode != http.StatusNoContent { + qtr, err = client.TestQueryMethodResponder(qtr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "streamanalytics.SubscriptionsTestQueryMethodFuture", "Result", qtr.Response.Response, "Failure responding to request") + } + } + return +} + +// TestDatasourceResult the result of the test input or output request. +type TestDatasourceResult struct { + autorest.Response `json:"-"` + // Status - The status of the sample output request. Possible values include: 'TestSucceeded', 'TestFailed' + Status TestDatasourceResultStatus `json:"status,omitempty"` + // Error - Error definition properties. + Error *ErrorError `json:"error,omitempty"` +} + +// TestInput a stream analytics input. +type TestInput struct { + // Input - The stream analytics input to test. + Input *Input `json:"input,omitempty"` +} + +// TestOutput a stream analytics output. +type TestOutput struct { + // Output - The stream analytics output to test. + Output *Output `json:"output,omitempty"` +} + +// TestQuery the request object for query testing. +type TestQuery struct { + // Diagnostics - Diagnostics information related to query testing. + Diagnostics *TestQueryDiagnostics `json:"diagnostics,omitempty"` + // StreamingJob - Stream analytics job object which defines the input, output, and transformation for the query testing. + StreamingJob *StreamingJob `json:"streamingJob,omitempty"` +} + +// TestQueryDiagnostics diagnostics information related to query testing. +type TestQueryDiagnostics struct { + // WriteURI - The SAS URI to the container or directory. + WriteURI *string `json:"writeUri,omitempty"` + // Path - The path to the subdirectory. + Path *string `json:"path,omitempty"` +} + // TrackedResource the resource model definition for a ARM tracked top level resource type TrackedResource struct { // Tags - Resource tags. diff --git a/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/streamanalyticsapi/interfaces.go b/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/streamanalyticsapi/interfaces.go index eb68889867d1..733778f1e3a7 100644 --- a/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/streamanalyticsapi/interfaces.go +++ b/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/streamanalyticsapi/interfaces.go @@ -70,7 +70,12 @@ var _ StreamingJobsClientAPI = (*streamanalytics.StreamingJobsClient)(nil) // SubscriptionsClientAPI contains the set of methods on the SubscriptionsClient type. type SubscriptionsClientAPI interface { + CompileQueryMethod(ctx context.Context, compileQuery streamanalytics.CompileQuery, location string) (result streamanalytics.QueryCompilationResult, err error) ListQuotas(ctx context.Context, location string) (result streamanalytics.SubscriptionQuotasListResult, err error) + SampleInputMethod(ctx context.Context, sampleInput streamanalytics.SampleInput, location string) (result streamanalytics.SubscriptionsSampleInputMethodFuture, err error) + TestInputMethod(ctx context.Context, testInput streamanalytics.TestInput, location string) (result streamanalytics.SubscriptionsTestInputMethodFuture, err error) + TestOutputMethod(ctx context.Context, testOutput streamanalytics.TestOutput, location string) (result streamanalytics.SubscriptionsTestOutputMethodFuture, err error) + TestQueryMethod(ctx context.Context, testQuery streamanalytics.TestQuery, location string) (result streamanalytics.SubscriptionsTestQueryMethodFuture, err error) } var _ SubscriptionsClientAPI = (*streamanalytics.SubscriptionsClient)(nil) diff --git a/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/subscriptions.go b/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/subscriptions.go index cf0b9b4d09ac..20c438ed8e87 100644 --- a/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/subscriptions.go +++ b/services/preview/streamanalytics/mgmt/2020-03-01-preview/streamanalytics/subscriptions.go @@ -31,10 +31,97 @@ func NewSubscriptionsClientWithBaseURI(baseURI string, subscriptionID string) Su return SubscriptionsClient{NewWithBaseURI(baseURI, subscriptionID)} } +// CompileQueryMethod compile the Stream Analytics query. +// Parameters: +// compileQuery - the query compilation object which defines the input, output, and transformation for the +// query compilation. +// 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/ +func (client SubscriptionsClient) CompileQueryMethod(ctx context.Context, compileQuery CompileQuery, location string) (result QueryCompilationResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.CompileQueryMethod") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: compileQuery, + Constraints: []validation.Constraint{{Target: "compileQuery.Query", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("streamanalytics.SubscriptionsClient", "CompileQueryMethod", err.Error()) + } + + req, err := client.CompileQueryMethodPreparer(ctx, compileQuery, location) + if err != nil { + err = autorest.NewErrorWithError(err, "streamanalytics.SubscriptionsClient", "CompileQueryMethod", nil, "Failure preparing request") + return + } + + resp, err := client.CompileQueryMethodSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "streamanalytics.SubscriptionsClient", "CompileQueryMethod", resp, "Failure sending request") + return + } + + result, err = client.CompileQueryMethodResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "streamanalytics.SubscriptionsClient", "CompileQueryMethod", resp, "Failure responding to request") + return + } + + return +} + +// CompileQueryMethodPreparer prepares the CompileQueryMethod request. +func (client SubscriptionsClient) CompileQueryMethodPreparer(ctx context.Context, compileQuery CompileQuery, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-04-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/compileQuery", pathParameters), + autorest.WithJSON(compileQuery), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CompileQueryMethodSender sends the CompileQueryMethod request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionsClient) CompileQueryMethodSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CompileQueryMethodResponder handles the response to the CompileQueryMethod request. The method always +// closes the http.Response Body. +func (client SubscriptionsClient) CompileQueryMethodResponder(resp *http.Response) (result QueryCompilationResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // ListQuotas retrieves the subscription's current quota information in a particular region. // Parameters: -// 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/ +// 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/ func (client SubscriptionsClient) ListQuotas(ctx context.Context, location string) (result SubscriptionQuotasListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.ListQuotas") @@ -111,3 +198,356 @@ func (client SubscriptionsClient) ListQuotasResponder(resp *http.Response) (resu result.Response = autorest.Response{Response: resp} return } + +// SampleInputMethod sample the Stream Analytics input data. +// Parameters: +// sampleInput - defines the necessary parameters for sampling the Stream Analytics input data. +// 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/ +func (client SubscriptionsClient) SampleInputMethod(ctx context.Context, sampleInput SampleInput, location string) (result SubscriptionsSampleInputMethodFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.SampleInputMethod") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("streamanalytics.SubscriptionsClient", "SampleInputMethod", err.Error()) + } + + req, err := client.SampleInputMethodPreparer(ctx, sampleInput, location) + if err != nil { + err = autorest.NewErrorWithError(err, "streamanalytics.SubscriptionsClient", "SampleInputMethod", nil, "Failure preparing request") + return + } + + result, err = client.SampleInputMethodSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "streamanalytics.SubscriptionsClient", "SampleInputMethod", nil, "Failure sending request") + return + } + + return +} + +// SampleInputMethodPreparer prepares the SampleInputMethod request. +func (client SubscriptionsClient) SampleInputMethodPreparer(ctx context.Context, sampleInput SampleInput, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-04-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/sampleInput", pathParameters), + autorest.WithJSON(sampleInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SampleInputMethodSender sends the SampleInputMethod request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionsClient) SampleInputMethodSender(req *http.Request) (future SubscriptionsSampleInputMethodFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SampleInputMethodResponder handles the response to the SampleInputMethod request. The method always +// closes the http.Response Body. +func (client SubscriptionsClient) SampleInputMethodResponder(resp *http.Response) (result SampleInputResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestInputMethod test the Stream Analytics input. +// Parameters: +// testInput - defines the necessary parameters for testing the Stream Analytics input. +// 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/ +func (client SubscriptionsClient) TestInputMethod(ctx context.Context, testInput TestInput, location string) (result SubscriptionsTestInputMethodFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.TestInputMethod") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testInput, + Constraints: []validation.Constraint{{Target: "testInput.Input", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("streamanalytics.SubscriptionsClient", "TestInputMethod", err.Error()) + } + + req, err := client.TestInputMethodPreparer(ctx, testInput, location) + if err != nil { + err = autorest.NewErrorWithError(err, "streamanalytics.SubscriptionsClient", "TestInputMethod", nil, "Failure preparing request") + return + } + + result, err = client.TestInputMethodSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "streamanalytics.SubscriptionsClient", "TestInputMethod", nil, "Failure sending request") + return + } + + return +} + +// TestInputMethodPreparer prepares the TestInputMethod request. +func (client SubscriptionsClient) TestInputMethodPreparer(ctx context.Context, testInput TestInput, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-04-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/testInput", pathParameters), + autorest.WithJSON(testInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestInputMethodSender sends the TestInputMethod request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionsClient) TestInputMethodSender(req *http.Request) (future SubscriptionsTestInputMethodFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestInputMethodResponder handles the response to the TestInputMethod request. The method always +// closes the http.Response Body. +func (client SubscriptionsClient) TestInputMethodResponder(resp *http.Response) (result TestDatasourceResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestOutputMethod test the Stream Analytics output. +// Parameters: +// testOutput - defines the necessary parameters for testing the Stream Analytics output. +// 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/ +func (client SubscriptionsClient) TestOutputMethod(ctx context.Context, testOutput TestOutput, location string) (result SubscriptionsTestOutputMethodFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.TestOutputMethod") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testOutput, + Constraints: []validation.Constraint{{Target: "testOutput.Output", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("streamanalytics.SubscriptionsClient", "TestOutputMethod", err.Error()) + } + + req, err := client.TestOutputMethodPreparer(ctx, testOutput, location) + if err != nil { + err = autorest.NewErrorWithError(err, "streamanalytics.SubscriptionsClient", "TestOutputMethod", nil, "Failure preparing request") + return + } + + result, err = client.TestOutputMethodSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "streamanalytics.SubscriptionsClient", "TestOutputMethod", nil, "Failure sending request") + return + } + + return +} + +// TestOutputMethodPreparer prepares the TestOutputMethod request. +func (client SubscriptionsClient) TestOutputMethodPreparer(ctx context.Context, testOutput TestOutput, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-04-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/testOutput", pathParameters), + autorest.WithJSON(testOutput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestOutputMethodSender sends the TestOutputMethod request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionsClient) TestOutputMethodSender(req *http.Request) (future SubscriptionsTestOutputMethodFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestOutputMethodResponder handles the response to the TestOutputMethod request. The method always +// closes the http.Response Body. +func (client SubscriptionsClient) TestOutputMethodResponder(resp *http.Response) (result TestDatasourceResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestQueryMethod test the Stream Analytics query on a sample input. +// Parameters: +// testQuery - the query testing object that defines the input, output, and transformation for the query +// testing. +// 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/ +func (client SubscriptionsClient) TestQueryMethod(ctx context.Context, testQuery TestQuery, location string) (result SubscriptionsTestQueryMethodFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.TestQueryMethod") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: testQuery, + Constraints: []validation.Constraint{{Target: "testQuery.Diagnostics", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "testQuery.Diagnostics.WriteURI", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "testQuery.StreamingJob", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("streamanalytics.SubscriptionsClient", "TestQueryMethod", err.Error()) + } + + req, err := client.TestQueryMethodPreparer(ctx, testQuery, location) + if err != nil { + err = autorest.NewErrorWithError(err, "streamanalytics.SubscriptionsClient", "TestQueryMethod", nil, "Failure preparing request") + return + } + + result, err = client.TestQueryMethodSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "streamanalytics.SubscriptionsClient", "TestQueryMethod", nil, "Failure sending request") + return + } + + return +} + +// TestQueryMethodPreparer prepares the TestQueryMethod request. +func (client SubscriptionsClient) TestQueryMethodPreparer(ctx context.Context, testQuery TestQuery, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-04-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.StreamAnalytics/locations/{location}/testQuery", pathParameters), + autorest.WithJSON(testQuery), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestQueryMethodSender sends the TestQueryMethod request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionsClient) TestQueryMethodSender(req *http.Request) (future SubscriptionsTestQueryMethodFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// TestQueryMethodResponder handles the response to the TestQueryMethod request. The method always +// closes the http.Response Body. +func (client SubscriptionsClient) TestQueryMethodResponder(resp *http.Response) (result QueryTestingResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/streamanalytics/mgmt/2016-03-01/streamanalytics/CHANGELOG.md b/services/streamanalytics/mgmt/2016-03-01/streamanalytics/CHANGELOG.md index 78283cafb67d..78844d099fe8 100644 --- a/services/streamanalytics/mgmt/2016-03-01/streamanalytics/CHANGELOG.md +++ b/services/streamanalytics/mgmt/2016-03-01/streamanalytics/CHANGELOG.md @@ -1,19 +1,34 @@ -# Change History +# Unreleased + +## Breaking Changes + +### Struct Changes + +#### Removed Struct Fields + +1. Resource.Location +1. Resource.Tags ## Additive Changes +### New Constants + +1. EventSerializationType.Avro +1. EventSerializationType.Csv +1. EventSerializationType.JSON + ### New Funcs -1. DiagnosticCondition.MarshalJSON() ([]byte, error) -1. Diagnostics.MarshalJSON() ([]byte, error) -1. ErrorResponse.MarshalJSON() ([]byte, error) -1. FunctionListResult.MarshalJSON() ([]byte, error) -1. InputListResult.MarshalJSON() ([]byte, error) -1. Operation.MarshalJSON() ([]byte, error) -1. OperationDisplay.MarshalJSON() ([]byte, error) -1. OperationListResult.MarshalJSON() ([]byte, error) -1. OutputListResult.MarshalJSON() ([]byte, error) -1. ResourceTestStatus.MarshalJSON() ([]byte, error) -1. StreamingJobListResult.MarshalJSON() ([]byte, error) -1. SubscriptionQuotaProperties.MarshalJSON() ([]byte, error) -1. SubscriptionQuotasListResult.MarshalJSON() ([]byte, error) +1. PossibleEventSerializationTypeValues() []EventSerializationType +1. ProxyResource.MarshalJSON() ([]byte, error) +1. TrackedResource.MarshalJSON() ([]byte, error) + +### Struct Changes + +#### New Structs + +1. Error +1. ErrorDetails +1. ErrorError +1. ProxyResource +1. TrackedResource diff --git a/services/streamanalytics/mgmt/2016-03-01/streamanalytics/_meta.json b/services/streamanalytics/mgmt/2016-03-01/streamanalytics/_meta.json index 29d2c7578c6d..8c48a98e187c 100644 --- a/services/streamanalytics/mgmt/2016-03-01/streamanalytics/_meta.json +++ b/services/streamanalytics/mgmt/2016-03-01/streamanalytics/_meta.json @@ -1,5 +1,5 @@ { - "commit": "3c764635e7d442b3e74caf593029fcd440b3ef82", + "commit": "b5a24940312f09a613f422f71ab6dc404546260e", "readme": "/_/azure-rest-api-specs/specification/streamanalytics/resource-manager/readme.md", "tag": "package-pure-2016-03", "use": "@microsoft.azure/autorest.go@2.1.183", diff --git a/services/streamanalytics/mgmt/2016-03-01/streamanalytics/enums.go b/services/streamanalytics/mgmt/2016-03-01/streamanalytics/enums.go index 73e856e7ec33..f9365161c097 100644 --- a/services/streamanalytics/mgmt/2016-03-01/streamanalytics/enums.go +++ b/services/streamanalytics/mgmt/2016-03-01/streamanalytics/enums.go @@ -49,6 +49,23 @@ func PossibleEncodingValues() []Encoding { return []Encoding{UTF8} } +// EventSerializationType enumerates the values for event serialization type. +type EventSerializationType string + +const ( + // Avro ... + Avro EventSerializationType = "Avro" + // Csv ... + Csv EventSerializationType = "Csv" + // JSON ... + JSON EventSerializationType = "Json" +) + +// PossibleEventSerializationTypeValues returns an array of possible values for the EventSerializationType const type. +func PossibleEventSerializationTypeValues() []EventSerializationType { + return []EventSerializationType{Avro, Csv, JSON} +} + // EventsOutOfOrderPolicy enumerates the values for events out of order policy. type EventsOutOfOrderPolicy string diff --git a/services/streamanalytics/mgmt/2016-03-01/streamanalytics/functions.go b/services/streamanalytics/mgmt/2016-03-01/streamanalytics/functions.go index 997ad9b8ab9e..3cd1898d3b48 100644 --- a/services/streamanalytics/mgmt/2016-03-01/streamanalytics/functions.go +++ b/services/streamanalytics/mgmt/2016-03-01/streamanalytics/functions.go @@ -466,7 +466,7 @@ func (client FunctionsClient) RetrieveDefaultDefinitionPreparer(ctx context.Cont autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/functions/{functionName}/RetrieveDefaultDefinition", pathParameters), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.StreamAnalytics/streamingjobs/{jobName}/functions/{functionName}/retrieveDefaultDefinition", pathParameters), autorest.WithQueryParameters(queryParameters)) if functionRetrieveDefaultDefinitionParameters != nil { preparer = autorest.DecoratePreparer(preparer, diff --git a/services/streamanalytics/mgmt/2016-03-01/streamanalytics/models.go b/services/streamanalytics/mgmt/2016-03-01/streamanalytics/models.go index fc385424a951..bdcdaa2fa6af 100644 --- a/services/streamanalytics/mgmt/2016-03-01/streamanalytics/models.go +++ b/services/streamanalytics/mgmt/2016-03-01/streamanalytics/models.go @@ -1224,6 +1224,34 @@ type DocumentDbOutputDataSourceProperties struct { DocumentID *string `json:"documentId,omitempty"` } +// Error common error representation. +type Error struct { + // Error - Error definition properties. + Error *ErrorError `json:"error,omitempty"` +} + +// ErrorDetails common error details representation. +type ErrorDetails struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Target - Error target. + Target *string `json:"target,omitempty"` + // Message - Error message. + Message *string `json:"message,omitempty"` +} + +// ErrorError error definition properties. +type ErrorError struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Message - Error message. + Message *string `json:"message,omitempty"` + // Target - Error target. + Target *string `json:"target,omitempty"` + // Details - Error details. + Details *[]ErrorDetails `json:"details,omitempty"` +} + // ErrorResponse describes the error that occurred. type ErrorResponse struct { // Code - READ-ONLY; Error code associated with the error that occurred. @@ -3622,6 +3650,23 @@ type PowerBIOutputDataSourceProperties struct { TokenUserDisplayName *string `json:"tokenUserDisplayName,omitempty"` } +// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than +// required location and tags +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + // BasicReferenceInputDataSource describes an input data source that contains reference data. type BasicReferenceInputDataSource interface { AsBlobReferenceInputDataSource() (*BlobReferenceInputDataSource, bool) @@ -3800,29 +3845,19 @@ func (rip *ReferenceInputProperties) UnmarshalJSON(body []byte) error { return nil } -// Resource the base resource model definition. +// Resource the base resource definition type Resource struct { - // ID - READ-ONLY; Resource Id + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` - // Location - Resource location. Required on PUT (CreateOrReplace) requests. - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` } // MarshalJSON is the custom marshaler for Resource. func (r Resource) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if r.Location != nil { - objectMap["location"] = r.Location - } - if r.Tags != nil { - objectMap["tags"] = r.Tags - } return json.Marshal(objectMap) } @@ -4355,16 +4390,16 @@ type StreamingJob struct { autorest.Response `json:"-"` // StreamingJobProperties - The properties that are associated with a streaming job. Required on PUT (CreateOrReplace) requests. *StreamingJobProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` - // Location - Resource location. Required on PUT (CreateOrReplace) requests. - Location *string `json:"location,omitempty"` - // Tags - Resource tags - Tags map[string]*string `json:"tags"` } // MarshalJSON is the custom marshaler for StreamingJob. @@ -4373,12 +4408,12 @@ func (sj StreamingJob) MarshalJSON() ([]byte, error) { if sj.StreamingJobProperties != nil { objectMap["properties"] = sj.StreamingJobProperties } - if sj.Location != nil { - objectMap["location"] = sj.Location - } if sj.Tags != nil { objectMap["tags"] = sj.Tags } + if sj.Location != nil { + objectMap["location"] = sj.Location + } return json.Marshal(objectMap) } @@ -4400,6 +4435,24 @@ func (sj *StreamingJob) UnmarshalJSON(body []byte) error { } sj.StreamingJobProperties = &streamingJobProperties } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + sj.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + sj.Location = &location + } case "id": if v != nil { var ID string @@ -4427,24 +4480,6 @@ func (sj *StreamingJob) UnmarshalJSON(body []byte) error { } sj.Type = &typeVar } - case "location": - if v != nil { - var location string - err = json.Unmarshal(*v, &location) - if err != nil { - return err - } - sj.Location = &location - } - case "tags": - if v != nil { - var tags map[string]*string - err = json.Unmarshal(*v, &tags) - if err != nil { - return err - } - sj.Tags = tags - } } } @@ -5174,6 +5209,32 @@ func (sqlr SubscriptionQuotasListResult) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// TrackedResource the resource model definition for a ARM tracked top level resource +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} + // Transformation a transformation object, containing all information associated with the named // transformation. All transformations are contained under a streaming job. type Transformation struct {