1package streamanalytics
2
3// Copyright (c) Microsoft Corporation. All rights reserved.
4// Licensed under the MIT License. See License.txt in the project root for license information.
5//
6// Code generated by Microsoft (R) AutoRest Code Generator.
7// Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
9import (
10	"context"
11	"encoding/json"
12	"github.com/Azure/go-autorest/autorest"
13	"github.com/Azure/go-autorest/autorest/azure"
14	"github.com/Azure/go-autorest/autorest/date"
15	"github.com/Azure/go-autorest/autorest/to"
16	"github.com/Azure/go-autorest/tracing"
17	"net/http"
18)
19
20// The package's fully qualified name.
21const fqdn = "github.com/Azure/azure-sdk-for-go/services/streamanalytics/mgmt/2016-03-01/streamanalytics"
22
23// AvroSerialization describes how data from an input is serialized or how data is serialized when written
24// to an output in Avro format.
25type AvroSerialization struct {
26	// Properties - The properties that are associated with the Avro serialization type. Required on PUT (CreateOrReplace) requests.
27	Properties interface{} `json:"properties,omitempty"`
28	// Type - Possible values include: 'TypeSerialization', 'TypeAvro', 'TypeJSON', 'TypeCsv'
29	Type Type `json:"type,omitempty"`
30}
31
32// MarshalJSON is the custom marshaler for AvroSerialization.
33func (as AvroSerialization) MarshalJSON() ([]byte, error) {
34	as.Type = TypeAvro
35	objectMap := make(map[string]interface{})
36	if as.Properties != nil {
37		objectMap["properties"] = as.Properties
38	}
39	if as.Type != "" {
40		objectMap["type"] = as.Type
41	}
42	return json.Marshal(objectMap)
43}
44
45// AsAvroSerialization is the BasicSerialization implementation for AvroSerialization.
46func (as AvroSerialization) AsAvroSerialization() (*AvroSerialization, bool) {
47	return &as, true
48}
49
50// AsJSONSerialization is the BasicSerialization implementation for AvroSerialization.
51func (as AvroSerialization) AsJSONSerialization() (*JSONSerialization, bool) {
52	return nil, false
53}
54
55// AsCsvSerialization is the BasicSerialization implementation for AvroSerialization.
56func (as AvroSerialization) AsCsvSerialization() (*CsvSerialization, bool) {
57	return nil, false
58}
59
60// AsSerialization is the BasicSerialization implementation for AvroSerialization.
61func (as AvroSerialization) AsSerialization() (*Serialization, bool) {
62	return nil, false
63}
64
65// AsBasicSerialization is the BasicSerialization implementation for AvroSerialization.
66func (as AvroSerialization) AsBasicSerialization() (BasicSerialization, bool) {
67	return &as, true
68}
69
70// AzureDataLakeStoreOutputDataSource describes an Azure Data Lake Store output data source.
71type AzureDataLakeStoreOutputDataSource struct {
72	// AzureDataLakeStoreOutputDataSourceProperties - The properties that are associated with an Azure Data Lake Store output. Required on PUT (CreateOrReplace) requests.
73	*AzureDataLakeStoreOutputDataSourceProperties `json:"properties,omitempty"`
74	// Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftDataLakeAccounts', 'TypePowerBI', 'TypeMicrosoftServiceBusTopic', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftStorageTable', 'TypeMicrosoftStorageBlob'
75	Type TypeBasicOutputDataSource `json:"type,omitempty"`
76}
77
78// MarshalJSON is the custom marshaler for AzureDataLakeStoreOutputDataSource.
79func (adlsods AzureDataLakeStoreOutputDataSource) MarshalJSON() ([]byte, error) {
80	adlsods.Type = TypeMicrosoftDataLakeAccounts
81	objectMap := make(map[string]interface{})
82	if adlsods.AzureDataLakeStoreOutputDataSourceProperties != nil {
83		objectMap["properties"] = adlsods.AzureDataLakeStoreOutputDataSourceProperties
84	}
85	if adlsods.Type != "" {
86		objectMap["type"] = adlsods.Type
87	}
88	return json.Marshal(objectMap)
89}
90
91// AsAzureDataLakeStoreOutputDataSource is the BasicOutputDataSource implementation for AzureDataLakeStoreOutputDataSource.
92func (adlsods AzureDataLakeStoreOutputDataSource) AsAzureDataLakeStoreOutputDataSource() (*AzureDataLakeStoreOutputDataSource, bool) {
93	return &adlsods, true
94}
95
96// AsPowerBIOutputDataSource is the BasicOutputDataSource implementation for AzureDataLakeStoreOutputDataSource.
97func (adlsods AzureDataLakeStoreOutputDataSource) AsPowerBIOutputDataSource() (*PowerBIOutputDataSource, bool) {
98	return nil, false
99}
100
101// AsServiceBusTopicOutputDataSource is the BasicOutputDataSource implementation for AzureDataLakeStoreOutputDataSource.
102func (adlsods AzureDataLakeStoreOutputDataSource) AsServiceBusTopicOutputDataSource() (*ServiceBusTopicOutputDataSource, bool) {
103	return nil, false
104}
105
106// AsServiceBusQueueOutputDataSource is the BasicOutputDataSource implementation for AzureDataLakeStoreOutputDataSource.
107func (adlsods AzureDataLakeStoreOutputDataSource) AsServiceBusQueueOutputDataSource() (*ServiceBusQueueOutputDataSource, bool) {
108	return nil, false
109}
110
111// AsDocumentDbOutputDataSource is the BasicOutputDataSource implementation for AzureDataLakeStoreOutputDataSource.
112func (adlsods AzureDataLakeStoreOutputDataSource) AsDocumentDbOutputDataSource() (*DocumentDbOutputDataSource, bool) {
113	return nil, false
114}
115
116// AsAzureSQLDatabaseOutputDataSource is the BasicOutputDataSource implementation for AzureDataLakeStoreOutputDataSource.
117func (adlsods AzureDataLakeStoreOutputDataSource) AsAzureSQLDatabaseOutputDataSource() (*AzureSQLDatabaseOutputDataSource, bool) {
118	return nil, false
119}
120
121// AsEventHubOutputDataSource is the BasicOutputDataSource implementation for AzureDataLakeStoreOutputDataSource.
122func (adlsods AzureDataLakeStoreOutputDataSource) AsEventHubOutputDataSource() (*EventHubOutputDataSource, bool) {
123	return nil, false
124}
125
126// AsAzureTableOutputDataSource is the BasicOutputDataSource implementation for AzureDataLakeStoreOutputDataSource.
127func (adlsods AzureDataLakeStoreOutputDataSource) AsAzureTableOutputDataSource() (*AzureTableOutputDataSource, bool) {
128	return nil, false
129}
130
131// AsBlobOutputDataSource is the BasicOutputDataSource implementation for AzureDataLakeStoreOutputDataSource.
132func (adlsods AzureDataLakeStoreOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) {
133	return nil, false
134}
135
136// AsOutputDataSource is the BasicOutputDataSource implementation for AzureDataLakeStoreOutputDataSource.
137func (adlsods AzureDataLakeStoreOutputDataSource) AsOutputDataSource() (*OutputDataSource, bool) {
138	return nil, false
139}
140
141// AsBasicOutputDataSource is the BasicOutputDataSource implementation for AzureDataLakeStoreOutputDataSource.
142func (adlsods AzureDataLakeStoreOutputDataSource) AsBasicOutputDataSource() (BasicOutputDataSource, bool) {
143	return &adlsods, true
144}
145
146// UnmarshalJSON is the custom unmarshaler for AzureDataLakeStoreOutputDataSource struct.
147func (adlsods *AzureDataLakeStoreOutputDataSource) UnmarshalJSON(body []byte) error {
148	var m map[string]*json.RawMessage
149	err := json.Unmarshal(body, &m)
150	if err != nil {
151		return err
152	}
153	for k, v := range m {
154		switch k {
155		case "properties":
156			if v != nil {
157				var azureDataLakeStoreOutputDataSourceProperties AzureDataLakeStoreOutputDataSourceProperties
158				err = json.Unmarshal(*v, &azureDataLakeStoreOutputDataSourceProperties)
159				if err != nil {
160					return err
161				}
162				adlsods.AzureDataLakeStoreOutputDataSourceProperties = &azureDataLakeStoreOutputDataSourceProperties
163			}
164		case "type":
165			if v != nil {
166				var typeVar TypeBasicOutputDataSource
167				err = json.Unmarshal(*v, &typeVar)
168				if err != nil {
169					return err
170				}
171				adlsods.Type = typeVar
172			}
173		}
174	}
175
176	return nil
177}
178
179// AzureDataLakeStoreOutputDataSourceProperties the properties that are associated with an Azure Data Lake
180// Store.
181type AzureDataLakeStoreOutputDataSourceProperties struct {
182	// AccountName - The name of the Azure Data Lake Store account. Required on PUT (CreateOrReplace) requests.
183	AccountName *string `json:"accountName,omitempty"`
184	// TenantID - The tenant id of the user used to obtain the refresh token. Required on PUT (CreateOrReplace) requests.
185	TenantID *string `json:"tenantId,omitempty"`
186	// FilePathPrefix - The location of the file to which the output should be written to. Required on PUT (CreateOrReplace) requests.
187	FilePathPrefix *string `json:"filePathPrefix,omitempty"`
188	// DateFormat - The date format. Wherever {date} appears in filePathPrefix, the value of this property is used as the date format instead.
189	DateFormat *string `json:"dateFormat,omitempty"`
190	// TimeFormat - The time format. Wherever {time} appears in filePathPrefix, the value of this property is used as the time format instead.
191	TimeFormat *string `json:"timeFormat,omitempty"`
192	// RefreshToken - A refresh token that can be used to obtain a valid access token that can then be used to authenticate with the data source. A valid refresh token is currently only obtainable via the Azure Portal. It is recommended to put a dummy string value here when creating the data source and then going to the Azure Portal to authenticate the data source which will update this property with a valid refresh token. Required on PUT (CreateOrReplace) requests.
193	RefreshToken *string `json:"refreshToken,omitempty"`
194	// TokenUserPrincipalName - The user principal name (UPN) of the user that was used to obtain the refresh token. Use this property to help remember which user was used to obtain the refresh token.
195	TokenUserPrincipalName *string `json:"tokenUserPrincipalName,omitempty"`
196	// TokenUserDisplayName - The user display name of the user that was used to obtain the refresh token. Use this property to help remember which user was used to obtain the refresh token.
197	TokenUserDisplayName *string `json:"tokenUserDisplayName,omitempty"`
198}
199
200// AzureMachineLearningWebServiceFunctionBinding the binding to an Azure Machine Learning web service.
201type AzureMachineLearningWebServiceFunctionBinding struct {
202	// AzureMachineLearningWebServiceFunctionBindingProperties - The binding properties associated with an Azure Machine learning web service.
203	*AzureMachineLearningWebServiceFunctionBindingProperties `json:"properties,omitempty"`
204	// Type - Possible values include: 'TypeFunctionBinding', 'TypeMicrosoftStreamAnalyticsJavascriptUdf', 'TypeMicrosoftMachineLearningWebService'
205	Type TypeBasicFunctionBinding `json:"type,omitempty"`
206}
207
208// MarshalJSON is the custom marshaler for AzureMachineLearningWebServiceFunctionBinding.
209func (amlwsfb AzureMachineLearningWebServiceFunctionBinding) MarshalJSON() ([]byte, error) {
210	amlwsfb.Type = TypeMicrosoftMachineLearningWebService
211	objectMap := make(map[string]interface{})
212	if amlwsfb.AzureMachineLearningWebServiceFunctionBindingProperties != nil {
213		objectMap["properties"] = amlwsfb.AzureMachineLearningWebServiceFunctionBindingProperties
214	}
215	if amlwsfb.Type != "" {
216		objectMap["type"] = amlwsfb.Type
217	}
218	return json.Marshal(objectMap)
219}
220
221// AsJavaScriptFunctionBinding is the BasicFunctionBinding implementation for AzureMachineLearningWebServiceFunctionBinding.
222func (amlwsfb AzureMachineLearningWebServiceFunctionBinding) AsJavaScriptFunctionBinding() (*JavaScriptFunctionBinding, bool) {
223	return nil, false
224}
225
226// AsAzureMachineLearningWebServiceFunctionBinding is the BasicFunctionBinding implementation for AzureMachineLearningWebServiceFunctionBinding.
227func (amlwsfb AzureMachineLearningWebServiceFunctionBinding) AsAzureMachineLearningWebServiceFunctionBinding() (*AzureMachineLearningWebServiceFunctionBinding, bool) {
228	return &amlwsfb, true
229}
230
231// AsFunctionBinding is the BasicFunctionBinding implementation for AzureMachineLearningWebServiceFunctionBinding.
232func (amlwsfb AzureMachineLearningWebServiceFunctionBinding) AsFunctionBinding() (*FunctionBinding, bool) {
233	return nil, false
234}
235
236// AsBasicFunctionBinding is the BasicFunctionBinding implementation for AzureMachineLearningWebServiceFunctionBinding.
237func (amlwsfb AzureMachineLearningWebServiceFunctionBinding) AsBasicFunctionBinding() (BasicFunctionBinding, bool) {
238	return &amlwsfb, true
239}
240
241// UnmarshalJSON is the custom unmarshaler for AzureMachineLearningWebServiceFunctionBinding struct.
242func (amlwsfb *AzureMachineLearningWebServiceFunctionBinding) UnmarshalJSON(body []byte) error {
243	var m map[string]*json.RawMessage
244	err := json.Unmarshal(body, &m)
245	if err != nil {
246		return err
247	}
248	for k, v := range m {
249		switch k {
250		case "properties":
251			if v != nil {
252				var azureMachineLearningWebServiceFunctionBindingProperties AzureMachineLearningWebServiceFunctionBindingProperties
253				err = json.Unmarshal(*v, &azureMachineLearningWebServiceFunctionBindingProperties)
254				if err != nil {
255					return err
256				}
257				amlwsfb.AzureMachineLearningWebServiceFunctionBindingProperties = &azureMachineLearningWebServiceFunctionBindingProperties
258			}
259		case "type":
260			if v != nil {
261				var typeVar TypeBasicFunctionBinding
262				err = json.Unmarshal(*v, &typeVar)
263				if err != nil {
264					return err
265				}
266				amlwsfb.Type = typeVar
267			}
268		}
269	}
270
271	return nil
272}
273
274// AzureMachineLearningWebServiceFunctionBindingProperties the binding properties associated with an Azure
275// Machine learning web service.
276type AzureMachineLearningWebServiceFunctionBindingProperties struct {
277	// Endpoint - The Request-Response execute endpoint of the Azure Machine Learning web service. Find out more here: https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-consume-web-services#request-response-service-rrs
278	Endpoint *string `json:"endpoint,omitempty"`
279	// APIKey - The API key used to authenticate with Request-Response endpoint.
280	APIKey *string `json:"apiKey,omitempty"`
281	// Inputs - The inputs for the Azure Machine Learning web service endpoint.
282	Inputs *AzureMachineLearningWebServiceInputs `json:"inputs,omitempty"`
283	// Outputs - A list of outputs from the Azure Machine Learning web service endpoint execution.
284	Outputs *[]AzureMachineLearningWebServiceOutputColumn `json:"outputs,omitempty"`
285	// BatchSize - Number between 1 and 10000 describing maximum number of rows for every Azure ML RRS execute request. Default is 1000.
286	BatchSize *int32 `json:"batchSize,omitempty"`
287}
288
289// AzureMachineLearningWebServiceFunctionBindingRetrievalProperties the binding retrieval properties
290// associated with an Azure Machine learning web service.
291type AzureMachineLearningWebServiceFunctionBindingRetrievalProperties struct {
292	// ExecuteEndpoint - The Request-Response execute endpoint of the Azure Machine Learning web service. Find out more here: https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-consume-web-services#request-response-service-rrs
293	ExecuteEndpoint *string `json:"executeEndpoint,omitempty"`
294	// UdfType - The function type. Possible values include: 'Scalar'
295	UdfType UdfType `json:"udfType,omitempty"`
296}
297
298// AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters the parameters needed to
299// retrieve the default function definition for an Azure Machine Learning web service function.
300type AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters struct {
301	// AzureMachineLearningWebServiceFunctionBindingRetrievalProperties - The binding retrieval properties associated with an Azure Machine learning web service.
302	*AzureMachineLearningWebServiceFunctionBindingRetrievalProperties `json:"bindingRetrievalProperties,omitempty"`
303	// BindingType - Possible values include: 'BindingTypeFunctionRetrieveDefaultDefinitionParameters', 'BindingTypeMicrosoftMachineLearningWebService', 'BindingTypeMicrosoftStreamAnalyticsJavascriptUdf'
304	BindingType BindingType `json:"bindingType,omitempty"`
305}
306
307// MarshalJSON is the custom marshaler for AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters.
308func (amlwsfrddp AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters) MarshalJSON() ([]byte, error) {
309	amlwsfrddp.BindingType = BindingTypeMicrosoftMachineLearningWebService
310	objectMap := make(map[string]interface{})
311	if amlwsfrddp.AzureMachineLearningWebServiceFunctionBindingRetrievalProperties != nil {
312		objectMap["bindingRetrievalProperties"] = amlwsfrddp.AzureMachineLearningWebServiceFunctionBindingRetrievalProperties
313	}
314	if amlwsfrddp.BindingType != "" {
315		objectMap["bindingType"] = amlwsfrddp.BindingType
316	}
317	return json.Marshal(objectMap)
318}
319
320// AsAzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters is the BasicFunctionRetrieveDefaultDefinitionParameters implementation for AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters.
321func (amlwsfrddp AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters) AsAzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters() (*AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters, bool) {
322	return &amlwsfrddp, true
323}
324
325// AsJavaScriptFunctionRetrieveDefaultDefinitionParameters is the BasicFunctionRetrieveDefaultDefinitionParameters implementation for AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters.
326func (amlwsfrddp AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters) AsJavaScriptFunctionRetrieveDefaultDefinitionParameters() (*JavaScriptFunctionRetrieveDefaultDefinitionParameters, bool) {
327	return nil, false
328}
329
330// AsFunctionRetrieveDefaultDefinitionParameters is the BasicFunctionRetrieveDefaultDefinitionParameters implementation for AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters.
331func (amlwsfrddp AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters) AsFunctionRetrieveDefaultDefinitionParameters() (*FunctionRetrieveDefaultDefinitionParameters, bool) {
332	return nil, false
333}
334
335// AsBasicFunctionRetrieveDefaultDefinitionParameters is the BasicFunctionRetrieveDefaultDefinitionParameters implementation for AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters.
336func (amlwsfrddp AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters) AsBasicFunctionRetrieveDefaultDefinitionParameters() (BasicFunctionRetrieveDefaultDefinitionParameters, bool) {
337	return &amlwsfrddp, true
338}
339
340// UnmarshalJSON is the custom unmarshaler for AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters struct.
341func (amlwsfrddp *AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters) UnmarshalJSON(body []byte) error {
342	var m map[string]*json.RawMessage
343	err := json.Unmarshal(body, &m)
344	if err != nil {
345		return err
346	}
347	for k, v := range m {
348		switch k {
349		case "bindingRetrievalProperties":
350			if v != nil {
351				var azureMachineLearningWebServiceFunctionBindingRetrievalProperties AzureMachineLearningWebServiceFunctionBindingRetrievalProperties
352				err = json.Unmarshal(*v, &azureMachineLearningWebServiceFunctionBindingRetrievalProperties)
353				if err != nil {
354					return err
355				}
356				amlwsfrddp.AzureMachineLearningWebServiceFunctionBindingRetrievalProperties = &azureMachineLearningWebServiceFunctionBindingRetrievalProperties
357			}
358		case "bindingType":
359			if v != nil {
360				var bindingType BindingType
361				err = json.Unmarshal(*v, &bindingType)
362				if err != nil {
363					return err
364				}
365				amlwsfrddp.BindingType = bindingType
366			}
367		}
368	}
369
370	return nil
371}
372
373// AzureMachineLearningWebServiceInputColumn describes an input column for the Azure Machine Learning web
374// service endpoint.
375type AzureMachineLearningWebServiceInputColumn struct {
376	// Name - The name of the input column.
377	Name *string `json:"name,omitempty"`
378	// DataType - The (Azure Machine Learning supported) data type of the input column. A list of valid  Azure Machine Learning data types are described at https://msdn.microsoft.com/en-us/library/azure/dn905923.aspx .
379	DataType *string `json:"dataType,omitempty"`
380	// MapTo - The zero based index of the function parameter this input maps to.
381	MapTo *int32 `json:"mapTo,omitempty"`
382}
383
384// AzureMachineLearningWebServiceInputs the inputs for the Azure Machine Learning web service endpoint.
385type AzureMachineLearningWebServiceInputs struct {
386	// Name - The name of the input. This is the name provided while authoring the endpoint.
387	Name *string `json:"name,omitempty"`
388	// ColumnNames - A list of input columns for the Azure Machine Learning web service endpoint.
389	ColumnNames *[]AzureMachineLearningWebServiceInputColumn `json:"columnNames,omitempty"`
390}
391
392// AzureMachineLearningWebServiceOutputColumn describes an output column for the Azure Machine Learning web
393// service endpoint.
394type AzureMachineLearningWebServiceOutputColumn struct {
395	// Name - The name of the output column.
396	Name *string `json:"name,omitempty"`
397	// DataType - The (Azure Machine Learning supported) data type of the output column. A list of valid  Azure Machine Learning data types are described at https://msdn.microsoft.com/en-us/library/azure/dn905923.aspx .
398	DataType *string `json:"dataType,omitempty"`
399}
400
401// AzureSQLDatabaseDataSourceProperties the properties that are associated with an Azure SQL database data
402// source.
403type AzureSQLDatabaseDataSourceProperties struct {
404	// Server - The name of the SQL server containing the Azure SQL database. Required on PUT (CreateOrReplace) requests.
405	Server *string `json:"server,omitempty"`
406	// Database - The name of the Azure SQL database. Required on PUT (CreateOrReplace) requests.
407	Database *string `json:"database,omitempty"`
408	// User - The user name that will be used to connect to the Azure SQL database. Required on PUT (CreateOrReplace) requests.
409	User *string `json:"user,omitempty"`
410	// Password - The password that will be used to connect to the Azure SQL database. Required on PUT (CreateOrReplace) requests.
411	Password *string `json:"password,omitempty"`
412	// Table - The name of the table in the Azure SQL database. Required on PUT (CreateOrReplace) requests.
413	Table *string `json:"table,omitempty"`
414}
415
416// AzureSQLDatabaseOutputDataSource describes an Azure SQL database output data source.
417type AzureSQLDatabaseOutputDataSource struct {
418	// AzureSQLDatabaseOutputDataSourceProperties - The properties that are associated with an Azure SQL database output. Required on PUT (CreateOrReplace) requests.
419	*AzureSQLDatabaseOutputDataSourceProperties `json:"properties,omitempty"`
420	// Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftDataLakeAccounts', 'TypePowerBI', 'TypeMicrosoftServiceBusTopic', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftStorageTable', 'TypeMicrosoftStorageBlob'
421	Type TypeBasicOutputDataSource `json:"type,omitempty"`
422}
423
424// MarshalJSON is the custom marshaler for AzureSQLDatabaseOutputDataSource.
425func (asdods AzureSQLDatabaseOutputDataSource) MarshalJSON() ([]byte, error) {
426	asdods.Type = TypeMicrosoftSQLServerDatabase
427	objectMap := make(map[string]interface{})
428	if asdods.AzureSQLDatabaseOutputDataSourceProperties != nil {
429		objectMap["properties"] = asdods.AzureSQLDatabaseOutputDataSourceProperties
430	}
431	if asdods.Type != "" {
432		objectMap["type"] = asdods.Type
433	}
434	return json.Marshal(objectMap)
435}
436
437// AsAzureDataLakeStoreOutputDataSource is the BasicOutputDataSource implementation for AzureSQLDatabaseOutputDataSource.
438func (asdods AzureSQLDatabaseOutputDataSource) AsAzureDataLakeStoreOutputDataSource() (*AzureDataLakeStoreOutputDataSource, bool) {
439	return nil, false
440}
441
442// AsPowerBIOutputDataSource is the BasicOutputDataSource implementation for AzureSQLDatabaseOutputDataSource.
443func (asdods AzureSQLDatabaseOutputDataSource) AsPowerBIOutputDataSource() (*PowerBIOutputDataSource, bool) {
444	return nil, false
445}
446
447// AsServiceBusTopicOutputDataSource is the BasicOutputDataSource implementation for AzureSQLDatabaseOutputDataSource.
448func (asdods AzureSQLDatabaseOutputDataSource) AsServiceBusTopicOutputDataSource() (*ServiceBusTopicOutputDataSource, bool) {
449	return nil, false
450}
451
452// AsServiceBusQueueOutputDataSource is the BasicOutputDataSource implementation for AzureSQLDatabaseOutputDataSource.
453func (asdods AzureSQLDatabaseOutputDataSource) AsServiceBusQueueOutputDataSource() (*ServiceBusQueueOutputDataSource, bool) {
454	return nil, false
455}
456
457// AsDocumentDbOutputDataSource is the BasicOutputDataSource implementation for AzureSQLDatabaseOutputDataSource.
458func (asdods AzureSQLDatabaseOutputDataSource) AsDocumentDbOutputDataSource() (*DocumentDbOutputDataSource, bool) {
459	return nil, false
460}
461
462// AsAzureSQLDatabaseOutputDataSource is the BasicOutputDataSource implementation for AzureSQLDatabaseOutputDataSource.
463func (asdods AzureSQLDatabaseOutputDataSource) AsAzureSQLDatabaseOutputDataSource() (*AzureSQLDatabaseOutputDataSource, bool) {
464	return &asdods, true
465}
466
467// AsEventHubOutputDataSource is the BasicOutputDataSource implementation for AzureSQLDatabaseOutputDataSource.
468func (asdods AzureSQLDatabaseOutputDataSource) AsEventHubOutputDataSource() (*EventHubOutputDataSource, bool) {
469	return nil, false
470}
471
472// AsAzureTableOutputDataSource is the BasicOutputDataSource implementation for AzureSQLDatabaseOutputDataSource.
473func (asdods AzureSQLDatabaseOutputDataSource) AsAzureTableOutputDataSource() (*AzureTableOutputDataSource, bool) {
474	return nil, false
475}
476
477// AsBlobOutputDataSource is the BasicOutputDataSource implementation for AzureSQLDatabaseOutputDataSource.
478func (asdods AzureSQLDatabaseOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) {
479	return nil, false
480}
481
482// AsOutputDataSource is the BasicOutputDataSource implementation for AzureSQLDatabaseOutputDataSource.
483func (asdods AzureSQLDatabaseOutputDataSource) AsOutputDataSource() (*OutputDataSource, bool) {
484	return nil, false
485}
486
487// AsBasicOutputDataSource is the BasicOutputDataSource implementation for AzureSQLDatabaseOutputDataSource.
488func (asdods AzureSQLDatabaseOutputDataSource) AsBasicOutputDataSource() (BasicOutputDataSource, bool) {
489	return &asdods, true
490}
491
492// UnmarshalJSON is the custom unmarshaler for AzureSQLDatabaseOutputDataSource struct.
493func (asdods *AzureSQLDatabaseOutputDataSource) UnmarshalJSON(body []byte) error {
494	var m map[string]*json.RawMessage
495	err := json.Unmarshal(body, &m)
496	if err != nil {
497		return err
498	}
499	for k, v := range m {
500		switch k {
501		case "properties":
502			if v != nil {
503				var azureSQLDatabaseOutputDataSourceProperties AzureSQLDatabaseOutputDataSourceProperties
504				err = json.Unmarshal(*v, &azureSQLDatabaseOutputDataSourceProperties)
505				if err != nil {
506					return err
507				}
508				asdods.AzureSQLDatabaseOutputDataSourceProperties = &azureSQLDatabaseOutputDataSourceProperties
509			}
510		case "type":
511			if v != nil {
512				var typeVar TypeBasicOutputDataSource
513				err = json.Unmarshal(*v, &typeVar)
514				if err != nil {
515					return err
516				}
517				asdods.Type = typeVar
518			}
519		}
520	}
521
522	return nil
523}
524
525// AzureSQLDatabaseOutputDataSourceProperties the properties that are associated with an Azure SQL database
526// output.
527type AzureSQLDatabaseOutputDataSourceProperties struct {
528	// Server - The name of the SQL server containing the Azure SQL database. Required on PUT (CreateOrReplace) requests.
529	Server *string `json:"server,omitempty"`
530	// Database - The name of the Azure SQL database. Required on PUT (CreateOrReplace) requests.
531	Database *string `json:"database,omitempty"`
532	// User - The user name that will be used to connect to the Azure SQL database. Required on PUT (CreateOrReplace) requests.
533	User *string `json:"user,omitempty"`
534	// Password - The password that will be used to connect to the Azure SQL database. Required on PUT (CreateOrReplace) requests.
535	Password *string `json:"password,omitempty"`
536	// Table - The name of the table in the Azure SQL database. Required on PUT (CreateOrReplace) requests.
537	Table *string `json:"table,omitempty"`
538}
539
540// AzureTableOutputDataSource describes an Azure Table output data source.
541type AzureTableOutputDataSource struct {
542	// AzureTableOutputDataSourceProperties - The properties that are associated with an Azure Table output. Required on PUT (CreateOrReplace) requests.
543	*AzureTableOutputDataSourceProperties `json:"properties,omitempty"`
544	// Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftDataLakeAccounts', 'TypePowerBI', 'TypeMicrosoftServiceBusTopic', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftStorageTable', 'TypeMicrosoftStorageBlob'
545	Type TypeBasicOutputDataSource `json:"type,omitempty"`
546}
547
548// MarshalJSON is the custom marshaler for AzureTableOutputDataSource.
549func (atods AzureTableOutputDataSource) MarshalJSON() ([]byte, error) {
550	atods.Type = TypeMicrosoftStorageTable
551	objectMap := make(map[string]interface{})
552	if atods.AzureTableOutputDataSourceProperties != nil {
553		objectMap["properties"] = atods.AzureTableOutputDataSourceProperties
554	}
555	if atods.Type != "" {
556		objectMap["type"] = atods.Type
557	}
558	return json.Marshal(objectMap)
559}
560
561// AsAzureDataLakeStoreOutputDataSource is the BasicOutputDataSource implementation for AzureTableOutputDataSource.
562func (atods AzureTableOutputDataSource) AsAzureDataLakeStoreOutputDataSource() (*AzureDataLakeStoreOutputDataSource, bool) {
563	return nil, false
564}
565
566// AsPowerBIOutputDataSource is the BasicOutputDataSource implementation for AzureTableOutputDataSource.
567func (atods AzureTableOutputDataSource) AsPowerBIOutputDataSource() (*PowerBIOutputDataSource, bool) {
568	return nil, false
569}
570
571// AsServiceBusTopicOutputDataSource is the BasicOutputDataSource implementation for AzureTableOutputDataSource.
572func (atods AzureTableOutputDataSource) AsServiceBusTopicOutputDataSource() (*ServiceBusTopicOutputDataSource, bool) {
573	return nil, false
574}
575
576// AsServiceBusQueueOutputDataSource is the BasicOutputDataSource implementation for AzureTableOutputDataSource.
577func (atods AzureTableOutputDataSource) AsServiceBusQueueOutputDataSource() (*ServiceBusQueueOutputDataSource, bool) {
578	return nil, false
579}
580
581// AsDocumentDbOutputDataSource is the BasicOutputDataSource implementation for AzureTableOutputDataSource.
582func (atods AzureTableOutputDataSource) AsDocumentDbOutputDataSource() (*DocumentDbOutputDataSource, bool) {
583	return nil, false
584}
585
586// AsAzureSQLDatabaseOutputDataSource is the BasicOutputDataSource implementation for AzureTableOutputDataSource.
587func (atods AzureTableOutputDataSource) AsAzureSQLDatabaseOutputDataSource() (*AzureSQLDatabaseOutputDataSource, bool) {
588	return nil, false
589}
590
591// AsEventHubOutputDataSource is the BasicOutputDataSource implementation for AzureTableOutputDataSource.
592func (atods AzureTableOutputDataSource) AsEventHubOutputDataSource() (*EventHubOutputDataSource, bool) {
593	return nil, false
594}
595
596// AsAzureTableOutputDataSource is the BasicOutputDataSource implementation for AzureTableOutputDataSource.
597func (atods AzureTableOutputDataSource) AsAzureTableOutputDataSource() (*AzureTableOutputDataSource, bool) {
598	return &atods, true
599}
600
601// AsBlobOutputDataSource is the BasicOutputDataSource implementation for AzureTableOutputDataSource.
602func (atods AzureTableOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) {
603	return nil, false
604}
605
606// AsOutputDataSource is the BasicOutputDataSource implementation for AzureTableOutputDataSource.
607func (atods AzureTableOutputDataSource) AsOutputDataSource() (*OutputDataSource, bool) {
608	return nil, false
609}
610
611// AsBasicOutputDataSource is the BasicOutputDataSource implementation for AzureTableOutputDataSource.
612func (atods AzureTableOutputDataSource) AsBasicOutputDataSource() (BasicOutputDataSource, bool) {
613	return &atods, true
614}
615
616// UnmarshalJSON is the custom unmarshaler for AzureTableOutputDataSource struct.
617func (atods *AzureTableOutputDataSource) UnmarshalJSON(body []byte) error {
618	var m map[string]*json.RawMessage
619	err := json.Unmarshal(body, &m)
620	if err != nil {
621		return err
622	}
623	for k, v := range m {
624		switch k {
625		case "properties":
626			if v != nil {
627				var azureTableOutputDataSourceProperties AzureTableOutputDataSourceProperties
628				err = json.Unmarshal(*v, &azureTableOutputDataSourceProperties)
629				if err != nil {
630					return err
631				}
632				atods.AzureTableOutputDataSourceProperties = &azureTableOutputDataSourceProperties
633			}
634		case "type":
635			if v != nil {
636				var typeVar TypeBasicOutputDataSource
637				err = json.Unmarshal(*v, &typeVar)
638				if err != nil {
639					return err
640				}
641				atods.Type = typeVar
642			}
643		}
644	}
645
646	return nil
647}
648
649// AzureTableOutputDataSourceProperties the properties that are associated with an Azure Table output.
650type AzureTableOutputDataSourceProperties struct {
651	// AccountName - The name of the Azure Storage account. Required on PUT (CreateOrReplace) requests.
652	AccountName *string `json:"accountName,omitempty"`
653	// AccountKey - The account key for the Azure Storage account. Required on PUT (CreateOrReplace) requests.
654	AccountKey *string `json:"accountKey,omitempty"`
655	// Table - The name of the Azure Table. Required on PUT (CreateOrReplace) requests.
656	Table *string `json:"table,omitempty"`
657	// PartitionKey - This element indicates the name of a column from the SELECT statement in the query that will be used as the partition key for the Azure Table. Required on PUT (CreateOrReplace) requests.
658	PartitionKey *string `json:"partitionKey,omitempty"`
659	// RowKey - This element indicates the name of a column from the SELECT statement in the query that will be used as the row key for the Azure Table. Required on PUT (CreateOrReplace) requests.
660	RowKey *string `json:"rowKey,omitempty"`
661	// ColumnsToRemove - If specified, each item in the array is the name of a column to remove (if present) from output event entities.
662	ColumnsToRemove *[]string `json:"columnsToRemove,omitempty"`
663	// BatchSize - The number of rows to write to the Azure Table at a time.
664	BatchSize *int32 `json:"batchSize,omitempty"`
665}
666
667// BlobDataSourceProperties the properties that are associated with a blob data source.
668type BlobDataSourceProperties struct {
669	// StorageAccounts - A list of one or more Azure Storage accounts. Required on PUT (CreateOrReplace) requests.
670	StorageAccounts *[]StorageAccount `json:"storageAccounts,omitempty"`
671	// Container - The name of a container within the associated Storage account. This container contains either the blob(s) to be read from or written to. Required on PUT (CreateOrReplace) requests.
672	Container *string `json:"container,omitempty"`
673	// PathPattern - The blob path pattern. Not a regular expression. It represents a pattern against which blob names will be matched to determine whether or not they should be included as input or output to the job. See https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-input or https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-output for a more detailed explanation and example.
674	PathPattern *string `json:"pathPattern,omitempty"`
675	// DateFormat - The date format. Wherever {date} appears in pathPattern, the value of this property is used as the date format instead.
676	DateFormat *string `json:"dateFormat,omitempty"`
677	// TimeFormat - The time format. Wherever {time} appears in pathPattern, the value of this property is used as the time format instead.
678	TimeFormat *string `json:"timeFormat,omitempty"`
679}
680
681// BlobOutputDataSource describes a blob output data source.
682type BlobOutputDataSource struct {
683	// BlobOutputDataSourceProperties - The properties that are associated with a blob output. Required on PUT (CreateOrReplace) requests.
684	*BlobOutputDataSourceProperties `json:"properties,omitempty"`
685	// Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftDataLakeAccounts', 'TypePowerBI', 'TypeMicrosoftServiceBusTopic', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftStorageTable', 'TypeMicrosoftStorageBlob'
686	Type TypeBasicOutputDataSource `json:"type,omitempty"`
687}
688
689// MarshalJSON is the custom marshaler for BlobOutputDataSource.
690func (bods BlobOutputDataSource) MarshalJSON() ([]byte, error) {
691	bods.Type = TypeMicrosoftStorageBlob
692	objectMap := make(map[string]interface{})
693	if bods.BlobOutputDataSourceProperties != nil {
694		objectMap["properties"] = bods.BlobOutputDataSourceProperties
695	}
696	if bods.Type != "" {
697		objectMap["type"] = bods.Type
698	}
699	return json.Marshal(objectMap)
700}
701
702// AsAzureDataLakeStoreOutputDataSource is the BasicOutputDataSource implementation for BlobOutputDataSource.
703func (bods BlobOutputDataSource) AsAzureDataLakeStoreOutputDataSource() (*AzureDataLakeStoreOutputDataSource, bool) {
704	return nil, false
705}
706
707// AsPowerBIOutputDataSource is the BasicOutputDataSource implementation for BlobOutputDataSource.
708func (bods BlobOutputDataSource) AsPowerBIOutputDataSource() (*PowerBIOutputDataSource, bool) {
709	return nil, false
710}
711
712// AsServiceBusTopicOutputDataSource is the BasicOutputDataSource implementation for BlobOutputDataSource.
713func (bods BlobOutputDataSource) AsServiceBusTopicOutputDataSource() (*ServiceBusTopicOutputDataSource, bool) {
714	return nil, false
715}
716
717// AsServiceBusQueueOutputDataSource is the BasicOutputDataSource implementation for BlobOutputDataSource.
718func (bods BlobOutputDataSource) AsServiceBusQueueOutputDataSource() (*ServiceBusQueueOutputDataSource, bool) {
719	return nil, false
720}
721
722// AsDocumentDbOutputDataSource is the BasicOutputDataSource implementation for BlobOutputDataSource.
723func (bods BlobOutputDataSource) AsDocumentDbOutputDataSource() (*DocumentDbOutputDataSource, bool) {
724	return nil, false
725}
726
727// AsAzureSQLDatabaseOutputDataSource is the BasicOutputDataSource implementation for BlobOutputDataSource.
728func (bods BlobOutputDataSource) AsAzureSQLDatabaseOutputDataSource() (*AzureSQLDatabaseOutputDataSource, bool) {
729	return nil, false
730}
731
732// AsEventHubOutputDataSource is the BasicOutputDataSource implementation for BlobOutputDataSource.
733func (bods BlobOutputDataSource) AsEventHubOutputDataSource() (*EventHubOutputDataSource, bool) {
734	return nil, false
735}
736
737// AsAzureTableOutputDataSource is the BasicOutputDataSource implementation for BlobOutputDataSource.
738func (bods BlobOutputDataSource) AsAzureTableOutputDataSource() (*AzureTableOutputDataSource, bool) {
739	return nil, false
740}
741
742// AsBlobOutputDataSource is the BasicOutputDataSource implementation for BlobOutputDataSource.
743func (bods BlobOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) {
744	return &bods, true
745}
746
747// AsOutputDataSource is the BasicOutputDataSource implementation for BlobOutputDataSource.
748func (bods BlobOutputDataSource) AsOutputDataSource() (*OutputDataSource, bool) {
749	return nil, false
750}
751
752// AsBasicOutputDataSource is the BasicOutputDataSource implementation for BlobOutputDataSource.
753func (bods BlobOutputDataSource) AsBasicOutputDataSource() (BasicOutputDataSource, bool) {
754	return &bods, true
755}
756
757// UnmarshalJSON is the custom unmarshaler for BlobOutputDataSource struct.
758func (bods *BlobOutputDataSource) UnmarshalJSON(body []byte) error {
759	var m map[string]*json.RawMessage
760	err := json.Unmarshal(body, &m)
761	if err != nil {
762		return err
763	}
764	for k, v := range m {
765		switch k {
766		case "properties":
767			if v != nil {
768				var blobOutputDataSourceProperties BlobOutputDataSourceProperties
769				err = json.Unmarshal(*v, &blobOutputDataSourceProperties)
770				if err != nil {
771					return err
772				}
773				bods.BlobOutputDataSourceProperties = &blobOutputDataSourceProperties
774			}
775		case "type":
776			if v != nil {
777				var typeVar TypeBasicOutputDataSource
778				err = json.Unmarshal(*v, &typeVar)
779				if err != nil {
780					return err
781				}
782				bods.Type = typeVar
783			}
784		}
785	}
786
787	return nil
788}
789
790// BlobOutputDataSourceProperties the properties that are associated with a blob output.
791type BlobOutputDataSourceProperties struct {
792	// StorageAccounts - A list of one or more Azure Storage accounts. Required on PUT (CreateOrReplace) requests.
793	StorageAccounts *[]StorageAccount `json:"storageAccounts,omitempty"`
794	// Container - The name of a container within the associated Storage account. This container contains either the blob(s) to be read from or written to. Required on PUT (CreateOrReplace) requests.
795	Container *string `json:"container,omitempty"`
796	// PathPattern - The blob path pattern. Not a regular expression. It represents a pattern against which blob names will be matched to determine whether or not they should be included as input or output to the job. See https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-input or https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-output for a more detailed explanation and example.
797	PathPattern *string `json:"pathPattern,omitempty"`
798	// DateFormat - The date format. Wherever {date} appears in pathPattern, the value of this property is used as the date format instead.
799	DateFormat *string `json:"dateFormat,omitempty"`
800	// TimeFormat - The time format. Wherever {time} appears in pathPattern, the value of this property is used as the time format instead.
801	TimeFormat *string `json:"timeFormat,omitempty"`
802}
803
804// BlobReferenceInputDataSource describes a blob input data source that contains reference data.
805type BlobReferenceInputDataSource struct {
806	// BlobReferenceInputDataSourceProperties - The properties that are associated with a blob input containing reference data. Required on PUT (CreateOrReplace) requests.
807	*BlobReferenceInputDataSourceProperties `json:"properties,omitempty"`
808	// Type - Possible values include: 'TypeBasicReferenceInputDataSourceTypeReferenceInputDataSource', 'TypeBasicReferenceInputDataSourceTypeMicrosoftStorageBlob'
809	Type TypeBasicReferenceInputDataSource `json:"type,omitempty"`
810}
811
812// MarshalJSON is the custom marshaler for BlobReferenceInputDataSource.
813func (brids BlobReferenceInputDataSource) MarshalJSON() ([]byte, error) {
814	brids.Type = TypeBasicReferenceInputDataSourceTypeMicrosoftStorageBlob
815	objectMap := make(map[string]interface{})
816	if brids.BlobReferenceInputDataSourceProperties != nil {
817		objectMap["properties"] = brids.BlobReferenceInputDataSourceProperties
818	}
819	if brids.Type != "" {
820		objectMap["type"] = brids.Type
821	}
822	return json.Marshal(objectMap)
823}
824
825// AsBlobReferenceInputDataSource is the BasicReferenceInputDataSource implementation for BlobReferenceInputDataSource.
826func (brids BlobReferenceInputDataSource) AsBlobReferenceInputDataSource() (*BlobReferenceInputDataSource, bool) {
827	return &brids, true
828}
829
830// AsReferenceInputDataSource is the BasicReferenceInputDataSource implementation for BlobReferenceInputDataSource.
831func (brids BlobReferenceInputDataSource) AsReferenceInputDataSource() (*ReferenceInputDataSource, bool) {
832	return nil, false
833}
834
835// AsBasicReferenceInputDataSource is the BasicReferenceInputDataSource implementation for BlobReferenceInputDataSource.
836func (brids BlobReferenceInputDataSource) AsBasicReferenceInputDataSource() (BasicReferenceInputDataSource, bool) {
837	return &brids, true
838}
839
840// UnmarshalJSON is the custom unmarshaler for BlobReferenceInputDataSource struct.
841func (brids *BlobReferenceInputDataSource) UnmarshalJSON(body []byte) error {
842	var m map[string]*json.RawMessage
843	err := json.Unmarshal(body, &m)
844	if err != nil {
845		return err
846	}
847	for k, v := range m {
848		switch k {
849		case "properties":
850			if v != nil {
851				var blobReferenceInputDataSourceProperties BlobReferenceInputDataSourceProperties
852				err = json.Unmarshal(*v, &blobReferenceInputDataSourceProperties)
853				if err != nil {
854					return err
855				}
856				brids.BlobReferenceInputDataSourceProperties = &blobReferenceInputDataSourceProperties
857			}
858		case "type":
859			if v != nil {
860				var typeVar TypeBasicReferenceInputDataSource
861				err = json.Unmarshal(*v, &typeVar)
862				if err != nil {
863					return err
864				}
865				brids.Type = typeVar
866			}
867		}
868	}
869
870	return nil
871}
872
873// BlobReferenceInputDataSourceProperties the properties that are associated with a blob input containing
874// reference data.
875type BlobReferenceInputDataSourceProperties struct {
876	// StorageAccounts - A list of one or more Azure Storage accounts. Required on PUT (CreateOrReplace) requests.
877	StorageAccounts *[]StorageAccount `json:"storageAccounts,omitempty"`
878	// Container - The name of a container within the associated Storage account. This container contains either the blob(s) to be read from or written to. Required on PUT (CreateOrReplace) requests.
879	Container *string `json:"container,omitempty"`
880	// PathPattern - The blob path pattern. Not a regular expression. It represents a pattern against which blob names will be matched to determine whether or not they should be included as input or output to the job. See https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-input or https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-output for a more detailed explanation and example.
881	PathPattern *string `json:"pathPattern,omitempty"`
882	// DateFormat - The date format. Wherever {date} appears in pathPattern, the value of this property is used as the date format instead.
883	DateFormat *string `json:"dateFormat,omitempty"`
884	// TimeFormat - The time format. Wherever {time} appears in pathPattern, the value of this property is used as the time format instead.
885	TimeFormat *string `json:"timeFormat,omitempty"`
886}
887
888// BlobStreamInputDataSource describes a blob input data source that contains stream data.
889type BlobStreamInputDataSource struct {
890	// BlobStreamInputDataSourceProperties - The properties that are associated with a blob input containing stream data. Required on PUT (CreateOrReplace) requests.
891	*BlobStreamInputDataSourceProperties `json:"properties,omitempty"`
892	// Type - Possible values include: 'TypeBasicStreamInputDataSourceTypeStreamInputDataSource', 'TypeBasicStreamInputDataSourceTypeMicrosoftDevicesIotHubs', 'TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob'
893	Type TypeBasicStreamInputDataSource `json:"type,omitempty"`
894}
895
896// MarshalJSON is the custom marshaler for BlobStreamInputDataSource.
897func (bsids BlobStreamInputDataSource) MarshalJSON() ([]byte, error) {
898	bsids.Type = TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob
899	objectMap := make(map[string]interface{})
900	if bsids.BlobStreamInputDataSourceProperties != nil {
901		objectMap["properties"] = bsids.BlobStreamInputDataSourceProperties
902	}
903	if bsids.Type != "" {
904		objectMap["type"] = bsids.Type
905	}
906	return json.Marshal(objectMap)
907}
908
909// AsIoTHubStreamInputDataSource is the BasicStreamInputDataSource implementation for BlobStreamInputDataSource.
910func (bsids BlobStreamInputDataSource) AsIoTHubStreamInputDataSource() (*IoTHubStreamInputDataSource, bool) {
911	return nil, false
912}
913
914// AsEventHubStreamInputDataSource is the BasicStreamInputDataSource implementation for BlobStreamInputDataSource.
915func (bsids BlobStreamInputDataSource) AsEventHubStreamInputDataSource() (*EventHubStreamInputDataSource, bool) {
916	return nil, false
917}
918
919// AsBlobStreamInputDataSource is the BasicStreamInputDataSource implementation for BlobStreamInputDataSource.
920func (bsids BlobStreamInputDataSource) AsBlobStreamInputDataSource() (*BlobStreamInputDataSource, bool) {
921	return &bsids, true
922}
923
924// AsStreamInputDataSource is the BasicStreamInputDataSource implementation for BlobStreamInputDataSource.
925func (bsids BlobStreamInputDataSource) AsStreamInputDataSource() (*StreamInputDataSource, bool) {
926	return nil, false
927}
928
929// AsBasicStreamInputDataSource is the BasicStreamInputDataSource implementation for BlobStreamInputDataSource.
930func (bsids BlobStreamInputDataSource) AsBasicStreamInputDataSource() (BasicStreamInputDataSource, bool) {
931	return &bsids, true
932}
933
934// UnmarshalJSON is the custom unmarshaler for BlobStreamInputDataSource struct.
935func (bsids *BlobStreamInputDataSource) UnmarshalJSON(body []byte) error {
936	var m map[string]*json.RawMessage
937	err := json.Unmarshal(body, &m)
938	if err != nil {
939		return err
940	}
941	for k, v := range m {
942		switch k {
943		case "properties":
944			if v != nil {
945				var blobStreamInputDataSourceProperties BlobStreamInputDataSourceProperties
946				err = json.Unmarshal(*v, &blobStreamInputDataSourceProperties)
947				if err != nil {
948					return err
949				}
950				bsids.BlobStreamInputDataSourceProperties = &blobStreamInputDataSourceProperties
951			}
952		case "type":
953			if v != nil {
954				var typeVar TypeBasicStreamInputDataSource
955				err = json.Unmarshal(*v, &typeVar)
956				if err != nil {
957					return err
958				}
959				bsids.Type = typeVar
960			}
961		}
962	}
963
964	return nil
965}
966
967// BlobStreamInputDataSourceProperties the properties that are associated with a blob input containing
968// stream data.
969type BlobStreamInputDataSourceProperties struct {
970	// SourcePartitionCount - The partition count of the blob input data source. Range 1 - 256.
971	SourcePartitionCount *int32 `json:"sourcePartitionCount,omitempty"`
972	// StorageAccounts - A list of one or more Azure Storage accounts. Required on PUT (CreateOrReplace) requests.
973	StorageAccounts *[]StorageAccount `json:"storageAccounts,omitempty"`
974	// Container - The name of a container within the associated Storage account. This container contains either the blob(s) to be read from or written to. Required on PUT (CreateOrReplace) requests.
975	Container *string `json:"container,omitempty"`
976	// PathPattern - The blob path pattern. Not a regular expression. It represents a pattern against which blob names will be matched to determine whether or not they should be included as input or output to the job. See https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-input or https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-output for a more detailed explanation and example.
977	PathPattern *string `json:"pathPattern,omitempty"`
978	// DateFormat - The date format. Wherever {date} appears in pathPattern, the value of this property is used as the date format instead.
979	DateFormat *string `json:"dateFormat,omitempty"`
980	// TimeFormat - The time format. Wherever {time} appears in pathPattern, the value of this property is used as the time format instead.
981	TimeFormat *string `json:"timeFormat,omitempty"`
982}
983
984// CsvSerialization describes how data from an input is serialized or how data is serialized when written
985// to an output in CSV format.
986type CsvSerialization struct {
987	// CsvSerializationProperties - The properties that are associated with the CSV serialization type. Required on PUT (CreateOrReplace) requests.
988	*CsvSerializationProperties `json:"properties,omitempty"`
989	// Type - Possible values include: 'TypeSerialization', 'TypeAvro', 'TypeJSON', 'TypeCsv'
990	Type Type `json:"type,omitempty"`
991}
992
993// MarshalJSON is the custom marshaler for CsvSerialization.
994func (cs CsvSerialization) MarshalJSON() ([]byte, error) {
995	cs.Type = TypeCsv
996	objectMap := make(map[string]interface{})
997	if cs.CsvSerializationProperties != nil {
998		objectMap["properties"] = cs.CsvSerializationProperties
999	}
1000	if cs.Type != "" {
1001		objectMap["type"] = cs.Type
1002	}
1003	return json.Marshal(objectMap)
1004}
1005
1006// AsAvroSerialization is the BasicSerialization implementation for CsvSerialization.
1007func (cs CsvSerialization) AsAvroSerialization() (*AvroSerialization, bool) {
1008	return nil, false
1009}
1010
1011// AsJSONSerialization is the BasicSerialization implementation for CsvSerialization.
1012func (cs CsvSerialization) AsJSONSerialization() (*JSONSerialization, bool) {
1013	return nil, false
1014}
1015
1016// AsCsvSerialization is the BasicSerialization implementation for CsvSerialization.
1017func (cs CsvSerialization) AsCsvSerialization() (*CsvSerialization, bool) {
1018	return &cs, true
1019}
1020
1021// AsSerialization is the BasicSerialization implementation for CsvSerialization.
1022func (cs CsvSerialization) AsSerialization() (*Serialization, bool) {
1023	return nil, false
1024}
1025
1026// AsBasicSerialization is the BasicSerialization implementation for CsvSerialization.
1027func (cs CsvSerialization) AsBasicSerialization() (BasicSerialization, bool) {
1028	return &cs, true
1029}
1030
1031// UnmarshalJSON is the custom unmarshaler for CsvSerialization struct.
1032func (cs *CsvSerialization) UnmarshalJSON(body []byte) error {
1033	var m map[string]*json.RawMessage
1034	err := json.Unmarshal(body, &m)
1035	if err != nil {
1036		return err
1037	}
1038	for k, v := range m {
1039		switch k {
1040		case "properties":
1041			if v != nil {
1042				var csvSerializationProperties CsvSerializationProperties
1043				err = json.Unmarshal(*v, &csvSerializationProperties)
1044				if err != nil {
1045					return err
1046				}
1047				cs.CsvSerializationProperties = &csvSerializationProperties
1048			}
1049		case "type":
1050			if v != nil {
1051				var typeVar Type
1052				err = json.Unmarshal(*v, &typeVar)
1053				if err != nil {
1054					return err
1055				}
1056				cs.Type = typeVar
1057			}
1058		}
1059	}
1060
1061	return nil
1062}
1063
1064// CsvSerializationProperties the properties that are associated with the CSV serialization type.
1065type CsvSerializationProperties struct {
1066	// FieldDelimiter - Specifies the delimiter that will be used to separate comma-separated value (CSV) records. See https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-input or https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-output for a list of supported values. Required on PUT (CreateOrReplace) requests.
1067	FieldDelimiter *string `json:"fieldDelimiter,omitempty"`
1068	// Encoding - Specifies the encoding of the incoming data in the case of input and the encoding of outgoing data in the case of output. Required on PUT (CreateOrReplace) requests. Possible values include: 'UTF8'
1069	Encoding Encoding `json:"encoding,omitempty"`
1070}
1071
1072// DiagnosticCondition condition applicable to the resource, or to the job overall, that warrant customer
1073// attention.
1074type DiagnosticCondition struct {
1075	// Since - READ-ONLY; The UTC timestamp of when the condition started. Customers should be able to find a corresponding event in the ops log around this time.
1076	Since *string `json:"since,omitempty"`
1077	// Code - READ-ONLY; The opaque diagnostic code.
1078	Code *string `json:"code,omitempty"`
1079	// Message - READ-ONLY; The human-readable message describing the condition in detail. Localized in the Accept-Language of the client request.
1080	Message *string `json:"message,omitempty"`
1081}
1082
1083// MarshalJSON is the custom marshaler for DiagnosticCondition.
1084func (dc DiagnosticCondition) MarshalJSON() ([]byte, error) {
1085	objectMap := make(map[string]interface{})
1086	return json.Marshal(objectMap)
1087}
1088
1089// Diagnostics describes conditions applicable to the Input, Output, or the job overall, that warrant
1090// customer attention.
1091type Diagnostics struct {
1092	// Conditions - READ-ONLY; A collection of zero or more conditions applicable to the resource, or to the job overall, that warrant customer attention.
1093	Conditions *[]DiagnosticCondition `json:"conditions,omitempty"`
1094}
1095
1096// MarshalJSON is the custom marshaler for Diagnostics.
1097func (d Diagnostics) MarshalJSON() ([]byte, error) {
1098	objectMap := make(map[string]interface{})
1099	return json.Marshal(objectMap)
1100}
1101
1102// DocumentDbOutputDataSource describes a DocumentDB output data source.
1103type DocumentDbOutputDataSource struct {
1104	// DocumentDbOutputDataSourceProperties - The properties that are associated with a DocumentDB output. Required on PUT (CreateOrReplace) requests.
1105	*DocumentDbOutputDataSourceProperties `json:"properties,omitempty"`
1106	// Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftDataLakeAccounts', 'TypePowerBI', 'TypeMicrosoftServiceBusTopic', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftStorageTable', 'TypeMicrosoftStorageBlob'
1107	Type TypeBasicOutputDataSource `json:"type,omitempty"`
1108}
1109
1110// MarshalJSON is the custom marshaler for DocumentDbOutputDataSource.
1111func (ddods DocumentDbOutputDataSource) MarshalJSON() ([]byte, error) {
1112	ddods.Type = TypeMicrosoftStorageDocumentDB
1113	objectMap := make(map[string]interface{})
1114	if ddods.DocumentDbOutputDataSourceProperties != nil {
1115		objectMap["properties"] = ddods.DocumentDbOutputDataSourceProperties
1116	}
1117	if ddods.Type != "" {
1118		objectMap["type"] = ddods.Type
1119	}
1120	return json.Marshal(objectMap)
1121}
1122
1123// AsAzureDataLakeStoreOutputDataSource is the BasicOutputDataSource implementation for DocumentDbOutputDataSource.
1124func (ddods DocumentDbOutputDataSource) AsAzureDataLakeStoreOutputDataSource() (*AzureDataLakeStoreOutputDataSource, bool) {
1125	return nil, false
1126}
1127
1128// AsPowerBIOutputDataSource is the BasicOutputDataSource implementation for DocumentDbOutputDataSource.
1129func (ddods DocumentDbOutputDataSource) AsPowerBIOutputDataSource() (*PowerBIOutputDataSource, bool) {
1130	return nil, false
1131}
1132
1133// AsServiceBusTopicOutputDataSource is the BasicOutputDataSource implementation for DocumentDbOutputDataSource.
1134func (ddods DocumentDbOutputDataSource) AsServiceBusTopicOutputDataSource() (*ServiceBusTopicOutputDataSource, bool) {
1135	return nil, false
1136}
1137
1138// AsServiceBusQueueOutputDataSource is the BasicOutputDataSource implementation for DocumentDbOutputDataSource.
1139func (ddods DocumentDbOutputDataSource) AsServiceBusQueueOutputDataSource() (*ServiceBusQueueOutputDataSource, bool) {
1140	return nil, false
1141}
1142
1143// AsDocumentDbOutputDataSource is the BasicOutputDataSource implementation for DocumentDbOutputDataSource.
1144func (ddods DocumentDbOutputDataSource) AsDocumentDbOutputDataSource() (*DocumentDbOutputDataSource, bool) {
1145	return &ddods, true
1146}
1147
1148// AsAzureSQLDatabaseOutputDataSource is the BasicOutputDataSource implementation for DocumentDbOutputDataSource.
1149func (ddods DocumentDbOutputDataSource) AsAzureSQLDatabaseOutputDataSource() (*AzureSQLDatabaseOutputDataSource, bool) {
1150	return nil, false
1151}
1152
1153// AsEventHubOutputDataSource is the BasicOutputDataSource implementation for DocumentDbOutputDataSource.
1154func (ddods DocumentDbOutputDataSource) AsEventHubOutputDataSource() (*EventHubOutputDataSource, bool) {
1155	return nil, false
1156}
1157
1158// AsAzureTableOutputDataSource is the BasicOutputDataSource implementation for DocumentDbOutputDataSource.
1159func (ddods DocumentDbOutputDataSource) AsAzureTableOutputDataSource() (*AzureTableOutputDataSource, bool) {
1160	return nil, false
1161}
1162
1163// AsBlobOutputDataSource is the BasicOutputDataSource implementation for DocumentDbOutputDataSource.
1164func (ddods DocumentDbOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) {
1165	return nil, false
1166}
1167
1168// AsOutputDataSource is the BasicOutputDataSource implementation for DocumentDbOutputDataSource.
1169func (ddods DocumentDbOutputDataSource) AsOutputDataSource() (*OutputDataSource, bool) {
1170	return nil, false
1171}
1172
1173// AsBasicOutputDataSource is the BasicOutputDataSource implementation for DocumentDbOutputDataSource.
1174func (ddods DocumentDbOutputDataSource) AsBasicOutputDataSource() (BasicOutputDataSource, bool) {
1175	return &ddods, true
1176}
1177
1178// UnmarshalJSON is the custom unmarshaler for DocumentDbOutputDataSource struct.
1179func (ddods *DocumentDbOutputDataSource) UnmarshalJSON(body []byte) error {
1180	var m map[string]*json.RawMessage
1181	err := json.Unmarshal(body, &m)
1182	if err != nil {
1183		return err
1184	}
1185	for k, v := range m {
1186		switch k {
1187		case "properties":
1188			if v != nil {
1189				var documentDbOutputDataSourceProperties DocumentDbOutputDataSourceProperties
1190				err = json.Unmarshal(*v, &documentDbOutputDataSourceProperties)
1191				if err != nil {
1192					return err
1193				}
1194				ddods.DocumentDbOutputDataSourceProperties = &documentDbOutputDataSourceProperties
1195			}
1196		case "type":
1197			if v != nil {
1198				var typeVar TypeBasicOutputDataSource
1199				err = json.Unmarshal(*v, &typeVar)
1200				if err != nil {
1201					return err
1202				}
1203				ddods.Type = typeVar
1204			}
1205		}
1206	}
1207
1208	return nil
1209}
1210
1211// DocumentDbOutputDataSourceProperties the properties that are associated with a DocumentDB output.
1212type DocumentDbOutputDataSourceProperties struct {
1213	// AccountID - The DocumentDB account name or ID. Required on PUT (CreateOrReplace) requests.
1214	AccountID *string `json:"accountId,omitempty"`
1215	// AccountKey - The account key for the DocumentDB account. Required on PUT (CreateOrReplace) requests.
1216	AccountKey *string `json:"accountKey,omitempty"`
1217	// Database - The name of the DocumentDB database. Required on PUT (CreateOrReplace) requests.
1218	Database *string `json:"database,omitempty"`
1219	// CollectionNamePattern - The collection name pattern for the collections to be used. The collection name format can be constructed using the optional {partition} token, where partitions start from 0. See the DocumentDB section of https://docs.microsoft.com/en-us/rest/api/streamanalytics/stream-analytics-output for more information. Required on PUT (CreateOrReplace) requests.
1220	CollectionNamePattern *string `json:"collectionNamePattern,omitempty"`
1221	// PartitionKey - The name of the field in output events used to specify the key for partitioning output across collections. If 'collectionNamePattern' contains the {partition} token, this property is required to be specified.
1222	PartitionKey *string `json:"partitionKey,omitempty"`
1223	// DocumentID - The name of the field in output events used to specify the primary key which insert or update operations are based on.
1224	DocumentID *string `json:"documentId,omitempty"`
1225}
1226
1227// ErrorResponse describes the error that occurred.
1228type ErrorResponse struct {
1229	// Code - READ-ONLY; Error code associated with the error that occurred.
1230	Code *string `json:"code,omitempty"`
1231	// Message - READ-ONLY; Describes the error in detail.
1232	Message *string `json:"message,omitempty"`
1233}
1234
1235// MarshalJSON is the custom marshaler for ErrorResponse.
1236func (er ErrorResponse) MarshalJSON() ([]byte, error) {
1237	objectMap := make(map[string]interface{})
1238	return json.Marshal(objectMap)
1239}
1240
1241// EventHubDataSourceProperties the common properties that are associated with Event Hub data sources.
1242type EventHubDataSourceProperties struct {
1243	// EventHubName - The name of the Event Hub. Required on PUT (CreateOrReplace) requests.
1244	EventHubName *string `json:"eventHubName,omitempty"`
1245	// ServiceBusNamespace - The namespace that is associated with the desired Event Hub, Service Bus Queue, Service Bus Topic, etc. Required on PUT (CreateOrReplace) requests.
1246	ServiceBusNamespace *string `json:"serviceBusNamespace,omitempty"`
1247	// SharedAccessPolicyName - The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc. Required on PUT (CreateOrReplace) requests.
1248	SharedAccessPolicyName *string `json:"sharedAccessPolicyName,omitempty"`
1249	// SharedAccessPolicyKey - The shared access policy key for the specified shared access policy. Required on PUT (CreateOrReplace) requests.
1250	SharedAccessPolicyKey *string `json:"sharedAccessPolicyKey,omitempty"`
1251}
1252
1253// EventHubOutputDataSource describes an Event Hub output data source.
1254type EventHubOutputDataSource struct {
1255	// EventHubOutputDataSourceProperties - The properties that are associated with an Event Hub output. Required on PUT (CreateOrReplace) requests.
1256	*EventHubOutputDataSourceProperties `json:"properties,omitempty"`
1257	// Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftDataLakeAccounts', 'TypePowerBI', 'TypeMicrosoftServiceBusTopic', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftStorageTable', 'TypeMicrosoftStorageBlob'
1258	Type TypeBasicOutputDataSource `json:"type,omitempty"`
1259}
1260
1261// MarshalJSON is the custom marshaler for EventHubOutputDataSource.
1262func (ehods EventHubOutputDataSource) MarshalJSON() ([]byte, error) {
1263	ehods.Type = TypeMicrosoftServiceBusEventHub
1264	objectMap := make(map[string]interface{})
1265	if ehods.EventHubOutputDataSourceProperties != nil {
1266		objectMap["properties"] = ehods.EventHubOutputDataSourceProperties
1267	}
1268	if ehods.Type != "" {
1269		objectMap["type"] = ehods.Type
1270	}
1271	return json.Marshal(objectMap)
1272}
1273
1274// AsAzureDataLakeStoreOutputDataSource is the BasicOutputDataSource implementation for EventHubOutputDataSource.
1275func (ehods EventHubOutputDataSource) AsAzureDataLakeStoreOutputDataSource() (*AzureDataLakeStoreOutputDataSource, bool) {
1276	return nil, false
1277}
1278
1279// AsPowerBIOutputDataSource is the BasicOutputDataSource implementation for EventHubOutputDataSource.
1280func (ehods EventHubOutputDataSource) AsPowerBIOutputDataSource() (*PowerBIOutputDataSource, bool) {
1281	return nil, false
1282}
1283
1284// AsServiceBusTopicOutputDataSource is the BasicOutputDataSource implementation for EventHubOutputDataSource.
1285func (ehods EventHubOutputDataSource) AsServiceBusTopicOutputDataSource() (*ServiceBusTopicOutputDataSource, bool) {
1286	return nil, false
1287}
1288
1289// AsServiceBusQueueOutputDataSource is the BasicOutputDataSource implementation for EventHubOutputDataSource.
1290func (ehods EventHubOutputDataSource) AsServiceBusQueueOutputDataSource() (*ServiceBusQueueOutputDataSource, bool) {
1291	return nil, false
1292}
1293
1294// AsDocumentDbOutputDataSource is the BasicOutputDataSource implementation for EventHubOutputDataSource.
1295func (ehods EventHubOutputDataSource) AsDocumentDbOutputDataSource() (*DocumentDbOutputDataSource, bool) {
1296	return nil, false
1297}
1298
1299// AsAzureSQLDatabaseOutputDataSource is the BasicOutputDataSource implementation for EventHubOutputDataSource.
1300func (ehods EventHubOutputDataSource) AsAzureSQLDatabaseOutputDataSource() (*AzureSQLDatabaseOutputDataSource, bool) {
1301	return nil, false
1302}
1303
1304// AsEventHubOutputDataSource is the BasicOutputDataSource implementation for EventHubOutputDataSource.
1305func (ehods EventHubOutputDataSource) AsEventHubOutputDataSource() (*EventHubOutputDataSource, bool) {
1306	return &ehods, true
1307}
1308
1309// AsAzureTableOutputDataSource is the BasicOutputDataSource implementation for EventHubOutputDataSource.
1310func (ehods EventHubOutputDataSource) AsAzureTableOutputDataSource() (*AzureTableOutputDataSource, bool) {
1311	return nil, false
1312}
1313
1314// AsBlobOutputDataSource is the BasicOutputDataSource implementation for EventHubOutputDataSource.
1315func (ehods EventHubOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) {
1316	return nil, false
1317}
1318
1319// AsOutputDataSource is the BasicOutputDataSource implementation for EventHubOutputDataSource.
1320func (ehods EventHubOutputDataSource) AsOutputDataSource() (*OutputDataSource, bool) {
1321	return nil, false
1322}
1323
1324// AsBasicOutputDataSource is the BasicOutputDataSource implementation for EventHubOutputDataSource.
1325func (ehods EventHubOutputDataSource) AsBasicOutputDataSource() (BasicOutputDataSource, bool) {
1326	return &ehods, true
1327}
1328
1329// UnmarshalJSON is the custom unmarshaler for EventHubOutputDataSource struct.
1330func (ehods *EventHubOutputDataSource) UnmarshalJSON(body []byte) error {
1331	var m map[string]*json.RawMessage
1332	err := json.Unmarshal(body, &m)
1333	if err != nil {
1334		return err
1335	}
1336	for k, v := range m {
1337		switch k {
1338		case "properties":
1339			if v != nil {
1340				var eventHubOutputDataSourceProperties EventHubOutputDataSourceProperties
1341				err = json.Unmarshal(*v, &eventHubOutputDataSourceProperties)
1342				if err != nil {
1343					return err
1344				}
1345				ehods.EventHubOutputDataSourceProperties = &eventHubOutputDataSourceProperties
1346			}
1347		case "type":
1348			if v != nil {
1349				var typeVar TypeBasicOutputDataSource
1350				err = json.Unmarshal(*v, &typeVar)
1351				if err != nil {
1352					return err
1353				}
1354				ehods.Type = typeVar
1355			}
1356		}
1357	}
1358
1359	return nil
1360}
1361
1362// EventHubOutputDataSourceProperties the properties that are associated with an Event Hub output.
1363type EventHubOutputDataSourceProperties struct {
1364	// PartitionKey - The key/column that is used to determine to which partition to send event data.
1365	PartitionKey *string `json:"partitionKey,omitempty"`
1366	// EventHubName - The name of the Event Hub. Required on PUT (CreateOrReplace) requests.
1367	EventHubName *string `json:"eventHubName,omitempty"`
1368	// ServiceBusNamespace - The namespace that is associated with the desired Event Hub, Service Bus Queue, Service Bus Topic, etc. Required on PUT (CreateOrReplace) requests.
1369	ServiceBusNamespace *string `json:"serviceBusNamespace,omitempty"`
1370	// SharedAccessPolicyName - The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc. Required on PUT (CreateOrReplace) requests.
1371	SharedAccessPolicyName *string `json:"sharedAccessPolicyName,omitempty"`
1372	// SharedAccessPolicyKey - The shared access policy key for the specified shared access policy. Required on PUT (CreateOrReplace) requests.
1373	SharedAccessPolicyKey *string `json:"sharedAccessPolicyKey,omitempty"`
1374}
1375
1376// EventHubStreamInputDataSource describes an Event Hub input data source that contains stream data.
1377type EventHubStreamInputDataSource struct {
1378	// EventHubStreamInputDataSourceProperties - The properties that are associated with an Event Hub input containing stream data. Required on PUT (CreateOrReplace) requests.
1379	*EventHubStreamInputDataSourceProperties `json:"properties,omitempty"`
1380	// Type - Possible values include: 'TypeBasicStreamInputDataSourceTypeStreamInputDataSource', 'TypeBasicStreamInputDataSourceTypeMicrosoftDevicesIotHubs', 'TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob'
1381	Type TypeBasicStreamInputDataSource `json:"type,omitempty"`
1382}
1383
1384// MarshalJSON is the custom marshaler for EventHubStreamInputDataSource.
1385func (ehsids EventHubStreamInputDataSource) MarshalJSON() ([]byte, error) {
1386	ehsids.Type = TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub
1387	objectMap := make(map[string]interface{})
1388	if ehsids.EventHubStreamInputDataSourceProperties != nil {
1389		objectMap["properties"] = ehsids.EventHubStreamInputDataSourceProperties
1390	}
1391	if ehsids.Type != "" {
1392		objectMap["type"] = ehsids.Type
1393	}
1394	return json.Marshal(objectMap)
1395}
1396
1397// AsIoTHubStreamInputDataSource is the BasicStreamInputDataSource implementation for EventHubStreamInputDataSource.
1398func (ehsids EventHubStreamInputDataSource) AsIoTHubStreamInputDataSource() (*IoTHubStreamInputDataSource, bool) {
1399	return nil, false
1400}
1401
1402// AsEventHubStreamInputDataSource is the BasicStreamInputDataSource implementation for EventHubStreamInputDataSource.
1403func (ehsids EventHubStreamInputDataSource) AsEventHubStreamInputDataSource() (*EventHubStreamInputDataSource, bool) {
1404	return &ehsids, true
1405}
1406
1407// AsBlobStreamInputDataSource is the BasicStreamInputDataSource implementation for EventHubStreamInputDataSource.
1408func (ehsids EventHubStreamInputDataSource) AsBlobStreamInputDataSource() (*BlobStreamInputDataSource, bool) {
1409	return nil, false
1410}
1411
1412// AsStreamInputDataSource is the BasicStreamInputDataSource implementation for EventHubStreamInputDataSource.
1413func (ehsids EventHubStreamInputDataSource) AsStreamInputDataSource() (*StreamInputDataSource, bool) {
1414	return nil, false
1415}
1416
1417// AsBasicStreamInputDataSource is the BasicStreamInputDataSource implementation for EventHubStreamInputDataSource.
1418func (ehsids EventHubStreamInputDataSource) AsBasicStreamInputDataSource() (BasicStreamInputDataSource, bool) {
1419	return &ehsids, true
1420}
1421
1422// UnmarshalJSON is the custom unmarshaler for EventHubStreamInputDataSource struct.
1423func (ehsids *EventHubStreamInputDataSource) UnmarshalJSON(body []byte) error {
1424	var m map[string]*json.RawMessage
1425	err := json.Unmarshal(body, &m)
1426	if err != nil {
1427		return err
1428	}
1429	for k, v := range m {
1430		switch k {
1431		case "properties":
1432			if v != nil {
1433				var eventHubStreamInputDataSourceProperties EventHubStreamInputDataSourceProperties
1434				err = json.Unmarshal(*v, &eventHubStreamInputDataSourceProperties)
1435				if err != nil {
1436					return err
1437				}
1438				ehsids.EventHubStreamInputDataSourceProperties = &eventHubStreamInputDataSourceProperties
1439			}
1440		case "type":
1441			if v != nil {
1442				var typeVar TypeBasicStreamInputDataSource
1443				err = json.Unmarshal(*v, &typeVar)
1444				if err != nil {
1445					return err
1446				}
1447				ehsids.Type = typeVar
1448			}
1449		}
1450	}
1451
1452	return nil
1453}
1454
1455// EventHubStreamInputDataSourceProperties the properties that are associated with a Event Hub input
1456// containing stream data.
1457type EventHubStreamInputDataSourceProperties struct {
1458	// ConsumerGroupName - The name of an Event Hub Consumer Group that should be used to read events from the Event Hub. Specifying distinct consumer group names for multiple inputs allows each of those inputs to receive the same events from the Event Hub. If not specified, the input uses the Event Hub’s default consumer group.
1459	ConsumerGroupName *string `json:"consumerGroupName,omitempty"`
1460	// EventHubName - The name of the Event Hub. Required on PUT (CreateOrReplace) requests.
1461	EventHubName *string `json:"eventHubName,omitempty"`
1462	// ServiceBusNamespace - The namespace that is associated with the desired Event Hub, Service Bus Queue, Service Bus Topic, etc. Required on PUT (CreateOrReplace) requests.
1463	ServiceBusNamespace *string `json:"serviceBusNamespace,omitempty"`
1464	// SharedAccessPolicyName - The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc. Required on PUT (CreateOrReplace) requests.
1465	SharedAccessPolicyName *string `json:"sharedAccessPolicyName,omitempty"`
1466	// SharedAccessPolicyKey - The shared access policy key for the specified shared access policy. Required on PUT (CreateOrReplace) requests.
1467	SharedAccessPolicyKey *string `json:"sharedAccessPolicyKey,omitempty"`
1468}
1469
1470// Function a function object, containing all information associated with the named function. All functions
1471// are contained under a streaming job.
1472type Function struct {
1473	autorest.Response `json:"-"`
1474	// Properties - The properties that are associated with a function.
1475	Properties BasicFunctionProperties `json:"properties,omitempty"`
1476	// ID - READ-ONLY; Resource Id
1477	ID *string `json:"id,omitempty"`
1478	// Name - Resource name
1479	Name *string `json:"name,omitempty"`
1480	// Type - READ-ONLY; Resource type
1481	Type *string `json:"type,omitempty"`
1482}
1483
1484// MarshalJSON is the custom marshaler for Function.
1485func (f Function) MarshalJSON() ([]byte, error) {
1486	objectMap := make(map[string]interface{})
1487	objectMap["properties"] = f.Properties
1488	if f.Name != nil {
1489		objectMap["name"] = f.Name
1490	}
1491	return json.Marshal(objectMap)
1492}
1493
1494// UnmarshalJSON is the custom unmarshaler for Function struct.
1495func (f *Function) UnmarshalJSON(body []byte) error {
1496	var m map[string]*json.RawMessage
1497	err := json.Unmarshal(body, &m)
1498	if err != nil {
1499		return err
1500	}
1501	for k, v := range m {
1502		switch k {
1503		case "properties":
1504			if v != nil {
1505				properties, err := unmarshalBasicFunctionProperties(*v)
1506				if err != nil {
1507					return err
1508				}
1509				f.Properties = properties
1510			}
1511		case "id":
1512			if v != nil {
1513				var ID string
1514				err = json.Unmarshal(*v, &ID)
1515				if err != nil {
1516					return err
1517				}
1518				f.ID = &ID
1519			}
1520		case "name":
1521			if v != nil {
1522				var name string
1523				err = json.Unmarshal(*v, &name)
1524				if err != nil {
1525					return err
1526				}
1527				f.Name = &name
1528			}
1529		case "type":
1530			if v != nil {
1531				var typeVar string
1532				err = json.Unmarshal(*v, &typeVar)
1533				if err != nil {
1534					return err
1535				}
1536				f.Type = &typeVar
1537			}
1538		}
1539	}
1540
1541	return nil
1542}
1543
1544// BasicFunctionBinding the physical binding of the function. For example, in the Azure Machine Learning web service’s
1545// case, this describes the endpoint.
1546type BasicFunctionBinding interface {
1547	AsJavaScriptFunctionBinding() (*JavaScriptFunctionBinding, bool)
1548	AsAzureMachineLearningWebServiceFunctionBinding() (*AzureMachineLearningWebServiceFunctionBinding, bool)
1549	AsFunctionBinding() (*FunctionBinding, bool)
1550}
1551
1552// FunctionBinding the physical binding of the function. For example, in the Azure Machine Learning web
1553// service’s case, this describes the endpoint.
1554type FunctionBinding struct {
1555	// Type - Possible values include: 'TypeFunctionBinding', 'TypeMicrosoftStreamAnalyticsJavascriptUdf', 'TypeMicrosoftMachineLearningWebService'
1556	Type TypeBasicFunctionBinding `json:"type,omitempty"`
1557}
1558
1559func unmarshalBasicFunctionBinding(body []byte) (BasicFunctionBinding, error) {
1560	var m map[string]interface{}
1561	err := json.Unmarshal(body, &m)
1562	if err != nil {
1563		return nil, err
1564	}
1565
1566	switch m["type"] {
1567	case string(TypeMicrosoftStreamAnalyticsJavascriptUdf):
1568		var jsfb JavaScriptFunctionBinding
1569		err := json.Unmarshal(body, &jsfb)
1570		return jsfb, err
1571	case string(TypeMicrosoftMachineLearningWebService):
1572		var amlwsfb AzureMachineLearningWebServiceFunctionBinding
1573		err := json.Unmarshal(body, &amlwsfb)
1574		return amlwsfb, err
1575	default:
1576		var fb FunctionBinding
1577		err := json.Unmarshal(body, &fb)
1578		return fb, err
1579	}
1580}
1581func unmarshalBasicFunctionBindingArray(body []byte) ([]BasicFunctionBinding, error) {
1582	var rawMessages []*json.RawMessage
1583	err := json.Unmarshal(body, &rawMessages)
1584	if err != nil {
1585		return nil, err
1586	}
1587
1588	fbArray := make([]BasicFunctionBinding, len(rawMessages))
1589
1590	for index, rawMessage := range rawMessages {
1591		fb, err := unmarshalBasicFunctionBinding(*rawMessage)
1592		if err != nil {
1593			return nil, err
1594		}
1595		fbArray[index] = fb
1596	}
1597	return fbArray, nil
1598}
1599
1600// MarshalJSON is the custom marshaler for FunctionBinding.
1601func (fb FunctionBinding) MarshalJSON() ([]byte, error) {
1602	fb.Type = TypeFunctionBinding
1603	objectMap := make(map[string]interface{})
1604	if fb.Type != "" {
1605		objectMap["type"] = fb.Type
1606	}
1607	return json.Marshal(objectMap)
1608}
1609
1610// AsJavaScriptFunctionBinding is the BasicFunctionBinding implementation for FunctionBinding.
1611func (fb FunctionBinding) AsJavaScriptFunctionBinding() (*JavaScriptFunctionBinding, bool) {
1612	return nil, false
1613}
1614
1615// AsAzureMachineLearningWebServiceFunctionBinding is the BasicFunctionBinding implementation for FunctionBinding.
1616func (fb FunctionBinding) AsAzureMachineLearningWebServiceFunctionBinding() (*AzureMachineLearningWebServiceFunctionBinding, bool) {
1617	return nil, false
1618}
1619
1620// AsFunctionBinding is the BasicFunctionBinding implementation for FunctionBinding.
1621func (fb FunctionBinding) AsFunctionBinding() (*FunctionBinding, bool) {
1622	return &fb, true
1623}
1624
1625// AsBasicFunctionBinding is the BasicFunctionBinding implementation for FunctionBinding.
1626func (fb FunctionBinding) AsBasicFunctionBinding() (BasicFunctionBinding, bool) {
1627	return &fb, true
1628}
1629
1630// FunctionInput describes one input parameter of a function.
1631type FunctionInput struct {
1632	// DataType - The (Azure Stream Analytics supported) data type of the function input parameter. A list of valid Azure Stream Analytics data types are described at https://msdn.microsoft.com/en-us/library/azure/dn835065.aspx
1633	DataType *string `json:"dataType,omitempty"`
1634	// IsConfigurationParameter - A flag indicating if the parameter is a configuration parameter. True if this input parameter is expected to be a constant. Default is false.
1635	IsConfigurationParameter *bool `json:"isConfigurationParameter,omitempty"`
1636}
1637
1638// FunctionListResult object containing a list of functions under a streaming job.
1639type FunctionListResult struct {
1640	autorest.Response `json:"-"`
1641	// Value - READ-ONLY; A list of functions under a streaming job. Populated by a 'List' operation.
1642	Value *[]Function `json:"value,omitempty"`
1643	// NextLink - READ-ONLY; The link (url) to the next page of results.
1644	NextLink *string `json:"nextLink,omitempty"`
1645}
1646
1647// MarshalJSON is the custom marshaler for FunctionListResult.
1648func (flr FunctionListResult) MarshalJSON() ([]byte, error) {
1649	objectMap := make(map[string]interface{})
1650	return json.Marshal(objectMap)
1651}
1652
1653// FunctionListResultIterator provides access to a complete listing of Function values.
1654type FunctionListResultIterator struct {
1655	i    int
1656	page FunctionListResultPage
1657}
1658
1659// NextWithContext advances to the next value.  If there was an error making
1660// the request the iterator does not advance and the error is returned.
1661func (iter *FunctionListResultIterator) NextWithContext(ctx context.Context) (err error) {
1662	if tracing.IsEnabled() {
1663		ctx = tracing.StartSpan(ctx, fqdn+"/FunctionListResultIterator.NextWithContext")
1664		defer func() {
1665			sc := -1
1666			if iter.Response().Response.Response != nil {
1667				sc = iter.Response().Response.Response.StatusCode
1668			}
1669			tracing.EndSpan(ctx, sc, err)
1670		}()
1671	}
1672	iter.i++
1673	if iter.i < len(iter.page.Values()) {
1674		return nil
1675	}
1676	err = iter.page.NextWithContext(ctx)
1677	if err != nil {
1678		iter.i--
1679		return err
1680	}
1681	iter.i = 0
1682	return nil
1683}
1684
1685// Next advances to the next value.  If there was an error making
1686// the request the iterator does not advance and the error is returned.
1687// Deprecated: Use NextWithContext() instead.
1688func (iter *FunctionListResultIterator) Next() error {
1689	return iter.NextWithContext(context.Background())
1690}
1691
1692// NotDone returns true if the enumeration should be started or is not yet complete.
1693func (iter FunctionListResultIterator) NotDone() bool {
1694	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1695}
1696
1697// Response returns the raw server response from the last page request.
1698func (iter FunctionListResultIterator) Response() FunctionListResult {
1699	return iter.page.Response()
1700}
1701
1702// Value returns the current value or a zero-initialized value if the
1703// iterator has advanced beyond the end of the collection.
1704func (iter FunctionListResultIterator) Value() Function {
1705	if !iter.page.NotDone() {
1706		return Function{}
1707	}
1708	return iter.page.Values()[iter.i]
1709}
1710
1711// Creates a new instance of the FunctionListResultIterator type.
1712func NewFunctionListResultIterator(page FunctionListResultPage) FunctionListResultIterator {
1713	return FunctionListResultIterator{page: page}
1714}
1715
1716// IsEmpty returns true if the ListResult contains no values.
1717func (flr FunctionListResult) IsEmpty() bool {
1718	return flr.Value == nil || len(*flr.Value) == 0
1719}
1720
1721// hasNextLink returns true if the NextLink is not empty.
1722func (flr FunctionListResult) hasNextLink() bool {
1723	return flr.NextLink != nil && len(*flr.NextLink) != 0
1724}
1725
1726// functionListResultPreparer prepares a request to retrieve the next set of results.
1727// It returns nil if no more results exist.
1728func (flr FunctionListResult) functionListResultPreparer(ctx context.Context) (*http.Request, error) {
1729	if !flr.hasNextLink() {
1730		return nil, nil
1731	}
1732	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1733		autorest.AsJSON(),
1734		autorest.AsGet(),
1735		autorest.WithBaseURL(to.String(flr.NextLink)))
1736}
1737
1738// FunctionListResultPage contains a page of Function values.
1739type FunctionListResultPage struct {
1740	fn  func(context.Context, FunctionListResult) (FunctionListResult, error)
1741	flr FunctionListResult
1742}
1743
1744// NextWithContext advances to the next page of values.  If there was an error making
1745// the request the page does not advance and the error is returned.
1746func (page *FunctionListResultPage) NextWithContext(ctx context.Context) (err error) {
1747	if tracing.IsEnabled() {
1748		ctx = tracing.StartSpan(ctx, fqdn+"/FunctionListResultPage.NextWithContext")
1749		defer func() {
1750			sc := -1
1751			if page.Response().Response.Response != nil {
1752				sc = page.Response().Response.Response.StatusCode
1753			}
1754			tracing.EndSpan(ctx, sc, err)
1755		}()
1756	}
1757	for {
1758		next, err := page.fn(ctx, page.flr)
1759		if err != nil {
1760			return err
1761		}
1762		page.flr = next
1763		if !next.hasNextLink() || !next.IsEmpty() {
1764			break
1765		}
1766	}
1767	return nil
1768}
1769
1770// Next advances to the next page of values.  If there was an error making
1771// the request the page does not advance and the error is returned.
1772// Deprecated: Use NextWithContext() instead.
1773func (page *FunctionListResultPage) Next() error {
1774	return page.NextWithContext(context.Background())
1775}
1776
1777// NotDone returns true if the page enumeration should be started or is not yet complete.
1778func (page FunctionListResultPage) NotDone() bool {
1779	return !page.flr.IsEmpty()
1780}
1781
1782// Response returns the raw server response from the last page request.
1783func (page FunctionListResultPage) Response() FunctionListResult {
1784	return page.flr
1785}
1786
1787// Values returns the slice of values for the current page or nil if there are no values.
1788func (page FunctionListResultPage) Values() []Function {
1789	if page.flr.IsEmpty() {
1790		return nil
1791	}
1792	return *page.flr.Value
1793}
1794
1795// Creates a new instance of the FunctionListResultPage type.
1796func NewFunctionListResultPage(cur FunctionListResult, getNextPage func(context.Context, FunctionListResult) (FunctionListResult, error)) FunctionListResultPage {
1797	return FunctionListResultPage{
1798		fn:  getNextPage,
1799		flr: cur,
1800	}
1801}
1802
1803// FunctionOutput describes the output of a function.
1804type FunctionOutput struct {
1805	// DataType - The (Azure Stream Analytics supported) data type of the function output. A list of valid Azure Stream Analytics data types are described at https://msdn.microsoft.com/en-us/library/azure/dn835065.aspx
1806	DataType *string `json:"dataType,omitempty"`
1807}
1808
1809// BasicFunctionProperties the properties that are associated with a function.
1810type BasicFunctionProperties interface {
1811	AsScalarFunctionProperties() (*ScalarFunctionProperties, bool)
1812	AsFunctionProperties() (*FunctionProperties, bool)
1813}
1814
1815// FunctionProperties the properties that are associated with a function.
1816type FunctionProperties struct {
1817	// 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.
1818	Etag *string `json:"etag,omitempty"`
1819	// Type - Possible values include: 'TypeFunctionProperties', 'TypeScalar'
1820	Type TypeBasicFunctionProperties `json:"type,omitempty"`
1821}
1822
1823func unmarshalBasicFunctionProperties(body []byte) (BasicFunctionProperties, error) {
1824	var m map[string]interface{}
1825	err := json.Unmarshal(body, &m)
1826	if err != nil {
1827		return nil, err
1828	}
1829
1830	switch m["type"] {
1831	case string(TypeScalar):
1832		var sfp ScalarFunctionProperties
1833		err := json.Unmarshal(body, &sfp)
1834		return sfp, err
1835	default:
1836		var fp FunctionProperties
1837		err := json.Unmarshal(body, &fp)
1838		return fp, err
1839	}
1840}
1841func unmarshalBasicFunctionPropertiesArray(body []byte) ([]BasicFunctionProperties, error) {
1842	var rawMessages []*json.RawMessage
1843	err := json.Unmarshal(body, &rawMessages)
1844	if err != nil {
1845		return nil, err
1846	}
1847
1848	fpArray := make([]BasicFunctionProperties, len(rawMessages))
1849
1850	for index, rawMessage := range rawMessages {
1851		fp, err := unmarshalBasicFunctionProperties(*rawMessage)
1852		if err != nil {
1853			return nil, err
1854		}
1855		fpArray[index] = fp
1856	}
1857	return fpArray, nil
1858}
1859
1860// MarshalJSON is the custom marshaler for FunctionProperties.
1861func (fp FunctionProperties) MarshalJSON() ([]byte, error) {
1862	fp.Type = TypeFunctionProperties
1863	objectMap := make(map[string]interface{})
1864	if fp.Type != "" {
1865		objectMap["type"] = fp.Type
1866	}
1867	return json.Marshal(objectMap)
1868}
1869
1870// AsScalarFunctionProperties is the BasicFunctionProperties implementation for FunctionProperties.
1871func (fp FunctionProperties) AsScalarFunctionProperties() (*ScalarFunctionProperties, bool) {
1872	return nil, false
1873}
1874
1875// AsFunctionProperties is the BasicFunctionProperties implementation for FunctionProperties.
1876func (fp FunctionProperties) AsFunctionProperties() (*FunctionProperties, bool) {
1877	return &fp, true
1878}
1879
1880// AsBasicFunctionProperties is the BasicFunctionProperties implementation for FunctionProperties.
1881func (fp FunctionProperties) AsBasicFunctionProperties() (BasicFunctionProperties, bool) {
1882	return &fp, true
1883}
1884
1885// BasicFunctionRetrieveDefaultDefinitionParameters parameters used to specify the type of function to retrieve the
1886// default definition for.
1887type BasicFunctionRetrieveDefaultDefinitionParameters interface {
1888	AsAzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters() (*AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters, bool)
1889	AsJavaScriptFunctionRetrieveDefaultDefinitionParameters() (*JavaScriptFunctionRetrieveDefaultDefinitionParameters, bool)
1890	AsFunctionRetrieveDefaultDefinitionParameters() (*FunctionRetrieveDefaultDefinitionParameters, bool)
1891}
1892
1893// FunctionRetrieveDefaultDefinitionParameters parameters used to specify the type of function to retrieve the
1894// default definition for.
1895type FunctionRetrieveDefaultDefinitionParameters struct {
1896	// BindingType - Possible values include: 'BindingTypeFunctionRetrieveDefaultDefinitionParameters', 'BindingTypeMicrosoftMachineLearningWebService', 'BindingTypeMicrosoftStreamAnalyticsJavascriptUdf'
1897	BindingType BindingType `json:"bindingType,omitempty"`
1898}
1899
1900func unmarshalBasicFunctionRetrieveDefaultDefinitionParameters(body []byte) (BasicFunctionRetrieveDefaultDefinitionParameters, error) {
1901	var m map[string]interface{}
1902	err := json.Unmarshal(body, &m)
1903	if err != nil {
1904		return nil, err
1905	}
1906
1907	switch m["bindingType"] {
1908	case string(BindingTypeMicrosoftMachineLearningWebService):
1909		var amlwsfrddp AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters
1910		err := json.Unmarshal(body, &amlwsfrddp)
1911		return amlwsfrddp, err
1912	case string(BindingTypeMicrosoftStreamAnalyticsJavascriptUdf):
1913		var jsfrddp JavaScriptFunctionRetrieveDefaultDefinitionParameters
1914		err := json.Unmarshal(body, &jsfrddp)
1915		return jsfrddp, err
1916	default:
1917		var frddp FunctionRetrieveDefaultDefinitionParameters
1918		err := json.Unmarshal(body, &frddp)
1919		return frddp, err
1920	}
1921}
1922func unmarshalBasicFunctionRetrieveDefaultDefinitionParametersArray(body []byte) ([]BasicFunctionRetrieveDefaultDefinitionParameters, error) {
1923	var rawMessages []*json.RawMessage
1924	err := json.Unmarshal(body, &rawMessages)
1925	if err != nil {
1926		return nil, err
1927	}
1928
1929	frddpArray := make([]BasicFunctionRetrieveDefaultDefinitionParameters, len(rawMessages))
1930
1931	for index, rawMessage := range rawMessages {
1932		frddp, err := unmarshalBasicFunctionRetrieveDefaultDefinitionParameters(*rawMessage)
1933		if err != nil {
1934			return nil, err
1935		}
1936		frddpArray[index] = frddp
1937	}
1938	return frddpArray, nil
1939}
1940
1941// MarshalJSON is the custom marshaler for FunctionRetrieveDefaultDefinitionParameters.
1942func (frddp FunctionRetrieveDefaultDefinitionParameters) MarshalJSON() ([]byte, error) {
1943	frddp.BindingType = BindingTypeFunctionRetrieveDefaultDefinitionParameters
1944	objectMap := make(map[string]interface{})
1945	if frddp.BindingType != "" {
1946		objectMap["bindingType"] = frddp.BindingType
1947	}
1948	return json.Marshal(objectMap)
1949}
1950
1951// AsAzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters is the BasicFunctionRetrieveDefaultDefinitionParameters implementation for FunctionRetrieveDefaultDefinitionParameters.
1952func (frddp FunctionRetrieveDefaultDefinitionParameters) AsAzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters() (*AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters, bool) {
1953	return nil, false
1954}
1955
1956// AsJavaScriptFunctionRetrieveDefaultDefinitionParameters is the BasicFunctionRetrieveDefaultDefinitionParameters implementation for FunctionRetrieveDefaultDefinitionParameters.
1957func (frddp FunctionRetrieveDefaultDefinitionParameters) AsJavaScriptFunctionRetrieveDefaultDefinitionParameters() (*JavaScriptFunctionRetrieveDefaultDefinitionParameters, bool) {
1958	return nil, false
1959}
1960
1961// AsFunctionRetrieveDefaultDefinitionParameters is the BasicFunctionRetrieveDefaultDefinitionParameters implementation for FunctionRetrieveDefaultDefinitionParameters.
1962func (frddp FunctionRetrieveDefaultDefinitionParameters) AsFunctionRetrieveDefaultDefinitionParameters() (*FunctionRetrieveDefaultDefinitionParameters, bool) {
1963	return &frddp, true
1964}
1965
1966// AsBasicFunctionRetrieveDefaultDefinitionParameters is the BasicFunctionRetrieveDefaultDefinitionParameters implementation for FunctionRetrieveDefaultDefinitionParameters.
1967func (frddp FunctionRetrieveDefaultDefinitionParameters) AsBasicFunctionRetrieveDefaultDefinitionParameters() (BasicFunctionRetrieveDefaultDefinitionParameters, bool) {
1968	return &frddp, true
1969}
1970
1971// FunctionsTestFuture an abstraction for monitoring and retrieving the results of a long-running
1972// operation.
1973type FunctionsTestFuture struct {
1974	azure.FutureAPI
1975	// Result returns the result of the asynchronous operation.
1976	// If the operation has not completed it will return an error.
1977	Result func(FunctionsClient) (ResourceTestStatus, error)
1978}
1979
1980// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1981func (future *FunctionsTestFuture) UnmarshalJSON(body []byte) error {
1982	var azFuture azure.Future
1983	if err := json.Unmarshal(body, &azFuture); err != nil {
1984		return err
1985	}
1986	future.FutureAPI = &azFuture
1987	future.Result = future.result
1988	return nil
1989}
1990
1991// result is the default implementation for FunctionsTestFuture.Result.
1992func (future *FunctionsTestFuture) result(client FunctionsClient) (rts ResourceTestStatus, err error) {
1993	var done bool
1994	done, err = future.DoneWithContext(context.Background(), client)
1995	if err != nil {
1996		err = autorest.NewErrorWithError(err, "streamanalytics.FunctionsTestFuture", "Result", future.Response(), "Polling failure")
1997		return
1998	}
1999	if !done {
2000		rts.Response.Response = future.Response()
2001		err = azure.NewAsyncOpIncompleteError("streamanalytics.FunctionsTestFuture")
2002		return
2003	}
2004	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2005	if rts.Response.Response, err = future.GetResult(sender); err == nil && rts.Response.Response.StatusCode != http.StatusNoContent {
2006		rts, err = client.TestResponder(rts.Response.Response)
2007		if err != nil {
2008			err = autorest.NewErrorWithError(err, "streamanalytics.FunctionsTestFuture", "Result", rts.Response.Response, "Failure responding to request")
2009		}
2010	}
2011	return
2012}
2013
2014// Input an input object, containing all information associated with the named input. All inputs are
2015// contained under a streaming job.
2016type Input struct {
2017	autorest.Response `json:"-"`
2018	// Properties - The properties that are associated with an input. Required on PUT (CreateOrReplace) requests.
2019	Properties BasicInputProperties `json:"properties,omitempty"`
2020	// ID - READ-ONLY; Resource Id
2021	ID *string `json:"id,omitempty"`
2022	// Name - Resource name
2023	Name *string `json:"name,omitempty"`
2024	// Type - READ-ONLY; Resource type
2025	Type *string `json:"type,omitempty"`
2026}
2027
2028// MarshalJSON is the custom marshaler for Input.
2029func (i Input) MarshalJSON() ([]byte, error) {
2030	objectMap := make(map[string]interface{})
2031	objectMap["properties"] = i.Properties
2032	if i.Name != nil {
2033		objectMap["name"] = i.Name
2034	}
2035	return json.Marshal(objectMap)
2036}
2037
2038// UnmarshalJSON is the custom unmarshaler for Input struct.
2039func (i *Input) UnmarshalJSON(body []byte) error {
2040	var m map[string]*json.RawMessage
2041	err := json.Unmarshal(body, &m)
2042	if err != nil {
2043		return err
2044	}
2045	for k, v := range m {
2046		switch k {
2047		case "properties":
2048			if v != nil {
2049				properties, err := unmarshalBasicInputProperties(*v)
2050				if err != nil {
2051					return err
2052				}
2053				i.Properties = properties
2054			}
2055		case "id":
2056			if v != nil {
2057				var ID string
2058				err = json.Unmarshal(*v, &ID)
2059				if err != nil {
2060					return err
2061				}
2062				i.ID = &ID
2063			}
2064		case "name":
2065			if v != nil {
2066				var name string
2067				err = json.Unmarshal(*v, &name)
2068				if err != nil {
2069					return err
2070				}
2071				i.Name = &name
2072			}
2073		case "type":
2074			if v != nil {
2075				var typeVar string
2076				err = json.Unmarshal(*v, &typeVar)
2077				if err != nil {
2078					return err
2079				}
2080				i.Type = &typeVar
2081			}
2082		}
2083	}
2084
2085	return nil
2086}
2087
2088// InputListResult object containing a list of inputs under a streaming job.
2089type InputListResult struct {
2090	autorest.Response `json:"-"`
2091	// Value - READ-ONLY; A list of inputs under a streaming job. Populated by a 'List' operation.
2092	Value *[]Input `json:"value,omitempty"`
2093	// NextLink - READ-ONLY; The link (url) to the next page of results.
2094	NextLink *string `json:"nextLink,omitempty"`
2095}
2096
2097// MarshalJSON is the custom marshaler for InputListResult.
2098func (ilr InputListResult) MarshalJSON() ([]byte, error) {
2099	objectMap := make(map[string]interface{})
2100	return json.Marshal(objectMap)
2101}
2102
2103// InputListResultIterator provides access to a complete listing of Input values.
2104type InputListResultIterator struct {
2105	i    int
2106	page InputListResultPage
2107}
2108
2109// NextWithContext advances to the next value.  If there was an error making
2110// the request the iterator does not advance and the error is returned.
2111func (iter *InputListResultIterator) NextWithContext(ctx context.Context) (err error) {
2112	if tracing.IsEnabled() {
2113		ctx = tracing.StartSpan(ctx, fqdn+"/InputListResultIterator.NextWithContext")
2114		defer func() {
2115			sc := -1
2116			if iter.Response().Response.Response != nil {
2117				sc = iter.Response().Response.Response.StatusCode
2118			}
2119			tracing.EndSpan(ctx, sc, err)
2120		}()
2121	}
2122	iter.i++
2123	if iter.i < len(iter.page.Values()) {
2124		return nil
2125	}
2126	err = iter.page.NextWithContext(ctx)
2127	if err != nil {
2128		iter.i--
2129		return err
2130	}
2131	iter.i = 0
2132	return nil
2133}
2134
2135// Next advances to the next value.  If there was an error making
2136// the request the iterator does not advance and the error is returned.
2137// Deprecated: Use NextWithContext() instead.
2138func (iter *InputListResultIterator) Next() error {
2139	return iter.NextWithContext(context.Background())
2140}
2141
2142// NotDone returns true if the enumeration should be started or is not yet complete.
2143func (iter InputListResultIterator) NotDone() bool {
2144	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2145}
2146
2147// Response returns the raw server response from the last page request.
2148func (iter InputListResultIterator) Response() InputListResult {
2149	return iter.page.Response()
2150}
2151
2152// Value returns the current value or a zero-initialized value if the
2153// iterator has advanced beyond the end of the collection.
2154func (iter InputListResultIterator) Value() Input {
2155	if !iter.page.NotDone() {
2156		return Input{}
2157	}
2158	return iter.page.Values()[iter.i]
2159}
2160
2161// Creates a new instance of the InputListResultIterator type.
2162func NewInputListResultIterator(page InputListResultPage) InputListResultIterator {
2163	return InputListResultIterator{page: page}
2164}
2165
2166// IsEmpty returns true if the ListResult contains no values.
2167func (ilr InputListResult) IsEmpty() bool {
2168	return ilr.Value == nil || len(*ilr.Value) == 0
2169}
2170
2171// hasNextLink returns true if the NextLink is not empty.
2172func (ilr InputListResult) hasNextLink() bool {
2173	return ilr.NextLink != nil && len(*ilr.NextLink) != 0
2174}
2175
2176// inputListResultPreparer prepares a request to retrieve the next set of results.
2177// It returns nil if no more results exist.
2178func (ilr InputListResult) inputListResultPreparer(ctx context.Context) (*http.Request, error) {
2179	if !ilr.hasNextLink() {
2180		return nil, nil
2181	}
2182	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2183		autorest.AsJSON(),
2184		autorest.AsGet(),
2185		autorest.WithBaseURL(to.String(ilr.NextLink)))
2186}
2187
2188// InputListResultPage contains a page of Input values.
2189type InputListResultPage struct {
2190	fn  func(context.Context, InputListResult) (InputListResult, error)
2191	ilr InputListResult
2192}
2193
2194// NextWithContext advances to the next page of values.  If there was an error making
2195// the request the page does not advance and the error is returned.
2196func (page *InputListResultPage) NextWithContext(ctx context.Context) (err error) {
2197	if tracing.IsEnabled() {
2198		ctx = tracing.StartSpan(ctx, fqdn+"/InputListResultPage.NextWithContext")
2199		defer func() {
2200			sc := -1
2201			if page.Response().Response.Response != nil {
2202				sc = page.Response().Response.Response.StatusCode
2203			}
2204			tracing.EndSpan(ctx, sc, err)
2205		}()
2206	}
2207	for {
2208		next, err := page.fn(ctx, page.ilr)
2209		if err != nil {
2210			return err
2211		}
2212		page.ilr = next
2213		if !next.hasNextLink() || !next.IsEmpty() {
2214			break
2215		}
2216	}
2217	return nil
2218}
2219
2220// Next advances to the next page of values.  If there was an error making
2221// the request the page does not advance and the error is returned.
2222// Deprecated: Use NextWithContext() instead.
2223func (page *InputListResultPage) Next() error {
2224	return page.NextWithContext(context.Background())
2225}
2226
2227// NotDone returns true if the page enumeration should be started or is not yet complete.
2228func (page InputListResultPage) NotDone() bool {
2229	return !page.ilr.IsEmpty()
2230}
2231
2232// Response returns the raw server response from the last page request.
2233func (page InputListResultPage) Response() InputListResult {
2234	return page.ilr
2235}
2236
2237// Values returns the slice of values for the current page or nil if there are no values.
2238func (page InputListResultPage) Values() []Input {
2239	if page.ilr.IsEmpty() {
2240		return nil
2241	}
2242	return *page.ilr.Value
2243}
2244
2245// Creates a new instance of the InputListResultPage type.
2246func NewInputListResultPage(cur InputListResult, getNextPage func(context.Context, InputListResult) (InputListResult, error)) InputListResultPage {
2247	return InputListResultPage{
2248		fn:  getNextPage,
2249		ilr: cur,
2250	}
2251}
2252
2253// BasicInputProperties the properties that are associated with an input.
2254type BasicInputProperties interface {
2255	AsReferenceInputProperties() (*ReferenceInputProperties, bool)
2256	AsStreamInputProperties() (*StreamInputProperties, bool)
2257	AsInputProperties() (*InputProperties, bool)
2258}
2259
2260// InputProperties the properties that are associated with an input.
2261type InputProperties struct {
2262	// Serialization - Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests.
2263	Serialization BasicSerialization `json:"serialization,omitempty"`
2264	// Diagnostics - READ-ONLY; Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention.
2265	Diagnostics *Diagnostics `json:"diagnostics,omitempty"`
2266	// Etag - READ-ONLY; The current entity tag for the input. 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.
2267	Etag *string `json:"etag,omitempty"`
2268	// Type - Possible values include: 'TypeInputProperties', 'TypeReference', 'TypeStream'
2269	Type TypeBasicInputProperties `json:"type,omitempty"`
2270}
2271
2272func unmarshalBasicInputProperties(body []byte) (BasicInputProperties, error) {
2273	var m map[string]interface{}
2274	err := json.Unmarshal(body, &m)
2275	if err != nil {
2276		return nil, err
2277	}
2278
2279	switch m["type"] {
2280	case string(TypeReference):
2281		var rip ReferenceInputProperties
2282		err := json.Unmarshal(body, &rip)
2283		return rip, err
2284	case string(TypeStream):
2285		var sip StreamInputProperties
2286		err := json.Unmarshal(body, &sip)
2287		return sip, err
2288	default:
2289		var IP InputProperties
2290		err := json.Unmarshal(body, &IP)
2291		return IP, err
2292	}
2293}
2294func unmarshalBasicInputPropertiesArray(body []byte) ([]BasicInputProperties, error) {
2295	var rawMessages []*json.RawMessage
2296	err := json.Unmarshal(body, &rawMessages)
2297	if err != nil {
2298		return nil, err
2299	}
2300
2301	IPArray := make([]BasicInputProperties, len(rawMessages))
2302
2303	for index, rawMessage := range rawMessages {
2304		IP, err := unmarshalBasicInputProperties(*rawMessage)
2305		if err != nil {
2306			return nil, err
2307		}
2308		IPArray[index] = IP
2309	}
2310	return IPArray, nil
2311}
2312
2313// MarshalJSON is the custom marshaler for InputProperties.
2314func (IP InputProperties) MarshalJSON() ([]byte, error) {
2315	IP.Type = TypeInputProperties
2316	objectMap := make(map[string]interface{})
2317	objectMap["serialization"] = IP.Serialization
2318	if IP.Type != "" {
2319		objectMap["type"] = IP.Type
2320	}
2321	return json.Marshal(objectMap)
2322}
2323
2324// AsReferenceInputProperties is the BasicInputProperties implementation for InputProperties.
2325func (IP InputProperties) AsReferenceInputProperties() (*ReferenceInputProperties, bool) {
2326	return nil, false
2327}
2328
2329// AsStreamInputProperties is the BasicInputProperties implementation for InputProperties.
2330func (IP InputProperties) AsStreamInputProperties() (*StreamInputProperties, bool) {
2331	return nil, false
2332}
2333
2334// AsInputProperties is the BasicInputProperties implementation for InputProperties.
2335func (IP InputProperties) AsInputProperties() (*InputProperties, bool) {
2336	return &IP, true
2337}
2338
2339// AsBasicInputProperties is the BasicInputProperties implementation for InputProperties.
2340func (IP InputProperties) AsBasicInputProperties() (BasicInputProperties, bool) {
2341	return &IP, true
2342}
2343
2344// UnmarshalJSON is the custom unmarshaler for InputProperties struct.
2345func (IP *InputProperties) UnmarshalJSON(body []byte) error {
2346	var m map[string]*json.RawMessage
2347	err := json.Unmarshal(body, &m)
2348	if err != nil {
2349		return err
2350	}
2351	for k, v := range m {
2352		switch k {
2353		case "serialization":
2354			if v != nil {
2355				serialization, err := unmarshalBasicSerialization(*v)
2356				if err != nil {
2357					return err
2358				}
2359				IP.Serialization = serialization
2360			}
2361		case "diagnostics":
2362			if v != nil {
2363				var diagnostics Diagnostics
2364				err = json.Unmarshal(*v, &diagnostics)
2365				if err != nil {
2366					return err
2367				}
2368				IP.Diagnostics = &diagnostics
2369			}
2370		case "etag":
2371			if v != nil {
2372				var etag string
2373				err = json.Unmarshal(*v, &etag)
2374				if err != nil {
2375					return err
2376				}
2377				IP.Etag = &etag
2378			}
2379		case "type":
2380			if v != nil {
2381				var typeVar TypeBasicInputProperties
2382				err = json.Unmarshal(*v, &typeVar)
2383				if err != nil {
2384					return err
2385				}
2386				IP.Type = typeVar
2387			}
2388		}
2389	}
2390
2391	return nil
2392}
2393
2394// InputsTestFuture an abstraction for monitoring and retrieving the results of a long-running operation.
2395type InputsTestFuture struct {
2396	azure.FutureAPI
2397	// Result returns the result of the asynchronous operation.
2398	// If the operation has not completed it will return an error.
2399	Result func(InputsClient) (ResourceTestStatus, error)
2400}
2401
2402// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2403func (future *InputsTestFuture) UnmarshalJSON(body []byte) error {
2404	var azFuture azure.Future
2405	if err := json.Unmarshal(body, &azFuture); err != nil {
2406		return err
2407	}
2408	future.FutureAPI = &azFuture
2409	future.Result = future.result
2410	return nil
2411}
2412
2413// result is the default implementation for InputsTestFuture.Result.
2414func (future *InputsTestFuture) result(client InputsClient) (rts ResourceTestStatus, err error) {
2415	var done bool
2416	done, err = future.DoneWithContext(context.Background(), client)
2417	if err != nil {
2418		err = autorest.NewErrorWithError(err, "streamanalytics.InputsTestFuture", "Result", future.Response(), "Polling failure")
2419		return
2420	}
2421	if !done {
2422		rts.Response.Response = future.Response()
2423		err = azure.NewAsyncOpIncompleteError("streamanalytics.InputsTestFuture")
2424		return
2425	}
2426	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2427	if rts.Response.Response, err = future.GetResult(sender); err == nil && rts.Response.Response.StatusCode != http.StatusNoContent {
2428		rts, err = client.TestResponder(rts.Response.Response)
2429		if err != nil {
2430			err = autorest.NewErrorWithError(err, "streamanalytics.InputsTestFuture", "Result", rts.Response.Response, "Failure responding to request")
2431		}
2432	}
2433	return
2434}
2435
2436// IoTHubStreamInputDataSource describes an IoT Hub input data source that contains stream data.
2437type IoTHubStreamInputDataSource struct {
2438	// IoTHubStreamInputDataSourceProperties - The properties that are associated with an IoT Hub input containing stream data. Required on PUT (CreateOrReplace) requests.
2439	*IoTHubStreamInputDataSourceProperties `json:"properties,omitempty"`
2440	// Type - Possible values include: 'TypeBasicStreamInputDataSourceTypeStreamInputDataSource', 'TypeBasicStreamInputDataSourceTypeMicrosoftDevicesIotHubs', 'TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob'
2441	Type TypeBasicStreamInputDataSource `json:"type,omitempty"`
2442}
2443
2444// MarshalJSON is the custom marshaler for IoTHubStreamInputDataSource.
2445func (ithsids IoTHubStreamInputDataSource) MarshalJSON() ([]byte, error) {
2446	ithsids.Type = TypeBasicStreamInputDataSourceTypeMicrosoftDevicesIotHubs
2447	objectMap := make(map[string]interface{})
2448	if ithsids.IoTHubStreamInputDataSourceProperties != nil {
2449		objectMap["properties"] = ithsids.IoTHubStreamInputDataSourceProperties
2450	}
2451	if ithsids.Type != "" {
2452		objectMap["type"] = ithsids.Type
2453	}
2454	return json.Marshal(objectMap)
2455}
2456
2457// AsIoTHubStreamInputDataSource is the BasicStreamInputDataSource implementation for IoTHubStreamInputDataSource.
2458func (ithsids IoTHubStreamInputDataSource) AsIoTHubStreamInputDataSource() (*IoTHubStreamInputDataSource, bool) {
2459	return &ithsids, true
2460}
2461
2462// AsEventHubStreamInputDataSource is the BasicStreamInputDataSource implementation for IoTHubStreamInputDataSource.
2463func (ithsids IoTHubStreamInputDataSource) AsEventHubStreamInputDataSource() (*EventHubStreamInputDataSource, bool) {
2464	return nil, false
2465}
2466
2467// AsBlobStreamInputDataSource is the BasicStreamInputDataSource implementation for IoTHubStreamInputDataSource.
2468func (ithsids IoTHubStreamInputDataSource) AsBlobStreamInputDataSource() (*BlobStreamInputDataSource, bool) {
2469	return nil, false
2470}
2471
2472// AsStreamInputDataSource is the BasicStreamInputDataSource implementation for IoTHubStreamInputDataSource.
2473func (ithsids IoTHubStreamInputDataSource) AsStreamInputDataSource() (*StreamInputDataSource, bool) {
2474	return nil, false
2475}
2476
2477// AsBasicStreamInputDataSource is the BasicStreamInputDataSource implementation for IoTHubStreamInputDataSource.
2478func (ithsids IoTHubStreamInputDataSource) AsBasicStreamInputDataSource() (BasicStreamInputDataSource, bool) {
2479	return &ithsids, true
2480}
2481
2482// UnmarshalJSON is the custom unmarshaler for IoTHubStreamInputDataSource struct.
2483func (ithsids *IoTHubStreamInputDataSource) UnmarshalJSON(body []byte) error {
2484	var m map[string]*json.RawMessage
2485	err := json.Unmarshal(body, &m)
2486	if err != nil {
2487		return err
2488	}
2489	for k, v := range m {
2490		switch k {
2491		case "properties":
2492			if v != nil {
2493				var ioTHubStreamInputDataSourceProperties IoTHubStreamInputDataSourceProperties
2494				err = json.Unmarshal(*v, &ioTHubStreamInputDataSourceProperties)
2495				if err != nil {
2496					return err
2497				}
2498				ithsids.IoTHubStreamInputDataSourceProperties = &ioTHubStreamInputDataSourceProperties
2499			}
2500		case "type":
2501			if v != nil {
2502				var typeVar TypeBasicStreamInputDataSource
2503				err = json.Unmarshal(*v, &typeVar)
2504				if err != nil {
2505					return err
2506				}
2507				ithsids.Type = typeVar
2508			}
2509		}
2510	}
2511
2512	return nil
2513}
2514
2515// IoTHubStreamInputDataSourceProperties the properties that are associated with a IoT Hub input containing
2516// stream data.
2517type IoTHubStreamInputDataSourceProperties struct {
2518	// IotHubNamespace - The name or the URI of the IoT Hub. Required on PUT (CreateOrReplace) requests.
2519	IotHubNamespace *string `json:"iotHubNamespace,omitempty"`
2520	// SharedAccessPolicyName - The shared access policy name for the IoT Hub. This policy must contain at least the Service connect permission. Required on PUT (CreateOrReplace) requests.
2521	SharedAccessPolicyName *string `json:"sharedAccessPolicyName,omitempty"`
2522	// SharedAccessPolicyKey - The shared access policy key for the specified shared access policy. Required on PUT (CreateOrReplace) requests.
2523	SharedAccessPolicyKey *string `json:"sharedAccessPolicyKey,omitempty"`
2524	// ConsumerGroupName - The name of an IoT Hub Consumer Group that should be used to read events from the IoT Hub. If not specified, the input uses the Iot Hub’s default consumer group.
2525	ConsumerGroupName *string `json:"consumerGroupName,omitempty"`
2526	// Endpoint - The IoT Hub endpoint to connect to (ie. messages/events, messages/operationsMonitoringEvents, etc.).
2527	Endpoint *string `json:"endpoint,omitempty"`
2528}
2529
2530// JavaScriptFunctionBinding the binding to a JavaScript function.
2531type JavaScriptFunctionBinding struct {
2532	// JavaScriptFunctionBindingProperties - The binding properties associated with a JavaScript function.
2533	*JavaScriptFunctionBindingProperties `json:"properties,omitempty"`
2534	// Type - Possible values include: 'TypeFunctionBinding', 'TypeMicrosoftStreamAnalyticsJavascriptUdf', 'TypeMicrosoftMachineLearningWebService'
2535	Type TypeBasicFunctionBinding `json:"type,omitempty"`
2536}
2537
2538// MarshalJSON is the custom marshaler for JavaScriptFunctionBinding.
2539func (jsfb JavaScriptFunctionBinding) MarshalJSON() ([]byte, error) {
2540	jsfb.Type = TypeMicrosoftStreamAnalyticsJavascriptUdf
2541	objectMap := make(map[string]interface{})
2542	if jsfb.JavaScriptFunctionBindingProperties != nil {
2543		objectMap["properties"] = jsfb.JavaScriptFunctionBindingProperties
2544	}
2545	if jsfb.Type != "" {
2546		objectMap["type"] = jsfb.Type
2547	}
2548	return json.Marshal(objectMap)
2549}
2550
2551// AsJavaScriptFunctionBinding is the BasicFunctionBinding implementation for JavaScriptFunctionBinding.
2552func (jsfb JavaScriptFunctionBinding) AsJavaScriptFunctionBinding() (*JavaScriptFunctionBinding, bool) {
2553	return &jsfb, true
2554}
2555
2556// AsAzureMachineLearningWebServiceFunctionBinding is the BasicFunctionBinding implementation for JavaScriptFunctionBinding.
2557func (jsfb JavaScriptFunctionBinding) AsAzureMachineLearningWebServiceFunctionBinding() (*AzureMachineLearningWebServiceFunctionBinding, bool) {
2558	return nil, false
2559}
2560
2561// AsFunctionBinding is the BasicFunctionBinding implementation for JavaScriptFunctionBinding.
2562func (jsfb JavaScriptFunctionBinding) AsFunctionBinding() (*FunctionBinding, bool) {
2563	return nil, false
2564}
2565
2566// AsBasicFunctionBinding is the BasicFunctionBinding implementation for JavaScriptFunctionBinding.
2567func (jsfb JavaScriptFunctionBinding) AsBasicFunctionBinding() (BasicFunctionBinding, bool) {
2568	return &jsfb, true
2569}
2570
2571// UnmarshalJSON is the custom unmarshaler for JavaScriptFunctionBinding struct.
2572func (jsfb *JavaScriptFunctionBinding) UnmarshalJSON(body []byte) error {
2573	var m map[string]*json.RawMessage
2574	err := json.Unmarshal(body, &m)
2575	if err != nil {
2576		return err
2577	}
2578	for k, v := range m {
2579		switch k {
2580		case "properties":
2581			if v != nil {
2582				var javaScriptFunctionBindingProperties JavaScriptFunctionBindingProperties
2583				err = json.Unmarshal(*v, &javaScriptFunctionBindingProperties)
2584				if err != nil {
2585					return err
2586				}
2587				jsfb.JavaScriptFunctionBindingProperties = &javaScriptFunctionBindingProperties
2588			}
2589		case "type":
2590			if v != nil {
2591				var typeVar TypeBasicFunctionBinding
2592				err = json.Unmarshal(*v, &typeVar)
2593				if err != nil {
2594					return err
2595				}
2596				jsfb.Type = typeVar
2597			}
2598		}
2599	}
2600
2601	return nil
2602}
2603
2604// JavaScriptFunctionBindingProperties the binding properties associated with a JavaScript function.
2605type JavaScriptFunctionBindingProperties struct {
2606	// Script - The JavaScript code containing a single function definition. For example: 'function (x, y) { return x + y; }'
2607	Script *string `json:"script,omitempty"`
2608}
2609
2610// JavaScriptFunctionBindingRetrievalProperties the binding retrieval properties associated with a
2611// JavaScript function.
2612type JavaScriptFunctionBindingRetrievalProperties struct {
2613	// Script - The JavaScript code containing a single function definition. For example: 'function (x, y) { return x + y; }'.
2614	Script *string `json:"script,omitempty"`
2615	// UdfType - The function type. Possible values include: 'Scalar'
2616	UdfType UdfType `json:"udfType,omitempty"`
2617}
2618
2619// JavaScriptFunctionRetrieveDefaultDefinitionParameters the parameters needed to retrieve the default
2620// function definition for a JavaScript function.
2621type JavaScriptFunctionRetrieveDefaultDefinitionParameters struct {
2622	// JavaScriptFunctionBindingRetrievalProperties - The binding retrieval properties associated with a JavaScript function.
2623	*JavaScriptFunctionBindingRetrievalProperties `json:"bindingRetrievalProperties,omitempty"`
2624	// BindingType - Possible values include: 'BindingTypeFunctionRetrieveDefaultDefinitionParameters', 'BindingTypeMicrosoftMachineLearningWebService', 'BindingTypeMicrosoftStreamAnalyticsJavascriptUdf'
2625	BindingType BindingType `json:"bindingType,omitempty"`
2626}
2627
2628// MarshalJSON is the custom marshaler for JavaScriptFunctionRetrieveDefaultDefinitionParameters.
2629func (jsfrddp JavaScriptFunctionRetrieveDefaultDefinitionParameters) MarshalJSON() ([]byte, error) {
2630	jsfrddp.BindingType = BindingTypeMicrosoftStreamAnalyticsJavascriptUdf
2631	objectMap := make(map[string]interface{})
2632	if jsfrddp.JavaScriptFunctionBindingRetrievalProperties != nil {
2633		objectMap["bindingRetrievalProperties"] = jsfrddp.JavaScriptFunctionBindingRetrievalProperties
2634	}
2635	if jsfrddp.BindingType != "" {
2636		objectMap["bindingType"] = jsfrddp.BindingType
2637	}
2638	return json.Marshal(objectMap)
2639}
2640
2641// AsAzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters is the BasicFunctionRetrieveDefaultDefinitionParameters implementation for JavaScriptFunctionRetrieveDefaultDefinitionParameters.
2642func (jsfrddp JavaScriptFunctionRetrieveDefaultDefinitionParameters) AsAzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters() (*AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters, bool) {
2643	return nil, false
2644}
2645
2646// AsJavaScriptFunctionRetrieveDefaultDefinitionParameters is the BasicFunctionRetrieveDefaultDefinitionParameters implementation for JavaScriptFunctionRetrieveDefaultDefinitionParameters.
2647func (jsfrddp JavaScriptFunctionRetrieveDefaultDefinitionParameters) AsJavaScriptFunctionRetrieveDefaultDefinitionParameters() (*JavaScriptFunctionRetrieveDefaultDefinitionParameters, bool) {
2648	return &jsfrddp, true
2649}
2650
2651// AsFunctionRetrieveDefaultDefinitionParameters is the BasicFunctionRetrieveDefaultDefinitionParameters implementation for JavaScriptFunctionRetrieveDefaultDefinitionParameters.
2652func (jsfrddp JavaScriptFunctionRetrieveDefaultDefinitionParameters) AsFunctionRetrieveDefaultDefinitionParameters() (*FunctionRetrieveDefaultDefinitionParameters, bool) {
2653	return nil, false
2654}
2655
2656// AsBasicFunctionRetrieveDefaultDefinitionParameters is the BasicFunctionRetrieveDefaultDefinitionParameters implementation for JavaScriptFunctionRetrieveDefaultDefinitionParameters.
2657func (jsfrddp JavaScriptFunctionRetrieveDefaultDefinitionParameters) AsBasicFunctionRetrieveDefaultDefinitionParameters() (BasicFunctionRetrieveDefaultDefinitionParameters, bool) {
2658	return &jsfrddp, true
2659}
2660
2661// UnmarshalJSON is the custom unmarshaler for JavaScriptFunctionRetrieveDefaultDefinitionParameters struct.
2662func (jsfrddp *JavaScriptFunctionRetrieveDefaultDefinitionParameters) UnmarshalJSON(body []byte) error {
2663	var m map[string]*json.RawMessage
2664	err := json.Unmarshal(body, &m)
2665	if err != nil {
2666		return err
2667	}
2668	for k, v := range m {
2669		switch k {
2670		case "bindingRetrievalProperties":
2671			if v != nil {
2672				var javaScriptFunctionBindingRetrievalProperties JavaScriptFunctionBindingRetrievalProperties
2673				err = json.Unmarshal(*v, &javaScriptFunctionBindingRetrievalProperties)
2674				if err != nil {
2675					return err
2676				}
2677				jsfrddp.JavaScriptFunctionBindingRetrievalProperties = &javaScriptFunctionBindingRetrievalProperties
2678			}
2679		case "bindingType":
2680			if v != nil {
2681				var bindingType BindingType
2682				err = json.Unmarshal(*v, &bindingType)
2683				if err != nil {
2684					return err
2685				}
2686				jsfrddp.BindingType = bindingType
2687			}
2688		}
2689	}
2690
2691	return nil
2692}
2693
2694// JSONSerialization describes how data from an input is serialized or how data is serialized when written
2695// to an output in JSON format.
2696type JSONSerialization struct {
2697	// JSONSerializationProperties - The properties that are associated with the JSON serialization type. Required on PUT (CreateOrReplace) requests.
2698	*JSONSerializationProperties `json:"properties,omitempty"`
2699	// Type - Possible values include: 'TypeSerialization', 'TypeAvro', 'TypeJSON', 'TypeCsv'
2700	Type Type `json:"type,omitempty"`
2701}
2702
2703// MarshalJSON is the custom marshaler for JSONSerialization.
2704func (js JSONSerialization) MarshalJSON() ([]byte, error) {
2705	js.Type = TypeJSON
2706	objectMap := make(map[string]interface{})
2707	if js.JSONSerializationProperties != nil {
2708		objectMap["properties"] = js.JSONSerializationProperties
2709	}
2710	if js.Type != "" {
2711		objectMap["type"] = js.Type
2712	}
2713	return json.Marshal(objectMap)
2714}
2715
2716// AsAvroSerialization is the BasicSerialization implementation for JSONSerialization.
2717func (js JSONSerialization) AsAvroSerialization() (*AvroSerialization, bool) {
2718	return nil, false
2719}
2720
2721// AsJSONSerialization is the BasicSerialization implementation for JSONSerialization.
2722func (js JSONSerialization) AsJSONSerialization() (*JSONSerialization, bool) {
2723	return &js, true
2724}
2725
2726// AsCsvSerialization is the BasicSerialization implementation for JSONSerialization.
2727func (js JSONSerialization) AsCsvSerialization() (*CsvSerialization, bool) {
2728	return nil, false
2729}
2730
2731// AsSerialization is the BasicSerialization implementation for JSONSerialization.
2732func (js JSONSerialization) AsSerialization() (*Serialization, bool) {
2733	return nil, false
2734}
2735
2736// AsBasicSerialization is the BasicSerialization implementation for JSONSerialization.
2737func (js JSONSerialization) AsBasicSerialization() (BasicSerialization, bool) {
2738	return &js, true
2739}
2740
2741// UnmarshalJSON is the custom unmarshaler for JSONSerialization struct.
2742func (js *JSONSerialization) UnmarshalJSON(body []byte) error {
2743	var m map[string]*json.RawMessage
2744	err := json.Unmarshal(body, &m)
2745	if err != nil {
2746		return err
2747	}
2748	for k, v := range m {
2749		switch k {
2750		case "properties":
2751			if v != nil {
2752				var JSONSerializationProperties JSONSerializationProperties
2753				err = json.Unmarshal(*v, &JSONSerializationProperties)
2754				if err != nil {
2755					return err
2756				}
2757				js.JSONSerializationProperties = &JSONSerializationProperties
2758			}
2759		case "type":
2760			if v != nil {
2761				var typeVar Type
2762				err = json.Unmarshal(*v, &typeVar)
2763				if err != nil {
2764					return err
2765				}
2766				js.Type = typeVar
2767			}
2768		}
2769	}
2770
2771	return nil
2772}
2773
2774// JSONSerializationProperties the properties that are associated with the JSON serialization type.
2775type JSONSerializationProperties struct {
2776	// Encoding - Specifies the encoding of the incoming data in the case of input and the encoding of outgoing data in the case of output. Required on PUT (CreateOrReplace) requests. Possible values include: 'UTF8'
2777	Encoding Encoding `json:"encoding,omitempty"`
2778	// Format - This property only applies to JSON serialization of outputs only. It is not applicable to inputs. This property specifies the format of the JSON the output will be written in. The currently supported values are 'lineSeparated' indicating the output will be formatted by having each JSON object separated by a new line and 'array' indicating the output will be formatted as an array of JSON objects. Default value is 'lineSeparated' if left null. Possible values include: 'LineSeparated', 'Array'
2779	Format JSONOutputSerializationFormat `json:"format,omitempty"`
2780}
2781
2782// OAuthBasedDataSourceProperties the properties that are associated with data sources that use OAuth as
2783// their authentication model.
2784type OAuthBasedDataSourceProperties struct {
2785	// RefreshToken - A refresh token that can be used to obtain a valid access token that can then be used to authenticate with the data source. A valid refresh token is currently only obtainable via the Azure Portal. It is recommended to put a dummy string value here when creating the data source and then going to the Azure Portal to authenticate the data source which will update this property with a valid refresh token. Required on PUT (CreateOrReplace) requests.
2786	RefreshToken *string `json:"refreshToken,omitempty"`
2787	// TokenUserPrincipalName - The user principal name (UPN) of the user that was used to obtain the refresh token. Use this property to help remember which user was used to obtain the refresh token.
2788	TokenUserPrincipalName *string `json:"tokenUserPrincipalName,omitempty"`
2789	// TokenUserDisplayName - The user display name of the user that was used to obtain the refresh token. Use this property to help remember which user was used to obtain the refresh token.
2790	TokenUserDisplayName *string `json:"tokenUserDisplayName,omitempty"`
2791}
2792
2793// Operation a Stream Analytics REST API operation
2794type Operation struct {
2795	// Name - READ-ONLY; The name of the operation being performed on this particular object.
2796	Name *string `json:"name,omitempty"`
2797	// Display - READ-ONLY; Contains the localized display information for this particular operation / action.
2798	Display *OperationDisplay `json:"display,omitempty"`
2799}
2800
2801// MarshalJSON is the custom marshaler for Operation.
2802func (o Operation) MarshalJSON() ([]byte, error) {
2803	objectMap := make(map[string]interface{})
2804	return json.Marshal(objectMap)
2805}
2806
2807// OperationDisplay contains the localized display information for this particular operation / action.
2808type OperationDisplay struct {
2809	// Provider - READ-ONLY; The localized friendly form of the resource provider name.
2810	Provider *string `json:"provider,omitempty"`
2811	// Resource - READ-ONLY; The localized friendly form of the resource type related to this action/operation.
2812	Resource *string `json:"resource,omitempty"`
2813	// Operation - READ-ONLY; The localized friendly name for the operation.
2814	Operation *string `json:"operation,omitempty"`
2815	// Description - READ-ONLY; The localized friendly description for the operation.
2816	Description *string `json:"description,omitempty"`
2817}
2818
2819// MarshalJSON is the custom marshaler for OperationDisplay.
2820func (o OperationDisplay) MarshalJSON() ([]byte, error) {
2821	objectMap := make(map[string]interface{})
2822	return json.Marshal(objectMap)
2823}
2824
2825// OperationListResult result of the request to list Stream Analytics operations. It contains a list of
2826// operations and a URL link to get the next set of results.
2827type OperationListResult struct {
2828	autorest.Response `json:"-"`
2829	// Value - READ-ONLY; List of Stream Analytics operations supported by the Microsoft.StreamAnalytics resource provider.
2830	Value *[]Operation `json:"value,omitempty"`
2831	// NextLink - READ-ONLY; URL to get the next set of operation list results if there are any.
2832	NextLink *string `json:"nextLink,omitempty"`
2833}
2834
2835// MarshalJSON is the custom marshaler for OperationListResult.
2836func (olr OperationListResult) MarshalJSON() ([]byte, error) {
2837	objectMap := make(map[string]interface{})
2838	return json.Marshal(objectMap)
2839}
2840
2841// OperationListResultIterator provides access to a complete listing of Operation values.
2842type OperationListResultIterator struct {
2843	i    int
2844	page OperationListResultPage
2845}
2846
2847// NextWithContext advances to the next value.  If there was an error making
2848// the request the iterator does not advance and the error is returned.
2849func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
2850	if tracing.IsEnabled() {
2851		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
2852		defer func() {
2853			sc := -1
2854			if iter.Response().Response.Response != nil {
2855				sc = iter.Response().Response.Response.StatusCode
2856			}
2857			tracing.EndSpan(ctx, sc, err)
2858		}()
2859	}
2860	iter.i++
2861	if iter.i < len(iter.page.Values()) {
2862		return nil
2863	}
2864	err = iter.page.NextWithContext(ctx)
2865	if err != nil {
2866		iter.i--
2867		return err
2868	}
2869	iter.i = 0
2870	return nil
2871}
2872
2873// Next advances to the next value.  If there was an error making
2874// the request the iterator does not advance and the error is returned.
2875// Deprecated: Use NextWithContext() instead.
2876func (iter *OperationListResultIterator) Next() error {
2877	return iter.NextWithContext(context.Background())
2878}
2879
2880// NotDone returns true if the enumeration should be started or is not yet complete.
2881func (iter OperationListResultIterator) NotDone() bool {
2882	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2883}
2884
2885// Response returns the raw server response from the last page request.
2886func (iter OperationListResultIterator) Response() OperationListResult {
2887	return iter.page.Response()
2888}
2889
2890// Value returns the current value or a zero-initialized value if the
2891// iterator has advanced beyond the end of the collection.
2892func (iter OperationListResultIterator) Value() Operation {
2893	if !iter.page.NotDone() {
2894		return Operation{}
2895	}
2896	return iter.page.Values()[iter.i]
2897}
2898
2899// Creates a new instance of the OperationListResultIterator type.
2900func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
2901	return OperationListResultIterator{page: page}
2902}
2903
2904// IsEmpty returns true if the ListResult contains no values.
2905func (olr OperationListResult) IsEmpty() bool {
2906	return olr.Value == nil || len(*olr.Value) == 0
2907}
2908
2909// hasNextLink returns true if the NextLink is not empty.
2910func (olr OperationListResult) hasNextLink() bool {
2911	return olr.NextLink != nil && len(*olr.NextLink) != 0
2912}
2913
2914// operationListResultPreparer prepares a request to retrieve the next set of results.
2915// It returns nil if no more results exist.
2916func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
2917	if !olr.hasNextLink() {
2918		return nil, nil
2919	}
2920	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2921		autorest.AsJSON(),
2922		autorest.AsGet(),
2923		autorest.WithBaseURL(to.String(olr.NextLink)))
2924}
2925
2926// OperationListResultPage contains a page of Operation values.
2927type OperationListResultPage struct {
2928	fn  func(context.Context, OperationListResult) (OperationListResult, error)
2929	olr OperationListResult
2930}
2931
2932// NextWithContext advances to the next page of values.  If there was an error making
2933// the request the page does not advance and the error is returned.
2934func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
2935	if tracing.IsEnabled() {
2936		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
2937		defer func() {
2938			sc := -1
2939			if page.Response().Response.Response != nil {
2940				sc = page.Response().Response.Response.StatusCode
2941			}
2942			tracing.EndSpan(ctx, sc, err)
2943		}()
2944	}
2945	for {
2946		next, err := page.fn(ctx, page.olr)
2947		if err != nil {
2948			return err
2949		}
2950		page.olr = next
2951		if !next.hasNextLink() || !next.IsEmpty() {
2952			break
2953		}
2954	}
2955	return nil
2956}
2957
2958// Next advances to the next page of values.  If there was an error making
2959// the request the page does not advance and the error is returned.
2960// Deprecated: Use NextWithContext() instead.
2961func (page *OperationListResultPage) Next() error {
2962	return page.NextWithContext(context.Background())
2963}
2964
2965// NotDone returns true if the page enumeration should be started or is not yet complete.
2966func (page OperationListResultPage) NotDone() bool {
2967	return !page.olr.IsEmpty()
2968}
2969
2970// Response returns the raw server response from the last page request.
2971func (page OperationListResultPage) Response() OperationListResult {
2972	return page.olr
2973}
2974
2975// Values returns the slice of values for the current page or nil if there are no values.
2976func (page OperationListResultPage) Values() []Operation {
2977	if page.olr.IsEmpty() {
2978		return nil
2979	}
2980	return *page.olr.Value
2981}
2982
2983// Creates a new instance of the OperationListResultPage type.
2984func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
2985	return OperationListResultPage{
2986		fn:  getNextPage,
2987		olr: cur,
2988	}
2989}
2990
2991// Output an output object, containing all information associated with the named output. All outputs are
2992// contained under a streaming job.
2993type Output struct {
2994	autorest.Response `json:"-"`
2995	// OutputProperties - The properties that are associated with an output. Required on PUT (CreateOrReplace) requests.
2996	*OutputProperties `json:"properties,omitempty"`
2997	// ID - READ-ONLY; Resource Id
2998	ID *string `json:"id,omitempty"`
2999	// Name - Resource name
3000	Name *string `json:"name,omitempty"`
3001	// Type - READ-ONLY; Resource type
3002	Type *string `json:"type,omitempty"`
3003}
3004
3005// MarshalJSON is the custom marshaler for Output.
3006func (o Output) MarshalJSON() ([]byte, error) {
3007	objectMap := make(map[string]interface{})
3008	if o.OutputProperties != nil {
3009		objectMap["properties"] = o.OutputProperties
3010	}
3011	if o.Name != nil {
3012		objectMap["name"] = o.Name
3013	}
3014	return json.Marshal(objectMap)
3015}
3016
3017// UnmarshalJSON is the custom unmarshaler for Output struct.
3018func (o *Output) UnmarshalJSON(body []byte) error {
3019	var m map[string]*json.RawMessage
3020	err := json.Unmarshal(body, &m)
3021	if err != nil {
3022		return err
3023	}
3024	for k, v := range m {
3025		switch k {
3026		case "properties":
3027			if v != nil {
3028				var outputProperties OutputProperties
3029				err = json.Unmarshal(*v, &outputProperties)
3030				if err != nil {
3031					return err
3032				}
3033				o.OutputProperties = &outputProperties
3034			}
3035		case "id":
3036			if v != nil {
3037				var ID string
3038				err = json.Unmarshal(*v, &ID)
3039				if err != nil {
3040					return err
3041				}
3042				o.ID = &ID
3043			}
3044		case "name":
3045			if v != nil {
3046				var name string
3047				err = json.Unmarshal(*v, &name)
3048				if err != nil {
3049					return err
3050				}
3051				o.Name = &name
3052			}
3053		case "type":
3054			if v != nil {
3055				var typeVar string
3056				err = json.Unmarshal(*v, &typeVar)
3057				if err != nil {
3058					return err
3059				}
3060				o.Type = &typeVar
3061			}
3062		}
3063	}
3064
3065	return nil
3066}
3067
3068// BasicOutputDataSource describes the data source that output will be written to.
3069type BasicOutputDataSource interface {
3070	AsAzureDataLakeStoreOutputDataSource() (*AzureDataLakeStoreOutputDataSource, bool)
3071	AsPowerBIOutputDataSource() (*PowerBIOutputDataSource, bool)
3072	AsServiceBusTopicOutputDataSource() (*ServiceBusTopicOutputDataSource, bool)
3073	AsServiceBusQueueOutputDataSource() (*ServiceBusQueueOutputDataSource, bool)
3074	AsDocumentDbOutputDataSource() (*DocumentDbOutputDataSource, bool)
3075	AsAzureSQLDatabaseOutputDataSource() (*AzureSQLDatabaseOutputDataSource, bool)
3076	AsEventHubOutputDataSource() (*EventHubOutputDataSource, bool)
3077	AsAzureTableOutputDataSource() (*AzureTableOutputDataSource, bool)
3078	AsBlobOutputDataSource() (*BlobOutputDataSource, bool)
3079	AsOutputDataSource() (*OutputDataSource, bool)
3080}
3081
3082// OutputDataSource describes the data source that output will be written to.
3083type OutputDataSource struct {
3084	// Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftDataLakeAccounts', 'TypePowerBI', 'TypeMicrosoftServiceBusTopic', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftStorageTable', 'TypeMicrosoftStorageBlob'
3085	Type TypeBasicOutputDataSource `json:"type,omitempty"`
3086}
3087
3088func unmarshalBasicOutputDataSource(body []byte) (BasicOutputDataSource, error) {
3089	var m map[string]interface{}
3090	err := json.Unmarshal(body, &m)
3091	if err != nil {
3092		return nil, err
3093	}
3094
3095	switch m["type"] {
3096	case string(TypeMicrosoftDataLakeAccounts):
3097		var adlsods AzureDataLakeStoreOutputDataSource
3098		err := json.Unmarshal(body, &adlsods)
3099		return adlsods, err
3100	case string(TypePowerBI):
3101		var pbods PowerBIOutputDataSource
3102		err := json.Unmarshal(body, &pbods)
3103		return pbods, err
3104	case string(TypeMicrosoftServiceBusTopic):
3105		var sbtods ServiceBusTopicOutputDataSource
3106		err := json.Unmarshal(body, &sbtods)
3107		return sbtods, err
3108	case string(TypeMicrosoftServiceBusQueue):
3109		var sbqods ServiceBusQueueOutputDataSource
3110		err := json.Unmarshal(body, &sbqods)
3111		return sbqods, err
3112	case string(TypeMicrosoftStorageDocumentDB):
3113		var ddods DocumentDbOutputDataSource
3114		err := json.Unmarshal(body, &ddods)
3115		return ddods, err
3116	case string(TypeMicrosoftSQLServerDatabase):
3117		var asdods AzureSQLDatabaseOutputDataSource
3118		err := json.Unmarshal(body, &asdods)
3119		return asdods, err
3120	case string(TypeMicrosoftServiceBusEventHub):
3121		var ehods EventHubOutputDataSource
3122		err := json.Unmarshal(body, &ehods)
3123		return ehods, err
3124	case string(TypeMicrosoftStorageTable):
3125		var atods AzureTableOutputDataSource
3126		err := json.Unmarshal(body, &atods)
3127		return atods, err
3128	case string(TypeMicrosoftStorageBlob):
3129		var bods BlobOutputDataSource
3130		err := json.Unmarshal(body, &bods)
3131		return bods, err
3132	default:
3133		var ods OutputDataSource
3134		err := json.Unmarshal(body, &ods)
3135		return ods, err
3136	}
3137}
3138func unmarshalBasicOutputDataSourceArray(body []byte) ([]BasicOutputDataSource, error) {
3139	var rawMessages []*json.RawMessage
3140	err := json.Unmarshal(body, &rawMessages)
3141	if err != nil {
3142		return nil, err
3143	}
3144
3145	odsArray := make([]BasicOutputDataSource, len(rawMessages))
3146
3147	for index, rawMessage := range rawMessages {
3148		ods, err := unmarshalBasicOutputDataSource(*rawMessage)
3149		if err != nil {
3150			return nil, err
3151		}
3152		odsArray[index] = ods
3153	}
3154	return odsArray, nil
3155}
3156
3157// MarshalJSON is the custom marshaler for OutputDataSource.
3158func (ods OutputDataSource) MarshalJSON() ([]byte, error) {
3159	ods.Type = TypeOutputDataSource
3160	objectMap := make(map[string]interface{})
3161	if ods.Type != "" {
3162		objectMap["type"] = ods.Type
3163	}
3164	return json.Marshal(objectMap)
3165}
3166
3167// AsAzureDataLakeStoreOutputDataSource is the BasicOutputDataSource implementation for OutputDataSource.
3168func (ods OutputDataSource) AsAzureDataLakeStoreOutputDataSource() (*AzureDataLakeStoreOutputDataSource, bool) {
3169	return nil, false
3170}
3171
3172// AsPowerBIOutputDataSource is the BasicOutputDataSource implementation for OutputDataSource.
3173func (ods OutputDataSource) AsPowerBIOutputDataSource() (*PowerBIOutputDataSource, bool) {
3174	return nil, false
3175}
3176
3177// AsServiceBusTopicOutputDataSource is the BasicOutputDataSource implementation for OutputDataSource.
3178func (ods OutputDataSource) AsServiceBusTopicOutputDataSource() (*ServiceBusTopicOutputDataSource, bool) {
3179	return nil, false
3180}
3181
3182// AsServiceBusQueueOutputDataSource is the BasicOutputDataSource implementation for OutputDataSource.
3183func (ods OutputDataSource) AsServiceBusQueueOutputDataSource() (*ServiceBusQueueOutputDataSource, bool) {
3184	return nil, false
3185}
3186
3187// AsDocumentDbOutputDataSource is the BasicOutputDataSource implementation for OutputDataSource.
3188func (ods OutputDataSource) AsDocumentDbOutputDataSource() (*DocumentDbOutputDataSource, bool) {
3189	return nil, false
3190}
3191
3192// AsAzureSQLDatabaseOutputDataSource is the BasicOutputDataSource implementation for OutputDataSource.
3193func (ods OutputDataSource) AsAzureSQLDatabaseOutputDataSource() (*AzureSQLDatabaseOutputDataSource, bool) {
3194	return nil, false
3195}
3196
3197// AsEventHubOutputDataSource is the BasicOutputDataSource implementation for OutputDataSource.
3198func (ods OutputDataSource) AsEventHubOutputDataSource() (*EventHubOutputDataSource, bool) {
3199	return nil, false
3200}
3201
3202// AsAzureTableOutputDataSource is the BasicOutputDataSource implementation for OutputDataSource.
3203func (ods OutputDataSource) AsAzureTableOutputDataSource() (*AzureTableOutputDataSource, bool) {
3204	return nil, false
3205}
3206
3207// AsBlobOutputDataSource is the BasicOutputDataSource implementation for OutputDataSource.
3208func (ods OutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) {
3209	return nil, false
3210}
3211
3212// AsOutputDataSource is the BasicOutputDataSource implementation for OutputDataSource.
3213func (ods OutputDataSource) AsOutputDataSource() (*OutputDataSource, bool) {
3214	return &ods, true
3215}
3216
3217// AsBasicOutputDataSource is the BasicOutputDataSource implementation for OutputDataSource.
3218func (ods OutputDataSource) AsBasicOutputDataSource() (BasicOutputDataSource, bool) {
3219	return &ods, true
3220}
3221
3222// OutputListResult object containing a list of outputs under a streaming job.
3223type OutputListResult struct {
3224	autorest.Response `json:"-"`
3225	// Value - READ-ONLY; A list of outputs under a streaming job. Populated by a 'List' operation.
3226	Value *[]Output `json:"value,omitempty"`
3227	// NextLink - READ-ONLY; The link (url) to the next page of results.
3228	NextLink *string `json:"nextLink,omitempty"`
3229}
3230
3231// MarshalJSON is the custom marshaler for OutputListResult.
3232func (olr OutputListResult) MarshalJSON() ([]byte, error) {
3233	objectMap := make(map[string]interface{})
3234	return json.Marshal(objectMap)
3235}
3236
3237// OutputListResultIterator provides access to a complete listing of Output values.
3238type OutputListResultIterator struct {
3239	i    int
3240	page OutputListResultPage
3241}
3242
3243// NextWithContext advances to the next value.  If there was an error making
3244// the request the iterator does not advance and the error is returned.
3245func (iter *OutputListResultIterator) NextWithContext(ctx context.Context) (err error) {
3246	if tracing.IsEnabled() {
3247		ctx = tracing.StartSpan(ctx, fqdn+"/OutputListResultIterator.NextWithContext")
3248		defer func() {
3249			sc := -1
3250			if iter.Response().Response.Response != nil {
3251				sc = iter.Response().Response.Response.StatusCode
3252			}
3253			tracing.EndSpan(ctx, sc, err)
3254		}()
3255	}
3256	iter.i++
3257	if iter.i < len(iter.page.Values()) {
3258		return nil
3259	}
3260	err = iter.page.NextWithContext(ctx)
3261	if err != nil {
3262		iter.i--
3263		return err
3264	}
3265	iter.i = 0
3266	return nil
3267}
3268
3269// Next advances to the next value.  If there was an error making
3270// the request the iterator does not advance and the error is returned.
3271// Deprecated: Use NextWithContext() instead.
3272func (iter *OutputListResultIterator) Next() error {
3273	return iter.NextWithContext(context.Background())
3274}
3275
3276// NotDone returns true if the enumeration should be started or is not yet complete.
3277func (iter OutputListResultIterator) NotDone() bool {
3278	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3279}
3280
3281// Response returns the raw server response from the last page request.
3282func (iter OutputListResultIterator) Response() OutputListResult {
3283	return iter.page.Response()
3284}
3285
3286// Value returns the current value or a zero-initialized value if the
3287// iterator has advanced beyond the end of the collection.
3288func (iter OutputListResultIterator) Value() Output {
3289	if !iter.page.NotDone() {
3290		return Output{}
3291	}
3292	return iter.page.Values()[iter.i]
3293}
3294
3295// Creates a new instance of the OutputListResultIterator type.
3296func NewOutputListResultIterator(page OutputListResultPage) OutputListResultIterator {
3297	return OutputListResultIterator{page: page}
3298}
3299
3300// IsEmpty returns true if the ListResult contains no values.
3301func (olr OutputListResult) IsEmpty() bool {
3302	return olr.Value == nil || len(*olr.Value) == 0
3303}
3304
3305// hasNextLink returns true if the NextLink is not empty.
3306func (olr OutputListResult) hasNextLink() bool {
3307	return olr.NextLink != nil && len(*olr.NextLink) != 0
3308}
3309
3310// outputListResultPreparer prepares a request to retrieve the next set of results.
3311// It returns nil if no more results exist.
3312func (olr OutputListResult) outputListResultPreparer(ctx context.Context) (*http.Request, error) {
3313	if !olr.hasNextLink() {
3314		return nil, nil
3315	}
3316	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3317		autorest.AsJSON(),
3318		autorest.AsGet(),
3319		autorest.WithBaseURL(to.String(olr.NextLink)))
3320}
3321
3322// OutputListResultPage contains a page of Output values.
3323type OutputListResultPage struct {
3324	fn  func(context.Context, OutputListResult) (OutputListResult, error)
3325	olr OutputListResult
3326}
3327
3328// NextWithContext advances to the next page of values.  If there was an error making
3329// the request the page does not advance and the error is returned.
3330func (page *OutputListResultPage) NextWithContext(ctx context.Context) (err error) {
3331	if tracing.IsEnabled() {
3332		ctx = tracing.StartSpan(ctx, fqdn+"/OutputListResultPage.NextWithContext")
3333		defer func() {
3334			sc := -1
3335			if page.Response().Response.Response != nil {
3336				sc = page.Response().Response.Response.StatusCode
3337			}
3338			tracing.EndSpan(ctx, sc, err)
3339		}()
3340	}
3341	for {
3342		next, err := page.fn(ctx, page.olr)
3343		if err != nil {
3344			return err
3345		}
3346		page.olr = next
3347		if !next.hasNextLink() || !next.IsEmpty() {
3348			break
3349		}
3350	}
3351	return nil
3352}
3353
3354// Next advances to the next page of values.  If there was an error making
3355// the request the page does not advance and the error is returned.
3356// Deprecated: Use NextWithContext() instead.
3357func (page *OutputListResultPage) Next() error {
3358	return page.NextWithContext(context.Background())
3359}
3360
3361// NotDone returns true if the page enumeration should be started or is not yet complete.
3362func (page OutputListResultPage) NotDone() bool {
3363	return !page.olr.IsEmpty()
3364}
3365
3366// Response returns the raw server response from the last page request.
3367func (page OutputListResultPage) Response() OutputListResult {
3368	return page.olr
3369}
3370
3371// Values returns the slice of values for the current page or nil if there are no values.
3372func (page OutputListResultPage) Values() []Output {
3373	if page.olr.IsEmpty() {
3374		return nil
3375	}
3376	return *page.olr.Value
3377}
3378
3379// Creates a new instance of the OutputListResultPage type.
3380func NewOutputListResultPage(cur OutputListResult, getNextPage func(context.Context, OutputListResult) (OutputListResult, error)) OutputListResultPage {
3381	return OutputListResultPage{
3382		fn:  getNextPage,
3383		olr: cur,
3384	}
3385}
3386
3387// OutputProperties the properties that are associated with an output.
3388type OutputProperties struct {
3389	// Datasource - Describes the data source that output will be written to. Required on PUT (CreateOrReplace) requests.
3390	Datasource BasicOutputDataSource `json:"datasource,omitempty"`
3391	// Serialization - Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests.
3392	Serialization BasicSerialization `json:"serialization,omitempty"`
3393	// Diagnostics - READ-ONLY; Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention.
3394	Diagnostics *Diagnostics `json:"diagnostics,omitempty"`
3395	// Etag - READ-ONLY; The current entity tag for the output. 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.
3396	Etag *string `json:"etag,omitempty"`
3397}
3398
3399// MarshalJSON is the custom marshaler for OutputProperties.
3400func (op OutputProperties) MarshalJSON() ([]byte, error) {
3401	objectMap := make(map[string]interface{})
3402	objectMap["datasource"] = op.Datasource
3403	objectMap["serialization"] = op.Serialization
3404	return json.Marshal(objectMap)
3405}
3406
3407// UnmarshalJSON is the custom unmarshaler for OutputProperties struct.
3408func (op *OutputProperties) UnmarshalJSON(body []byte) error {
3409	var m map[string]*json.RawMessage
3410	err := json.Unmarshal(body, &m)
3411	if err != nil {
3412		return err
3413	}
3414	for k, v := range m {
3415		switch k {
3416		case "datasource":
3417			if v != nil {
3418				datasource, err := unmarshalBasicOutputDataSource(*v)
3419				if err != nil {
3420					return err
3421				}
3422				op.Datasource = datasource
3423			}
3424		case "serialization":
3425			if v != nil {
3426				serialization, err := unmarshalBasicSerialization(*v)
3427				if err != nil {
3428					return err
3429				}
3430				op.Serialization = serialization
3431			}
3432		case "diagnostics":
3433			if v != nil {
3434				var diagnostics Diagnostics
3435				err = json.Unmarshal(*v, &diagnostics)
3436				if err != nil {
3437					return err
3438				}
3439				op.Diagnostics = &diagnostics
3440			}
3441		case "etag":
3442			if v != nil {
3443				var etag string
3444				err = json.Unmarshal(*v, &etag)
3445				if err != nil {
3446					return err
3447				}
3448				op.Etag = &etag
3449			}
3450		}
3451	}
3452
3453	return nil
3454}
3455
3456// OutputsTestFuture an abstraction for monitoring and retrieving the results of a long-running operation.
3457type OutputsTestFuture struct {
3458	azure.FutureAPI
3459	// Result returns the result of the asynchronous operation.
3460	// If the operation has not completed it will return an error.
3461	Result func(OutputsClient) (ResourceTestStatus, error)
3462}
3463
3464// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3465func (future *OutputsTestFuture) UnmarshalJSON(body []byte) error {
3466	var azFuture azure.Future
3467	if err := json.Unmarshal(body, &azFuture); err != nil {
3468		return err
3469	}
3470	future.FutureAPI = &azFuture
3471	future.Result = future.result
3472	return nil
3473}
3474
3475// result is the default implementation for OutputsTestFuture.Result.
3476func (future *OutputsTestFuture) result(client OutputsClient) (rts ResourceTestStatus, err error) {
3477	var done bool
3478	done, err = future.DoneWithContext(context.Background(), client)
3479	if err != nil {
3480		err = autorest.NewErrorWithError(err, "streamanalytics.OutputsTestFuture", "Result", future.Response(), "Polling failure")
3481		return
3482	}
3483	if !done {
3484		rts.Response.Response = future.Response()
3485		err = azure.NewAsyncOpIncompleteError("streamanalytics.OutputsTestFuture")
3486		return
3487	}
3488	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3489	if rts.Response.Response, err = future.GetResult(sender); err == nil && rts.Response.Response.StatusCode != http.StatusNoContent {
3490		rts, err = client.TestResponder(rts.Response.Response)
3491		if err != nil {
3492			err = autorest.NewErrorWithError(err, "streamanalytics.OutputsTestFuture", "Result", rts.Response.Response, "Failure responding to request")
3493		}
3494	}
3495	return
3496}
3497
3498// PowerBIOutputDataSource describes a Power BI output data source.
3499type PowerBIOutputDataSource struct {
3500	// PowerBIOutputDataSourceProperties - The properties that are associated with a Power BI output. Required on PUT (CreateOrReplace) requests.
3501	*PowerBIOutputDataSourceProperties `json:"properties,omitempty"`
3502	// Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftDataLakeAccounts', 'TypePowerBI', 'TypeMicrosoftServiceBusTopic', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftStorageTable', 'TypeMicrosoftStorageBlob'
3503	Type TypeBasicOutputDataSource `json:"type,omitempty"`
3504}
3505
3506// MarshalJSON is the custom marshaler for PowerBIOutputDataSource.
3507func (pbods PowerBIOutputDataSource) MarshalJSON() ([]byte, error) {
3508	pbods.Type = TypePowerBI
3509	objectMap := make(map[string]interface{})
3510	if pbods.PowerBIOutputDataSourceProperties != nil {
3511		objectMap["properties"] = pbods.PowerBIOutputDataSourceProperties
3512	}
3513	if pbods.Type != "" {
3514		objectMap["type"] = pbods.Type
3515	}
3516	return json.Marshal(objectMap)
3517}
3518
3519// AsAzureDataLakeStoreOutputDataSource is the BasicOutputDataSource implementation for PowerBIOutputDataSource.
3520func (pbods PowerBIOutputDataSource) AsAzureDataLakeStoreOutputDataSource() (*AzureDataLakeStoreOutputDataSource, bool) {
3521	return nil, false
3522}
3523
3524// AsPowerBIOutputDataSource is the BasicOutputDataSource implementation for PowerBIOutputDataSource.
3525func (pbods PowerBIOutputDataSource) AsPowerBIOutputDataSource() (*PowerBIOutputDataSource, bool) {
3526	return &pbods, true
3527}
3528
3529// AsServiceBusTopicOutputDataSource is the BasicOutputDataSource implementation for PowerBIOutputDataSource.
3530func (pbods PowerBIOutputDataSource) AsServiceBusTopicOutputDataSource() (*ServiceBusTopicOutputDataSource, bool) {
3531	return nil, false
3532}
3533
3534// AsServiceBusQueueOutputDataSource is the BasicOutputDataSource implementation for PowerBIOutputDataSource.
3535func (pbods PowerBIOutputDataSource) AsServiceBusQueueOutputDataSource() (*ServiceBusQueueOutputDataSource, bool) {
3536	return nil, false
3537}
3538
3539// AsDocumentDbOutputDataSource is the BasicOutputDataSource implementation for PowerBIOutputDataSource.
3540func (pbods PowerBIOutputDataSource) AsDocumentDbOutputDataSource() (*DocumentDbOutputDataSource, bool) {
3541	return nil, false
3542}
3543
3544// AsAzureSQLDatabaseOutputDataSource is the BasicOutputDataSource implementation for PowerBIOutputDataSource.
3545func (pbods PowerBIOutputDataSource) AsAzureSQLDatabaseOutputDataSource() (*AzureSQLDatabaseOutputDataSource, bool) {
3546	return nil, false
3547}
3548
3549// AsEventHubOutputDataSource is the BasicOutputDataSource implementation for PowerBIOutputDataSource.
3550func (pbods PowerBIOutputDataSource) AsEventHubOutputDataSource() (*EventHubOutputDataSource, bool) {
3551	return nil, false
3552}
3553
3554// AsAzureTableOutputDataSource is the BasicOutputDataSource implementation for PowerBIOutputDataSource.
3555func (pbods PowerBIOutputDataSource) AsAzureTableOutputDataSource() (*AzureTableOutputDataSource, bool) {
3556	return nil, false
3557}
3558
3559// AsBlobOutputDataSource is the BasicOutputDataSource implementation for PowerBIOutputDataSource.
3560func (pbods PowerBIOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) {
3561	return nil, false
3562}
3563
3564// AsOutputDataSource is the BasicOutputDataSource implementation for PowerBIOutputDataSource.
3565func (pbods PowerBIOutputDataSource) AsOutputDataSource() (*OutputDataSource, bool) {
3566	return nil, false
3567}
3568
3569// AsBasicOutputDataSource is the BasicOutputDataSource implementation for PowerBIOutputDataSource.
3570func (pbods PowerBIOutputDataSource) AsBasicOutputDataSource() (BasicOutputDataSource, bool) {
3571	return &pbods, true
3572}
3573
3574// UnmarshalJSON is the custom unmarshaler for PowerBIOutputDataSource struct.
3575func (pbods *PowerBIOutputDataSource) UnmarshalJSON(body []byte) error {
3576	var m map[string]*json.RawMessage
3577	err := json.Unmarshal(body, &m)
3578	if err != nil {
3579		return err
3580	}
3581	for k, v := range m {
3582		switch k {
3583		case "properties":
3584			if v != nil {
3585				var powerBIOutputDataSourceProperties PowerBIOutputDataSourceProperties
3586				err = json.Unmarshal(*v, &powerBIOutputDataSourceProperties)
3587				if err != nil {
3588					return err
3589				}
3590				pbods.PowerBIOutputDataSourceProperties = &powerBIOutputDataSourceProperties
3591			}
3592		case "type":
3593			if v != nil {
3594				var typeVar TypeBasicOutputDataSource
3595				err = json.Unmarshal(*v, &typeVar)
3596				if err != nil {
3597					return err
3598				}
3599				pbods.Type = typeVar
3600			}
3601		}
3602	}
3603
3604	return nil
3605}
3606
3607// PowerBIOutputDataSourceProperties the properties that are associated with a Power BI output.
3608type PowerBIOutputDataSourceProperties struct {
3609	// Dataset - The name of the Power BI dataset. Required on PUT (CreateOrReplace) requests.
3610	Dataset *string `json:"dataset,omitempty"`
3611	// Table - The name of the Power BI table under the specified dataset. Required on PUT (CreateOrReplace) requests.
3612	Table *string `json:"table,omitempty"`
3613	// GroupID - The ID of the Power BI group.
3614	GroupID *string `json:"groupId,omitempty"`
3615	// GroupName - The name of the Power BI group. Use this property to help remember which specific Power BI group id was used.
3616	GroupName *string `json:"groupName,omitempty"`
3617	// RefreshToken - A refresh token that can be used to obtain a valid access token that can then be used to authenticate with the data source. A valid refresh token is currently only obtainable via the Azure Portal. It is recommended to put a dummy string value here when creating the data source and then going to the Azure Portal to authenticate the data source which will update this property with a valid refresh token. Required on PUT (CreateOrReplace) requests.
3618	RefreshToken *string `json:"refreshToken,omitempty"`
3619	// TokenUserPrincipalName - The user principal name (UPN) of the user that was used to obtain the refresh token. Use this property to help remember which user was used to obtain the refresh token.
3620	TokenUserPrincipalName *string `json:"tokenUserPrincipalName,omitempty"`
3621	// TokenUserDisplayName - The user display name of the user that was used to obtain the refresh token. Use this property to help remember which user was used to obtain the refresh token.
3622	TokenUserDisplayName *string `json:"tokenUserDisplayName,omitempty"`
3623}
3624
3625// BasicReferenceInputDataSource describes an input data source that contains reference data.
3626type BasicReferenceInputDataSource interface {
3627	AsBlobReferenceInputDataSource() (*BlobReferenceInputDataSource, bool)
3628	AsReferenceInputDataSource() (*ReferenceInputDataSource, bool)
3629}
3630
3631// ReferenceInputDataSource describes an input data source that contains reference data.
3632type ReferenceInputDataSource struct {
3633	// Type - Possible values include: 'TypeBasicReferenceInputDataSourceTypeReferenceInputDataSource', 'TypeBasicReferenceInputDataSourceTypeMicrosoftStorageBlob'
3634	Type TypeBasicReferenceInputDataSource `json:"type,omitempty"`
3635}
3636
3637func unmarshalBasicReferenceInputDataSource(body []byte) (BasicReferenceInputDataSource, error) {
3638	var m map[string]interface{}
3639	err := json.Unmarshal(body, &m)
3640	if err != nil {
3641		return nil, err
3642	}
3643
3644	switch m["type"] {
3645	case string(TypeBasicReferenceInputDataSourceTypeMicrosoftStorageBlob):
3646		var brids BlobReferenceInputDataSource
3647		err := json.Unmarshal(body, &brids)
3648		return brids, err
3649	default:
3650		var rids ReferenceInputDataSource
3651		err := json.Unmarshal(body, &rids)
3652		return rids, err
3653	}
3654}
3655func unmarshalBasicReferenceInputDataSourceArray(body []byte) ([]BasicReferenceInputDataSource, error) {
3656	var rawMessages []*json.RawMessage
3657	err := json.Unmarshal(body, &rawMessages)
3658	if err != nil {
3659		return nil, err
3660	}
3661
3662	ridsArray := make([]BasicReferenceInputDataSource, len(rawMessages))
3663
3664	for index, rawMessage := range rawMessages {
3665		rids, err := unmarshalBasicReferenceInputDataSource(*rawMessage)
3666		if err != nil {
3667			return nil, err
3668		}
3669		ridsArray[index] = rids
3670	}
3671	return ridsArray, nil
3672}
3673
3674// MarshalJSON is the custom marshaler for ReferenceInputDataSource.
3675func (rids ReferenceInputDataSource) MarshalJSON() ([]byte, error) {
3676	rids.Type = TypeBasicReferenceInputDataSourceTypeReferenceInputDataSource
3677	objectMap := make(map[string]interface{})
3678	if rids.Type != "" {
3679		objectMap["type"] = rids.Type
3680	}
3681	return json.Marshal(objectMap)
3682}
3683
3684// AsBlobReferenceInputDataSource is the BasicReferenceInputDataSource implementation for ReferenceInputDataSource.
3685func (rids ReferenceInputDataSource) AsBlobReferenceInputDataSource() (*BlobReferenceInputDataSource, bool) {
3686	return nil, false
3687}
3688
3689// AsReferenceInputDataSource is the BasicReferenceInputDataSource implementation for ReferenceInputDataSource.
3690func (rids ReferenceInputDataSource) AsReferenceInputDataSource() (*ReferenceInputDataSource, bool) {
3691	return &rids, true
3692}
3693
3694// AsBasicReferenceInputDataSource is the BasicReferenceInputDataSource implementation for ReferenceInputDataSource.
3695func (rids ReferenceInputDataSource) AsBasicReferenceInputDataSource() (BasicReferenceInputDataSource, bool) {
3696	return &rids, true
3697}
3698
3699// ReferenceInputProperties the properties that are associated with an input containing reference data.
3700type ReferenceInputProperties struct {
3701	// Datasource - Describes an input data source that contains reference data. Required on PUT (CreateOrReplace) requests.
3702	Datasource BasicReferenceInputDataSource `json:"datasource,omitempty"`
3703	// Serialization - Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests.
3704	Serialization BasicSerialization `json:"serialization,omitempty"`
3705	// Diagnostics - READ-ONLY; Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention.
3706	Diagnostics *Diagnostics `json:"diagnostics,omitempty"`
3707	// Etag - READ-ONLY; The current entity tag for the input. 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.
3708	Etag *string `json:"etag,omitempty"`
3709	// Type - Possible values include: 'TypeInputProperties', 'TypeReference', 'TypeStream'
3710	Type TypeBasicInputProperties `json:"type,omitempty"`
3711}
3712
3713// MarshalJSON is the custom marshaler for ReferenceInputProperties.
3714func (rip ReferenceInputProperties) MarshalJSON() ([]byte, error) {
3715	rip.Type = TypeReference
3716	objectMap := make(map[string]interface{})
3717	objectMap["datasource"] = rip.Datasource
3718	objectMap["serialization"] = rip.Serialization
3719	if rip.Type != "" {
3720		objectMap["type"] = rip.Type
3721	}
3722	return json.Marshal(objectMap)
3723}
3724
3725// AsReferenceInputProperties is the BasicInputProperties implementation for ReferenceInputProperties.
3726func (rip ReferenceInputProperties) AsReferenceInputProperties() (*ReferenceInputProperties, bool) {
3727	return &rip, true
3728}
3729
3730// AsStreamInputProperties is the BasicInputProperties implementation for ReferenceInputProperties.
3731func (rip ReferenceInputProperties) AsStreamInputProperties() (*StreamInputProperties, bool) {
3732	return nil, false
3733}
3734
3735// AsInputProperties is the BasicInputProperties implementation for ReferenceInputProperties.
3736func (rip ReferenceInputProperties) AsInputProperties() (*InputProperties, bool) {
3737	return nil, false
3738}
3739
3740// AsBasicInputProperties is the BasicInputProperties implementation for ReferenceInputProperties.
3741func (rip ReferenceInputProperties) AsBasicInputProperties() (BasicInputProperties, bool) {
3742	return &rip, true
3743}
3744
3745// UnmarshalJSON is the custom unmarshaler for ReferenceInputProperties struct.
3746func (rip *ReferenceInputProperties) UnmarshalJSON(body []byte) error {
3747	var m map[string]*json.RawMessage
3748	err := json.Unmarshal(body, &m)
3749	if err != nil {
3750		return err
3751	}
3752	for k, v := range m {
3753		switch k {
3754		case "datasource":
3755			if v != nil {
3756				datasource, err := unmarshalBasicReferenceInputDataSource(*v)
3757				if err != nil {
3758					return err
3759				}
3760				rip.Datasource = datasource
3761			}
3762		case "serialization":
3763			if v != nil {
3764				serialization, err := unmarshalBasicSerialization(*v)
3765				if err != nil {
3766					return err
3767				}
3768				rip.Serialization = serialization
3769			}
3770		case "diagnostics":
3771			if v != nil {
3772				var diagnostics Diagnostics
3773				err = json.Unmarshal(*v, &diagnostics)
3774				if err != nil {
3775					return err
3776				}
3777				rip.Diagnostics = &diagnostics
3778			}
3779		case "etag":
3780			if v != nil {
3781				var etag string
3782				err = json.Unmarshal(*v, &etag)
3783				if err != nil {
3784					return err
3785				}
3786				rip.Etag = &etag
3787			}
3788		case "type":
3789			if v != nil {
3790				var typeVar TypeBasicInputProperties
3791				err = json.Unmarshal(*v, &typeVar)
3792				if err != nil {
3793					return err
3794				}
3795				rip.Type = typeVar
3796			}
3797		}
3798	}
3799
3800	return nil
3801}
3802
3803// Resource the base resource model definition.
3804type Resource struct {
3805	// ID - READ-ONLY; Resource Id
3806	ID *string `json:"id,omitempty"`
3807	// Name - READ-ONLY; Resource name
3808	Name *string `json:"name,omitempty"`
3809	// Type - READ-ONLY; Resource type
3810	Type *string `json:"type,omitempty"`
3811	// Location - Resource location. Required on PUT (CreateOrReplace) requests.
3812	Location *string `json:"location,omitempty"`
3813	// Tags - Resource tags
3814	Tags map[string]*string `json:"tags"`
3815}
3816
3817// MarshalJSON is the custom marshaler for Resource.
3818func (r Resource) MarshalJSON() ([]byte, error) {
3819	objectMap := make(map[string]interface{})
3820	if r.Location != nil {
3821		objectMap["location"] = r.Location
3822	}
3823	if r.Tags != nil {
3824		objectMap["tags"] = r.Tags
3825	}
3826	return json.Marshal(objectMap)
3827}
3828
3829// ResourceTestStatus describes the status of the test operation along with error information, if
3830// applicable.
3831type ResourceTestStatus struct {
3832	autorest.Response `json:"-"`
3833	// Status - READ-ONLY; The status of the test operation.
3834	Status *string `json:"status,omitempty"`
3835	// Error - READ-ONLY; Describes the error that occurred.
3836	Error *ErrorResponse `json:"error,omitempty"`
3837}
3838
3839// MarshalJSON is the custom marshaler for ResourceTestStatus.
3840func (rts ResourceTestStatus) MarshalJSON() ([]byte, error) {
3841	objectMap := make(map[string]interface{})
3842	return json.Marshal(objectMap)
3843}
3844
3845// ScalarFunctionConfiguration describes the configuration of the scalar function.
3846type ScalarFunctionConfiguration struct {
3847	// Inputs - A list of inputs describing the parameters of the function.
3848	Inputs *[]FunctionInput `json:"inputs,omitempty"`
3849	// Output - The output of the function.
3850	Output *FunctionOutput `json:"output,omitempty"`
3851	// Binding - The physical binding of the function. For example, in the Azure Machine Learning web service’s case, this describes the endpoint.
3852	Binding BasicFunctionBinding `json:"binding,omitempty"`
3853}
3854
3855// UnmarshalJSON is the custom unmarshaler for ScalarFunctionConfiguration struct.
3856func (sfc *ScalarFunctionConfiguration) UnmarshalJSON(body []byte) error {
3857	var m map[string]*json.RawMessage
3858	err := json.Unmarshal(body, &m)
3859	if err != nil {
3860		return err
3861	}
3862	for k, v := range m {
3863		switch k {
3864		case "inputs":
3865			if v != nil {
3866				var inputs []FunctionInput
3867				err = json.Unmarshal(*v, &inputs)
3868				if err != nil {
3869					return err
3870				}
3871				sfc.Inputs = &inputs
3872			}
3873		case "output":
3874			if v != nil {
3875				var output FunctionOutput
3876				err = json.Unmarshal(*v, &output)
3877				if err != nil {
3878					return err
3879				}
3880				sfc.Output = &output
3881			}
3882		case "binding":
3883			if v != nil {
3884				binding, err := unmarshalBasicFunctionBinding(*v)
3885				if err != nil {
3886					return err
3887				}
3888				sfc.Binding = binding
3889			}
3890		}
3891	}
3892
3893	return nil
3894}
3895
3896// ScalarFunctionProperties the properties that are associated with a scalar function.
3897type ScalarFunctionProperties struct {
3898	// ScalarFunctionConfiguration - Describes the configuration of the scalar function.
3899	*ScalarFunctionConfiguration `json:"properties,omitempty"`
3900	// 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.
3901	Etag *string `json:"etag,omitempty"`
3902	// Type - Possible values include: 'TypeFunctionProperties', 'TypeScalar'
3903	Type TypeBasicFunctionProperties `json:"type,omitempty"`
3904}
3905
3906// MarshalJSON is the custom marshaler for ScalarFunctionProperties.
3907func (sfp ScalarFunctionProperties) MarshalJSON() ([]byte, error) {
3908	sfp.Type = TypeScalar
3909	objectMap := make(map[string]interface{})
3910	if sfp.ScalarFunctionConfiguration != nil {
3911		objectMap["properties"] = sfp.ScalarFunctionConfiguration
3912	}
3913	if sfp.Type != "" {
3914		objectMap["type"] = sfp.Type
3915	}
3916	return json.Marshal(objectMap)
3917}
3918
3919// AsScalarFunctionProperties is the BasicFunctionProperties implementation for ScalarFunctionProperties.
3920func (sfp ScalarFunctionProperties) AsScalarFunctionProperties() (*ScalarFunctionProperties, bool) {
3921	return &sfp, true
3922}
3923
3924// AsFunctionProperties is the BasicFunctionProperties implementation for ScalarFunctionProperties.
3925func (sfp ScalarFunctionProperties) AsFunctionProperties() (*FunctionProperties, bool) {
3926	return nil, false
3927}
3928
3929// AsBasicFunctionProperties is the BasicFunctionProperties implementation for ScalarFunctionProperties.
3930func (sfp ScalarFunctionProperties) AsBasicFunctionProperties() (BasicFunctionProperties, bool) {
3931	return &sfp, true
3932}
3933
3934// UnmarshalJSON is the custom unmarshaler for ScalarFunctionProperties struct.
3935func (sfp *ScalarFunctionProperties) UnmarshalJSON(body []byte) error {
3936	var m map[string]*json.RawMessage
3937	err := json.Unmarshal(body, &m)
3938	if err != nil {
3939		return err
3940	}
3941	for k, v := range m {
3942		switch k {
3943		case "properties":
3944			if v != nil {
3945				var scalarFunctionConfiguration ScalarFunctionConfiguration
3946				err = json.Unmarshal(*v, &scalarFunctionConfiguration)
3947				if err != nil {
3948					return err
3949				}
3950				sfp.ScalarFunctionConfiguration = &scalarFunctionConfiguration
3951			}
3952		case "etag":
3953			if v != nil {
3954				var etag string
3955				err = json.Unmarshal(*v, &etag)
3956				if err != nil {
3957					return err
3958				}
3959				sfp.Etag = &etag
3960			}
3961		case "type":
3962			if v != nil {
3963				var typeVar TypeBasicFunctionProperties
3964				err = json.Unmarshal(*v, &typeVar)
3965				if err != nil {
3966					return err
3967				}
3968				sfp.Type = typeVar
3969			}
3970		}
3971	}
3972
3973	return nil
3974}
3975
3976// BasicSerialization describes how data from an input is serialized or how data is serialized when written to an
3977// output.
3978type BasicSerialization interface {
3979	AsAvroSerialization() (*AvroSerialization, bool)
3980	AsJSONSerialization() (*JSONSerialization, bool)
3981	AsCsvSerialization() (*CsvSerialization, bool)
3982	AsSerialization() (*Serialization, bool)
3983}
3984
3985// Serialization describes how data from an input is serialized or how data is serialized when written to an
3986// output.
3987type Serialization struct {
3988	// Type - Possible values include: 'TypeSerialization', 'TypeAvro', 'TypeJSON', 'TypeCsv'
3989	Type Type `json:"type,omitempty"`
3990}
3991
3992func unmarshalBasicSerialization(body []byte) (BasicSerialization, error) {
3993	var m map[string]interface{}
3994	err := json.Unmarshal(body, &m)
3995	if err != nil {
3996		return nil, err
3997	}
3998
3999	switch m["type"] {
4000	case string(TypeAvro):
4001		var as AvroSerialization
4002		err := json.Unmarshal(body, &as)
4003		return as, err
4004	case string(TypeJSON):
4005		var js JSONSerialization
4006		err := json.Unmarshal(body, &js)
4007		return js, err
4008	case string(TypeCsv):
4009		var cs CsvSerialization
4010		err := json.Unmarshal(body, &cs)
4011		return cs, err
4012	default:
4013		var s Serialization
4014		err := json.Unmarshal(body, &s)
4015		return s, err
4016	}
4017}
4018func unmarshalBasicSerializationArray(body []byte) ([]BasicSerialization, error) {
4019	var rawMessages []*json.RawMessage
4020	err := json.Unmarshal(body, &rawMessages)
4021	if err != nil {
4022		return nil, err
4023	}
4024
4025	sArray := make([]BasicSerialization, len(rawMessages))
4026
4027	for index, rawMessage := range rawMessages {
4028		s, err := unmarshalBasicSerialization(*rawMessage)
4029		if err != nil {
4030			return nil, err
4031		}
4032		sArray[index] = s
4033	}
4034	return sArray, nil
4035}
4036
4037// MarshalJSON is the custom marshaler for Serialization.
4038func (s Serialization) MarshalJSON() ([]byte, error) {
4039	s.Type = TypeSerialization
4040	objectMap := make(map[string]interface{})
4041	if s.Type != "" {
4042		objectMap["type"] = s.Type
4043	}
4044	return json.Marshal(objectMap)
4045}
4046
4047// AsAvroSerialization is the BasicSerialization implementation for Serialization.
4048func (s Serialization) AsAvroSerialization() (*AvroSerialization, bool) {
4049	return nil, false
4050}
4051
4052// AsJSONSerialization is the BasicSerialization implementation for Serialization.
4053func (s Serialization) AsJSONSerialization() (*JSONSerialization, bool) {
4054	return nil, false
4055}
4056
4057// AsCsvSerialization is the BasicSerialization implementation for Serialization.
4058func (s Serialization) AsCsvSerialization() (*CsvSerialization, bool) {
4059	return nil, false
4060}
4061
4062// AsSerialization is the BasicSerialization implementation for Serialization.
4063func (s Serialization) AsSerialization() (*Serialization, bool) {
4064	return &s, true
4065}
4066
4067// AsBasicSerialization is the BasicSerialization implementation for Serialization.
4068func (s Serialization) AsBasicSerialization() (BasicSerialization, bool) {
4069	return &s, true
4070}
4071
4072// ServiceBusDataSourceProperties the common properties that are associated with Service Bus data sources
4073// (Queues, Topics, Event Hubs, etc.).
4074type ServiceBusDataSourceProperties struct {
4075	// ServiceBusNamespace - The namespace that is associated with the desired Event Hub, Service Bus Queue, Service Bus Topic, etc. Required on PUT (CreateOrReplace) requests.
4076	ServiceBusNamespace *string `json:"serviceBusNamespace,omitempty"`
4077	// SharedAccessPolicyName - The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc. Required on PUT (CreateOrReplace) requests.
4078	SharedAccessPolicyName *string `json:"sharedAccessPolicyName,omitempty"`
4079	// SharedAccessPolicyKey - The shared access policy key for the specified shared access policy. Required on PUT (CreateOrReplace) requests.
4080	SharedAccessPolicyKey *string `json:"sharedAccessPolicyKey,omitempty"`
4081}
4082
4083// ServiceBusQueueOutputDataSource describes a Service Bus Queue output data source.
4084type ServiceBusQueueOutputDataSource struct {
4085	// ServiceBusQueueOutputDataSourceProperties - The properties that are associated with a Service Bus Queue output. Required on PUT (CreateOrReplace) requests.
4086	*ServiceBusQueueOutputDataSourceProperties `json:"properties,omitempty"`
4087	// Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftDataLakeAccounts', 'TypePowerBI', 'TypeMicrosoftServiceBusTopic', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftStorageTable', 'TypeMicrosoftStorageBlob'
4088	Type TypeBasicOutputDataSource `json:"type,omitempty"`
4089}
4090
4091// MarshalJSON is the custom marshaler for ServiceBusQueueOutputDataSource.
4092func (sbqods ServiceBusQueueOutputDataSource) MarshalJSON() ([]byte, error) {
4093	sbqods.Type = TypeMicrosoftServiceBusQueue
4094	objectMap := make(map[string]interface{})
4095	if sbqods.ServiceBusQueueOutputDataSourceProperties != nil {
4096		objectMap["properties"] = sbqods.ServiceBusQueueOutputDataSourceProperties
4097	}
4098	if sbqods.Type != "" {
4099		objectMap["type"] = sbqods.Type
4100	}
4101	return json.Marshal(objectMap)
4102}
4103
4104// AsAzureDataLakeStoreOutputDataSource is the BasicOutputDataSource implementation for ServiceBusQueueOutputDataSource.
4105func (sbqods ServiceBusQueueOutputDataSource) AsAzureDataLakeStoreOutputDataSource() (*AzureDataLakeStoreOutputDataSource, bool) {
4106	return nil, false
4107}
4108
4109// AsPowerBIOutputDataSource is the BasicOutputDataSource implementation for ServiceBusQueueOutputDataSource.
4110func (sbqods ServiceBusQueueOutputDataSource) AsPowerBIOutputDataSource() (*PowerBIOutputDataSource, bool) {
4111	return nil, false
4112}
4113
4114// AsServiceBusTopicOutputDataSource is the BasicOutputDataSource implementation for ServiceBusQueueOutputDataSource.
4115func (sbqods ServiceBusQueueOutputDataSource) AsServiceBusTopicOutputDataSource() (*ServiceBusTopicOutputDataSource, bool) {
4116	return nil, false
4117}
4118
4119// AsServiceBusQueueOutputDataSource is the BasicOutputDataSource implementation for ServiceBusQueueOutputDataSource.
4120func (sbqods ServiceBusQueueOutputDataSource) AsServiceBusQueueOutputDataSource() (*ServiceBusQueueOutputDataSource, bool) {
4121	return &sbqods, true
4122}
4123
4124// AsDocumentDbOutputDataSource is the BasicOutputDataSource implementation for ServiceBusQueueOutputDataSource.
4125func (sbqods ServiceBusQueueOutputDataSource) AsDocumentDbOutputDataSource() (*DocumentDbOutputDataSource, bool) {
4126	return nil, false
4127}
4128
4129// AsAzureSQLDatabaseOutputDataSource is the BasicOutputDataSource implementation for ServiceBusQueueOutputDataSource.
4130func (sbqods ServiceBusQueueOutputDataSource) AsAzureSQLDatabaseOutputDataSource() (*AzureSQLDatabaseOutputDataSource, bool) {
4131	return nil, false
4132}
4133
4134// AsEventHubOutputDataSource is the BasicOutputDataSource implementation for ServiceBusQueueOutputDataSource.
4135func (sbqods ServiceBusQueueOutputDataSource) AsEventHubOutputDataSource() (*EventHubOutputDataSource, bool) {
4136	return nil, false
4137}
4138
4139// AsAzureTableOutputDataSource is the BasicOutputDataSource implementation for ServiceBusQueueOutputDataSource.
4140func (sbqods ServiceBusQueueOutputDataSource) AsAzureTableOutputDataSource() (*AzureTableOutputDataSource, bool) {
4141	return nil, false
4142}
4143
4144// AsBlobOutputDataSource is the BasicOutputDataSource implementation for ServiceBusQueueOutputDataSource.
4145func (sbqods ServiceBusQueueOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) {
4146	return nil, false
4147}
4148
4149// AsOutputDataSource is the BasicOutputDataSource implementation for ServiceBusQueueOutputDataSource.
4150func (sbqods ServiceBusQueueOutputDataSource) AsOutputDataSource() (*OutputDataSource, bool) {
4151	return nil, false
4152}
4153
4154// AsBasicOutputDataSource is the BasicOutputDataSource implementation for ServiceBusQueueOutputDataSource.
4155func (sbqods ServiceBusQueueOutputDataSource) AsBasicOutputDataSource() (BasicOutputDataSource, bool) {
4156	return &sbqods, true
4157}
4158
4159// UnmarshalJSON is the custom unmarshaler for ServiceBusQueueOutputDataSource struct.
4160func (sbqods *ServiceBusQueueOutputDataSource) UnmarshalJSON(body []byte) error {
4161	var m map[string]*json.RawMessage
4162	err := json.Unmarshal(body, &m)
4163	if err != nil {
4164		return err
4165	}
4166	for k, v := range m {
4167		switch k {
4168		case "properties":
4169			if v != nil {
4170				var serviceBusQueueOutputDataSourceProperties ServiceBusQueueOutputDataSourceProperties
4171				err = json.Unmarshal(*v, &serviceBusQueueOutputDataSourceProperties)
4172				if err != nil {
4173					return err
4174				}
4175				sbqods.ServiceBusQueueOutputDataSourceProperties = &serviceBusQueueOutputDataSourceProperties
4176			}
4177		case "type":
4178			if v != nil {
4179				var typeVar TypeBasicOutputDataSource
4180				err = json.Unmarshal(*v, &typeVar)
4181				if err != nil {
4182					return err
4183				}
4184				sbqods.Type = typeVar
4185			}
4186		}
4187	}
4188
4189	return nil
4190}
4191
4192// ServiceBusQueueOutputDataSourceProperties the properties that are associated with a Service Bus Queue
4193// output.
4194type ServiceBusQueueOutputDataSourceProperties struct {
4195	// QueueName - The name of the Service Bus Queue. Required on PUT (CreateOrReplace) requests.
4196	QueueName *string `json:"queueName,omitempty"`
4197	// PropertyColumns - A string array of the names of output columns to be attached to Service Bus messages as custom properties.
4198	PropertyColumns *[]string `json:"propertyColumns,omitempty"`
4199	// ServiceBusNamespace - The namespace that is associated with the desired Event Hub, Service Bus Queue, Service Bus Topic, etc. Required on PUT (CreateOrReplace) requests.
4200	ServiceBusNamespace *string `json:"serviceBusNamespace,omitempty"`
4201	// SharedAccessPolicyName - The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc. Required on PUT (CreateOrReplace) requests.
4202	SharedAccessPolicyName *string `json:"sharedAccessPolicyName,omitempty"`
4203	// SharedAccessPolicyKey - The shared access policy key for the specified shared access policy. Required on PUT (CreateOrReplace) requests.
4204	SharedAccessPolicyKey *string `json:"sharedAccessPolicyKey,omitempty"`
4205}
4206
4207// ServiceBusTopicOutputDataSource describes a Service Bus Topic output data source.
4208type ServiceBusTopicOutputDataSource struct {
4209	// ServiceBusTopicOutputDataSourceProperties - The properties that are associated with a Service Bus Topic output. Required on PUT (CreateOrReplace) requests.
4210	*ServiceBusTopicOutputDataSourceProperties `json:"properties,omitempty"`
4211	// Type - Possible values include: 'TypeOutputDataSource', 'TypeMicrosoftDataLakeAccounts', 'TypePowerBI', 'TypeMicrosoftServiceBusTopic', 'TypeMicrosoftServiceBusQueue', 'TypeMicrosoftStorageDocumentDB', 'TypeMicrosoftSQLServerDatabase', 'TypeMicrosoftServiceBusEventHub', 'TypeMicrosoftStorageTable', 'TypeMicrosoftStorageBlob'
4212	Type TypeBasicOutputDataSource `json:"type,omitempty"`
4213}
4214
4215// MarshalJSON is the custom marshaler for ServiceBusTopicOutputDataSource.
4216func (sbtods ServiceBusTopicOutputDataSource) MarshalJSON() ([]byte, error) {
4217	sbtods.Type = TypeMicrosoftServiceBusTopic
4218	objectMap := make(map[string]interface{})
4219	if sbtods.ServiceBusTopicOutputDataSourceProperties != nil {
4220		objectMap["properties"] = sbtods.ServiceBusTopicOutputDataSourceProperties
4221	}
4222	if sbtods.Type != "" {
4223		objectMap["type"] = sbtods.Type
4224	}
4225	return json.Marshal(objectMap)
4226}
4227
4228// AsAzureDataLakeStoreOutputDataSource is the BasicOutputDataSource implementation for ServiceBusTopicOutputDataSource.
4229func (sbtods ServiceBusTopicOutputDataSource) AsAzureDataLakeStoreOutputDataSource() (*AzureDataLakeStoreOutputDataSource, bool) {
4230	return nil, false
4231}
4232
4233// AsPowerBIOutputDataSource is the BasicOutputDataSource implementation for ServiceBusTopicOutputDataSource.
4234func (sbtods ServiceBusTopicOutputDataSource) AsPowerBIOutputDataSource() (*PowerBIOutputDataSource, bool) {
4235	return nil, false
4236}
4237
4238// AsServiceBusTopicOutputDataSource is the BasicOutputDataSource implementation for ServiceBusTopicOutputDataSource.
4239func (sbtods ServiceBusTopicOutputDataSource) AsServiceBusTopicOutputDataSource() (*ServiceBusTopicOutputDataSource, bool) {
4240	return &sbtods, true
4241}
4242
4243// AsServiceBusQueueOutputDataSource is the BasicOutputDataSource implementation for ServiceBusTopicOutputDataSource.
4244func (sbtods ServiceBusTopicOutputDataSource) AsServiceBusQueueOutputDataSource() (*ServiceBusQueueOutputDataSource, bool) {
4245	return nil, false
4246}
4247
4248// AsDocumentDbOutputDataSource is the BasicOutputDataSource implementation for ServiceBusTopicOutputDataSource.
4249func (sbtods ServiceBusTopicOutputDataSource) AsDocumentDbOutputDataSource() (*DocumentDbOutputDataSource, bool) {
4250	return nil, false
4251}
4252
4253// AsAzureSQLDatabaseOutputDataSource is the BasicOutputDataSource implementation for ServiceBusTopicOutputDataSource.
4254func (sbtods ServiceBusTopicOutputDataSource) AsAzureSQLDatabaseOutputDataSource() (*AzureSQLDatabaseOutputDataSource, bool) {
4255	return nil, false
4256}
4257
4258// AsEventHubOutputDataSource is the BasicOutputDataSource implementation for ServiceBusTopicOutputDataSource.
4259func (sbtods ServiceBusTopicOutputDataSource) AsEventHubOutputDataSource() (*EventHubOutputDataSource, bool) {
4260	return nil, false
4261}
4262
4263// AsAzureTableOutputDataSource is the BasicOutputDataSource implementation for ServiceBusTopicOutputDataSource.
4264func (sbtods ServiceBusTopicOutputDataSource) AsAzureTableOutputDataSource() (*AzureTableOutputDataSource, bool) {
4265	return nil, false
4266}
4267
4268// AsBlobOutputDataSource is the BasicOutputDataSource implementation for ServiceBusTopicOutputDataSource.
4269func (sbtods ServiceBusTopicOutputDataSource) AsBlobOutputDataSource() (*BlobOutputDataSource, bool) {
4270	return nil, false
4271}
4272
4273// AsOutputDataSource is the BasicOutputDataSource implementation for ServiceBusTopicOutputDataSource.
4274func (sbtods ServiceBusTopicOutputDataSource) AsOutputDataSource() (*OutputDataSource, bool) {
4275	return nil, false
4276}
4277
4278// AsBasicOutputDataSource is the BasicOutputDataSource implementation for ServiceBusTopicOutputDataSource.
4279func (sbtods ServiceBusTopicOutputDataSource) AsBasicOutputDataSource() (BasicOutputDataSource, bool) {
4280	return &sbtods, true
4281}
4282
4283// UnmarshalJSON is the custom unmarshaler for ServiceBusTopicOutputDataSource struct.
4284func (sbtods *ServiceBusTopicOutputDataSource) UnmarshalJSON(body []byte) error {
4285	var m map[string]*json.RawMessage
4286	err := json.Unmarshal(body, &m)
4287	if err != nil {
4288		return err
4289	}
4290	for k, v := range m {
4291		switch k {
4292		case "properties":
4293			if v != nil {
4294				var serviceBusTopicOutputDataSourceProperties ServiceBusTopicOutputDataSourceProperties
4295				err = json.Unmarshal(*v, &serviceBusTopicOutputDataSourceProperties)
4296				if err != nil {
4297					return err
4298				}
4299				sbtods.ServiceBusTopicOutputDataSourceProperties = &serviceBusTopicOutputDataSourceProperties
4300			}
4301		case "type":
4302			if v != nil {
4303				var typeVar TypeBasicOutputDataSource
4304				err = json.Unmarshal(*v, &typeVar)
4305				if err != nil {
4306					return err
4307				}
4308				sbtods.Type = typeVar
4309			}
4310		}
4311	}
4312
4313	return nil
4314}
4315
4316// ServiceBusTopicOutputDataSourceProperties the properties that are associated with a Service Bus Topic
4317// output.
4318type ServiceBusTopicOutputDataSourceProperties struct {
4319	// TopicName - The name of the Service Bus Topic. Required on PUT (CreateOrReplace) requests.
4320	TopicName *string `json:"topicName,omitempty"`
4321	// PropertyColumns - A string array of the names of output columns to be attached to Service Bus messages as custom properties.
4322	PropertyColumns *[]string `json:"propertyColumns,omitempty"`
4323	// ServiceBusNamespace - The namespace that is associated with the desired Event Hub, Service Bus Queue, Service Bus Topic, etc. Required on PUT (CreateOrReplace) requests.
4324	ServiceBusNamespace *string `json:"serviceBusNamespace,omitempty"`
4325	// SharedAccessPolicyName - The shared access policy name for the Event Hub, Service Bus Queue, Service Bus Topic, etc. Required on PUT (CreateOrReplace) requests.
4326	SharedAccessPolicyName *string `json:"sharedAccessPolicyName,omitempty"`
4327	// SharedAccessPolicyKey - The shared access policy key for the specified shared access policy. Required on PUT (CreateOrReplace) requests.
4328	SharedAccessPolicyKey *string `json:"sharedAccessPolicyKey,omitempty"`
4329}
4330
4331// Sku the properties that are associated with a SKU.
4332type Sku struct {
4333	// Name - The name of the SKU. Required on PUT (CreateOrReplace) requests. Possible values include: 'Standard'
4334	Name SkuName `json:"name,omitempty"`
4335}
4336
4337// StartStreamingJobParameters parameters supplied to the Start Streaming Job operation.
4338type StartStreamingJobParameters struct {
4339	// OutputStartMode - Value may be JobStartTime, CustomTime, or LastOutputEventTime to indicate whether the starting point of the output event stream should start whenever the job is started, start at a custom user time stamp specified via the outputStartTime property, or start from the last event output time. Possible values include: 'JobStartTime', 'CustomTime', 'LastOutputEventTime'
4340	OutputStartMode OutputStartMode `json:"outputStartMode,omitempty"`
4341	// OutputStartTime - Value is either an ISO-8601 formatted time stamp that indicates the starting point of the output event stream, or null to indicate that the output event stream will start whenever the streaming job is started. This property must have a value if outputStartMode is set to CustomTime.
4342	OutputStartTime *date.Time `json:"outputStartTime,omitempty"`
4343}
4344
4345// StorageAccount the properties that are associated with an Azure Storage account
4346type StorageAccount struct {
4347	// AccountName - The name of the Azure Storage account. Required on PUT (CreateOrReplace) requests.
4348	AccountName *string `json:"accountName,omitempty"`
4349	// AccountKey - The account key for the Azure Storage account. Required on PUT (CreateOrReplace) requests.
4350	AccountKey *string `json:"accountKey,omitempty"`
4351}
4352
4353// StreamingJob a streaming job object, containing all information associated with the named streaming job.
4354type StreamingJob struct {
4355	autorest.Response `json:"-"`
4356	// StreamingJobProperties - The properties that are associated with a streaming job.  Required on PUT (CreateOrReplace) requests.
4357	*StreamingJobProperties `json:"properties,omitempty"`
4358	// ID - READ-ONLY; Resource Id
4359	ID *string `json:"id,omitempty"`
4360	// Name - READ-ONLY; Resource name
4361	Name *string `json:"name,omitempty"`
4362	// Type - READ-ONLY; Resource type
4363	Type *string `json:"type,omitempty"`
4364	// Location - Resource location. Required on PUT (CreateOrReplace) requests.
4365	Location *string `json:"location,omitempty"`
4366	// Tags - Resource tags
4367	Tags map[string]*string `json:"tags"`
4368}
4369
4370// MarshalJSON is the custom marshaler for StreamingJob.
4371func (sj StreamingJob) MarshalJSON() ([]byte, error) {
4372	objectMap := make(map[string]interface{})
4373	if sj.StreamingJobProperties != nil {
4374		objectMap["properties"] = sj.StreamingJobProperties
4375	}
4376	if sj.Location != nil {
4377		objectMap["location"] = sj.Location
4378	}
4379	if sj.Tags != nil {
4380		objectMap["tags"] = sj.Tags
4381	}
4382	return json.Marshal(objectMap)
4383}
4384
4385// UnmarshalJSON is the custom unmarshaler for StreamingJob struct.
4386func (sj *StreamingJob) UnmarshalJSON(body []byte) error {
4387	var m map[string]*json.RawMessage
4388	err := json.Unmarshal(body, &m)
4389	if err != nil {
4390		return err
4391	}
4392	for k, v := range m {
4393		switch k {
4394		case "properties":
4395			if v != nil {
4396				var streamingJobProperties StreamingJobProperties
4397				err = json.Unmarshal(*v, &streamingJobProperties)
4398				if err != nil {
4399					return err
4400				}
4401				sj.StreamingJobProperties = &streamingJobProperties
4402			}
4403		case "id":
4404			if v != nil {
4405				var ID string
4406				err = json.Unmarshal(*v, &ID)
4407				if err != nil {
4408					return err
4409				}
4410				sj.ID = &ID
4411			}
4412		case "name":
4413			if v != nil {
4414				var name string
4415				err = json.Unmarshal(*v, &name)
4416				if err != nil {
4417					return err
4418				}
4419				sj.Name = &name
4420			}
4421		case "type":
4422			if v != nil {
4423				var typeVar string
4424				err = json.Unmarshal(*v, &typeVar)
4425				if err != nil {
4426					return err
4427				}
4428				sj.Type = &typeVar
4429			}
4430		case "location":
4431			if v != nil {
4432				var location string
4433				err = json.Unmarshal(*v, &location)
4434				if err != nil {
4435					return err
4436				}
4437				sj.Location = &location
4438			}
4439		case "tags":
4440			if v != nil {
4441				var tags map[string]*string
4442				err = json.Unmarshal(*v, &tags)
4443				if err != nil {
4444					return err
4445				}
4446				sj.Tags = tags
4447			}
4448		}
4449	}
4450
4451	return nil
4452}
4453
4454// StreamingJobListResult object containing a list of streaming jobs.
4455type StreamingJobListResult struct {
4456	autorest.Response `json:"-"`
4457	// Value - READ-ONLY; A list of streaming jobs. Populated by a 'List' operation.
4458	Value *[]StreamingJob `json:"value,omitempty"`
4459	// NextLink - READ-ONLY; The link (url) to the next page of results.
4460	NextLink *string `json:"nextLink,omitempty"`
4461}
4462
4463// MarshalJSON is the custom marshaler for StreamingJobListResult.
4464func (sjlr StreamingJobListResult) MarshalJSON() ([]byte, error) {
4465	objectMap := make(map[string]interface{})
4466	return json.Marshal(objectMap)
4467}
4468
4469// StreamingJobListResultIterator provides access to a complete listing of StreamingJob values.
4470type StreamingJobListResultIterator struct {
4471	i    int
4472	page StreamingJobListResultPage
4473}
4474
4475// NextWithContext advances to the next value.  If there was an error making
4476// the request the iterator does not advance and the error is returned.
4477func (iter *StreamingJobListResultIterator) NextWithContext(ctx context.Context) (err error) {
4478	if tracing.IsEnabled() {
4479		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingJobListResultIterator.NextWithContext")
4480		defer func() {
4481			sc := -1
4482			if iter.Response().Response.Response != nil {
4483				sc = iter.Response().Response.Response.StatusCode
4484			}
4485			tracing.EndSpan(ctx, sc, err)
4486		}()
4487	}
4488	iter.i++
4489	if iter.i < len(iter.page.Values()) {
4490		return nil
4491	}
4492	err = iter.page.NextWithContext(ctx)
4493	if err != nil {
4494		iter.i--
4495		return err
4496	}
4497	iter.i = 0
4498	return nil
4499}
4500
4501// Next advances to the next value.  If there was an error making
4502// the request the iterator does not advance and the error is returned.
4503// Deprecated: Use NextWithContext() instead.
4504func (iter *StreamingJobListResultIterator) Next() error {
4505	return iter.NextWithContext(context.Background())
4506}
4507
4508// NotDone returns true if the enumeration should be started or is not yet complete.
4509func (iter StreamingJobListResultIterator) NotDone() bool {
4510	return iter.page.NotDone() && iter.i < len(iter.page.Values())
4511}
4512
4513// Response returns the raw server response from the last page request.
4514func (iter StreamingJobListResultIterator) Response() StreamingJobListResult {
4515	return iter.page.Response()
4516}
4517
4518// Value returns the current value or a zero-initialized value if the
4519// iterator has advanced beyond the end of the collection.
4520func (iter StreamingJobListResultIterator) Value() StreamingJob {
4521	if !iter.page.NotDone() {
4522		return StreamingJob{}
4523	}
4524	return iter.page.Values()[iter.i]
4525}
4526
4527// Creates a new instance of the StreamingJobListResultIterator type.
4528func NewStreamingJobListResultIterator(page StreamingJobListResultPage) StreamingJobListResultIterator {
4529	return StreamingJobListResultIterator{page: page}
4530}
4531
4532// IsEmpty returns true if the ListResult contains no values.
4533func (sjlr StreamingJobListResult) IsEmpty() bool {
4534	return sjlr.Value == nil || len(*sjlr.Value) == 0
4535}
4536
4537// hasNextLink returns true if the NextLink is not empty.
4538func (sjlr StreamingJobListResult) hasNextLink() bool {
4539	return sjlr.NextLink != nil && len(*sjlr.NextLink) != 0
4540}
4541
4542// streamingJobListResultPreparer prepares a request to retrieve the next set of results.
4543// It returns nil if no more results exist.
4544func (sjlr StreamingJobListResult) streamingJobListResultPreparer(ctx context.Context) (*http.Request, error) {
4545	if !sjlr.hasNextLink() {
4546		return nil, nil
4547	}
4548	return autorest.Prepare((&http.Request{}).WithContext(ctx),
4549		autorest.AsJSON(),
4550		autorest.AsGet(),
4551		autorest.WithBaseURL(to.String(sjlr.NextLink)))
4552}
4553
4554// StreamingJobListResultPage contains a page of StreamingJob values.
4555type StreamingJobListResultPage struct {
4556	fn   func(context.Context, StreamingJobListResult) (StreamingJobListResult, error)
4557	sjlr StreamingJobListResult
4558}
4559
4560// NextWithContext advances to the next page of values.  If there was an error making
4561// the request the page does not advance and the error is returned.
4562func (page *StreamingJobListResultPage) NextWithContext(ctx context.Context) (err error) {
4563	if tracing.IsEnabled() {
4564		ctx = tracing.StartSpan(ctx, fqdn+"/StreamingJobListResultPage.NextWithContext")
4565		defer func() {
4566			sc := -1
4567			if page.Response().Response.Response != nil {
4568				sc = page.Response().Response.Response.StatusCode
4569			}
4570			tracing.EndSpan(ctx, sc, err)
4571		}()
4572	}
4573	for {
4574		next, err := page.fn(ctx, page.sjlr)
4575		if err != nil {
4576			return err
4577		}
4578		page.sjlr = next
4579		if !next.hasNextLink() || !next.IsEmpty() {
4580			break
4581		}
4582	}
4583	return nil
4584}
4585
4586// Next advances to the next page of values.  If there was an error making
4587// the request the page does not advance and the error is returned.
4588// Deprecated: Use NextWithContext() instead.
4589func (page *StreamingJobListResultPage) Next() error {
4590	return page.NextWithContext(context.Background())
4591}
4592
4593// NotDone returns true if the page enumeration should be started or is not yet complete.
4594func (page StreamingJobListResultPage) NotDone() bool {
4595	return !page.sjlr.IsEmpty()
4596}
4597
4598// Response returns the raw server response from the last page request.
4599func (page StreamingJobListResultPage) Response() StreamingJobListResult {
4600	return page.sjlr
4601}
4602
4603// Values returns the slice of values for the current page or nil if there are no values.
4604func (page StreamingJobListResultPage) Values() []StreamingJob {
4605	if page.sjlr.IsEmpty() {
4606		return nil
4607	}
4608	return *page.sjlr.Value
4609}
4610
4611// Creates a new instance of the StreamingJobListResultPage type.
4612func NewStreamingJobListResultPage(cur StreamingJobListResult, getNextPage func(context.Context, StreamingJobListResult) (StreamingJobListResult, error)) StreamingJobListResultPage {
4613	return StreamingJobListResultPage{
4614		fn:   getNextPage,
4615		sjlr: cur,
4616	}
4617}
4618
4619// StreamingJobProperties the properties that are associated with a streaming job.
4620type StreamingJobProperties struct {
4621	// Sku - Describes the SKU of the streaming job. Required on PUT (CreateOrReplace) requests.
4622	Sku *Sku `json:"sku,omitempty"`
4623	// JobID - READ-ONLY; A GUID uniquely identifying the streaming job. This GUID is generated upon creation of the streaming job.
4624	JobID *string `json:"jobId,omitempty"`
4625	// ProvisioningState - READ-ONLY; Describes the provisioning status of the streaming job.
4626	ProvisioningState *string `json:"provisioningState,omitempty"`
4627	// JobState - READ-ONLY; Describes the state of the streaming job.
4628	JobState *string `json:"jobState,omitempty"`
4629	// OutputStartMode - This property should only be utilized when it is desired that the job be started immediately upon creation. Value may be JobStartTime, CustomTime, or LastOutputEventTime to indicate whether the starting point of the output event stream should start whenever the job is started, start at a custom user time stamp specified via the outputStartTime property, or start from the last event output time. Possible values include: 'JobStartTime', 'CustomTime', 'LastOutputEventTime'
4630	OutputStartMode OutputStartMode `json:"outputStartMode,omitempty"`
4631	// OutputStartTime - Value is either an ISO-8601 formatted time stamp that indicates the starting point of the output event stream, or null to indicate that the output event stream will start whenever the streaming job is started. This property must have a value if outputStartMode is set to CustomTime.
4632	OutputStartTime *date.Time `json:"outputStartTime,omitempty"`
4633	// LastOutputEventTime - READ-ONLY; Value is either an ISO-8601 formatted timestamp indicating the last output event time of the streaming job or null indicating that output has not yet been produced. In case of multiple outputs or multiple streams, this shows the latest value in that set.
4634	LastOutputEventTime *date.Time `json:"lastOutputEventTime,omitempty"`
4635	// EventsOutOfOrderPolicy - Indicates the policy to apply to events that arrive out of order in the input event stream. Possible values include: 'Adjust', 'Drop'
4636	EventsOutOfOrderPolicy EventsOutOfOrderPolicy `json:"eventsOutOfOrderPolicy,omitempty"`
4637	// OutputErrorPolicy - Indicates the policy to apply to events that arrive at the output and cannot be written to the external storage due to being malformed (missing column values, column values of wrong type or size). Possible values include: 'OutputErrorPolicyStop', 'OutputErrorPolicyDrop'
4638	OutputErrorPolicy OutputErrorPolicy `json:"outputErrorPolicy,omitempty"`
4639	// EventsOutOfOrderMaxDelayInSeconds - The maximum tolerable delay in seconds where out-of-order events can be adjusted to be back in order.
4640	EventsOutOfOrderMaxDelayInSeconds *int32 `json:"eventsOutOfOrderMaxDelayInSeconds,omitempty"`
4641	// EventsLateArrivalMaxDelayInSeconds - The maximum tolerable delay in seconds where events arriving late could be included.  Supported range is -1 to 1814399 (20.23:59:59 days) and -1 is used to specify wait indefinitely. If the property is absent, it is interpreted to have a value of -1.
4642	EventsLateArrivalMaxDelayInSeconds *int32 `json:"eventsLateArrivalMaxDelayInSeconds,omitempty"`
4643	// DataLocale - The data locale of the stream analytics job. Value should be the name of a supported .NET Culture from the set https://msdn.microsoft.com/en-us/library/system.globalization.culturetypes(v=vs.110).aspx. Defaults to 'en-US' if none specified.
4644	DataLocale *string `json:"dataLocale,omitempty"`
4645	// CompatibilityLevel - Controls certain runtime behaviors of the streaming job. Possible values include: 'OneFullStopZero'
4646	CompatibilityLevel CompatibilityLevel `json:"compatibilityLevel,omitempty"`
4647	// CreatedDate - READ-ONLY; Value is an ISO-8601 formatted UTC timestamp indicating when the streaming job was created.
4648	CreatedDate *date.Time `json:"createdDate,omitempty"`
4649	// Inputs - A list of one or more inputs to the streaming job. The name property for each input is required when specifying this property in a PUT request. This property cannot be modify via a PATCH operation. You must use the PATCH API available for the individual input.
4650	Inputs *[]Input `json:"inputs,omitempty"`
4651	// Transformation - Indicates the query and the number of streaming units to use for the streaming job. The name property of the transformation is required when specifying this property in a PUT request. This property cannot be modify via a PATCH operation. You must use the PATCH API available for the individual transformation.
4652	Transformation *Transformation `json:"transformation,omitempty"`
4653	// Outputs - A list of one or more outputs for the streaming job. The name property for each output is required when specifying this property in a PUT request. This property cannot be modify via a PATCH operation. You must use the PATCH API available for the individual output.
4654	Outputs *[]Output `json:"outputs,omitempty"`
4655	// Functions - A list of one or more functions for the streaming job. The name property for each function is required when specifying this property in a PUT request. This property cannot be modify via a PATCH operation. You must use the PATCH API available for the individual transformation.
4656	Functions *[]Function `json:"functions,omitempty"`
4657	// Etag - READ-ONLY; The current entity tag for the streaming job. 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.
4658	Etag *string `json:"etag,omitempty"`
4659}
4660
4661// MarshalJSON is the custom marshaler for StreamingJobProperties.
4662func (sjp StreamingJobProperties) MarshalJSON() ([]byte, error) {
4663	objectMap := make(map[string]interface{})
4664	if sjp.Sku != nil {
4665		objectMap["sku"] = sjp.Sku
4666	}
4667	if sjp.OutputStartMode != "" {
4668		objectMap["outputStartMode"] = sjp.OutputStartMode
4669	}
4670	if sjp.OutputStartTime != nil {
4671		objectMap["outputStartTime"] = sjp.OutputStartTime
4672	}
4673	if sjp.EventsOutOfOrderPolicy != "" {
4674		objectMap["eventsOutOfOrderPolicy"] = sjp.EventsOutOfOrderPolicy
4675	}
4676	if sjp.OutputErrorPolicy != "" {
4677		objectMap["outputErrorPolicy"] = sjp.OutputErrorPolicy
4678	}
4679	if sjp.EventsOutOfOrderMaxDelayInSeconds != nil {
4680		objectMap["eventsOutOfOrderMaxDelayInSeconds"] = sjp.EventsOutOfOrderMaxDelayInSeconds
4681	}
4682	if sjp.EventsLateArrivalMaxDelayInSeconds != nil {
4683		objectMap["eventsLateArrivalMaxDelayInSeconds"] = sjp.EventsLateArrivalMaxDelayInSeconds
4684	}
4685	if sjp.DataLocale != nil {
4686		objectMap["dataLocale"] = sjp.DataLocale
4687	}
4688	if sjp.CompatibilityLevel != "" {
4689		objectMap["compatibilityLevel"] = sjp.CompatibilityLevel
4690	}
4691	if sjp.Inputs != nil {
4692		objectMap["inputs"] = sjp.Inputs
4693	}
4694	if sjp.Transformation != nil {
4695		objectMap["transformation"] = sjp.Transformation
4696	}
4697	if sjp.Outputs != nil {
4698		objectMap["outputs"] = sjp.Outputs
4699	}
4700	if sjp.Functions != nil {
4701		objectMap["functions"] = sjp.Functions
4702	}
4703	return json.Marshal(objectMap)
4704}
4705
4706// StreamingJobsCreateOrReplaceFuture an abstraction for monitoring and retrieving the results of a
4707// long-running operation.
4708type StreamingJobsCreateOrReplaceFuture struct {
4709	azure.FutureAPI
4710	// Result returns the result of the asynchronous operation.
4711	// If the operation has not completed it will return an error.
4712	Result func(StreamingJobsClient) (StreamingJob, error)
4713}
4714
4715// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4716func (future *StreamingJobsCreateOrReplaceFuture) UnmarshalJSON(body []byte) error {
4717	var azFuture azure.Future
4718	if err := json.Unmarshal(body, &azFuture); err != nil {
4719		return err
4720	}
4721	future.FutureAPI = &azFuture
4722	future.Result = future.result
4723	return nil
4724}
4725
4726// result is the default implementation for StreamingJobsCreateOrReplaceFuture.Result.
4727func (future *StreamingJobsCreateOrReplaceFuture) result(client StreamingJobsClient) (sj StreamingJob, err error) {
4728	var done bool
4729	done, err = future.DoneWithContext(context.Background(), client)
4730	if err != nil {
4731		err = autorest.NewErrorWithError(err, "streamanalytics.StreamingJobsCreateOrReplaceFuture", "Result", future.Response(), "Polling failure")
4732		return
4733	}
4734	if !done {
4735		sj.Response.Response = future.Response()
4736		err = azure.NewAsyncOpIncompleteError("streamanalytics.StreamingJobsCreateOrReplaceFuture")
4737		return
4738	}
4739	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
4740	if sj.Response.Response, err = future.GetResult(sender); err == nil && sj.Response.Response.StatusCode != http.StatusNoContent {
4741		sj, err = client.CreateOrReplaceResponder(sj.Response.Response)
4742		if err != nil {
4743			err = autorest.NewErrorWithError(err, "streamanalytics.StreamingJobsCreateOrReplaceFuture", "Result", sj.Response.Response, "Failure responding to request")
4744		}
4745	}
4746	return
4747}
4748
4749// StreamingJobsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
4750// operation.
4751type StreamingJobsDeleteFuture struct {
4752	azure.FutureAPI
4753	// Result returns the result of the asynchronous operation.
4754	// If the operation has not completed it will return an error.
4755	Result func(StreamingJobsClient) (autorest.Response, error)
4756}
4757
4758// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4759func (future *StreamingJobsDeleteFuture) UnmarshalJSON(body []byte) error {
4760	var azFuture azure.Future
4761	if err := json.Unmarshal(body, &azFuture); err != nil {
4762		return err
4763	}
4764	future.FutureAPI = &azFuture
4765	future.Result = future.result
4766	return nil
4767}
4768
4769// result is the default implementation for StreamingJobsDeleteFuture.Result.
4770func (future *StreamingJobsDeleteFuture) result(client StreamingJobsClient) (ar autorest.Response, err error) {
4771	var done bool
4772	done, err = future.DoneWithContext(context.Background(), client)
4773	if err != nil {
4774		err = autorest.NewErrorWithError(err, "streamanalytics.StreamingJobsDeleteFuture", "Result", future.Response(), "Polling failure")
4775		return
4776	}
4777	if !done {
4778		ar.Response = future.Response()
4779		err = azure.NewAsyncOpIncompleteError("streamanalytics.StreamingJobsDeleteFuture")
4780		return
4781	}
4782	ar.Response = future.Response()
4783	return
4784}
4785
4786// StreamingJobsStartFuture an abstraction for monitoring and retrieving the results of a long-running
4787// operation.
4788type StreamingJobsStartFuture struct {
4789	azure.FutureAPI
4790	// Result returns the result of the asynchronous operation.
4791	// If the operation has not completed it will return an error.
4792	Result func(StreamingJobsClient) (autorest.Response, error)
4793}
4794
4795// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4796func (future *StreamingJobsStartFuture) UnmarshalJSON(body []byte) error {
4797	var azFuture azure.Future
4798	if err := json.Unmarshal(body, &azFuture); err != nil {
4799		return err
4800	}
4801	future.FutureAPI = &azFuture
4802	future.Result = future.result
4803	return nil
4804}
4805
4806// result is the default implementation for StreamingJobsStartFuture.Result.
4807func (future *StreamingJobsStartFuture) result(client StreamingJobsClient) (ar autorest.Response, err error) {
4808	var done bool
4809	done, err = future.DoneWithContext(context.Background(), client)
4810	if err != nil {
4811		err = autorest.NewErrorWithError(err, "streamanalytics.StreamingJobsStartFuture", "Result", future.Response(), "Polling failure")
4812		return
4813	}
4814	if !done {
4815		ar.Response = future.Response()
4816		err = azure.NewAsyncOpIncompleteError("streamanalytics.StreamingJobsStartFuture")
4817		return
4818	}
4819	ar.Response = future.Response()
4820	return
4821}
4822
4823// StreamingJobsStopFuture an abstraction for monitoring and retrieving the results of a long-running
4824// operation.
4825type StreamingJobsStopFuture struct {
4826	azure.FutureAPI
4827	// Result returns the result of the asynchronous operation.
4828	// If the operation has not completed it will return an error.
4829	Result func(StreamingJobsClient) (autorest.Response, error)
4830}
4831
4832// UnmarshalJSON is the custom unmarshaller for CreateFuture.
4833func (future *StreamingJobsStopFuture) UnmarshalJSON(body []byte) error {
4834	var azFuture azure.Future
4835	if err := json.Unmarshal(body, &azFuture); err != nil {
4836		return err
4837	}
4838	future.FutureAPI = &azFuture
4839	future.Result = future.result
4840	return nil
4841}
4842
4843// result is the default implementation for StreamingJobsStopFuture.Result.
4844func (future *StreamingJobsStopFuture) result(client StreamingJobsClient) (ar autorest.Response, err error) {
4845	var done bool
4846	done, err = future.DoneWithContext(context.Background(), client)
4847	if err != nil {
4848		err = autorest.NewErrorWithError(err, "streamanalytics.StreamingJobsStopFuture", "Result", future.Response(), "Polling failure")
4849		return
4850	}
4851	if !done {
4852		ar.Response = future.Response()
4853		err = azure.NewAsyncOpIncompleteError("streamanalytics.StreamingJobsStopFuture")
4854		return
4855	}
4856	ar.Response = future.Response()
4857	return
4858}
4859
4860// BasicStreamInputDataSource describes an input data source that contains stream data.
4861type BasicStreamInputDataSource interface {
4862	AsIoTHubStreamInputDataSource() (*IoTHubStreamInputDataSource, bool)
4863	AsEventHubStreamInputDataSource() (*EventHubStreamInputDataSource, bool)
4864	AsBlobStreamInputDataSource() (*BlobStreamInputDataSource, bool)
4865	AsStreamInputDataSource() (*StreamInputDataSource, bool)
4866}
4867
4868// StreamInputDataSource describes an input data source that contains stream data.
4869type StreamInputDataSource struct {
4870	// Type - Possible values include: 'TypeBasicStreamInputDataSourceTypeStreamInputDataSource', 'TypeBasicStreamInputDataSourceTypeMicrosoftDevicesIotHubs', 'TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub', 'TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob'
4871	Type TypeBasicStreamInputDataSource `json:"type,omitempty"`
4872}
4873
4874func unmarshalBasicStreamInputDataSource(body []byte) (BasicStreamInputDataSource, error) {
4875	var m map[string]interface{}
4876	err := json.Unmarshal(body, &m)
4877	if err != nil {
4878		return nil, err
4879	}
4880
4881	switch m["type"] {
4882	case string(TypeBasicStreamInputDataSourceTypeMicrosoftDevicesIotHubs):
4883		var ithsids IoTHubStreamInputDataSource
4884		err := json.Unmarshal(body, &ithsids)
4885		return ithsids, err
4886	case string(TypeBasicStreamInputDataSourceTypeMicrosoftServiceBusEventHub):
4887		var ehsids EventHubStreamInputDataSource
4888		err := json.Unmarshal(body, &ehsids)
4889		return ehsids, err
4890	case string(TypeBasicStreamInputDataSourceTypeMicrosoftStorageBlob):
4891		var bsids BlobStreamInputDataSource
4892		err := json.Unmarshal(body, &bsids)
4893		return bsids, err
4894	default:
4895		var sids StreamInputDataSource
4896		err := json.Unmarshal(body, &sids)
4897		return sids, err
4898	}
4899}
4900func unmarshalBasicStreamInputDataSourceArray(body []byte) ([]BasicStreamInputDataSource, error) {
4901	var rawMessages []*json.RawMessage
4902	err := json.Unmarshal(body, &rawMessages)
4903	if err != nil {
4904		return nil, err
4905	}
4906
4907	sidsArray := make([]BasicStreamInputDataSource, len(rawMessages))
4908
4909	for index, rawMessage := range rawMessages {
4910		sids, err := unmarshalBasicStreamInputDataSource(*rawMessage)
4911		if err != nil {
4912			return nil, err
4913		}
4914		sidsArray[index] = sids
4915	}
4916	return sidsArray, nil
4917}
4918
4919// MarshalJSON is the custom marshaler for StreamInputDataSource.
4920func (sids StreamInputDataSource) MarshalJSON() ([]byte, error) {
4921	sids.Type = TypeBasicStreamInputDataSourceTypeStreamInputDataSource
4922	objectMap := make(map[string]interface{})
4923	if sids.Type != "" {
4924		objectMap["type"] = sids.Type
4925	}
4926	return json.Marshal(objectMap)
4927}
4928
4929// AsIoTHubStreamInputDataSource is the BasicStreamInputDataSource implementation for StreamInputDataSource.
4930func (sids StreamInputDataSource) AsIoTHubStreamInputDataSource() (*IoTHubStreamInputDataSource, bool) {
4931	return nil, false
4932}
4933
4934// AsEventHubStreamInputDataSource is the BasicStreamInputDataSource implementation for StreamInputDataSource.
4935func (sids StreamInputDataSource) AsEventHubStreamInputDataSource() (*EventHubStreamInputDataSource, bool) {
4936	return nil, false
4937}
4938
4939// AsBlobStreamInputDataSource is the BasicStreamInputDataSource implementation for StreamInputDataSource.
4940func (sids StreamInputDataSource) AsBlobStreamInputDataSource() (*BlobStreamInputDataSource, bool) {
4941	return nil, false
4942}
4943
4944// AsStreamInputDataSource is the BasicStreamInputDataSource implementation for StreamInputDataSource.
4945func (sids StreamInputDataSource) AsStreamInputDataSource() (*StreamInputDataSource, bool) {
4946	return &sids, true
4947}
4948
4949// AsBasicStreamInputDataSource is the BasicStreamInputDataSource implementation for StreamInputDataSource.
4950func (sids StreamInputDataSource) AsBasicStreamInputDataSource() (BasicStreamInputDataSource, bool) {
4951	return &sids, true
4952}
4953
4954// StreamInputProperties the properties that are associated with an input containing stream data.
4955type StreamInputProperties struct {
4956	// Datasource - Describes an input data source that contains stream data. Required on PUT (CreateOrReplace) requests.
4957	Datasource BasicStreamInputDataSource `json:"datasource,omitempty"`
4958	// Serialization - Describes how data from an input is serialized or how data is serialized when written to an output. Required on PUT (CreateOrReplace) requests.
4959	Serialization BasicSerialization `json:"serialization,omitempty"`
4960	// Diagnostics - READ-ONLY; Describes conditions applicable to the Input, Output, or the job overall, that warrant customer attention.
4961	Diagnostics *Diagnostics `json:"diagnostics,omitempty"`
4962	// Etag - READ-ONLY; The current entity tag for the input. 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.
4963	Etag *string `json:"etag,omitempty"`
4964	// Type - Possible values include: 'TypeInputProperties', 'TypeReference', 'TypeStream'
4965	Type TypeBasicInputProperties `json:"type,omitempty"`
4966}
4967
4968// MarshalJSON is the custom marshaler for StreamInputProperties.
4969func (sip StreamInputProperties) MarshalJSON() ([]byte, error) {
4970	sip.Type = TypeStream
4971	objectMap := make(map[string]interface{})
4972	objectMap["datasource"] = sip.Datasource
4973	objectMap["serialization"] = sip.Serialization
4974	if sip.Type != "" {
4975		objectMap["type"] = sip.Type
4976	}
4977	return json.Marshal(objectMap)
4978}
4979
4980// AsReferenceInputProperties is the BasicInputProperties implementation for StreamInputProperties.
4981func (sip StreamInputProperties) AsReferenceInputProperties() (*ReferenceInputProperties, bool) {
4982	return nil, false
4983}
4984
4985// AsStreamInputProperties is the BasicInputProperties implementation for StreamInputProperties.
4986func (sip StreamInputProperties) AsStreamInputProperties() (*StreamInputProperties, bool) {
4987	return &sip, true
4988}
4989
4990// AsInputProperties is the BasicInputProperties implementation for StreamInputProperties.
4991func (sip StreamInputProperties) AsInputProperties() (*InputProperties, bool) {
4992	return nil, false
4993}
4994
4995// AsBasicInputProperties is the BasicInputProperties implementation for StreamInputProperties.
4996func (sip StreamInputProperties) AsBasicInputProperties() (BasicInputProperties, bool) {
4997	return &sip, true
4998}
4999
5000// UnmarshalJSON is the custom unmarshaler for StreamInputProperties struct.
5001func (sip *StreamInputProperties) UnmarshalJSON(body []byte) error {
5002	var m map[string]*json.RawMessage
5003	err := json.Unmarshal(body, &m)
5004	if err != nil {
5005		return err
5006	}
5007	for k, v := range m {
5008		switch k {
5009		case "datasource":
5010			if v != nil {
5011				datasource, err := unmarshalBasicStreamInputDataSource(*v)
5012				if err != nil {
5013					return err
5014				}
5015				sip.Datasource = datasource
5016			}
5017		case "serialization":
5018			if v != nil {
5019				serialization, err := unmarshalBasicSerialization(*v)
5020				if err != nil {
5021					return err
5022				}
5023				sip.Serialization = serialization
5024			}
5025		case "diagnostics":
5026			if v != nil {
5027				var diagnostics Diagnostics
5028				err = json.Unmarshal(*v, &diagnostics)
5029				if err != nil {
5030					return err
5031				}
5032				sip.Diagnostics = &diagnostics
5033			}
5034		case "etag":
5035			if v != nil {
5036				var etag string
5037				err = json.Unmarshal(*v, &etag)
5038				if err != nil {
5039					return err
5040				}
5041				sip.Etag = &etag
5042			}
5043		case "type":
5044			if v != nil {
5045				var typeVar TypeBasicInputProperties
5046				err = json.Unmarshal(*v, &typeVar)
5047				if err != nil {
5048					return err
5049				}
5050				sip.Type = typeVar
5051			}
5052		}
5053	}
5054
5055	return nil
5056}
5057
5058// SubResource the base sub-resource model definition.
5059type SubResource struct {
5060	// ID - READ-ONLY; Resource Id
5061	ID *string `json:"id,omitempty"`
5062	// Name - Resource name
5063	Name *string `json:"name,omitempty"`
5064	// Type - READ-ONLY; Resource type
5065	Type *string `json:"type,omitempty"`
5066}
5067
5068// MarshalJSON is the custom marshaler for SubResource.
5069func (sr SubResource) MarshalJSON() ([]byte, error) {
5070	objectMap := make(map[string]interface{})
5071	if sr.Name != nil {
5072		objectMap["name"] = sr.Name
5073	}
5074	return json.Marshal(objectMap)
5075}
5076
5077// SubscriptionQuota describes the current quota for the subscription.
5078type SubscriptionQuota struct {
5079	// SubscriptionQuotaProperties - READ-ONLY; Describes the properties of the quota.
5080	*SubscriptionQuotaProperties `json:"properties,omitempty"`
5081	// ID - READ-ONLY; Resource Id
5082	ID *string `json:"id,omitempty"`
5083	// Name - Resource name
5084	Name *string `json:"name,omitempty"`
5085	// Type - READ-ONLY; Resource type
5086	Type *string `json:"type,omitempty"`
5087}
5088
5089// MarshalJSON is the custom marshaler for SubscriptionQuota.
5090func (sq SubscriptionQuota) MarshalJSON() ([]byte, error) {
5091	objectMap := make(map[string]interface{})
5092	if sq.Name != nil {
5093		objectMap["name"] = sq.Name
5094	}
5095	return json.Marshal(objectMap)
5096}
5097
5098// UnmarshalJSON is the custom unmarshaler for SubscriptionQuota struct.
5099func (sq *SubscriptionQuota) UnmarshalJSON(body []byte) error {
5100	var m map[string]*json.RawMessage
5101	err := json.Unmarshal(body, &m)
5102	if err != nil {
5103		return err
5104	}
5105	for k, v := range m {
5106		switch k {
5107		case "properties":
5108			if v != nil {
5109				var subscriptionQuotaProperties SubscriptionQuotaProperties
5110				err = json.Unmarshal(*v, &subscriptionQuotaProperties)
5111				if err != nil {
5112					return err
5113				}
5114				sq.SubscriptionQuotaProperties = &subscriptionQuotaProperties
5115			}
5116		case "id":
5117			if v != nil {
5118				var ID string
5119				err = json.Unmarshal(*v, &ID)
5120				if err != nil {
5121					return err
5122				}
5123				sq.ID = &ID
5124			}
5125		case "name":
5126			if v != nil {
5127				var name string
5128				err = json.Unmarshal(*v, &name)
5129				if err != nil {
5130					return err
5131				}
5132				sq.Name = &name
5133			}
5134		case "type":
5135			if v != nil {
5136				var typeVar string
5137				err = json.Unmarshal(*v, &typeVar)
5138				if err != nil {
5139					return err
5140				}
5141				sq.Type = &typeVar
5142			}
5143		}
5144	}
5145
5146	return nil
5147}
5148
5149// SubscriptionQuotaProperties describes the properties of the quota.
5150type SubscriptionQuotaProperties struct {
5151	// MaxCount - READ-ONLY; The max permitted usage of this resource.
5152	MaxCount *int32 `json:"maxCount,omitempty"`
5153	// CurrentCount - READ-ONLY; The current usage of this resource.
5154	CurrentCount *int32 `json:"currentCount,omitempty"`
5155}
5156
5157// MarshalJSON is the custom marshaler for SubscriptionQuotaProperties.
5158func (sq SubscriptionQuotaProperties) MarshalJSON() ([]byte, error) {
5159	objectMap := make(map[string]interface{})
5160	return json.Marshal(objectMap)
5161}
5162
5163// SubscriptionQuotasListResult result of the GetQuotas operation. It contains a list of quotas for the
5164// subscription in a particular region.
5165type SubscriptionQuotasListResult struct {
5166	autorest.Response `json:"-"`
5167	// Value - READ-ONLY; List of quotas for the subscription in a particular region.
5168	Value *[]SubscriptionQuota `json:"value,omitempty"`
5169}
5170
5171// MarshalJSON is the custom marshaler for SubscriptionQuotasListResult.
5172func (sqlr SubscriptionQuotasListResult) MarshalJSON() ([]byte, error) {
5173	objectMap := make(map[string]interface{})
5174	return json.Marshal(objectMap)
5175}
5176
5177// Transformation a transformation object, containing all information associated with the named
5178// transformation. All transformations are contained under a streaming job.
5179type Transformation struct {
5180	autorest.Response `json:"-"`
5181	// TransformationProperties - The properties that are associated with a transformation. Required on PUT (CreateOrReplace) requests.
5182	*TransformationProperties `json:"properties,omitempty"`
5183	// ID - READ-ONLY; Resource Id
5184	ID *string `json:"id,omitempty"`
5185	// Name - Resource name
5186	Name *string `json:"name,omitempty"`
5187	// Type - READ-ONLY; Resource type
5188	Type *string `json:"type,omitempty"`
5189}
5190
5191// MarshalJSON is the custom marshaler for Transformation.
5192func (t Transformation) MarshalJSON() ([]byte, error) {
5193	objectMap := make(map[string]interface{})
5194	if t.TransformationProperties != nil {
5195		objectMap["properties"] = t.TransformationProperties
5196	}
5197	if t.Name != nil {
5198		objectMap["name"] = t.Name
5199	}
5200	return json.Marshal(objectMap)
5201}
5202
5203// UnmarshalJSON is the custom unmarshaler for Transformation struct.
5204func (t *Transformation) UnmarshalJSON(body []byte) error {
5205	var m map[string]*json.RawMessage
5206	err := json.Unmarshal(body, &m)
5207	if err != nil {
5208		return err
5209	}
5210	for k, v := range m {
5211		switch k {
5212		case "properties":
5213			if v != nil {
5214				var transformationProperties TransformationProperties
5215				err = json.Unmarshal(*v, &transformationProperties)
5216				if err != nil {
5217					return err
5218				}
5219				t.TransformationProperties = &transformationProperties
5220			}
5221		case "id":
5222			if v != nil {
5223				var ID string
5224				err = json.Unmarshal(*v, &ID)
5225				if err != nil {
5226					return err
5227				}
5228				t.ID = &ID
5229			}
5230		case "name":
5231			if v != nil {
5232				var name string
5233				err = json.Unmarshal(*v, &name)
5234				if err != nil {
5235					return err
5236				}
5237				t.Name = &name
5238			}
5239		case "type":
5240			if v != nil {
5241				var typeVar string
5242				err = json.Unmarshal(*v, &typeVar)
5243				if err != nil {
5244					return err
5245				}
5246				t.Type = &typeVar
5247			}
5248		}
5249	}
5250
5251	return nil
5252}
5253
5254// TransformationProperties the properties that are associated with a transformation.
5255type TransformationProperties struct {
5256	// StreamingUnits - Specifies the number of streaming units that the streaming job uses.
5257	StreamingUnits *int32 `json:"streamingUnits,omitempty"`
5258	// Query - Specifies the query that will be run in the streaming job. You can learn more about the Stream Analytics Query Language (SAQL) here: https://msdn.microsoft.com/library/azure/dn834998 . Required on PUT (CreateOrReplace) requests.
5259	Query *string `json:"query,omitempty"`
5260	// Etag - READ-ONLY; The current entity tag for the transformation. 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.
5261	Etag *string `json:"etag,omitempty"`
5262}
5263
5264// MarshalJSON is the custom marshaler for TransformationProperties.
5265func (tp TransformationProperties) MarshalJSON() ([]byte, error) {
5266	objectMap := make(map[string]interface{})
5267	if tp.StreamingUnits != nil {
5268		objectMap["streamingUnits"] = tp.StreamingUnits
5269	}
5270	if tp.Query != nil {
5271		objectMap["query"] = tp.Query
5272	}
5273	return json.Marshal(objectMap)
5274}
5275