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