1package kusto
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/to"
15	"github.com/Azure/go-autorest/tracing"
16	"net/http"
17)
18
19// The package's fully qualified name.
20const fqdn = "github.com/Azure/azure-sdk-for-go/services/kusto/mgmt/2020-09-18/kusto"
21
22// AttachedDatabaseConfiguration class representing an attached database configuration.
23type AttachedDatabaseConfiguration struct {
24	autorest.Response `json:"-"`
25	// Location - Resource location.
26	Location *string `json:"location,omitempty"`
27	// AttachedDatabaseConfigurationProperties - The properties of the attached database configuration.
28	*AttachedDatabaseConfigurationProperties `json:"properties,omitempty"`
29	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
30	ID *string `json:"id,omitempty"`
31	// Name - READ-ONLY; The name of the resource
32	Name *string `json:"name,omitempty"`
33	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
34	Type *string `json:"type,omitempty"`
35}
36
37// MarshalJSON is the custom marshaler for AttachedDatabaseConfiguration.
38func (adc AttachedDatabaseConfiguration) MarshalJSON() ([]byte, error) {
39	objectMap := make(map[string]interface{})
40	if adc.Location != nil {
41		objectMap["location"] = adc.Location
42	}
43	if adc.AttachedDatabaseConfigurationProperties != nil {
44		objectMap["properties"] = adc.AttachedDatabaseConfigurationProperties
45	}
46	return json.Marshal(objectMap)
47}
48
49// UnmarshalJSON is the custom unmarshaler for AttachedDatabaseConfiguration struct.
50func (adc *AttachedDatabaseConfiguration) UnmarshalJSON(body []byte) error {
51	var m map[string]*json.RawMessage
52	err := json.Unmarshal(body, &m)
53	if err != nil {
54		return err
55	}
56	for k, v := range m {
57		switch k {
58		case "location":
59			if v != nil {
60				var location string
61				err = json.Unmarshal(*v, &location)
62				if err != nil {
63					return err
64				}
65				adc.Location = &location
66			}
67		case "properties":
68			if v != nil {
69				var attachedDatabaseConfigurationProperties AttachedDatabaseConfigurationProperties
70				err = json.Unmarshal(*v, &attachedDatabaseConfigurationProperties)
71				if err != nil {
72					return err
73				}
74				adc.AttachedDatabaseConfigurationProperties = &attachedDatabaseConfigurationProperties
75			}
76		case "id":
77			if v != nil {
78				var ID string
79				err = json.Unmarshal(*v, &ID)
80				if err != nil {
81					return err
82				}
83				adc.ID = &ID
84			}
85		case "name":
86			if v != nil {
87				var name string
88				err = json.Unmarshal(*v, &name)
89				if err != nil {
90					return err
91				}
92				adc.Name = &name
93			}
94		case "type":
95			if v != nil {
96				var typeVar string
97				err = json.Unmarshal(*v, &typeVar)
98				if err != nil {
99					return err
100				}
101				adc.Type = &typeVar
102			}
103		}
104	}
105
106	return nil
107}
108
109// AttachedDatabaseConfigurationListResult the list attached database configurations operation response.
110type AttachedDatabaseConfigurationListResult struct {
111	autorest.Response `json:"-"`
112	// Value - The list of attached database configurations.
113	Value *[]AttachedDatabaseConfiguration `json:"value,omitempty"`
114}
115
116// AttachedDatabaseConfigurationProperties class representing the an attached database configuration
117// properties of kind specific.
118type AttachedDatabaseConfigurationProperties struct {
119	// ProvisioningState - The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'
120	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
121	// DatabaseName - The name of the database which you would like to attach, use * if you want to follow all current and future databases.
122	DatabaseName *string `json:"databaseName,omitempty"`
123	// ClusterResourceID - The resource id of the cluster where the databases you would like to attach reside.
124	ClusterResourceID *string `json:"clusterResourceId,omitempty"`
125	// AttachedDatabaseNames - READ-ONLY; The list of databases from the clusterResourceId which are currently attached to the cluster.
126	AttachedDatabaseNames *[]string `json:"attachedDatabaseNames,omitempty"`
127	// DefaultPrincipalsModificationKind - The default principals modification kind. Possible values include: 'DefaultPrincipalsModificationKindUnion', 'DefaultPrincipalsModificationKindReplace', 'DefaultPrincipalsModificationKindNone'
128	DefaultPrincipalsModificationKind DefaultPrincipalsModificationKind `json:"defaultPrincipalsModificationKind,omitempty"`
129}
130
131// MarshalJSON is the custom marshaler for AttachedDatabaseConfigurationProperties.
132func (adcp AttachedDatabaseConfigurationProperties) MarshalJSON() ([]byte, error) {
133	objectMap := make(map[string]interface{})
134	if adcp.ProvisioningState != "" {
135		objectMap["provisioningState"] = adcp.ProvisioningState
136	}
137	if adcp.DatabaseName != nil {
138		objectMap["databaseName"] = adcp.DatabaseName
139	}
140	if adcp.ClusterResourceID != nil {
141		objectMap["clusterResourceId"] = adcp.ClusterResourceID
142	}
143	if adcp.DefaultPrincipalsModificationKind != "" {
144		objectMap["defaultPrincipalsModificationKind"] = adcp.DefaultPrincipalsModificationKind
145	}
146	return json.Marshal(objectMap)
147}
148
149// AttachedDatabaseConfigurationsCreateOrUpdateFuture an abstraction for monitoring and retrieving the
150// results of a long-running operation.
151type AttachedDatabaseConfigurationsCreateOrUpdateFuture struct {
152	azure.FutureAPI
153	// Result returns the result of the asynchronous operation.
154	// If the operation has not completed it will return an error.
155	Result func(AttachedDatabaseConfigurationsClient) (AttachedDatabaseConfiguration, error)
156}
157
158// UnmarshalJSON is the custom unmarshaller for CreateFuture.
159func (future *AttachedDatabaseConfigurationsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
160	var azFuture azure.Future
161	if err := json.Unmarshal(body, &azFuture); err != nil {
162		return err
163	}
164	future.FutureAPI = &azFuture
165	future.Result = future.result
166	return nil
167}
168
169// result is the default implementation for AttachedDatabaseConfigurationsCreateOrUpdateFuture.Result.
170func (future *AttachedDatabaseConfigurationsCreateOrUpdateFuture) result(client AttachedDatabaseConfigurationsClient) (adc AttachedDatabaseConfiguration, err error) {
171	var done bool
172	done, err = future.DoneWithContext(context.Background(), client)
173	if err != nil {
174		err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
175		return
176	}
177	if !done {
178		adc.Response.Response = future.Response()
179		err = azure.NewAsyncOpIncompleteError("kusto.AttachedDatabaseConfigurationsCreateOrUpdateFuture")
180		return
181	}
182	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
183	if adc.Response.Response, err = future.GetResult(sender); err == nil && adc.Response.Response.StatusCode != http.StatusNoContent {
184		adc, err = client.CreateOrUpdateResponder(adc.Response.Response)
185		if err != nil {
186			err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsCreateOrUpdateFuture", "Result", adc.Response.Response, "Failure responding to request")
187		}
188	}
189	return
190}
191
192// AttachedDatabaseConfigurationsDeleteFuture an abstraction for monitoring and retrieving the results of a
193// long-running operation.
194type AttachedDatabaseConfigurationsDeleteFuture struct {
195	azure.FutureAPI
196	// Result returns the result of the asynchronous operation.
197	// If the operation has not completed it will return an error.
198	Result func(AttachedDatabaseConfigurationsClient) (autorest.Response, error)
199}
200
201// UnmarshalJSON is the custom unmarshaller for CreateFuture.
202func (future *AttachedDatabaseConfigurationsDeleteFuture) UnmarshalJSON(body []byte) error {
203	var azFuture azure.Future
204	if err := json.Unmarshal(body, &azFuture); err != nil {
205		return err
206	}
207	future.FutureAPI = &azFuture
208	future.Result = future.result
209	return nil
210}
211
212// result is the default implementation for AttachedDatabaseConfigurationsDeleteFuture.Result.
213func (future *AttachedDatabaseConfigurationsDeleteFuture) result(client AttachedDatabaseConfigurationsClient) (ar autorest.Response, err error) {
214	var done bool
215	done, err = future.DoneWithContext(context.Background(), client)
216	if err != nil {
217		err = autorest.NewErrorWithError(err, "kusto.AttachedDatabaseConfigurationsDeleteFuture", "Result", future.Response(), "Polling failure")
218		return
219	}
220	if !done {
221		ar.Response = future.Response()
222		err = azure.NewAsyncOpIncompleteError("kusto.AttachedDatabaseConfigurationsDeleteFuture")
223		return
224	}
225	ar.Response = future.Response()
226	return
227}
228
229// AzureCapacity azure capacity definition.
230type AzureCapacity struct {
231	// ScaleType - Scale type. Possible values include: 'Automatic', 'Manual', 'None'
232	ScaleType AzureScaleType `json:"scaleType,omitempty"`
233	// Minimum - Minimum allowed capacity.
234	Minimum *int32 `json:"minimum,omitempty"`
235	// Maximum - Maximum allowed capacity.
236	Maximum *int32 `json:"maximum,omitempty"`
237	// Default - The default capacity that would be used.
238	Default *int32 `json:"default,omitempty"`
239}
240
241// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag.
242type AzureEntityResource struct {
243	// Etag - READ-ONLY; Resource Etag.
244	Etag *string `json:"etag,omitempty"`
245	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
246	ID *string `json:"id,omitempty"`
247	// Name - READ-ONLY; The name of the resource
248	Name *string `json:"name,omitempty"`
249	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
250	Type *string `json:"type,omitempty"`
251}
252
253// MarshalJSON is the custom marshaler for AzureEntityResource.
254func (aer AzureEntityResource) MarshalJSON() ([]byte, error) {
255	objectMap := make(map[string]interface{})
256	return json.Marshal(objectMap)
257}
258
259// AzureResourceSku azure resource SKU definition.
260type AzureResourceSku struct {
261	// ResourceType - Resource Namespace and Type.
262	ResourceType *string `json:"resourceType,omitempty"`
263	// Sku - The SKU details.
264	Sku *AzureSku `json:"sku,omitempty"`
265	// Capacity - The number of instances of the cluster.
266	Capacity *AzureCapacity `json:"capacity,omitempty"`
267}
268
269// AzureSku azure SKU definition.
270type AzureSku struct {
271	// Name - SKU name. Possible values include: 'StandardDS13V21TBPS', 'StandardDS13V22TBPS', 'StandardDS14V23TBPS', 'StandardDS14V24TBPS', 'StandardD13V2', 'StandardD14V2', 'StandardL8s', 'StandardL16s', 'StandardD11V2', 'StandardD12V2', 'StandardL4s', 'DevNoSLAStandardD11V2', 'StandardE64iV3', 'StandardE2aV4', 'StandardE4aV4', 'StandardE8aV4', 'StandardE16aV4', 'StandardE8asV41TBPS', 'StandardE8asV42TBPS', 'StandardE16asV43TBPS', 'StandardE16asV44TBPS', 'DevNoSLAStandardE2aV4'
272	Name AzureSkuName `json:"name,omitempty"`
273	// Capacity - The number of instances of the cluster.
274	Capacity *int32 `json:"capacity,omitempty"`
275	// Tier - SKU tier. Possible values include: 'Basic', 'Standard'
276	Tier AzureSkuTier `json:"tier,omitempty"`
277}
278
279// CheckNameRequest the result returned from a database check name availability request.
280type CheckNameRequest struct {
281	// Name - Resource name.
282	Name *string `json:"name,omitempty"`
283	// Type - The type of resource, for instance Microsoft.Kusto/clusters/databases. Possible values include: 'MicrosoftKustoclustersdatabases', 'MicrosoftKustoclustersattachedDatabaseConfigurations'
284	Type Type `json:"type,omitempty"`
285}
286
287// CheckNameResult the result returned from a check name availability request.
288type CheckNameResult struct {
289	autorest.Response `json:"-"`
290	// NameAvailable - Specifies a Boolean value that indicates if the name is available.
291	NameAvailable *bool `json:"nameAvailable,omitempty"`
292	// Name - The name that was checked.
293	Name *string `json:"name,omitempty"`
294	// Message - Message indicating an unavailable name due to a conflict, or a description of the naming rules that are violated.
295	Message *string `json:"message,omitempty"`
296	// Reason - Message providing the reason why the given name is invalid. Possible values include: 'Invalid', 'AlreadyExists'
297	Reason Reason `json:"reason,omitempty"`
298}
299
300// CloudError an error response from Kusto.
301type CloudError struct {
302	// Error - An error response from Kusto.
303	Error *CloudErrorBody `json:"error,omitempty"`
304}
305
306// CloudErrorBody an error response from Kusto.
307type CloudErrorBody struct {
308	// Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically.
309	Code *string `json:"code,omitempty"`
310	// Message - A message describing the error, intended to be suitable for displaying in a user interface.
311	Message *string `json:"message,omitempty"`
312	// Target - The target of the particular error. For example, the name of the property in error.
313	Target *string `json:"target,omitempty"`
314	// Details - A list of additional details about the error.
315	Details *[]CloudErrorBody `json:"details,omitempty"`
316}
317
318// Cluster class representing a Kusto cluster.
319type Cluster struct {
320	autorest.Response `json:"-"`
321	// Sku - The SKU of the cluster.
322	Sku *AzureSku `json:"sku,omitempty"`
323	// Zones - The availability zones of the cluster.
324	Zones *[]string `json:"zones,omitempty"`
325	// Identity - The identity of the cluster, if configured.
326	Identity *Identity `json:"identity,omitempty"`
327	// ClusterProperties - The cluster properties.
328	*ClusterProperties `json:"properties,omitempty"`
329	// Tags - Resource tags.
330	Tags map[string]*string `json:"tags"`
331	// Location - The geo-location where the resource lives
332	Location *string `json:"location,omitempty"`
333	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
334	ID *string `json:"id,omitempty"`
335	// Name - READ-ONLY; The name of the resource
336	Name *string `json:"name,omitempty"`
337	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
338	Type *string `json:"type,omitempty"`
339}
340
341// MarshalJSON is the custom marshaler for Cluster.
342func (c Cluster) MarshalJSON() ([]byte, error) {
343	objectMap := make(map[string]interface{})
344	if c.Sku != nil {
345		objectMap["sku"] = c.Sku
346	}
347	if c.Zones != nil {
348		objectMap["zones"] = c.Zones
349	}
350	if c.Identity != nil {
351		objectMap["identity"] = c.Identity
352	}
353	if c.ClusterProperties != nil {
354		objectMap["properties"] = c.ClusterProperties
355	}
356	if c.Tags != nil {
357		objectMap["tags"] = c.Tags
358	}
359	if c.Location != nil {
360		objectMap["location"] = c.Location
361	}
362	return json.Marshal(objectMap)
363}
364
365// UnmarshalJSON is the custom unmarshaler for Cluster struct.
366func (c *Cluster) UnmarshalJSON(body []byte) error {
367	var m map[string]*json.RawMessage
368	err := json.Unmarshal(body, &m)
369	if err != nil {
370		return err
371	}
372	for k, v := range m {
373		switch k {
374		case "sku":
375			if v != nil {
376				var sku AzureSku
377				err = json.Unmarshal(*v, &sku)
378				if err != nil {
379					return err
380				}
381				c.Sku = &sku
382			}
383		case "zones":
384			if v != nil {
385				var zones []string
386				err = json.Unmarshal(*v, &zones)
387				if err != nil {
388					return err
389				}
390				c.Zones = &zones
391			}
392		case "identity":
393			if v != nil {
394				var identity Identity
395				err = json.Unmarshal(*v, &identity)
396				if err != nil {
397					return err
398				}
399				c.Identity = &identity
400			}
401		case "properties":
402			if v != nil {
403				var clusterProperties ClusterProperties
404				err = json.Unmarshal(*v, &clusterProperties)
405				if err != nil {
406					return err
407				}
408				c.ClusterProperties = &clusterProperties
409			}
410		case "tags":
411			if v != nil {
412				var tags map[string]*string
413				err = json.Unmarshal(*v, &tags)
414				if err != nil {
415					return err
416				}
417				c.Tags = tags
418			}
419		case "location":
420			if v != nil {
421				var location string
422				err = json.Unmarshal(*v, &location)
423				if err != nil {
424					return err
425				}
426				c.Location = &location
427			}
428		case "id":
429			if v != nil {
430				var ID string
431				err = json.Unmarshal(*v, &ID)
432				if err != nil {
433					return err
434				}
435				c.ID = &ID
436			}
437		case "name":
438			if v != nil {
439				var name string
440				err = json.Unmarshal(*v, &name)
441				if err != nil {
442					return err
443				}
444				c.Name = &name
445			}
446		case "type":
447			if v != nil {
448				var typeVar string
449				err = json.Unmarshal(*v, &typeVar)
450				if err != nil {
451					return err
452				}
453				c.Type = &typeVar
454			}
455		}
456	}
457
458	return nil
459}
460
461// ClusterCheckNameRequest the result returned from a cluster check name availability request.
462type ClusterCheckNameRequest struct {
463	// Name - Cluster name.
464	Name *string `json:"name,omitempty"`
465	// Type - The type of resource, Microsoft.Kusto/clusters.
466	Type *string `json:"type,omitempty"`
467}
468
469// ClusterListResult the list Kusto clusters operation response.
470type ClusterListResult struct {
471	autorest.Response `json:"-"`
472	// Value - The list of Kusto clusters.
473	Value *[]Cluster `json:"value,omitempty"`
474}
475
476// ClusterPrincipalAssignment class representing a cluster principal assignment.
477type ClusterPrincipalAssignment struct {
478	autorest.Response `json:"-"`
479	// ClusterPrincipalProperties - The cluster principal.
480	*ClusterPrincipalProperties `json:"properties,omitempty"`
481	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
482	ID *string `json:"id,omitempty"`
483	// Name - READ-ONLY; The name of the resource
484	Name *string `json:"name,omitempty"`
485	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
486	Type *string `json:"type,omitempty"`
487}
488
489// MarshalJSON is the custom marshaler for ClusterPrincipalAssignment.
490func (cpa ClusterPrincipalAssignment) MarshalJSON() ([]byte, error) {
491	objectMap := make(map[string]interface{})
492	if cpa.ClusterPrincipalProperties != nil {
493		objectMap["properties"] = cpa.ClusterPrincipalProperties
494	}
495	return json.Marshal(objectMap)
496}
497
498// UnmarshalJSON is the custom unmarshaler for ClusterPrincipalAssignment struct.
499func (cpa *ClusterPrincipalAssignment) UnmarshalJSON(body []byte) error {
500	var m map[string]*json.RawMessage
501	err := json.Unmarshal(body, &m)
502	if err != nil {
503		return err
504	}
505	for k, v := range m {
506		switch k {
507		case "properties":
508			if v != nil {
509				var clusterPrincipalProperties ClusterPrincipalProperties
510				err = json.Unmarshal(*v, &clusterPrincipalProperties)
511				if err != nil {
512					return err
513				}
514				cpa.ClusterPrincipalProperties = &clusterPrincipalProperties
515			}
516		case "id":
517			if v != nil {
518				var ID string
519				err = json.Unmarshal(*v, &ID)
520				if err != nil {
521					return err
522				}
523				cpa.ID = &ID
524			}
525		case "name":
526			if v != nil {
527				var name string
528				err = json.Unmarshal(*v, &name)
529				if err != nil {
530					return err
531				}
532				cpa.Name = &name
533			}
534		case "type":
535			if v != nil {
536				var typeVar string
537				err = json.Unmarshal(*v, &typeVar)
538				if err != nil {
539					return err
540				}
541				cpa.Type = &typeVar
542			}
543		}
544	}
545
546	return nil
547}
548
549// ClusterPrincipalAssignmentCheckNameRequest a principal assignment check name availability request.
550type ClusterPrincipalAssignmentCheckNameRequest struct {
551	// Name - Principal Assignment resource name.
552	Name *string `json:"name,omitempty"`
553	// Type - The type of resource, Microsoft.Kusto/clusters/principalAssignments.
554	Type *string `json:"type,omitempty"`
555}
556
557// ClusterPrincipalAssignmentListResult the list Kusto cluster principal assignments operation response.
558type ClusterPrincipalAssignmentListResult struct {
559	autorest.Response `json:"-"`
560	// Value - The list of Kusto cluster principal assignments.
561	Value *[]ClusterPrincipalAssignment `json:"value,omitempty"`
562}
563
564// ClusterPrincipalAssignmentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results
565// of a long-running operation.
566type ClusterPrincipalAssignmentsCreateOrUpdateFuture struct {
567	azure.FutureAPI
568	// Result returns the result of the asynchronous operation.
569	// If the operation has not completed it will return an error.
570	Result func(ClusterPrincipalAssignmentsClient) (ClusterPrincipalAssignment, error)
571}
572
573// UnmarshalJSON is the custom unmarshaller for CreateFuture.
574func (future *ClusterPrincipalAssignmentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
575	var azFuture azure.Future
576	if err := json.Unmarshal(body, &azFuture); err != nil {
577		return err
578	}
579	future.FutureAPI = &azFuture
580	future.Result = future.result
581	return nil
582}
583
584// result is the default implementation for ClusterPrincipalAssignmentsCreateOrUpdateFuture.Result.
585func (future *ClusterPrincipalAssignmentsCreateOrUpdateFuture) result(client ClusterPrincipalAssignmentsClient) (cpa ClusterPrincipalAssignment, err error) {
586	var done bool
587	done, err = future.DoneWithContext(context.Background(), client)
588	if err != nil {
589		err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
590		return
591	}
592	if !done {
593		cpa.Response.Response = future.Response()
594		err = azure.NewAsyncOpIncompleteError("kusto.ClusterPrincipalAssignmentsCreateOrUpdateFuture")
595		return
596	}
597	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
598	if cpa.Response.Response, err = future.GetResult(sender); err == nil && cpa.Response.Response.StatusCode != http.StatusNoContent {
599		cpa, err = client.CreateOrUpdateResponder(cpa.Response.Response)
600		if err != nil {
601			err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsCreateOrUpdateFuture", "Result", cpa.Response.Response, "Failure responding to request")
602		}
603	}
604	return
605}
606
607// ClusterPrincipalAssignmentsDeleteFuture an abstraction for monitoring and retrieving the results of a
608// long-running operation.
609type ClusterPrincipalAssignmentsDeleteFuture struct {
610	azure.FutureAPI
611	// Result returns the result of the asynchronous operation.
612	// If the operation has not completed it will return an error.
613	Result func(ClusterPrincipalAssignmentsClient) (autorest.Response, error)
614}
615
616// UnmarshalJSON is the custom unmarshaller for CreateFuture.
617func (future *ClusterPrincipalAssignmentsDeleteFuture) UnmarshalJSON(body []byte) error {
618	var azFuture azure.Future
619	if err := json.Unmarshal(body, &azFuture); err != nil {
620		return err
621	}
622	future.FutureAPI = &azFuture
623	future.Result = future.result
624	return nil
625}
626
627// result is the default implementation for ClusterPrincipalAssignmentsDeleteFuture.Result.
628func (future *ClusterPrincipalAssignmentsDeleteFuture) result(client ClusterPrincipalAssignmentsClient) (ar autorest.Response, err error) {
629	var done bool
630	done, err = future.DoneWithContext(context.Background(), client)
631	if err != nil {
632		err = autorest.NewErrorWithError(err, "kusto.ClusterPrincipalAssignmentsDeleteFuture", "Result", future.Response(), "Polling failure")
633		return
634	}
635	if !done {
636		ar.Response = future.Response()
637		err = azure.NewAsyncOpIncompleteError("kusto.ClusterPrincipalAssignmentsDeleteFuture")
638		return
639	}
640	ar.Response = future.Response()
641	return
642}
643
644// ClusterPrincipalProperties a class representing cluster principal property.
645type ClusterPrincipalProperties struct {
646	// PrincipalID - The principal ID assigned to the cluster principal. It can be a user email, application ID, or security group name.
647	PrincipalID *string `json:"principalId,omitempty"`
648	// Role - Cluster principal role. Possible values include: 'AllDatabasesAdmin', 'AllDatabasesViewer'
649	Role ClusterPrincipalRole `json:"role,omitempty"`
650	// TenantID - The tenant id of the principal
651	TenantID *string `json:"tenantId,omitempty"`
652	// PrincipalType - Principal type. Possible values include: 'PrincipalTypeApp', 'PrincipalTypeGroup', 'PrincipalTypeUser'
653	PrincipalType PrincipalType `json:"principalType,omitempty"`
654	// TenantName - READ-ONLY; The tenant name of the principal
655	TenantName *string `json:"tenantName,omitempty"`
656	// PrincipalName - READ-ONLY; The principal name
657	PrincipalName *string `json:"principalName,omitempty"`
658	// ProvisioningState - The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'
659	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
660}
661
662// MarshalJSON is the custom marshaler for ClusterPrincipalProperties.
663func (cpp ClusterPrincipalProperties) MarshalJSON() ([]byte, error) {
664	objectMap := make(map[string]interface{})
665	if cpp.PrincipalID != nil {
666		objectMap["principalId"] = cpp.PrincipalID
667	}
668	if cpp.Role != "" {
669		objectMap["role"] = cpp.Role
670	}
671	if cpp.TenantID != nil {
672		objectMap["tenantId"] = cpp.TenantID
673	}
674	if cpp.PrincipalType != "" {
675		objectMap["principalType"] = cpp.PrincipalType
676	}
677	if cpp.ProvisioningState != "" {
678		objectMap["provisioningState"] = cpp.ProvisioningState
679	}
680	return json.Marshal(objectMap)
681}
682
683// ClusterProperties class representing the Kusto cluster properties.
684type ClusterProperties struct {
685	// State - READ-ONLY; The state of the resource. Possible values include: 'StateCreating', 'StateUnavailable', 'StateRunning', 'StateDeleting', 'StateDeleted', 'StateStopping', 'StateStopped', 'StateStarting', 'StateUpdating'
686	State State `json:"state,omitempty"`
687	// ProvisioningState - The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'
688	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
689	// URI - READ-ONLY; The cluster URI.
690	URI *string `json:"uri,omitempty"`
691	// DataIngestionURI - READ-ONLY; The cluster data ingestion URI.
692	DataIngestionURI *string `json:"dataIngestionUri,omitempty"`
693	// StateReason - READ-ONLY; The reason for the cluster's current state.
694	StateReason *string `json:"stateReason,omitempty"`
695	// TrustedExternalTenants - The cluster's external tenants.
696	TrustedExternalTenants *[]TrustedExternalTenant `json:"trustedExternalTenants,omitempty"`
697	// OptimizedAutoscale - Optimized auto scale definition.
698	OptimizedAutoscale *OptimizedAutoscale `json:"optimizedAutoscale,omitempty"`
699	// EnableDiskEncryption - A boolean value that indicates if the cluster's disks are encrypted.
700	EnableDiskEncryption *bool `json:"enableDiskEncryption,omitempty"`
701	// EnableStreamingIngest - A boolean value that indicates if the streaming ingest is enabled.
702	EnableStreamingIngest *bool `json:"enableStreamingIngest,omitempty"`
703	// VirtualNetworkConfiguration - Virtual network definition.
704	VirtualNetworkConfiguration *VirtualNetworkConfiguration `json:"virtualNetworkConfiguration,omitempty"`
705	// KeyVaultProperties - KeyVault properties for the cluster encryption.
706	KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"`
707	// EnablePurge - A boolean value that indicates if the purge operations are enabled.
708	EnablePurge *bool `json:"enablePurge,omitempty"`
709	// LanguageExtensions - READ-ONLY; List of the cluster's language extensions.
710	LanguageExtensions *LanguageExtensionsList `json:"languageExtensions,omitempty"`
711	// EnableDoubleEncryption - A boolean value that indicates if double encryption is enabled.
712	EnableDoubleEncryption *bool `json:"enableDoubleEncryption,omitempty"`
713	// EngineType - The engine type. Possible values include: 'V2', 'V3'
714	EngineType EngineType `json:"engineType,omitempty"`
715}
716
717// MarshalJSON is the custom marshaler for ClusterProperties.
718func (cp ClusterProperties) MarshalJSON() ([]byte, error) {
719	objectMap := make(map[string]interface{})
720	if cp.ProvisioningState != "" {
721		objectMap["provisioningState"] = cp.ProvisioningState
722	}
723	if cp.TrustedExternalTenants != nil {
724		objectMap["trustedExternalTenants"] = cp.TrustedExternalTenants
725	}
726	if cp.OptimizedAutoscale != nil {
727		objectMap["optimizedAutoscale"] = cp.OptimizedAutoscale
728	}
729	if cp.EnableDiskEncryption != nil {
730		objectMap["enableDiskEncryption"] = cp.EnableDiskEncryption
731	}
732	if cp.EnableStreamingIngest != nil {
733		objectMap["enableStreamingIngest"] = cp.EnableStreamingIngest
734	}
735	if cp.VirtualNetworkConfiguration != nil {
736		objectMap["virtualNetworkConfiguration"] = cp.VirtualNetworkConfiguration
737	}
738	if cp.KeyVaultProperties != nil {
739		objectMap["keyVaultProperties"] = cp.KeyVaultProperties
740	}
741	if cp.EnablePurge != nil {
742		objectMap["enablePurge"] = cp.EnablePurge
743	}
744	if cp.EnableDoubleEncryption != nil {
745		objectMap["enableDoubleEncryption"] = cp.EnableDoubleEncryption
746	}
747	if cp.EngineType != "" {
748		objectMap["engineType"] = cp.EngineType
749	}
750	return json.Marshal(objectMap)
751}
752
753// ClustersAddLanguageExtensionsFuture an abstraction for monitoring and retrieving the results of a
754// long-running operation.
755type ClustersAddLanguageExtensionsFuture struct {
756	azure.FutureAPI
757	// Result returns the result of the asynchronous operation.
758	// If the operation has not completed it will return an error.
759	Result func(ClustersClient) (autorest.Response, error)
760}
761
762// UnmarshalJSON is the custom unmarshaller for CreateFuture.
763func (future *ClustersAddLanguageExtensionsFuture) UnmarshalJSON(body []byte) error {
764	var azFuture azure.Future
765	if err := json.Unmarshal(body, &azFuture); err != nil {
766		return err
767	}
768	future.FutureAPI = &azFuture
769	future.Result = future.result
770	return nil
771}
772
773// result is the default implementation for ClustersAddLanguageExtensionsFuture.Result.
774func (future *ClustersAddLanguageExtensionsFuture) result(client ClustersClient) (ar autorest.Response, err error) {
775	var done bool
776	done, err = future.DoneWithContext(context.Background(), client)
777	if err != nil {
778		err = autorest.NewErrorWithError(err, "kusto.ClustersAddLanguageExtensionsFuture", "Result", future.Response(), "Polling failure")
779		return
780	}
781	if !done {
782		ar.Response = future.Response()
783		err = azure.NewAsyncOpIncompleteError("kusto.ClustersAddLanguageExtensionsFuture")
784		return
785	}
786	ar.Response = future.Response()
787	return
788}
789
790// ClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
791// operation.
792type ClustersCreateOrUpdateFuture struct {
793	azure.FutureAPI
794	// Result returns the result of the asynchronous operation.
795	// If the operation has not completed it will return an error.
796	Result func(ClustersClient) (Cluster, error)
797}
798
799// UnmarshalJSON is the custom unmarshaller for CreateFuture.
800func (future *ClustersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
801	var azFuture azure.Future
802	if err := json.Unmarshal(body, &azFuture); err != nil {
803		return err
804	}
805	future.FutureAPI = &azFuture
806	future.Result = future.result
807	return nil
808}
809
810// result is the default implementation for ClustersCreateOrUpdateFuture.Result.
811func (future *ClustersCreateOrUpdateFuture) result(client ClustersClient) (c Cluster, err error) {
812	var done bool
813	done, err = future.DoneWithContext(context.Background(), client)
814	if err != nil {
815		err = autorest.NewErrorWithError(err, "kusto.ClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
816		return
817	}
818	if !done {
819		c.Response.Response = future.Response()
820		err = azure.NewAsyncOpIncompleteError("kusto.ClustersCreateOrUpdateFuture")
821		return
822	}
823	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
824	if c.Response.Response, err = future.GetResult(sender); err == nil && c.Response.Response.StatusCode != http.StatusNoContent {
825		c, err = client.CreateOrUpdateResponder(c.Response.Response)
826		if err != nil {
827			err = autorest.NewErrorWithError(err, "kusto.ClustersCreateOrUpdateFuture", "Result", c.Response.Response, "Failure responding to request")
828		}
829	}
830	return
831}
832
833// ClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
834// operation.
835type ClustersDeleteFuture struct {
836	azure.FutureAPI
837	// Result returns the result of the asynchronous operation.
838	// If the operation has not completed it will return an error.
839	Result func(ClustersClient) (autorest.Response, error)
840}
841
842// UnmarshalJSON is the custom unmarshaller for CreateFuture.
843func (future *ClustersDeleteFuture) UnmarshalJSON(body []byte) error {
844	var azFuture azure.Future
845	if err := json.Unmarshal(body, &azFuture); err != nil {
846		return err
847	}
848	future.FutureAPI = &azFuture
849	future.Result = future.result
850	return nil
851}
852
853// result is the default implementation for ClustersDeleteFuture.Result.
854func (future *ClustersDeleteFuture) result(client ClustersClient) (ar autorest.Response, err error) {
855	var done bool
856	done, err = future.DoneWithContext(context.Background(), client)
857	if err != nil {
858		err = autorest.NewErrorWithError(err, "kusto.ClustersDeleteFuture", "Result", future.Response(), "Polling failure")
859		return
860	}
861	if !done {
862		ar.Response = future.Response()
863		err = azure.NewAsyncOpIncompleteError("kusto.ClustersDeleteFuture")
864		return
865	}
866	ar.Response = future.Response()
867	return
868}
869
870// ClustersDetachFollowerDatabasesFuture an abstraction for monitoring and retrieving the results of a
871// long-running operation.
872type ClustersDetachFollowerDatabasesFuture struct {
873	azure.FutureAPI
874	// Result returns the result of the asynchronous operation.
875	// If the operation has not completed it will return an error.
876	Result func(ClustersClient) (autorest.Response, error)
877}
878
879// UnmarshalJSON is the custom unmarshaller for CreateFuture.
880func (future *ClustersDetachFollowerDatabasesFuture) UnmarshalJSON(body []byte) error {
881	var azFuture azure.Future
882	if err := json.Unmarshal(body, &azFuture); err != nil {
883		return err
884	}
885	future.FutureAPI = &azFuture
886	future.Result = future.result
887	return nil
888}
889
890// result is the default implementation for ClustersDetachFollowerDatabasesFuture.Result.
891func (future *ClustersDetachFollowerDatabasesFuture) result(client ClustersClient) (ar autorest.Response, err error) {
892	var done bool
893	done, err = future.DoneWithContext(context.Background(), client)
894	if err != nil {
895		err = autorest.NewErrorWithError(err, "kusto.ClustersDetachFollowerDatabasesFuture", "Result", future.Response(), "Polling failure")
896		return
897	}
898	if !done {
899		ar.Response = future.Response()
900		err = azure.NewAsyncOpIncompleteError("kusto.ClustersDetachFollowerDatabasesFuture")
901		return
902	}
903	ar.Response = future.Response()
904	return
905}
906
907// ClustersDiagnoseVirtualNetworkFuture an abstraction for monitoring and retrieving the results of a
908// long-running operation.
909type ClustersDiagnoseVirtualNetworkFuture struct {
910	azure.FutureAPI
911	// Result returns the result of the asynchronous operation.
912	// If the operation has not completed it will return an error.
913	Result func(ClustersClient) (DiagnoseVirtualNetworkResult, error)
914}
915
916// UnmarshalJSON is the custom unmarshaller for CreateFuture.
917func (future *ClustersDiagnoseVirtualNetworkFuture) UnmarshalJSON(body []byte) error {
918	var azFuture azure.Future
919	if err := json.Unmarshal(body, &azFuture); err != nil {
920		return err
921	}
922	future.FutureAPI = &azFuture
923	future.Result = future.result
924	return nil
925}
926
927// result is the default implementation for ClustersDiagnoseVirtualNetworkFuture.Result.
928func (future *ClustersDiagnoseVirtualNetworkFuture) result(client ClustersClient) (dvnr DiagnoseVirtualNetworkResult, err error) {
929	var done bool
930	done, err = future.DoneWithContext(context.Background(), client)
931	if err != nil {
932		err = autorest.NewErrorWithError(err, "kusto.ClustersDiagnoseVirtualNetworkFuture", "Result", future.Response(), "Polling failure")
933		return
934	}
935	if !done {
936		dvnr.Response.Response = future.Response()
937		err = azure.NewAsyncOpIncompleteError("kusto.ClustersDiagnoseVirtualNetworkFuture")
938		return
939	}
940	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
941	if dvnr.Response.Response, err = future.GetResult(sender); err == nil && dvnr.Response.Response.StatusCode != http.StatusNoContent {
942		dvnr, err = client.DiagnoseVirtualNetworkResponder(dvnr.Response.Response)
943		if err != nil {
944			err = autorest.NewErrorWithError(err, "kusto.ClustersDiagnoseVirtualNetworkFuture", "Result", dvnr.Response.Response, "Failure responding to request")
945		}
946	}
947	return
948}
949
950// ClustersRemoveLanguageExtensionsFuture an abstraction for monitoring and retrieving the results of a
951// long-running operation.
952type ClustersRemoveLanguageExtensionsFuture struct {
953	azure.FutureAPI
954	// Result returns the result of the asynchronous operation.
955	// If the operation has not completed it will return an error.
956	Result func(ClustersClient) (autorest.Response, error)
957}
958
959// UnmarshalJSON is the custom unmarshaller for CreateFuture.
960func (future *ClustersRemoveLanguageExtensionsFuture) UnmarshalJSON(body []byte) error {
961	var azFuture azure.Future
962	if err := json.Unmarshal(body, &azFuture); err != nil {
963		return err
964	}
965	future.FutureAPI = &azFuture
966	future.Result = future.result
967	return nil
968}
969
970// result is the default implementation for ClustersRemoveLanguageExtensionsFuture.Result.
971func (future *ClustersRemoveLanguageExtensionsFuture) result(client ClustersClient) (ar autorest.Response, err error) {
972	var done bool
973	done, err = future.DoneWithContext(context.Background(), client)
974	if err != nil {
975		err = autorest.NewErrorWithError(err, "kusto.ClustersRemoveLanguageExtensionsFuture", "Result", future.Response(), "Polling failure")
976		return
977	}
978	if !done {
979		ar.Response = future.Response()
980		err = azure.NewAsyncOpIncompleteError("kusto.ClustersRemoveLanguageExtensionsFuture")
981		return
982	}
983	ar.Response = future.Response()
984	return
985}
986
987// ClustersStartFuture an abstraction for monitoring and retrieving the results of a long-running
988// operation.
989type ClustersStartFuture struct {
990	azure.FutureAPI
991	// Result returns the result of the asynchronous operation.
992	// If the operation has not completed it will return an error.
993	Result func(ClustersClient) (autorest.Response, error)
994}
995
996// UnmarshalJSON is the custom unmarshaller for CreateFuture.
997func (future *ClustersStartFuture) UnmarshalJSON(body []byte) error {
998	var azFuture azure.Future
999	if err := json.Unmarshal(body, &azFuture); err != nil {
1000		return err
1001	}
1002	future.FutureAPI = &azFuture
1003	future.Result = future.result
1004	return nil
1005}
1006
1007// result is the default implementation for ClustersStartFuture.Result.
1008func (future *ClustersStartFuture) result(client ClustersClient) (ar autorest.Response, err error) {
1009	var done bool
1010	done, err = future.DoneWithContext(context.Background(), client)
1011	if err != nil {
1012		err = autorest.NewErrorWithError(err, "kusto.ClustersStartFuture", "Result", future.Response(), "Polling failure")
1013		return
1014	}
1015	if !done {
1016		ar.Response = future.Response()
1017		err = azure.NewAsyncOpIncompleteError("kusto.ClustersStartFuture")
1018		return
1019	}
1020	ar.Response = future.Response()
1021	return
1022}
1023
1024// ClustersStopFuture an abstraction for monitoring and retrieving the results of a long-running operation.
1025type ClustersStopFuture struct {
1026	azure.FutureAPI
1027	// Result returns the result of the asynchronous operation.
1028	// If the operation has not completed it will return an error.
1029	Result func(ClustersClient) (autorest.Response, error)
1030}
1031
1032// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1033func (future *ClustersStopFuture) UnmarshalJSON(body []byte) error {
1034	var azFuture azure.Future
1035	if err := json.Unmarshal(body, &azFuture); err != nil {
1036		return err
1037	}
1038	future.FutureAPI = &azFuture
1039	future.Result = future.result
1040	return nil
1041}
1042
1043// result is the default implementation for ClustersStopFuture.Result.
1044func (future *ClustersStopFuture) result(client ClustersClient) (ar autorest.Response, err error) {
1045	var done bool
1046	done, err = future.DoneWithContext(context.Background(), client)
1047	if err != nil {
1048		err = autorest.NewErrorWithError(err, "kusto.ClustersStopFuture", "Result", future.Response(), "Polling failure")
1049		return
1050	}
1051	if !done {
1052		ar.Response = future.Response()
1053		err = azure.NewAsyncOpIncompleteError("kusto.ClustersStopFuture")
1054		return
1055	}
1056	ar.Response = future.Response()
1057	return
1058}
1059
1060// ClustersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
1061// operation.
1062type ClustersUpdateFuture struct {
1063	azure.FutureAPI
1064	// Result returns the result of the asynchronous operation.
1065	// If the operation has not completed it will return an error.
1066	Result func(ClustersClient) (Cluster, error)
1067}
1068
1069// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1070func (future *ClustersUpdateFuture) UnmarshalJSON(body []byte) error {
1071	var azFuture azure.Future
1072	if err := json.Unmarshal(body, &azFuture); err != nil {
1073		return err
1074	}
1075	future.FutureAPI = &azFuture
1076	future.Result = future.result
1077	return nil
1078}
1079
1080// result is the default implementation for ClustersUpdateFuture.Result.
1081func (future *ClustersUpdateFuture) result(client ClustersClient) (c Cluster, err error) {
1082	var done bool
1083	done, err = future.DoneWithContext(context.Background(), client)
1084	if err != nil {
1085		err = autorest.NewErrorWithError(err, "kusto.ClustersUpdateFuture", "Result", future.Response(), "Polling failure")
1086		return
1087	}
1088	if !done {
1089		c.Response.Response = future.Response()
1090		err = azure.NewAsyncOpIncompleteError("kusto.ClustersUpdateFuture")
1091		return
1092	}
1093	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1094	if c.Response.Response, err = future.GetResult(sender); err == nil && c.Response.Response.StatusCode != http.StatusNoContent {
1095		c, err = client.UpdateResponder(c.Response.Response)
1096		if err != nil {
1097			err = autorest.NewErrorWithError(err, "kusto.ClustersUpdateFuture", "Result", c.Response.Response, "Failure responding to request")
1098		}
1099	}
1100	return
1101}
1102
1103// ClusterUpdate class representing an update to a Kusto cluster.
1104type ClusterUpdate struct {
1105	// Tags - Resource tags.
1106	Tags map[string]*string `json:"tags"`
1107	// Location - Resource location.
1108	Location *string `json:"location,omitempty"`
1109	// Sku - The SKU of the cluster.
1110	Sku *AzureSku `json:"sku,omitempty"`
1111	// Identity - The identity of the cluster, if configured.
1112	Identity *Identity `json:"identity,omitempty"`
1113	// ClusterProperties - The cluster properties.
1114	*ClusterProperties `json:"properties,omitempty"`
1115	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1116	ID *string `json:"id,omitempty"`
1117	// Name - READ-ONLY; The name of the resource
1118	Name *string `json:"name,omitempty"`
1119	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1120	Type *string `json:"type,omitempty"`
1121}
1122
1123// MarshalJSON is the custom marshaler for ClusterUpdate.
1124func (cu ClusterUpdate) MarshalJSON() ([]byte, error) {
1125	objectMap := make(map[string]interface{})
1126	if cu.Tags != nil {
1127		objectMap["tags"] = cu.Tags
1128	}
1129	if cu.Location != nil {
1130		objectMap["location"] = cu.Location
1131	}
1132	if cu.Sku != nil {
1133		objectMap["sku"] = cu.Sku
1134	}
1135	if cu.Identity != nil {
1136		objectMap["identity"] = cu.Identity
1137	}
1138	if cu.ClusterProperties != nil {
1139		objectMap["properties"] = cu.ClusterProperties
1140	}
1141	return json.Marshal(objectMap)
1142}
1143
1144// UnmarshalJSON is the custom unmarshaler for ClusterUpdate struct.
1145func (cu *ClusterUpdate) UnmarshalJSON(body []byte) error {
1146	var m map[string]*json.RawMessage
1147	err := json.Unmarshal(body, &m)
1148	if err != nil {
1149		return err
1150	}
1151	for k, v := range m {
1152		switch k {
1153		case "tags":
1154			if v != nil {
1155				var tags map[string]*string
1156				err = json.Unmarshal(*v, &tags)
1157				if err != nil {
1158					return err
1159				}
1160				cu.Tags = tags
1161			}
1162		case "location":
1163			if v != nil {
1164				var location string
1165				err = json.Unmarshal(*v, &location)
1166				if err != nil {
1167					return err
1168				}
1169				cu.Location = &location
1170			}
1171		case "sku":
1172			if v != nil {
1173				var sku AzureSku
1174				err = json.Unmarshal(*v, &sku)
1175				if err != nil {
1176					return err
1177				}
1178				cu.Sku = &sku
1179			}
1180		case "identity":
1181			if v != nil {
1182				var identity Identity
1183				err = json.Unmarshal(*v, &identity)
1184				if err != nil {
1185					return err
1186				}
1187				cu.Identity = &identity
1188			}
1189		case "properties":
1190			if v != nil {
1191				var clusterProperties ClusterProperties
1192				err = json.Unmarshal(*v, &clusterProperties)
1193				if err != nil {
1194					return err
1195				}
1196				cu.ClusterProperties = &clusterProperties
1197			}
1198		case "id":
1199			if v != nil {
1200				var ID string
1201				err = json.Unmarshal(*v, &ID)
1202				if err != nil {
1203					return err
1204				}
1205				cu.ID = &ID
1206			}
1207		case "name":
1208			if v != nil {
1209				var name string
1210				err = json.Unmarshal(*v, &name)
1211				if err != nil {
1212					return err
1213				}
1214				cu.Name = &name
1215			}
1216		case "type":
1217			if v != nil {
1218				var typeVar string
1219				err = json.Unmarshal(*v, &typeVar)
1220				if err != nil {
1221					return err
1222				}
1223				cu.Type = &typeVar
1224			}
1225		}
1226	}
1227
1228	return nil
1229}
1230
1231// BasicDatabase class representing a Kusto database.
1232type BasicDatabase interface {
1233	AsReadWriteDatabase() (*ReadWriteDatabase, bool)
1234	AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool)
1235	AsDatabase() (*Database, bool)
1236}
1237
1238// Database class representing a Kusto database.
1239type Database struct {
1240	autorest.Response `json:"-"`
1241	// Location - Resource location.
1242	Location *string `json:"location,omitempty"`
1243	// Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing'
1244	Kind Kind `json:"kind,omitempty"`
1245	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1246	ID *string `json:"id,omitempty"`
1247	// Name - READ-ONLY; The name of the resource
1248	Name *string `json:"name,omitempty"`
1249	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1250	Type *string `json:"type,omitempty"`
1251}
1252
1253func unmarshalBasicDatabase(body []byte) (BasicDatabase, error) {
1254	var m map[string]interface{}
1255	err := json.Unmarshal(body, &m)
1256	if err != nil {
1257		return nil, err
1258	}
1259
1260	switch m["kind"] {
1261	case string(KindReadWrite):
1262		var rwd ReadWriteDatabase
1263		err := json.Unmarshal(body, &rwd)
1264		return rwd, err
1265	case string(KindReadOnlyFollowing):
1266		var rofd ReadOnlyFollowingDatabase
1267		err := json.Unmarshal(body, &rofd)
1268		return rofd, err
1269	default:
1270		var d Database
1271		err := json.Unmarshal(body, &d)
1272		return d, err
1273	}
1274}
1275func unmarshalBasicDatabaseArray(body []byte) ([]BasicDatabase, error) {
1276	var rawMessages []*json.RawMessage
1277	err := json.Unmarshal(body, &rawMessages)
1278	if err != nil {
1279		return nil, err
1280	}
1281
1282	dArray := make([]BasicDatabase, len(rawMessages))
1283
1284	for index, rawMessage := range rawMessages {
1285		d, err := unmarshalBasicDatabase(*rawMessage)
1286		if err != nil {
1287			return nil, err
1288		}
1289		dArray[index] = d
1290	}
1291	return dArray, nil
1292}
1293
1294// MarshalJSON is the custom marshaler for Database.
1295func (d Database) MarshalJSON() ([]byte, error) {
1296	d.Kind = KindDatabase
1297	objectMap := make(map[string]interface{})
1298	if d.Location != nil {
1299		objectMap["location"] = d.Location
1300	}
1301	if d.Kind != "" {
1302		objectMap["kind"] = d.Kind
1303	}
1304	return json.Marshal(objectMap)
1305}
1306
1307// AsReadWriteDatabase is the BasicDatabase implementation for Database.
1308func (d Database) AsReadWriteDatabase() (*ReadWriteDatabase, bool) {
1309	return nil, false
1310}
1311
1312// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for Database.
1313func (d Database) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) {
1314	return nil, false
1315}
1316
1317// AsDatabase is the BasicDatabase implementation for Database.
1318func (d Database) AsDatabase() (*Database, bool) {
1319	return &d, true
1320}
1321
1322// AsBasicDatabase is the BasicDatabase implementation for Database.
1323func (d Database) AsBasicDatabase() (BasicDatabase, bool) {
1324	return &d, true
1325}
1326
1327// DatabaseListResult the list Kusto databases operation response.
1328type DatabaseListResult struct {
1329	autorest.Response `json:"-"`
1330	// Value - The list of Kusto databases.
1331	Value *[]BasicDatabase `json:"value,omitempty"`
1332}
1333
1334// UnmarshalJSON is the custom unmarshaler for DatabaseListResult struct.
1335func (dlr *DatabaseListResult) UnmarshalJSON(body []byte) error {
1336	var m map[string]*json.RawMessage
1337	err := json.Unmarshal(body, &m)
1338	if err != nil {
1339		return err
1340	}
1341	for k, v := range m {
1342		switch k {
1343		case "value":
1344			if v != nil {
1345				value, err := unmarshalBasicDatabaseArray(*v)
1346				if err != nil {
1347					return err
1348				}
1349				dlr.Value = &value
1350			}
1351		}
1352	}
1353
1354	return nil
1355}
1356
1357// DatabaseModel ...
1358type DatabaseModel struct {
1359	autorest.Response `json:"-"`
1360	Value             BasicDatabase `json:"value,omitempty"`
1361}
1362
1363// UnmarshalJSON is the custom unmarshaler for DatabaseModel struct.
1364func (dm *DatabaseModel) UnmarshalJSON(body []byte) error {
1365	d, err := unmarshalBasicDatabase(body)
1366	if err != nil {
1367		return err
1368	}
1369	dm.Value = d
1370
1371	return nil
1372}
1373
1374// DatabasePrincipal a class representing database principal entity.
1375type DatabasePrincipal struct {
1376	// Role - Database principal role. Possible values include: 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer'
1377	Role DatabasePrincipalRole `json:"role,omitempty"`
1378	// Name - Database principal name.
1379	Name *string `json:"name,omitempty"`
1380	// Type - Database principal type. Possible values include: 'DatabasePrincipalTypeApp', 'DatabasePrincipalTypeGroup', 'DatabasePrincipalTypeUser'
1381	Type DatabasePrincipalType `json:"type,omitempty"`
1382	// Fqn - Database principal fully qualified name.
1383	Fqn *string `json:"fqn,omitempty"`
1384	// Email - Database principal email if exists.
1385	Email *string `json:"email,omitempty"`
1386	// AppID - Application id - relevant only for application principal type.
1387	AppID *string `json:"appId,omitempty"`
1388	// TenantName - READ-ONLY; The tenant name of the principal
1389	TenantName *string `json:"tenantName,omitempty"`
1390}
1391
1392// MarshalJSON is the custom marshaler for DatabasePrincipal.
1393func (dp DatabasePrincipal) MarshalJSON() ([]byte, error) {
1394	objectMap := make(map[string]interface{})
1395	if dp.Role != "" {
1396		objectMap["role"] = dp.Role
1397	}
1398	if dp.Name != nil {
1399		objectMap["name"] = dp.Name
1400	}
1401	if dp.Type != "" {
1402		objectMap["type"] = dp.Type
1403	}
1404	if dp.Fqn != nil {
1405		objectMap["fqn"] = dp.Fqn
1406	}
1407	if dp.Email != nil {
1408		objectMap["email"] = dp.Email
1409	}
1410	if dp.AppID != nil {
1411		objectMap["appId"] = dp.AppID
1412	}
1413	return json.Marshal(objectMap)
1414}
1415
1416// DatabasePrincipalAssignment class representing a database principal assignment.
1417type DatabasePrincipalAssignment struct {
1418	autorest.Response `json:"-"`
1419	// DatabasePrincipalProperties - The database principal.
1420	*DatabasePrincipalProperties `json:"properties,omitempty"`
1421	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1422	ID *string `json:"id,omitempty"`
1423	// Name - READ-ONLY; The name of the resource
1424	Name *string `json:"name,omitempty"`
1425	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1426	Type *string `json:"type,omitempty"`
1427}
1428
1429// MarshalJSON is the custom marshaler for DatabasePrincipalAssignment.
1430func (dpa DatabasePrincipalAssignment) MarshalJSON() ([]byte, error) {
1431	objectMap := make(map[string]interface{})
1432	if dpa.DatabasePrincipalProperties != nil {
1433		objectMap["properties"] = dpa.DatabasePrincipalProperties
1434	}
1435	return json.Marshal(objectMap)
1436}
1437
1438// UnmarshalJSON is the custom unmarshaler for DatabasePrincipalAssignment struct.
1439func (dpa *DatabasePrincipalAssignment) UnmarshalJSON(body []byte) error {
1440	var m map[string]*json.RawMessage
1441	err := json.Unmarshal(body, &m)
1442	if err != nil {
1443		return err
1444	}
1445	for k, v := range m {
1446		switch k {
1447		case "properties":
1448			if v != nil {
1449				var databasePrincipalProperties DatabasePrincipalProperties
1450				err = json.Unmarshal(*v, &databasePrincipalProperties)
1451				if err != nil {
1452					return err
1453				}
1454				dpa.DatabasePrincipalProperties = &databasePrincipalProperties
1455			}
1456		case "id":
1457			if v != nil {
1458				var ID string
1459				err = json.Unmarshal(*v, &ID)
1460				if err != nil {
1461					return err
1462				}
1463				dpa.ID = &ID
1464			}
1465		case "name":
1466			if v != nil {
1467				var name string
1468				err = json.Unmarshal(*v, &name)
1469				if err != nil {
1470					return err
1471				}
1472				dpa.Name = &name
1473			}
1474		case "type":
1475			if v != nil {
1476				var typeVar string
1477				err = json.Unmarshal(*v, &typeVar)
1478				if err != nil {
1479					return err
1480				}
1481				dpa.Type = &typeVar
1482			}
1483		}
1484	}
1485
1486	return nil
1487}
1488
1489// DatabasePrincipalAssignmentCheckNameRequest a principal assignment check name availability request.
1490type DatabasePrincipalAssignmentCheckNameRequest struct {
1491	// Name - Principal Assignment resource name.
1492	Name *string `json:"name,omitempty"`
1493	// Type - The type of resource, Microsoft.Kusto/clusters/databases/principalAssignments.
1494	Type *string `json:"type,omitempty"`
1495}
1496
1497// DatabasePrincipalAssignmentListResult the list Kusto database principal assignments operation response.
1498type DatabasePrincipalAssignmentListResult struct {
1499	autorest.Response `json:"-"`
1500	// Value - The list of Kusto database principal assignments.
1501	Value *[]DatabasePrincipalAssignment `json:"value,omitempty"`
1502}
1503
1504// DatabasePrincipalAssignmentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the
1505// results of a long-running operation.
1506type DatabasePrincipalAssignmentsCreateOrUpdateFuture struct {
1507	azure.FutureAPI
1508	// Result returns the result of the asynchronous operation.
1509	// If the operation has not completed it will return an error.
1510	Result func(DatabasePrincipalAssignmentsClient) (DatabasePrincipalAssignment, error)
1511}
1512
1513// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1514func (future *DatabasePrincipalAssignmentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1515	var azFuture azure.Future
1516	if err := json.Unmarshal(body, &azFuture); err != nil {
1517		return err
1518	}
1519	future.FutureAPI = &azFuture
1520	future.Result = future.result
1521	return nil
1522}
1523
1524// result is the default implementation for DatabasePrincipalAssignmentsCreateOrUpdateFuture.Result.
1525func (future *DatabasePrincipalAssignmentsCreateOrUpdateFuture) result(client DatabasePrincipalAssignmentsClient) (dpa DatabasePrincipalAssignment, err error) {
1526	var done bool
1527	done, err = future.DoneWithContext(context.Background(), client)
1528	if err != nil {
1529		err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1530		return
1531	}
1532	if !done {
1533		dpa.Response.Response = future.Response()
1534		err = azure.NewAsyncOpIncompleteError("kusto.DatabasePrincipalAssignmentsCreateOrUpdateFuture")
1535		return
1536	}
1537	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1538	if dpa.Response.Response, err = future.GetResult(sender); err == nil && dpa.Response.Response.StatusCode != http.StatusNoContent {
1539		dpa, err = client.CreateOrUpdateResponder(dpa.Response.Response)
1540		if err != nil {
1541			err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsCreateOrUpdateFuture", "Result", dpa.Response.Response, "Failure responding to request")
1542		}
1543	}
1544	return
1545}
1546
1547// DatabasePrincipalAssignmentsDeleteFuture an abstraction for monitoring and retrieving the results of a
1548// long-running operation.
1549type DatabasePrincipalAssignmentsDeleteFuture struct {
1550	azure.FutureAPI
1551	// Result returns the result of the asynchronous operation.
1552	// If the operation has not completed it will return an error.
1553	Result func(DatabasePrincipalAssignmentsClient) (autorest.Response, error)
1554}
1555
1556// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1557func (future *DatabasePrincipalAssignmentsDeleteFuture) UnmarshalJSON(body []byte) error {
1558	var azFuture azure.Future
1559	if err := json.Unmarshal(body, &azFuture); err != nil {
1560		return err
1561	}
1562	future.FutureAPI = &azFuture
1563	future.Result = future.result
1564	return nil
1565}
1566
1567// result is the default implementation for DatabasePrincipalAssignmentsDeleteFuture.Result.
1568func (future *DatabasePrincipalAssignmentsDeleteFuture) result(client DatabasePrincipalAssignmentsClient) (ar autorest.Response, err error) {
1569	var done bool
1570	done, err = future.DoneWithContext(context.Background(), client)
1571	if err != nil {
1572		err = autorest.NewErrorWithError(err, "kusto.DatabasePrincipalAssignmentsDeleteFuture", "Result", future.Response(), "Polling failure")
1573		return
1574	}
1575	if !done {
1576		ar.Response = future.Response()
1577		err = azure.NewAsyncOpIncompleteError("kusto.DatabasePrincipalAssignmentsDeleteFuture")
1578		return
1579	}
1580	ar.Response = future.Response()
1581	return
1582}
1583
1584// DatabasePrincipalListRequest the list Kusto database principals operation request.
1585type DatabasePrincipalListRequest struct {
1586	// Value - The list of Kusto database principals.
1587	Value *[]DatabasePrincipal `json:"value,omitempty"`
1588}
1589
1590// DatabasePrincipalListResult the list Kusto database principals operation response.
1591type DatabasePrincipalListResult struct {
1592	autorest.Response `json:"-"`
1593	// Value - The list of Kusto database principals.
1594	Value *[]DatabasePrincipal `json:"value,omitempty"`
1595}
1596
1597// DatabasePrincipalProperties a class representing database principal property.
1598type DatabasePrincipalProperties struct {
1599	// PrincipalID - The principal ID assigned to the database principal. It can be a user email, application ID, or security group name.
1600	PrincipalID *string `json:"principalId,omitempty"`
1601	// Role - Database principal role. Possible values include: 'Admin', 'Ingestor', 'Monitor', 'User', 'UnrestrictedViewers', 'Viewer'
1602	Role DatabasePrincipalRole `json:"role,omitempty"`
1603	// TenantID - The tenant id of the principal
1604	TenantID *string `json:"tenantId,omitempty"`
1605	// PrincipalType - Principal type. Possible values include: 'PrincipalTypeApp', 'PrincipalTypeGroup', 'PrincipalTypeUser'
1606	PrincipalType PrincipalType `json:"principalType,omitempty"`
1607	// TenantName - READ-ONLY; The tenant name of the principal
1608	TenantName *string `json:"tenantName,omitempty"`
1609	// PrincipalName - READ-ONLY; The principal name
1610	PrincipalName *string `json:"principalName,omitempty"`
1611	// ProvisioningState - The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'
1612	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1613}
1614
1615// MarshalJSON is the custom marshaler for DatabasePrincipalProperties.
1616func (dpp DatabasePrincipalProperties) MarshalJSON() ([]byte, error) {
1617	objectMap := make(map[string]interface{})
1618	if dpp.PrincipalID != nil {
1619		objectMap["principalId"] = dpp.PrincipalID
1620	}
1621	if dpp.Role != "" {
1622		objectMap["role"] = dpp.Role
1623	}
1624	if dpp.TenantID != nil {
1625		objectMap["tenantId"] = dpp.TenantID
1626	}
1627	if dpp.PrincipalType != "" {
1628		objectMap["principalType"] = dpp.PrincipalType
1629	}
1630	if dpp.ProvisioningState != "" {
1631		objectMap["provisioningState"] = dpp.ProvisioningState
1632	}
1633	return json.Marshal(objectMap)
1634}
1635
1636// DatabasesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
1637// operation.
1638type DatabasesCreateOrUpdateFuture struct {
1639	azure.FutureAPI
1640	// Result returns the result of the asynchronous operation.
1641	// If the operation has not completed it will return an error.
1642	Result func(DatabasesClient) (DatabaseModel, error)
1643}
1644
1645// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1646func (future *DatabasesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1647	var azFuture azure.Future
1648	if err := json.Unmarshal(body, &azFuture); err != nil {
1649		return err
1650	}
1651	future.FutureAPI = &azFuture
1652	future.Result = future.result
1653	return nil
1654}
1655
1656// result is the default implementation for DatabasesCreateOrUpdateFuture.Result.
1657func (future *DatabasesCreateOrUpdateFuture) result(client DatabasesClient) (dm DatabaseModel, err error) {
1658	var done bool
1659	done, err = future.DoneWithContext(context.Background(), client)
1660	if err != nil {
1661		err = autorest.NewErrorWithError(err, "kusto.DatabasesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1662		return
1663	}
1664	if !done {
1665		dm.Response.Response = future.Response()
1666		err = azure.NewAsyncOpIncompleteError("kusto.DatabasesCreateOrUpdateFuture")
1667		return
1668	}
1669	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1670	if dm.Response.Response, err = future.GetResult(sender); err == nil && dm.Response.Response.StatusCode != http.StatusNoContent {
1671		dm, err = client.CreateOrUpdateResponder(dm.Response.Response)
1672		if err != nil {
1673			err = autorest.NewErrorWithError(err, "kusto.DatabasesCreateOrUpdateFuture", "Result", dm.Response.Response, "Failure responding to request")
1674		}
1675	}
1676	return
1677}
1678
1679// DatabasesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
1680// operation.
1681type DatabasesDeleteFuture struct {
1682	azure.FutureAPI
1683	// Result returns the result of the asynchronous operation.
1684	// If the operation has not completed it will return an error.
1685	Result func(DatabasesClient) (autorest.Response, error)
1686}
1687
1688// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1689func (future *DatabasesDeleteFuture) UnmarshalJSON(body []byte) error {
1690	var azFuture azure.Future
1691	if err := json.Unmarshal(body, &azFuture); err != nil {
1692		return err
1693	}
1694	future.FutureAPI = &azFuture
1695	future.Result = future.result
1696	return nil
1697}
1698
1699// result is the default implementation for DatabasesDeleteFuture.Result.
1700func (future *DatabasesDeleteFuture) result(client DatabasesClient) (ar autorest.Response, err error) {
1701	var done bool
1702	done, err = future.DoneWithContext(context.Background(), client)
1703	if err != nil {
1704		err = autorest.NewErrorWithError(err, "kusto.DatabasesDeleteFuture", "Result", future.Response(), "Polling failure")
1705		return
1706	}
1707	if !done {
1708		ar.Response = future.Response()
1709		err = azure.NewAsyncOpIncompleteError("kusto.DatabasesDeleteFuture")
1710		return
1711	}
1712	ar.Response = future.Response()
1713	return
1714}
1715
1716// DatabaseStatistics a class that contains database statistics information.
1717type DatabaseStatistics struct {
1718	// Size - The database size - the total size of compressed data and index in bytes.
1719	Size *float64 `json:"size,omitempty"`
1720}
1721
1722// DatabasesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
1723// operation.
1724type DatabasesUpdateFuture struct {
1725	azure.FutureAPI
1726	// Result returns the result of the asynchronous operation.
1727	// If the operation has not completed it will return an error.
1728	Result func(DatabasesClient) (DatabaseModel, error)
1729}
1730
1731// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1732func (future *DatabasesUpdateFuture) UnmarshalJSON(body []byte) error {
1733	var azFuture azure.Future
1734	if err := json.Unmarshal(body, &azFuture); err != nil {
1735		return err
1736	}
1737	future.FutureAPI = &azFuture
1738	future.Result = future.result
1739	return nil
1740}
1741
1742// result is the default implementation for DatabasesUpdateFuture.Result.
1743func (future *DatabasesUpdateFuture) result(client DatabasesClient) (dm DatabaseModel, err error) {
1744	var done bool
1745	done, err = future.DoneWithContext(context.Background(), client)
1746	if err != nil {
1747		err = autorest.NewErrorWithError(err, "kusto.DatabasesUpdateFuture", "Result", future.Response(), "Polling failure")
1748		return
1749	}
1750	if !done {
1751		dm.Response.Response = future.Response()
1752		err = azure.NewAsyncOpIncompleteError("kusto.DatabasesUpdateFuture")
1753		return
1754	}
1755	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1756	if dm.Response.Response, err = future.GetResult(sender); err == nil && dm.Response.Response.StatusCode != http.StatusNoContent {
1757		dm, err = client.UpdateResponder(dm.Response.Response)
1758		if err != nil {
1759			err = autorest.NewErrorWithError(err, "kusto.DatabasesUpdateFuture", "Result", dm.Response.Response, "Failure responding to request")
1760		}
1761	}
1762	return
1763}
1764
1765// BasicDataConnection class representing an data connection.
1766type BasicDataConnection interface {
1767	AsEventHubDataConnection() (*EventHubDataConnection, bool)
1768	AsIotHubDataConnection() (*IotHubDataConnection, bool)
1769	AsEventGridDataConnection() (*EventGridDataConnection, bool)
1770	AsDataConnection() (*DataConnection, bool)
1771}
1772
1773// DataConnection class representing an data connection.
1774type DataConnection struct {
1775	autorest.Response `json:"-"`
1776	// Location - Resource location.
1777	Location *string `json:"location,omitempty"`
1778	// Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid'
1779	Kind KindBasicDataConnection `json:"kind,omitempty"`
1780	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1781	ID *string `json:"id,omitempty"`
1782	// Name - READ-ONLY; The name of the resource
1783	Name *string `json:"name,omitempty"`
1784	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
1785	Type *string `json:"type,omitempty"`
1786}
1787
1788func unmarshalBasicDataConnection(body []byte) (BasicDataConnection, error) {
1789	var m map[string]interface{}
1790	err := json.Unmarshal(body, &m)
1791	if err != nil {
1792		return nil, err
1793	}
1794
1795	switch m["kind"] {
1796	case string(KindEventHub):
1797		var ehdc EventHubDataConnection
1798		err := json.Unmarshal(body, &ehdc)
1799		return ehdc, err
1800	case string(KindIotHub):
1801		var ihdc IotHubDataConnection
1802		err := json.Unmarshal(body, &ihdc)
1803		return ihdc, err
1804	case string(KindEventGrid):
1805		var egdc EventGridDataConnection
1806		err := json.Unmarshal(body, &egdc)
1807		return egdc, err
1808	default:
1809		var dc DataConnection
1810		err := json.Unmarshal(body, &dc)
1811		return dc, err
1812	}
1813}
1814func unmarshalBasicDataConnectionArray(body []byte) ([]BasicDataConnection, error) {
1815	var rawMessages []*json.RawMessage
1816	err := json.Unmarshal(body, &rawMessages)
1817	if err != nil {
1818		return nil, err
1819	}
1820
1821	dcArray := make([]BasicDataConnection, len(rawMessages))
1822
1823	for index, rawMessage := range rawMessages {
1824		dc, err := unmarshalBasicDataConnection(*rawMessage)
1825		if err != nil {
1826			return nil, err
1827		}
1828		dcArray[index] = dc
1829	}
1830	return dcArray, nil
1831}
1832
1833// MarshalJSON is the custom marshaler for DataConnection.
1834func (dc DataConnection) MarshalJSON() ([]byte, error) {
1835	dc.Kind = KindDataConnection
1836	objectMap := make(map[string]interface{})
1837	if dc.Location != nil {
1838		objectMap["location"] = dc.Location
1839	}
1840	if dc.Kind != "" {
1841		objectMap["kind"] = dc.Kind
1842	}
1843	return json.Marshal(objectMap)
1844}
1845
1846// AsEventHubDataConnection is the BasicDataConnection implementation for DataConnection.
1847func (dc DataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) {
1848	return nil, false
1849}
1850
1851// AsIotHubDataConnection is the BasicDataConnection implementation for DataConnection.
1852func (dc DataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) {
1853	return nil, false
1854}
1855
1856// AsEventGridDataConnection is the BasicDataConnection implementation for DataConnection.
1857func (dc DataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) {
1858	return nil, false
1859}
1860
1861// AsDataConnection is the BasicDataConnection implementation for DataConnection.
1862func (dc DataConnection) AsDataConnection() (*DataConnection, bool) {
1863	return &dc, true
1864}
1865
1866// AsBasicDataConnection is the BasicDataConnection implementation for DataConnection.
1867func (dc DataConnection) AsBasicDataConnection() (BasicDataConnection, bool) {
1868	return &dc, true
1869}
1870
1871// DataConnectionCheckNameRequest a data connection check name availability request.
1872type DataConnectionCheckNameRequest struct {
1873	// Name - Data Connection name.
1874	Name *string `json:"name,omitempty"`
1875	// Type - The type of resource, Microsoft.Kusto/clusters/databases/dataConnections.
1876	Type *string `json:"type,omitempty"`
1877}
1878
1879// DataConnectionListResult the list Kusto data connections operation response.
1880type DataConnectionListResult struct {
1881	autorest.Response `json:"-"`
1882	// Value - The list of Kusto data connections.
1883	Value *[]BasicDataConnection `json:"value,omitempty"`
1884}
1885
1886// UnmarshalJSON is the custom unmarshaler for DataConnectionListResult struct.
1887func (dclr *DataConnectionListResult) UnmarshalJSON(body []byte) error {
1888	var m map[string]*json.RawMessage
1889	err := json.Unmarshal(body, &m)
1890	if err != nil {
1891		return err
1892	}
1893	for k, v := range m {
1894		switch k {
1895		case "value":
1896			if v != nil {
1897				value, err := unmarshalBasicDataConnectionArray(*v)
1898				if err != nil {
1899					return err
1900				}
1901				dclr.Value = &value
1902			}
1903		}
1904	}
1905
1906	return nil
1907}
1908
1909// DataConnectionModel ...
1910type DataConnectionModel struct {
1911	autorest.Response `json:"-"`
1912	Value             BasicDataConnection `json:"value,omitempty"`
1913}
1914
1915// UnmarshalJSON is the custom unmarshaler for DataConnectionModel struct.
1916func (dcm *DataConnectionModel) UnmarshalJSON(body []byte) error {
1917	dc, err := unmarshalBasicDataConnection(body)
1918	if err != nil {
1919		return err
1920	}
1921	dcm.Value = dc
1922
1923	return nil
1924}
1925
1926// DataConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
1927// long-running operation.
1928type DataConnectionsCreateOrUpdateFuture struct {
1929	azure.FutureAPI
1930	// Result returns the result of the asynchronous operation.
1931	// If the operation has not completed it will return an error.
1932	Result func(DataConnectionsClient) (DataConnectionModel, error)
1933}
1934
1935// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1936func (future *DataConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1937	var azFuture azure.Future
1938	if err := json.Unmarshal(body, &azFuture); err != nil {
1939		return err
1940	}
1941	future.FutureAPI = &azFuture
1942	future.Result = future.result
1943	return nil
1944}
1945
1946// result is the default implementation for DataConnectionsCreateOrUpdateFuture.Result.
1947func (future *DataConnectionsCreateOrUpdateFuture) result(client DataConnectionsClient) (dcm DataConnectionModel, err error) {
1948	var done bool
1949	done, err = future.DoneWithContext(context.Background(), client)
1950	if err != nil {
1951		err = autorest.NewErrorWithError(err, "kusto.DataConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1952		return
1953	}
1954	if !done {
1955		dcm.Response.Response = future.Response()
1956		err = azure.NewAsyncOpIncompleteError("kusto.DataConnectionsCreateOrUpdateFuture")
1957		return
1958	}
1959	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1960	if dcm.Response.Response, err = future.GetResult(sender); err == nil && dcm.Response.Response.StatusCode != http.StatusNoContent {
1961		dcm, err = client.CreateOrUpdateResponder(dcm.Response.Response)
1962		if err != nil {
1963			err = autorest.NewErrorWithError(err, "kusto.DataConnectionsCreateOrUpdateFuture", "Result", dcm.Response.Response, "Failure responding to request")
1964		}
1965	}
1966	return
1967}
1968
1969// DataConnectionsDataConnectionValidationMethodFuture an abstraction for monitoring and retrieving the
1970// results of a long-running operation.
1971type DataConnectionsDataConnectionValidationMethodFuture struct {
1972	azure.FutureAPI
1973	// Result returns the result of the asynchronous operation.
1974	// If the operation has not completed it will return an error.
1975	Result func(DataConnectionsClient) (DataConnectionValidationListResult, error)
1976}
1977
1978// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1979func (future *DataConnectionsDataConnectionValidationMethodFuture) UnmarshalJSON(body []byte) error {
1980	var azFuture azure.Future
1981	if err := json.Unmarshal(body, &azFuture); err != nil {
1982		return err
1983	}
1984	future.FutureAPI = &azFuture
1985	future.Result = future.result
1986	return nil
1987}
1988
1989// result is the default implementation for DataConnectionsDataConnectionValidationMethodFuture.Result.
1990func (future *DataConnectionsDataConnectionValidationMethodFuture) result(client DataConnectionsClient) (dcvlr DataConnectionValidationListResult, err error) {
1991	var done bool
1992	done, err = future.DoneWithContext(context.Background(), client)
1993	if err != nil {
1994		err = autorest.NewErrorWithError(err, "kusto.DataConnectionsDataConnectionValidationMethodFuture", "Result", future.Response(), "Polling failure")
1995		return
1996	}
1997	if !done {
1998		dcvlr.Response.Response = future.Response()
1999		err = azure.NewAsyncOpIncompleteError("kusto.DataConnectionsDataConnectionValidationMethodFuture")
2000		return
2001	}
2002	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2003	if dcvlr.Response.Response, err = future.GetResult(sender); err == nil && dcvlr.Response.Response.StatusCode != http.StatusNoContent {
2004		dcvlr, err = client.DataConnectionValidationMethodResponder(dcvlr.Response.Response)
2005		if err != nil {
2006			err = autorest.NewErrorWithError(err, "kusto.DataConnectionsDataConnectionValidationMethodFuture", "Result", dcvlr.Response.Response, "Failure responding to request")
2007		}
2008	}
2009	return
2010}
2011
2012// DataConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
2013// operation.
2014type DataConnectionsDeleteFuture struct {
2015	azure.FutureAPI
2016	// Result returns the result of the asynchronous operation.
2017	// If the operation has not completed it will return an error.
2018	Result func(DataConnectionsClient) (autorest.Response, error)
2019}
2020
2021// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2022func (future *DataConnectionsDeleteFuture) UnmarshalJSON(body []byte) error {
2023	var azFuture azure.Future
2024	if err := json.Unmarshal(body, &azFuture); err != nil {
2025		return err
2026	}
2027	future.FutureAPI = &azFuture
2028	future.Result = future.result
2029	return nil
2030}
2031
2032// result is the default implementation for DataConnectionsDeleteFuture.Result.
2033func (future *DataConnectionsDeleteFuture) result(client DataConnectionsClient) (ar autorest.Response, err error) {
2034	var done bool
2035	done, err = future.DoneWithContext(context.Background(), client)
2036	if err != nil {
2037		err = autorest.NewErrorWithError(err, "kusto.DataConnectionsDeleteFuture", "Result", future.Response(), "Polling failure")
2038		return
2039	}
2040	if !done {
2041		ar.Response = future.Response()
2042		err = azure.NewAsyncOpIncompleteError("kusto.DataConnectionsDeleteFuture")
2043		return
2044	}
2045	ar.Response = future.Response()
2046	return
2047}
2048
2049// DataConnectionsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
2050// operation.
2051type DataConnectionsUpdateFuture struct {
2052	azure.FutureAPI
2053	// Result returns the result of the asynchronous operation.
2054	// If the operation has not completed it will return an error.
2055	Result func(DataConnectionsClient) (DataConnectionModel, error)
2056}
2057
2058// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2059func (future *DataConnectionsUpdateFuture) UnmarshalJSON(body []byte) error {
2060	var azFuture azure.Future
2061	if err := json.Unmarshal(body, &azFuture); err != nil {
2062		return err
2063	}
2064	future.FutureAPI = &azFuture
2065	future.Result = future.result
2066	return nil
2067}
2068
2069// result is the default implementation for DataConnectionsUpdateFuture.Result.
2070func (future *DataConnectionsUpdateFuture) result(client DataConnectionsClient) (dcm DataConnectionModel, err error) {
2071	var done bool
2072	done, err = future.DoneWithContext(context.Background(), client)
2073	if err != nil {
2074		err = autorest.NewErrorWithError(err, "kusto.DataConnectionsUpdateFuture", "Result", future.Response(), "Polling failure")
2075		return
2076	}
2077	if !done {
2078		dcm.Response.Response = future.Response()
2079		err = azure.NewAsyncOpIncompleteError("kusto.DataConnectionsUpdateFuture")
2080		return
2081	}
2082	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2083	if dcm.Response.Response, err = future.GetResult(sender); err == nil && dcm.Response.Response.StatusCode != http.StatusNoContent {
2084		dcm, err = client.UpdateResponder(dcm.Response.Response)
2085		if err != nil {
2086			err = autorest.NewErrorWithError(err, "kusto.DataConnectionsUpdateFuture", "Result", dcm.Response.Response, "Failure responding to request")
2087		}
2088	}
2089	return
2090}
2091
2092// DataConnectionValidation class representing an data connection validation.
2093type DataConnectionValidation struct {
2094	// DataConnectionName - The name of the data connection.
2095	DataConnectionName *string `json:"dataConnectionName,omitempty"`
2096	// Properties - The data connection properties to validate.
2097	Properties BasicDataConnection `json:"properties,omitempty"`
2098}
2099
2100// UnmarshalJSON is the custom unmarshaler for DataConnectionValidation struct.
2101func (dcv *DataConnectionValidation) UnmarshalJSON(body []byte) error {
2102	var m map[string]*json.RawMessage
2103	err := json.Unmarshal(body, &m)
2104	if err != nil {
2105		return err
2106	}
2107	for k, v := range m {
2108		switch k {
2109		case "dataConnectionName":
2110			if v != nil {
2111				var dataConnectionName string
2112				err = json.Unmarshal(*v, &dataConnectionName)
2113				if err != nil {
2114					return err
2115				}
2116				dcv.DataConnectionName = &dataConnectionName
2117			}
2118		case "properties":
2119			if v != nil {
2120				properties, err := unmarshalBasicDataConnection(*v)
2121				if err != nil {
2122					return err
2123				}
2124				dcv.Properties = properties
2125			}
2126		}
2127	}
2128
2129	return nil
2130}
2131
2132// DataConnectionValidationListResult the list Kusto data connection validation result.
2133type DataConnectionValidationListResult struct {
2134	autorest.Response `json:"-"`
2135	// Value - The list of Kusto data connection validation errors.
2136	Value *[]DataConnectionValidationResult `json:"value,omitempty"`
2137}
2138
2139// DataConnectionValidationResult the result returned from a data connection validation request.
2140type DataConnectionValidationResult struct {
2141	// ErrorMessage - A message which indicates a problem in data connection validation.
2142	ErrorMessage *string `json:"errorMessage,omitempty"`
2143}
2144
2145// DiagnoseVirtualNetworkResult ...
2146type DiagnoseVirtualNetworkResult struct {
2147	autorest.Response `json:"-"`
2148	// Findings - The list of network connectivity diagnostic finding
2149	Findings *[]string `json:"findings,omitempty"`
2150}
2151
2152// EventGridConnectionProperties class representing the Kusto event grid connection properties.
2153type EventGridConnectionProperties struct {
2154	// StorageAccountResourceID - The resource ID of the storage account where the data resides.
2155	StorageAccountResourceID *string `json:"storageAccountResourceId,omitempty"`
2156	// EventHubResourceID - The resource ID where the event grid is configured to send events.
2157	EventHubResourceID *string `json:"eventHubResourceId,omitempty"`
2158	// ConsumerGroup - The event hub consumer group.
2159	ConsumerGroup *string `json:"consumerGroup,omitempty"`
2160	// TableName - The table where the data should be ingested. Optionally the table information can be added to each message.
2161	TableName *string `json:"tableName,omitempty"`
2162	// MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.
2163	MappingRuleName *string `json:"mappingRuleName,omitempty"`
2164	// DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'MULTIJSON', 'JSON', 'CSV', 'TSV', 'SCSV', 'SOHSV', 'PSV', 'TXT', 'RAW', 'SINGLEJSON', 'AVRO', 'TSVE', 'PARQUET', 'ORC', 'APACHEAVRO', 'W3CLOGFILE'
2165	DataFormat EventGridDataFormat `json:"dataFormat,omitempty"`
2166	// IgnoreFirstRecord - A Boolean value that, if set to true, indicates that ingestion should ignore the first record of every file
2167	IgnoreFirstRecord *bool `json:"ignoreFirstRecord,omitempty"`
2168	// BlobStorageEventType - The name of blob storage event type to process. Possible values include: 'MicrosoftStorageBlobCreated', 'MicrosoftStorageBlobRenamed'
2169	BlobStorageEventType BlobStorageEventType `json:"blobStorageEventType,omitempty"`
2170	// ProvisioningState - The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'
2171	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
2172}
2173
2174// EventGridDataConnection class representing an Event Grid data connection.
2175type EventGridDataConnection struct {
2176	// EventGridConnectionProperties - The properties of the Event Grid data connection.
2177	*EventGridConnectionProperties `json:"properties,omitempty"`
2178	// Location - Resource location.
2179	Location *string `json:"location,omitempty"`
2180	// Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid'
2181	Kind KindBasicDataConnection `json:"kind,omitempty"`
2182	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
2183	ID *string `json:"id,omitempty"`
2184	// Name - READ-ONLY; The name of the resource
2185	Name *string `json:"name,omitempty"`
2186	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
2187	Type *string `json:"type,omitempty"`
2188}
2189
2190// MarshalJSON is the custom marshaler for EventGridDataConnection.
2191func (egdc EventGridDataConnection) MarshalJSON() ([]byte, error) {
2192	egdc.Kind = KindEventGrid
2193	objectMap := make(map[string]interface{})
2194	if egdc.EventGridConnectionProperties != nil {
2195		objectMap["properties"] = egdc.EventGridConnectionProperties
2196	}
2197	if egdc.Location != nil {
2198		objectMap["location"] = egdc.Location
2199	}
2200	if egdc.Kind != "" {
2201		objectMap["kind"] = egdc.Kind
2202	}
2203	return json.Marshal(objectMap)
2204}
2205
2206// AsEventHubDataConnection is the BasicDataConnection implementation for EventGridDataConnection.
2207func (egdc EventGridDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) {
2208	return nil, false
2209}
2210
2211// AsIotHubDataConnection is the BasicDataConnection implementation for EventGridDataConnection.
2212func (egdc EventGridDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) {
2213	return nil, false
2214}
2215
2216// AsEventGridDataConnection is the BasicDataConnection implementation for EventGridDataConnection.
2217func (egdc EventGridDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) {
2218	return &egdc, true
2219}
2220
2221// AsDataConnection is the BasicDataConnection implementation for EventGridDataConnection.
2222func (egdc EventGridDataConnection) AsDataConnection() (*DataConnection, bool) {
2223	return nil, false
2224}
2225
2226// AsBasicDataConnection is the BasicDataConnection implementation for EventGridDataConnection.
2227func (egdc EventGridDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) {
2228	return &egdc, true
2229}
2230
2231// UnmarshalJSON is the custom unmarshaler for EventGridDataConnection struct.
2232func (egdc *EventGridDataConnection) UnmarshalJSON(body []byte) error {
2233	var m map[string]*json.RawMessage
2234	err := json.Unmarshal(body, &m)
2235	if err != nil {
2236		return err
2237	}
2238	for k, v := range m {
2239		switch k {
2240		case "properties":
2241			if v != nil {
2242				var eventGridConnectionProperties EventGridConnectionProperties
2243				err = json.Unmarshal(*v, &eventGridConnectionProperties)
2244				if err != nil {
2245					return err
2246				}
2247				egdc.EventGridConnectionProperties = &eventGridConnectionProperties
2248			}
2249		case "location":
2250			if v != nil {
2251				var location string
2252				err = json.Unmarshal(*v, &location)
2253				if err != nil {
2254					return err
2255				}
2256				egdc.Location = &location
2257			}
2258		case "kind":
2259			if v != nil {
2260				var kind KindBasicDataConnection
2261				err = json.Unmarshal(*v, &kind)
2262				if err != nil {
2263					return err
2264				}
2265				egdc.Kind = kind
2266			}
2267		case "id":
2268			if v != nil {
2269				var ID string
2270				err = json.Unmarshal(*v, &ID)
2271				if err != nil {
2272					return err
2273				}
2274				egdc.ID = &ID
2275			}
2276		case "name":
2277			if v != nil {
2278				var name string
2279				err = json.Unmarshal(*v, &name)
2280				if err != nil {
2281					return err
2282				}
2283				egdc.Name = &name
2284			}
2285		case "type":
2286			if v != nil {
2287				var typeVar string
2288				err = json.Unmarshal(*v, &typeVar)
2289				if err != nil {
2290					return err
2291				}
2292				egdc.Type = &typeVar
2293			}
2294		}
2295	}
2296
2297	return nil
2298}
2299
2300// EventHubConnectionProperties class representing the Kusto event hub connection properties.
2301type EventHubConnectionProperties struct {
2302	// EventHubResourceID - The resource ID of the event hub to be used to create a data connection.
2303	EventHubResourceID *string `json:"eventHubResourceId,omitempty"`
2304	// ConsumerGroup - The event hub consumer group.
2305	ConsumerGroup *string `json:"consumerGroup,omitempty"`
2306	// TableName - The table where the data should be ingested. Optionally the table information can be added to each message.
2307	TableName *string `json:"tableName,omitempty"`
2308	// MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.
2309	MappingRuleName *string `json:"mappingRuleName,omitempty"`
2310	// DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'EventHubDataFormatMULTIJSON', 'EventHubDataFormatJSON', 'EventHubDataFormatCSV', 'EventHubDataFormatTSV', 'EventHubDataFormatSCSV', 'EventHubDataFormatSOHSV', 'EventHubDataFormatPSV', 'EventHubDataFormatTXT', 'EventHubDataFormatRAW', 'EventHubDataFormatSINGLEJSON', 'EventHubDataFormatAVRO', 'EventHubDataFormatTSVE', 'EventHubDataFormatPARQUET', 'EventHubDataFormatORC', 'EventHubDataFormatAPACHEAVRO', 'EventHubDataFormatW3CLOGFILE'
2311	DataFormat EventHubDataFormat `json:"dataFormat,omitempty"`
2312	// EventSystemProperties - System properties of the event hub
2313	EventSystemProperties *[]string `json:"eventSystemProperties,omitempty"`
2314	// Compression - The event hub messages compression type. Possible values include: 'CompressionNone', 'CompressionGZip'
2315	Compression Compression `json:"compression,omitempty"`
2316	// ProvisioningState - The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'
2317	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
2318}
2319
2320// EventHubDataConnection class representing an event hub data connection.
2321type EventHubDataConnection struct {
2322	// EventHubConnectionProperties - The Event Hub data connection properties to validate.
2323	*EventHubConnectionProperties `json:"properties,omitempty"`
2324	// Location - Resource location.
2325	Location *string `json:"location,omitempty"`
2326	// Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid'
2327	Kind KindBasicDataConnection `json:"kind,omitempty"`
2328	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
2329	ID *string `json:"id,omitempty"`
2330	// Name - READ-ONLY; The name of the resource
2331	Name *string `json:"name,omitempty"`
2332	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
2333	Type *string `json:"type,omitempty"`
2334}
2335
2336// MarshalJSON is the custom marshaler for EventHubDataConnection.
2337func (ehdc EventHubDataConnection) MarshalJSON() ([]byte, error) {
2338	ehdc.Kind = KindEventHub
2339	objectMap := make(map[string]interface{})
2340	if ehdc.EventHubConnectionProperties != nil {
2341		objectMap["properties"] = ehdc.EventHubConnectionProperties
2342	}
2343	if ehdc.Location != nil {
2344		objectMap["location"] = ehdc.Location
2345	}
2346	if ehdc.Kind != "" {
2347		objectMap["kind"] = ehdc.Kind
2348	}
2349	return json.Marshal(objectMap)
2350}
2351
2352// AsEventHubDataConnection is the BasicDataConnection implementation for EventHubDataConnection.
2353func (ehdc EventHubDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) {
2354	return &ehdc, true
2355}
2356
2357// AsIotHubDataConnection is the BasicDataConnection implementation for EventHubDataConnection.
2358func (ehdc EventHubDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) {
2359	return nil, false
2360}
2361
2362// AsEventGridDataConnection is the BasicDataConnection implementation for EventHubDataConnection.
2363func (ehdc EventHubDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) {
2364	return nil, false
2365}
2366
2367// AsDataConnection is the BasicDataConnection implementation for EventHubDataConnection.
2368func (ehdc EventHubDataConnection) AsDataConnection() (*DataConnection, bool) {
2369	return nil, false
2370}
2371
2372// AsBasicDataConnection is the BasicDataConnection implementation for EventHubDataConnection.
2373func (ehdc EventHubDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) {
2374	return &ehdc, true
2375}
2376
2377// UnmarshalJSON is the custom unmarshaler for EventHubDataConnection struct.
2378func (ehdc *EventHubDataConnection) UnmarshalJSON(body []byte) error {
2379	var m map[string]*json.RawMessage
2380	err := json.Unmarshal(body, &m)
2381	if err != nil {
2382		return err
2383	}
2384	for k, v := range m {
2385		switch k {
2386		case "properties":
2387			if v != nil {
2388				var eventHubConnectionProperties EventHubConnectionProperties
2389				err = json.Unmarshal(*v, &eventHubConnectionProperties)
2390				if err != nil {
2391					return err
2392				}
2393				ehdc.EventHubConnectionProperties = &eventHubConnectionProperties
2394			}
2395		case "location":
2396			if v != nil {
2397				var location string
2398				err = json.Unmarshal(*v, &location)
2399				if err != nil {
2400					return err
2401				}
2402				ehdc.Location = &location
2403			}
2404		case "kind":
2405			if v != nil {
2406				var kind KindBasicDataConnection
2407				err = json.Unmarshal(*v, &kind)
2408				if err != nil {
2409					return err
2410				}
2411				ehdc.Kind = kind
2412			}
2413		case "id":
2414			if v != nil {
2415				var ID string
2416				err = json.Unmarshal(*v, &ID)
2417				if err != nil {
2418					return err
2419				}
2420				ehdc.ID = &ID
2421			}
2422		case "name":
2423			if v != nil {
2424				var name string
2425				err = json.Unmarshal(*v, &name)
2426				if err != nil {
2427					return err
2428				}
2429				ehdc.Name = &name
2430			}
2431		case "type":
2432			if v != nil {
2433				var typeVar string
2434				err = json.Unmarshal(*v, &typeVar)
2435				if err != nil {
2436					return err
2437				}
2438				ehdc.Type = &typeVar
2439			}
2440		}
2441	}
2442
2443	return nil
2444}
2445
2446// FollowerDatabaseDefinition a class representing follower database request.
2447type FollowerDatabaseDefinition struct {
2448	// ClusterResourceID - Resource id of the cluster that follows a database owned by this cluster.
2449	ClusterResourceID *string `json:"clusterResourceId,omitempty"`
2450	// AttachedDatabaseConfigurationName - Resource name of the attached database configuration in the follower cluster.
2451	AttachedDatabaseConfigurationName *string `json:"attachedDatabaseConfigurationName,omitempty"`
2452	// DatabaseName - READ-ONLY; The database name owned by this cluster that was followed. * in case following all databases.
2453	DatabaseName *string `json:"databaseName,omitempty"`
2454}
2455
2456// MarshalJSON is the custom marshaler for FollowerDatabaseDefinition.
2457func (fdd FollowerDatabaseDefinition) MarshalJSON() ([]byte, error) {
2458	objectMap := make(map[string]interface{})
2459	if fdd.ClusterResourceID != nil {
2460		objectMap["clusterResourceId"] = fdd.ClusterResourceID
2461	}
2462	if fdd.AttachedDatabaseConfigurationName != nil {
2463		objectMap["attachedDatabaseConfigurationName"] = fdd.AttachedDatabaseConfigurationName
2464	}
2465	return json.Marshal(objectMap)
2466}
2467
2468// FollowerDatabaseListResult the list Kusto database principals operation response.
2469type FollowerDatabaseListResult struct {
2470	autorest.Response `json:"-"`
2471	// Value - The list of follower database result.
2472	Value *[]FollowerDatabaseDefinition `json:"value,omitempty"`
2473}
2474
2475// Identity identity for the resource.
2476type Identity struct {
2477	// PrincipalID - READ-ONLY; The principal ID of resource identity.
2478	PrincipalID *string `json:"principalId,omitempty"`
2479	// TenantID - READ-ONLY; The tenant ID of resource.
2480	TenantID *string `json:"tenantId,omitempty"`
2481	// Type - The type of managed identity used. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user-assigned identities. The type 'None' will remove all identities. Possible values include: 'IdentityTypeNone', 'IdentityTypeSystemAssigned', 'IdentityTypeUserAssigned', 'IdentityTypeSystemAssignedUserAssigned'
2482	Type IdentityType `json:"type,omitempty"`
2483	// UserAssignedIdentities - The list of user identities associated with the Kusto cluster. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'.
2484	UserAssignedIdentities map[string]*IdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"`
2485}
2486
2487// MarshalJSON is the custom marshaler for Identity.
2488func (i Identity) MarshalJSON() ([]byte, error) {
2489	objectMap := make(map[string]interface{})
2490	if i.Type != "" {
2491		objectMap["type"] = i.Type
2492	}
2493	if i.UserAssignedIdentities != nil {
2494		objectMap["userAssignedIdentities"] = i.UserAssignedIdentities
2495	}
2496	return json.Marshal(objectMap)
2497}
2498
2499// IdentityUserAssignedIdentitiesValue ...
2500type IdentityUserAssignedIdentitiesValue struct {
2501	// PrincipalID - READ-ONLY; The principal id of user assigned identity.
2502	PrincipalID *string `json:"principalId,omitempty"`
2503	// ClientID - READ-ONLY; The client id of user assigned identity.
2504	ClientID *string `json:"clientId,omitempty"`
2505}
2506
2507// MarshalJSON is the custom marshaler for IdentityUserAssignedIdentitiesValue.
2508func (iAiv IdentityUserAssignedIdentitiesValue) MarshalJSON() ([]byte, error) {
2509	objectMap := make(map[string]interface{})
2510	return json.Marshal(objectMap)
2511}
2512
2513// IotHubConnectionProperties class representing the Kusto Iot hub connection properties.
2514type IotHubConnectionProperties struct {
2515	// IotHubResourceID - The resource ID of the Iot hub to be used to create a data connection.
2516	IotHubResourceID *string `json:"iotHubResourceId,omitempty"`
2517	// ConsumerGroup - The iot hub consumer group.
2518	ConsumerGroup *string `json:"consumerGroup,omitempty"`
2519	// TableName - The table where the data should be ingested. Optionally the table information can be added to each message.
2520	TableName *string `json:"tableName,omitempty"`
2521	// MappingRuleName - The mapping rule to be used to ingest the data. Optionally the mapping information can be added to each message.
2522	MappingRuleName *string `json:"mappingRuleName,omitempty"`
2523	// DataFormat - The data format of the message. Optionally the data format can be added to each message. Possible values include: 'IotHubDataFormatMULTIJSON', 'IotHubDataFormatJSON', 'IotHubDataFormatCSV', 'IotHubDataFormatTSV', 'IotHubDataFormatSCSV', 'IotHubDataFormatSOHSV', 'IotHubDataFormatPSV', 'IotHubDataFormatTXT', 'IotHubDataFormatRAW', 'IotHubDataFormatSINGLEJSON', 'IotHubDataFormatAVRO', 'IotHubDataFormatTSVE', 'IotHubDataFormatPARQUET', 'IotHubDataFormatORC', 'IotHubDataFormatAPACHEAVRO', 'IotHubDataFormatW3CLOGFILE'
2524	DataFormat IotHubDataFormat `json:"dataFormat,omitempty"`
2525	// EventSystemProperties - System properties of the iot hub
2526	EventSystemProperties *[]string `json:"eventSystemProperties,omitempty"`
2527	// SharedAccessPolicyName - The name of the share access policy
2528	SharedAccessPolicyName *string `json:"sharedAccessPolicyName,omitempty"`
2529	// ProvisioningState - The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'
2530	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
2531}
2532
2533// IotHubDataConnection class representing an iot hub data connection.
2534type IotHubDataConnection struct {
2535	// IotHubConnectionProperties - The Iot Hub data connection properties.
2536	*IotHubConnectionProperties `json:"properties,omitempty"`
2537	// Location - Resource location.
2538	Location *string `json:"location,omitempty"`
2539	// Kind - Possible values include: 'KindDataConnection', 'KindEventHub', 'KindIotHub', 'KindEventGrid'
2540	Kind KindBasicDataConnection `json:"kind,omitempty"`
2541	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
2542	ID *string `json:"id,omitempty"`
2543	// Name - READ-ONLY; The name of the resource
2544	Name *string `json:"name,omitempty"`
2545	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
2546	Type *string `json:"type,omitempty"`
2547}
2548
2549// MarshalJSON is the custom marshaler for IotHubDataConnection.
2550func (ihdc IotHubDataConnection) MarshalJSON() ([]byte, error) {
2551	ihdc.Kind = KindIotHub
2552	objectMap := make(map[string]interface{})
2553	if ihdc.IotHubConnectionProperties != nil {
2554		objectMap["properties"] = ihdc.IotHubConnectionProperties
2555	}
2556	if ihdc.Location != nil {
2557		objectMap["location"] = ihdc.Location
2558	}
2559	if ihdc.Kind != "" {
2560		objectMap["kind"] = ihdc.Kind
2561	}
2562	return json.Marshal(objectMap)
2563}
2564
2565// AsEventHubDataConnection is the BasicDataConnection implementation for IotHubDataConnection.
2566func (ihdc IotHubDataConnection) AsEventHubDataConnection() (*EventHubDataConnection, bool) {
2567	return nil, false
2568}
2569
2570// AsIotHubDataConnection is the BasicDataConnection implementation for IotHubDataConnection.
2571func (ihdc IotHubDataConnection) AsIotHubDataConnection() (*IotHubDataConnection, bool) {
2572	return &ihdc, true
2573}
2574
2575// AsEventGridDataConnection is the BasicDataConnection implementation for IotHubDataConnection.
2576func (ihdc IotHubDataConnection) AsEventGridDataConnection() (*EventGridDataConnection, bool) {
2577	return nil, false
2578}
2579
2580// AsDataConnection is the BasicDataConnection implementation for IotHubDataConnection.
2581func (ihdc IotHubDataConnection) AsDataConnection() (*DataConnection, bool) {
2582	return nil, false
2583}
2584
2585// AsBasicDataConnection is the BasicDataConnection implementation for IotHubDataConnection.
2586func (ihdc IotHubDataConnection) AsBasicDataConnection() (BasicDataConnection, bool) {
2587	return &ihdc, true
2588}
2589
2590// UnmarshalJSON is the custom unmarshaler for IotHubDataConnection struct.
2591func (ihdc *IotHubDataConnection) UnmarshalJSON(body []byte) error {
2592	var m map[string]*json.RawMessage
2593	err := json.Unmarshal(body, &m)
2594	if err != nil {
2595		return err
2596	}
2597	for k, v := range m {
2598		switch k {
2599		case "properties":
2600			if v != nil {
2601				var iotHubConnectionProperties IotHubConnectionProperties
2602				err = json.Unmarshal(*v, &iotHubConnectionProperties)
2603				if err != nil {
2604					return err
2605				}
2606				ihdc.IotHubConnectionProperties = &iotHubConnectionProperties
2607			}
2608		case "location":
2609			if v != nil {
2610				var location string
2611				err = json.Unmarshal(*v, &location)
2612				if err != nil {
2613					return err
2614				}
2615				ihdc.Location = &location
2616			}
2617		case "kind":
2618			if v != nil {
2619				var kind KindBasicDataConnection
2620				err = json.Unmarshal(*v, &kind)
2621				if err != nil {
2622					return err
2623				}
2624				ihdc.Kind = kind
2625			}
2626		case "id":
2627			if v != nil {
2628				var ID string
2629				err = json.Unmarshal(*v, &ID)
2630				if err != nil {
2631					return err
2632				}
2633				ihdc.ID = &ID
2634			}
2635		case "name":
2636			if v != nil {
2637				var name string
2638				err = json.Unmarshal(*v, &name)
2639				if err != nil {
2640					return err
2641				}
2642				ihdc.Name = &name
2643			}
2644		case "type":
2645			if v != nil {
2646				var typeVar string
2647				err = json.Unmarshal(*v, &typeVar)
2648				if err != nil {
2649					return err
2650				}
2651				ihdc.Type = &typeVar
2652			}
2653		}
2654	}
2655
2656	return nil
2657}
2658
2659// KeyVaultProperties properties of the key vault.
2660type KeyVaultProperties struct {
2661	// KeyName - The name of the key vault key.
2662	KeyName *string `json:"keyName,omitempty"`
2663	// KeyVersion - The version of the key vault key.
2664	KeyVersion *string `json:"keyVersion,omitempty"`
2665	// KeyVaultURI - The Uri of the key vault.
2666	KeyVaultURI *string `json:"keyVaultUri,omitempty"`
2667	// UserIdentity - The user assigned identity (ARM resource id) that has access to the key.
2668	UserIdentity *string `json:"userIdentity,omitempty"`
2669}
2670
2671// LanguageExtension the language extension object.
2672type LanguageExtension struct {
2673	// LanguageExtensionName - The language extension name. Possible values include: 'PYTHON', 'R'
2674	LanguageExtensionName LanguageExtensionName `json:"languageExtensionName,omitempty"`
2675}
2676
2677// LanguageExtensionsList the list of language extension objects.
2678type LanguageExtensionsList struct {
2679	autorest.Response `json:"-"`
2680	// Value - The list of language extensions.
2681	Value *[]LanguageExtension `json:"value,omitempty"`
2682}
2683
2684// ListResourceSkusResult list of available SKUs for a Kusto Cluster.
2685type ListResourceSkusResult struct {
2686	autorest.Response `json:"-"`
2687	// Value - The collection of available SKUs for an existing resource.
2688	Value *[]AzureResourceSku `json:"value,omitempty"`
2689}
2690
2691// Operation ...
2692type Operation struct {
2693	// Name - This is of the format {provider}/{resource}/{operation}.
2694	Name       *string           `json:"name,omitempty"`
2695	Display    *OperationDisplay `json:"display,omitempty"`
2696	Origin     *string           `json:"origin,omitempty"`
2697	Properties interface{}       `json:"properties,omitempty"`
2698}
2699
2700// OperationDisplay ...
2701type OperationDisplay struct {
2702	Provider *string `json:"provider,omitempty"`
2703	// Operation - For example: read, write, delete.
2704	Operation   *string `json:"operation,omitempty"`
2705	Resource    *string `json:"resource,omitempty"`
2706	Description *string `json:"description,omitempty"`
2707}
2708
2709// OperationListResult ...
2710type OperationListResult struct {
2711	autorest.Response `json:"-"`
2712	Value             *[]Operation `json:"value,omitempty"`
2713	NextLink          *string      `json:"nextLink,omitempty"`
2714}
2715
2716// OperationListResultIterator provides access to a complete listing of Operation values.
2717type OperationListResultIterator struct {
2718	i    int
2719	page OperationListResultPage
2720}
2721
2722// NextWithContext advances to the next value.  If there was an error making
2723// the request the iterator does not advance and the error is returned.
2724func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
2725	if tracing.IsEnabled() {
2726		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
2727		defer func() {
2728			sc := -1
2729			if iter.Response().Response.Response != nil {
2730				sc = iter.Response().Response.Response.StatusCode
2731			}
2732			tracing.EndSpan(ctx, sc, err)
2733		}()
2734	}
2735	iter.i++
2736	if iter.i < len(iter.page.Values()) {
2737		return nil
2738	}
2739	err = iter.page.NextWithContext(ctx)
2740	if err != nil {
2741		iter.i--
2742		return err
2743	}
2744	iter.i = 0
2745	return nil
2746}
2747
2748// Next advances to the next value.  If there was an error making
2749// the request the iterator does not advance and the error is returned.
2750// Deprecated: Use NextWithContext() instead.
2751func (iter *OperationListResultIterator) Next() error {
2752	return iter.NextWithContext(context.Background())
2753}
2754
2755// NotDone returns true if the enumeration should be started or is not yet complete.
2756func (iter OperationListResultIterator) NotDone() bool {
2757	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2758}
2759
2760// Response returns the raw server response from the last page request.
2761func (iter OperationListResultIterator) Response() OperationListResult {
2762	return iter.page.Response()
2763}
2764
2765// Value returns the current value or a zero-initialized value if the
2766// iterator has advanced beyond the end of the collection.
2767func (iter OperationListResultIterator) Value() Operation {
2768	if !iter.page.NotDone() {
2769		return Operation{}
2770	}
2771	return iter.page.Values()[iter.i]
2772}
2773
2774// Creates a new instance of the OperationListResultIterator type.
2775func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
2776	return OperationListResultIterator{page: page}
2777}
2778
2779// IsEmpty returns true if the ListResult contains no values.
2780func (olr OperationListResult) IsEmpty() bool {
2781	return olr.Value == nil || len(*olr.Value) == 0
2782}
2783
2784// hasNextLink returns true if the NextLink is not empty.
2785func (olr OperationListResult) hasNextLink() bool {
2786	return olr.NextLink != nil && len(*olr.NextLink) != 0
2787}
2788
2789// operationListResultPreparer prepares a request to retrieve the next set of results.
2790// It returns nil if no more results exist.
2791func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
2792	if !olr.hasNextLink() {
2793		return nil, nil
2794	}
2795	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2796		autorest.AsJSON(),
2797		autorest.AsGet(),
2798		autorest.WithBaseURL(to.String(olr.NextLink)))
2799}
2800
2801// OperationListResultPage contains a page of Operation values.
2802type OperationListResultPage struct {
2803	fn  func(context.Context, OperationListResult) (OperationListResult, error)
2804	olr OperationListResult
2805}
2806
2807// NextWithContext advances to the next page of values.  If there was an error making
2808// the request the page does not advance and the error is returned.
2809func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
2810	if tracing.IsEnabled() {
2811		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
2812		defer func() {
2813			sc := -1
2814			if page.Response().Response.Response != nil {
2815				sc = page.Response().Response.Response.StatusCode
2816			}
2817			tracing.EndSpan(ctx, sc, err)
2818		}()
2819	}
2820	for {
2821		next, err := page.fn(ctx, page.olr)
2822		if err != nil {
2823			return err
2824		}
2825		page.olr = next
2826		if !next.hasNextLink() || !next.IsEmpty() {
2827			break
2828		}
2829	}
2830	return nil
2831}
2832
2833// Next advances to the next page of values.  If there was an error making
2834// the request the page does not advance and the error is returned.
2835// Deprecated: Use NextWithContext() instead.
2836func (page *OperationListResultPage) Next() error {
2837	return page.NextWithContext(context.Background())
2838}
2839
2840// NotDone returns true if the page enumeration should be started or is not yet complete.
2841func (page OperationListResultPage) NotDone() bool {
2842	return !page.olr.IsEmpty()
2843}
2844
2845// Response returns the raw server response from the last page request.
2846func (page OperationListResultPage) Response() OperationListResult {
2847	return page.olr
2848}
2849
2850// Values returns the slice of values for the current page or nil if there are no values.
2851func (page OperationListResultPage) Values() []Operation {
2852	if page.olr.IsEmpty() {
2853		return nil
2854	}
2855	return *page.olr.Value
2856}
2857
2858// Creates a new instance of the OperationListResultPage type.
2859func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
2860	return OperationListResultPage{
2861		fn:  getNextPage,
2862		olr: cur,
2863	}
2864}
2865
2866// OptimizedAutoscale a class that contains the optimized auto scale definition.
2867type OptimizedAutoscale struct {
2868	// Version - The version of the template defined, for instance 1.
2869	Version *int32 `json:"version,omitempty"`
2870	// IsEnabled - A boolean value that indicate if the optimized autoscale feature is enabled or not.
2871	IsEnabled *bool `json:"isEnabled,omitempty"`
2872	// Minimum - Minimum allowed instances count.
2873	Minimum *int32 `json:"minimum,omitempty"`
2874	// Maximum - Maximum allowed instances count.
2875	Maximum *int32 `json:"maximum,omitempty"`
2876}
2877
2878// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not
2879// have tags and a location
2880type ProxyResource struct {
2881	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
2882	ID *string `json:"id,omitempty"`
2883	// Name - READ-ONLY; The name of the resource
2884	Name *string `json:"name,omitempty"`
2885	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
2886	Type *string `json:"type,omitempty"`
2887}
2888
2889// MarshalJSON is the custom marshaler for ProxyResource.
2890func (pr ProxyResource) MarshalJSON() ([]byte, error) {
2891	objectMap := make(map[string]interface{})
2892	return json.Marshal(objectMap)
2893}
2894
2895// ReadOnlyFollowingDatabase class representing a read only following database.
2896type ReadOnlyFollowingDatabase struct {
2897	// ReadOnlyFollowingDatabaseProperties - The database properties.
2898	*ReadOnlyFollowingDatabaseProperties `json:"properties,omitempty"`
2899	// Location - Resource location.
2900	Location *string `json:"location,omitempty"`
2901	// Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing'
2902	Kind Kind `json:"kind,omitempty"`
2903	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
2904	ID *string `json:"id,omitempty"`
2905	// Name - READ-ONLY; The name of the resource
2906	Name *string `json:"name,omitempty"`
2907	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
2908	Type *string `json:"type,omitempty"`
2909}
2910
2911// MarshalJSON is the custom marshaler for ReadOnlyFollowingDatabase.
2912func (rofd ReadOnlyFollowingDatabase) MarshalJSON() ([]byte, error) {
2913	rofd.Kind = KindReadOnlyFollowing
2914	objectMap := make(map[string]interface{})
2915	if rofd.ReadOnlyFollowingDatabaseProperties != nil {
2916		objectMap["properties"] = rofd.ReadOnlyFollowingDatabaseProperties
2917	}
2918	if rofd.Location != nil {
2919		objectMap["location"] = rofd.Location
2920	}
2921	if rofd.Kind != "" {
2922		objectMap["kind"] = rofd.Kind
2923	}
2924	return json.Marshal(objectMap)
2925}
2926
2927// AsReadWriteDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase.
2928func (rofd ReadOnlyFollowingDatabase) AsReadWriteDatabase() (*ReadWriteDatabase, bool) {
2929	return nil, false
2930}
2931
2932// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase.
2933func (rofd ReadOnlyFollowingDatabase) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) {
2934	return &rofd, true
2935}
2936
2937// AsDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase.
2938func (rofd ReadOnlyFollowingDatabase) AsDatabase() (*Database, bool) {
2939	return nil, false
2940}
2941
2942// AsBasicDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase.
2943func (rofd ReadOnlyFollowingDatabase) AsBasicDatabase() (BasicDatabase, bool) {
2944	return &rofd, true
2945}
2946
2947// UnmarshalJSON is the custom unmarshaler for ReadOnlyFollowingDatabase struct.
2948func (rofd *ReadOnlyFollowingDatabase) UnmarshalJSON(body []byte) error {
2949	var m map[string]*json.RawMessage
2950	err := json.Unmarshal(body, &m)
2951	if err != nil {
2952		return err
2953	}
2954	for k, v := range m {
2955		switch k {
2956		case "properties":
2957			if v != nil {
2958				var readOnlyFollowingDatabaseProperties ReadOnlyFollowingDatabaseProperties
2959				err = json.Unmarshal(*v, &readOnlyFollowingDatabaseProperties)
2960				if err != nil {
2961					return err
2962				}
2963				rofd.ReadOnlyFollowingDatabaseProperties = &readOnlyFollowingDatabaseProperties
2964			}
2965		case "location":
2966			if v != nil {
2967				var location string
2968				err = json.Unmarshal(*v, &location)
2969				if err != nil {
2970					return err
2971				}
2972				rofd.Location = &location
2973			}
2974		case "kind":
2975			if v != nil {
2976				var kind Kind
2977				err = json.Unmarshal(*v, &kind)
2978				if err != nil {
2979					return err
2980				}
2981				rofd.Kind = kind
2982			}
2983		case "id":
2984			if v != nil {
2985				var ID string
2986				err = json.Unmarshal(*v, &ID)
2987				if err != nil {
2988					return err
2989				}
2990				rofd.ID = &ID
2991			}
2992		case "name":
2993			if v != nil {
2994				var name string
2995				err = json.Unmarshal(*v, &name)
2996				if err != nil {
2997					return err
2998				}
2999				rofd.Name = &name
3000			}
3001		case "type":
3002			if v != nil {
3003				var typeVar string
3004				err = json.Unmarshal(*v, &typeVar)
3005				if err != nil {
3006					return err
3007				}
3008				rofd.Type = &typeVar
3009			}
3010		}
3011	}
3012
3013	return nil
3014}
3015
3016// ReadOnlyFollowingDatabaseProperties class representing the Kusto database properties.
3017type ReadOnlyFollowingDatabaseProperties struct {
3018	// ProvisioningState - The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'
3019	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
3020	// SoftDeletePeriod - READ-ONLY; The time the data should be kept before it stops being accessible to queries in TimeSpan.
3021	SoftDeletePeriod *string `json:"softDeletePeriod,omitempty"`
3022	// HotCachePeriod - The time the data should be kept in cache for fast queries in TimeSpan.
3023	HotCachePeriod *string `json:"hotCachePeriod,omitempty"`
3024	// Statistics - The statistics of the database.
3025	Statistics *DatabaseStatistics `json:"statistics,omitempty"`
3026	// LeaderClusterResourceID - READ-ONLY; The name of the leader cluster
3027	LeaderClusterResourceID *string `json:"leaderClusterResourceId,omitempty"`
3028	// AttachedDatabaseConfigurationName - READ-ONLY; The name of the attached database configuration cluster
3029	AttachedDatabaseConfigurationName *string `json:"attachedDatabaseConfigurationName,omitempty"`
3030	// PrincipalsModificationKind - READ-ONLY; The principals modification kind of the database. Possible values include: 'PrincipalsModificationKindUnion', 'PrincipalsModificationKindReplace', 'PrincipalsModificationKindNone'
3031	PrincipalsModificationKind PrincipalsModificationKind `json:"principalsModificationKind,omitempty"`
3032}
3033
3034// MarshalJSON is the custom marshaler for ReadOnlyFollowingDatabaseProperties.
3035func (rofdp ReadOnlyFollowingDatabaseProperties) MarshalJSON() ([]byte, error) {
3036	objectMap := make(map[string]interface{})
3037	if rofdp.ProvisioningState != "" {
3038		objectMap["provisioningState"] = rofdp.ProvisioningState
3039	}
3040	if rofdp.HotCachePeriod != nil {
3041		objectMap["hotCachePeriod"] = rofdp.HotCachePeriod
3042	}
3043	if rofdp.Statistics != nil {
3044		objectMap["statistics"] = rofdp.Statistics
3045	}
3046	return json.Marshal(objectMap)
3047}
3048
3049// ReadWriteDatabase class representing a read write database.
3050type ReadWriteDatabase struct {
3051	// ReadWriteDatabaseProperties - The database properties.
3052	*ReadWriteDatabaseProperties `json:"properties,omitempty"`
3053	// Location - Resource location.
3054	Location *string `json:"location,omitempty"`
3055	// Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing'
3056	Kind Kind `json:"kind,omitempty"`
3057	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
3058	ID *string `json:"id,omitempty"`
3059	// Name - READ-ONLY; The name of the resource
3060	Name *string `json:"name,omitempty"`
3061	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
3062	Type *string `json:"type,omitempty"`
3063}
3064
3065// MarshalJSON is the custom marshaler for ReadWriteDatabase.
3066func (rwd ReadWriteDatabase) MarshalJSON() ([]byte, error) {
3067	rwd.Kind = KindReadWrite
3068	objectMap := make(map[string]interface{})
3069	if rwd.ReadWriteDatabaseProperties != nil {
3070		objectMap["properties"] = rwd.ReadWriteDatabaseProperties
3071	}
3072	if rwd.Location != nil {
3073		objectMap["location"] = rwd.Location
3074	}
3075	if rwd.Kind != "" {
3076		objectMap["kind"] = rwd.Kind
3077	}
3078	return json.Marshal(objectMap)
3079}
3080
3081// AsReadWriteDatabase is the BasicDatabase implementation for ReadWriteDatabase.
3082func (rwd ReadWriteDatabase) AsReadWriteDatabase() (*ReadWriteDatabase, bool) {
3083	return &rwd, true
3084}
3085
3086// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for ReadWriteDatabase.
3087func (rwd ReadWriteDatabase) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) {
3088	return nil, false
3089}
3090
3091// AsDatabase is the BasicDatabase implementation for ReadWriteDatabase.
3092func (rwd ReadWriteDatabase) AsDatabase() (*Database, bool) {
3093	return nil, false
3094}
3095
3096// AsBasicDatabase is the BasicDatabase implementation for ReadWriteDatabase.
3097func (rwd ReadWriteDatabase) AsBasicDatabase() (BasicDatabase, bool) {
3098	return &rwd, true
3099}
3100
3101// UnmarshalJSON is the custom unmarshaler for ReadWriteDatabase struct.
3102func (rwd *ReadWriteDatabase) UnmarshalJSON(body []byte) error {
3103	var m map[string]*json.RawMessage
3104	err := json.Unmarshal(body, &m)
3105	if err != nil {
3106		return err
3107	}
3108	for k, v := range m {
3109		switch k {
3110		case "properties":
3111			if v != nil {
3112				var readWriteDatabaseProperties ReadWriteDatabaseProperties
3113				err = json.Unmarshal(*v, &readWriteDatabaseProperties)
3114				if err != nil {
3115					return err
3116				}
3117				rwd.ReadWriteDatabaseProperties = &readWriteDatabaseProperties
3118			}
3119		case "location":
3120			if v != nil {
3121				var location string
3122				err = json.Unmarshal(*v, &location)
3123				if err != nil {
3124					return err
3125				}
3126				rwd.Location = &location
3127			}
3128		case "kind":
3129			if v != nil {
3130				var kind Kind
3131				err = json.Unmarshal(*v, &kind)
3132				if err != nil {
3133					return err
3134				}
3135				rwd.Kind = kind
3136			}
3137		case "id":
3138			if v != nil {
3139				var ID string
3140				err = json.Unmarshal(*v, &ID)
3141				if err != nil {
3142					return err
3143				}
3144				rwd.ID = &ID
3145			}
3146		case "name":
3147			if v != nil {
3148				var name string
3149				err = json.Unmarshal(*v, &name)
3150				if err != nil {
3151					return err
3152				}
3153				rwd.Name = &name
3154			}
3155		case "type":
3156			if v != nil {
3157				var typeVar string
3158				err = json.Unmarshal(*v, &typeVar)
3159				if err != nil {
3160					return err
3161				}
3162				rwd.Type = &typeVar
3163			}
3164		}
3165	}
3166
3167	return nil
3168}
3169
3170// ReadWriteDatabaseProperties class representing the Kusto database properties.
3171type ReadWriteDatabaseProperties struct {
3172	// ProvisioningState - The provisioned state of the resource. Possible values include: 'Running', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Moving'
3173	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
3174	// SoftDeletePeriod - The time the data should be kept before it stops being accessible to queries in TimeSpan.
3175	SoftDeletePeriod *string `json:"softDeletePeriod,omitempty"`
3176	// HotCachePeriod - The time the data should be kept in cache for fast queries in TimeSpan.
3177	HotCachePeriod *string `json:"hotCachePeriod,omitempty"`
3178	// Statistics - The statistics of the database.
3179	Statistics *DatabaseStatistics `json:"statistics,omitempty"`
3180	// IsFollowed - READ-ONLY; Indicates whether the database is followed.
3181	IsFollowed *bool `json:"isFollowed,omitempty"`
3182}
3183
3184// MarshalJSON is the custom marshaler for ReadWriteDatabaseProperties.
3185func (rwdp ReadWriteDatabaseProperties) MarshalJSON() ([]byte, error) {
3186	objectMap := make(map[string]interface{})
3187	if rwdp.ProvisioningState != "" {
3188		objectMap["provisioningState"] = rwdp.ProvisioningState
3189	}
3190	if rwdp.SoftDeletePeriod != nil {
3191		objectMap["softDeletePeriod"] = rwdp.SoftDeletePeriod
3192	}
3193	if rwdp.HotCachePeriod != nil {
3194		objectMap["hotCachePeriod"] = rwdp.HotCachePeriod
3195	}
3196	if rwdp.Statistics != nil {
3197		objectMap["statistics"] = rwdp.Statistics
3198	}
3199	return json.Marshal(objectMap)
3200}
3201
3202// Resource common fields that are returned in the response for all Azure Resource Manager resources
3203type Resource struct {
3204	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
3205	ID *string `json:"id,omitempty"`
3206	// Name - READ-ONLY; The name of the resource
3207	Name *string `json:"name,omitempty"`
3208	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
3209	Type *string `json:"type,omitempty"`
3210}
3211
3212// MarshalJSON is the custom marshaler for Resource.
3213func (r Resource) MarshalJSON() ([]byte, error) {
3214	objectMap := make(map[string]interface{})
3215	return json.Marshal(objectMap)
3216}
3217
3218// SkuDescription the Kusto SKU description of given resource type
3219type SkuDescription struct {
3220	// ResourceType - READ-ONLY; The resource type
3221	ResourceType *string `json:"resourceType,omitempty"`
3222	// Name - READ-ONLY; The name of the SKU
3223	Name *string `json:"name,omitempty"`
3224	// Tier - READ-ONLY; The tier of the SKU
3225	Tier *string `json:"tier,omitempty"`
3226	// Locations - READ-ONLY; The set of locations that the SKU is available
3227	Locations *[]string `json:"locations,omitempty"`
3228	// LocationInfo - READ-ONLY; Locations and zones
3229	LocationInfo *[]SkuLocationInfoItem `json:"locationInfo,omitempty"`
3230	// Restrictions - READ-ONLY; The restrictions because of which SKU cannot be used
3231	Restrictions *[]interface{} `json:"restrictions,omitempty"`
3232}
3233
3234// MarshalJSON is the custom marshaler for SkuDescription.
3235func (sd SkuDescription) MarshalJSON() ([]byte, error) {
3236	objectMap := make(map[string]interface{})
3237	return json.Marshal(objectMap)
3238}
3239
3240// SkuDescriptionList the list of the EngagementFabric SKU descriptions
3241type SkuDescriptionList struct {
3242	autorest.Response `json:"-"`
3243	// Value - READ-ONLY; SKU descriptions
3244	Value *[]SkuDescription `json:"value,omitempty"`
3245}
3246
3247// MarshalJSON is the custom marshaler for SkuDescriptionList.
3248func (sdl SkuDescriptionList) MarshalJSON() ([]byte, error) {
3249	objectMap := make(map[string]interface{})
3250	return json.Marshal(objectMap)
3251}
3252
3253// SkuLocationInfoItem the locations and zones info for SKU.
3254type SkuLocationInfoItem struct {
3255	// Location - The available location of the SKU.
3256	Location *string `json:"location,omitempty"`
3257	// Zones - The available zone of the SKU.
3258	Zones *[]string `json:"zones,omitempty"`
3259}
3260
3261// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource
3262// which has 'tags' and a 'location'
3263type TrackedResource struct {
3264	// Tags - Resource tags.
3265	Tags map[string]*string `json:"tags"`
3266	// Location - The geo-location where the resource lives
3267	Location *string `json:"location,omitempty"`
3268	// ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
3269	ID *string `json:"id,omitempty"`
3270	// Name - READ-ONLY; The name of the resource
3271	Name *string `json:"name,omitempty"`
3272	// Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
3273	Type *string `json:"type,omitempty"`
3274}
3275
3276// MarshalJSON is the custom marshaler for TrackedResource.
3277func (tr TrackedResource) MarshalJSON() ([]byte, error) {
3278	objectMap := make(map[string]interface{})
3279	if tr.Tags != nil {
3280		objectMap["tags"] = tr.Tags
3281	}
3282	if tr.Location != nil {
3283		objectMap["location"] = tr.Location
3284	}
3285	return json.Marshal(objectMap)
3286}
3287
3288// TrustedExternalTenant represents a tenant ID that is trusted by the cluster.
3289type TrustedExternalTenant struct {
3290	// Value - GUID representing an external tenant.
3291	Value *string `json:"value,omitempty"`
3292}
3293
3294// VirtualNetworkConfiguration a class that contains virtual network definition.
3295type VirtualNetworkConfiguration struct {
3296	// SubnetID - The subnet resource id.
3297	SubnetID *string `json:"subnetId,omitempty"`
3298	// EnginePublicIPID - Engine service's public IP address resource id.
3299	EnginePublicIPID *string `json:"enginePublicIpId,omitempty"`
3300	// DataManagementPublicIPID - Data management's service public IP address resource id.
3301	DataManagementPublicIPID *string `json:"dataManagementPublicIpId,omitempty"`
3302}
3303