1package operationalinsights
2
3// Copyright (c) Microsoft and contributors.  All rights reserved.
4//
5// Licensed under the Apache License, Version 2.0 (the "License");
6// you may not use this file except in compliance with the License.
7// You may obtain a copy of the License at
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13//
14// See the License for the specific language governing permissions and
15// limitations under the License.
16//
17// Code generated by Microsoft (R) AutoRest Code Generator.
18// Changes may cause incorrect behavior and will be lost if the code is regenerated.
19
20import (
21	"context"
22	"encoding/json"
23	"github.com/Azure/go-autorest/autorest"
24	"github.com/Azure/go-autorest/autorest/azure"
25	"github.com/Azure/go-autorest/autorest/date"
26	"github.com/Azure/go-autorest/autorest/to"
27	"github.com/Azure/go-autorest/tracing"
28	"net/http"
29)
30
31// The package's fully qualified name.
32const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights"
33
34// ClusterEntityStatus enumerates the values for cluster entity status.
35type ClusterEntityStatus string
36
37const (
38	// Canceled ...
39	Canceled ClusterEntityStatus = "Canceled"
40	// Creating ...
41	Creating ClusterEntityStatus = "Creating"
42	// Deleting ...
43	Deleting ClusterEntityStatus = "Deleting"
44	// Failed ...
45	Failed ClusterEntityStatus = "Failed"
46	// ProvisioningAccount ...
47	ProvisioningAccount ClusterEntityStatus = "ProvisioningAccount"
48	// Succeeded ...
49	Succeeded ClusterEntityStatus = "Succeeded"
50	// Updating ...
51	Updating ClusterEntityStatus = "Updating"
52)
53
54// PossibleClusterEntityStatusValues returns an array of possible values for the ClusterEntityStatus const type.
55func PossibleClusterEntityStatusValues() []ClusterEntityStatus {
56	return []ClusterEntityStatus{Canceled, Creating, Deleting, Failed, ProvisioningAccount, Succeeded, Updating}
57}
58
59// ClusterSkuNameEnum enumerates the values for cluster sku name enum.
60type ClusterSkuNameEnum string
61
62const (
63	// CapacityReservation ...
64	CapacityReservation ClusterSkuNameEnum = "CapacityReservation"
65)
66
67// PossibleClusterSkuNameEnumValues returns an array of possible values for the ClusterSkuNameEnum const type.
68func PossibleClusterSkuNameEnumValues() []ClusterSkuNameEnum {
69	return []ClusterSkuNameEnum{CapacityReservation}
70}
71
72// DataIngestionStatus enumerates the values for data ingestion status.
73type DataIngestionStatus string
74
75const (
76	// ApproachingQuota ...
77	ApproachingQuota DataIngestionStatus = "ApproachingQuota"
78	// ForceOff ...
79	ForceOff DataIngestionStatus = "ForceOff"
80	// ForceOn ...
81	ForceOn DataIngestionStatus = "ForceOn"
82	// OverQuota ...
83	OverQuota DataIngestionStatus = "OverQuota"
84	// RespectQuota ...
85	RespectQuota DataIngestionStatus = "RespectQuota"
86	// SubscriptionSuspended ...
87	SubscriptionSuspended DataIngestionStatus = "SubscriptionSuspended"
88)
89
90// PossibleDataIngestionStatusValues returns an array of possible values for the DataIngestionStatus const type.
91func PossibleDataIngestionStatusValues() []DataIngestionStatus {
92	return []DataIngestionStatus{ApproachingQuota, ForceOff, ForceOn, OverQuota, RespectQuota, SubscriptionSuspended}
93}
94
95// DataSourceKind enumerates the values for data source kind.
96type DataSourceKind string
97
98const (
99	// ApplicationInsights ...
100	ApplicationInsights DataSourceKind = "ApplicationInsights"
101	// AzureActivityLog ...
102	AzureActivityLog DataSourceKind = "AzureActivityLog"
103	// AzureAuditLog ...
104	AzureAuditLog DataSourceKind = "AzureAuditLog"
105	// ChangeTrackingContentLocation ...
106	ChangeTrackingContentLocation DataSourceKind = "ChangeTrackingContentLocation"
107	// ChangeTrackingCustomPath ...
108	ChangeTrackingCustomPath DataSourceKind = "ChangeTrackingCustomPath"
109	// ChangeTrackingDataTypeConfiguration ...
110	ChangeTrackingDataTypeConfiguration DataSourceKind = "ChangeTrackingDataTypeConfiguration"
111	// ChangeTrackingDefaultRegistry ...
112	ChangeTrackingDefaultRegistry DataSourceKind = "ChangeTrackingDefaultRegistry"
113	// ChangeTrackingLinuxPath ...
114	ChangeTrackingLinuxPath DataSourceKind = "ChangeTrackingLinuxPath"
115	// ChangeTrackingPath ...
116	ChangeTrackingPath DataSourceKind = "ChangeTrackingPath"
117	// ChangeTrackingRegistry ...
118	ChangeTrackingRegistry DataSourceKind = "ChangeTrackingRegistry"
119	// ChangeTrackingServices ...
120	ChangeTrackingServices DataSourceKind = "ChangeTrackingServices"
121	// CustomLog ...
122	CustomLog DataSourceKind = "CustomLog"
123	// CustomLogCollection ...
124	CustomLogCollection DataSourceKind = "CustomLogCollection"
125	// DNSAnalytics ...
126	DNSAnalytics DataSourceKind = "DnsAnalytics"
127	// GenericDataSource ...
128	GenericDataSource DataSourceKind = "GenericDataSource"
129	// IISLogs ...
130	IISLogs DataSourceKind = "IISLogs"
131	// ImportComputerGroup ...
132	ImportComputerGroup DataSourceKind = "ImportComputerGroup"
133	// Itsm ...
134	Itsm DataSourceKind = "Itsm"
135	// LinuxChangeTrackingPath ...
136	LinuxChangeTrackingPath DataSourceKind = "LinuxChangeTrackingPath"
137	// LinuxPerformanceCollection ...
138	LinuxPerformanceCollection DataSourceKind = "LinuxPerformanceCollection"
139	// LinuxPerformanceObject ...
140	LinuxPerformanceObject DataSourceKind = "LinuxPerformanceObject"
141	// LinuxSyslog ...
142	LinuxSyslog DataSourceKind = "LinuxSyslog"
143	// LinuxSyslogCollection ...
144	LinuxSyslogCollection DataSourceKind = "LinuxSyslogCollection"
145	// NetworkMonitoring ...
146	NetworkMonitoring DataSourceKind = "NetworkMonitoring"
147	// Office365 ...
148	Office365 DataSourceKind = "Office365"
149	// SecurityCenterSecurityWindowsBaselineConfiguration ...
150	SecurityCenterSecurityWindowsBaselineConfiguration DataSourceKind = "SecurityCenterSecurityWindowsBaselineConfiguration"
151	// SecurityEventCollectionConfiguration ...
152	SecurityEventCollectionConfiguration DataSourceKind = "SecurityEventCollectionConfiguration"
153	// SecurityInsightsSecurityEventCollectionConfiguration ...
154	SecurityInsightsSecurityEventCollectionConfiguration DataSourceKind = "SecurityInsightsSecurityEventCollectionConfiguration"
155	// SecurityWindowsBaselineConfiguration ...
156	SecurityWindowsBaselineConfiguration DataSourceKind = "SecurityWindowsBaselineConfiguration"
157	// SQLDataClassification ...
158	SQLDataClassification DataSourceKind = "SqlDataClassification"
159	// WindowsEvent ...
160	WindowsEvent DataSourceKind = "WindowsEvent"
161	// WindowsPerformanceCounter ...
162	WindowsPerformanceCounter DataSourceKind = "WindowsPerformanceCounter"
163	// WindowsTelemetry ...
164	WindowsTelemetry DataSourceKind = "WindowsTelemetry"
165)
166
167// PossibleDataSourceKindValues returns an array of possible values for the DataSourceKind const type.
168func PossibleDataSourceKindValues() []DataSourceKind {
169	return []DataSourceKind{ApplicationInsights, AzureActivityLog, AzureAuditLog, ChangeTrackingContentLocation, ChangeTrackingCustomPath, ChangeTrackingDataTypeConfiguration, ChangeTrackingDefaultRegistry, ChangeTrackingLinuxPath, ChangeTrackingPath, ChangeTrackingRegistry, ChangeTrackingServices, CustomLog, CustomLogCollection, DNSAnalytics, GenericDataSource, IISLogs, ImportComputerGroup, Itsm, LinuxChangeTrackingPath, LinuxPerformanceCollection, LinuxPerformanceObject, LinuxSyslog, LinuxSyslogCollection, NetworkMonitoring, Office365, SecurityCenterSecurityWindowsBaselineConfiguration, SecurityEventCollectionConfiguration, SecurityInsightsSecurityEventCollectionConfiguration, SecurityWindowsBaselineConfiguration, SQLDataClassification, WindowsEvent, WindowsPerformanceCounter, WindowsTelemetry}
170}
171
172// DataSourceType enumerates the values for data source type.
173type DataSourceType string
174
175const (
176	// AzureWatson ...
177	AzureWatson DataSourceType = "AzureWatson"
178	// CustomLogs ...
179	CustomLogs DataSourceType = "CustomLogs"
180)
181
182// PossibleDataSourceTypeValues returns an array of possible values for the DataSourceType const type.
183func PossibleDataSourceTypeValues() []DataSourceType {
184	return []DataSourceType{AzureWatson, CustomLogs}
185}
186
187// IdentityType enumerates the values for identity type.
188type IdentityType string
189
190const (
191	// None ...
192	None IdentityType = "None"
193	// SystemAssigned ...
194	SystemAssigned IdentityType = "SystemAssigned"
195)
196
197// PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type.
198func PossibleIdentityTypeValues() []IdentityType {
199	return []IdentityType{None, SystemAssigned}
200}
201
202// LinkedServiceEntityStatus enumerates the values for linked service entity status.
203type LinkedServiceEntityStatus string
204
205const (
206	// LinkedServiceEntityStatusDeleting ...
207	LinkedServiceEntityStatusDeleting LinkedServiceEntityStatus = "Deleting"
208	// LinkedServiceEntityStatusProvisioningAccount ...
209	LinkedServiceEntityStatusProvisioningAccount LinkedServiceEntityStatus = "ProvisioningAccount"
210	// LinkedServiceEntityStatusSucceeded ...
211	LinkedServiceEntityStatusSucceeded LinkedServiceEntityStatus = "Succeeded"
212	// LinkedServiceEntityStatusUpdating ...
213	LinkedServiceEntityStatusUpdating LinkedServiceEntityStatus = "Updating"
214)
215
216// PossibleLinkedServiceEntityStatusValues returns an array of possible values for the LinkedServiceEntityStatus const type.
217func PossibleLinkedServiceEntityStatusValues() []LinkedServiceEntityStatus {
218	return []LinkedServiceEntityStatus{LinkedServiceEntityStatusDeleting, LinkedServiceEntityStatusProvisioningAccount, LinkedServiceEntityStatusSucceeded, LinkedServiceEntityStatusUpdating}
219}
220
221// PublicNetworkAccessType enumerates the values for public network access type.
222type PublicNetworkAccessType string
223
224const (
225	// Disabled Disables public connectivity to Log Analytics through public DNS.
226	Disabled PublicNetworkAccessType = "Disabled"
227	// Enabled Enables connectivity to Log Analytics through public DNS.
228	Enabled PublicNetworkAccessType = "Enabled"
229)
230
231// PossiblePublicNetworkAccessTypeValues returns an array of possible values for the PublicNetworkAccessType const type.
232func PossiblePublicNetworkAccessTypeValues() []PublicNetworkAccessType {
233	return []PublicNetworkAccessType{Disabled, Enabled}
234}
235
236// PurgeState enumerates the values for purge state.
237type PurgeState string
238
239const (
240	// Completed ...
241	Completed PurgeState = "completed"
242	// Pending ...
243	Pending PurgeState = "pending"
244)
245
246// PossiblePurgeStateValues returns an array of possible values for the PurgeState const type.
247func PossiblePurgeStateValues() []PurgeState {
248	return []PurgeState{Completed, Pending}
249}
250
251// SearchSortEnum enumerates the values for search sort enum.
252type SearchSortEnum string
253
254const (
255	// Asc ...
256	Asc SearchSortEnum = "asc"
257	// Desc ...
258	Desc SearchSortEnum = "desc"
259)
260
261// PossibleSearchSortEnumValues returns an array of possible values for the SearchSortEnum const type.
262func PossibleSearchSortEnumValues() []SearchSortEnum {
263	return []SearchSortEnum{Asc, Desc}
264}
265
266// SkuNameEnum enumerates the values for sku name enum.
267type SkuNameEnum string
268
269const (
270	// SkuNameEnumCapacityReservation ...
271	SkuNameEnumCapacityReservation SkuNameEnum = "CapacityReservation"
272	// SkuNameEnumFree ...
273	SkuNameEnumFree SkuNameEnum = "Free"
274	// SkuNameEnumPerGB2018 ...
275	SkuNameEnumPerGB2018 SkuNameEnum = "PerGB2018"
276	// SkuNameEnumPerNode ...
277	SkuNameEnumPerNode SkuNameEnum = "PerNode"
278	// SkuNameEnumPremium ...
279	SkuNameEnumPremium SkuNameEnum = "Premium"
280	// SkuNameEnumStandalone ...
281	SkuNameEnumStandalone SkuNameEnum = "Standalone"
282	// SkuNameEnumStandard ...
283	SkuNameEnumStandard SkuNameEnum = "Standard"
284)
285
286// PossibleSkuNameEnumValues returns an array of possible values for the SkuNameEnum const type.
287func PossibleSkuNameEnumValues() []SkuNameEnum {
288	return []SkuNameEnum{SkuNameEnumCapacityReservation, SkuNameEnumFree, SkuNameEnumPerGB2018, SkuNameEnumPerNode, SkuNameEnumPremium, SkuNameEnumStandalone, SkuNameEnumStandard}
289}
290
291// StorageInsightState enumerates the values for storage insight state.
292type StorageInsightState string
293
294const (
295	// ERROR ...
296	ERROR StorageInsightState = "ERROR"
297	// OK ...
298	OK StorageInsightState = "OK"
299)
300
301// PossibleStorageInsightStateValues returns an array of possible values for the StorageInsightState const type.
302func PossibleStorageInsightStateValues() []StorageInsightState {
303	return []StorageInsightState{ERROR, OK}
304}
305
306// Type enumerates the values for type.
307type Type string
308
309const (
310	// TypeEventHub ...
311	TypeEventHub Type = "EventHub"
312	// TypeStorageAccount ...
313	TypeStorageAccount Type = "StorageAccount"
314)
315
316// PossibleTypeValues returns an array of possible values for the Type const type.
317func PossibleTypeValues() []Type {
318	return []Type{TypeEventHub, TypeStorageAccount}
319}
320
321// WorkspaceEntityStatus enumerates the values for workspace entity status.
322type WorkspaceEntityStatus string
323
324const (
325	// WorkspaceEntityStatusCanceled ...
326	WorkspaceEntityStatusCanceled WorkspaceEntityStatus = "Canceled"
327	// WorkspaceEntityStatusCreating ...
328	WorkspaceEntityStatusCreating WorkspaceEntityStatus = "Creating"
329	// WorkspaceEntityStatusDeleting ...
330	WorkspaceEntityStatusDeleting WorkspaceEntityStatus = "Deleting"
331	// WorkspaceEntityStatusFailed ...
332	WorkspaceEntityStatusFailed WorkspaceEntityStatus = "Failed"
333	// WorkspaceEntityStatusProvisioningAccount ...
334	WorkspaceEntityStatusProvisioningAccount WorkspaceEntityStatus = "ProvisioningAccount"
335	// WorkspaceEntityStatusSucceeded ...
336	WorkspaceEntityStatusSucceeded WorkspaceEntityStatus = "Succeeded"
337	// WorkspaceEntityStatusUpdating ...
338	WorkspaceEntityStatusUpdating WorkspaceEntityStatus = "Updating"
339)
340
341// PossibleWorkspaceEntityStatusValues returns an array of possible values for the WorkspaceEntityStatus const type.
342func PossibleWorkspaceEntityStatusValues() []WorkspaceEntityStatus {
343	return []WorkspaceEntityStatus{WorkspaceEntityStatusCanceled, WorkspaceEntityStatusCreating, WorkspaceEntityStatusDeleting, WorkspaceEntityStatusFailed, WorkspaceEntityStatusProvisioningAccount, WorkspaceEntityStatusSucceeded, WorkspaceEntityStatusUpdating}
344}
345
346// WorkspaceSkuNameEnum enumerates the values for workspace sku name enum.
347type WorkspaceSkuNameEnum string
348
349const (
350	// WorkspaceSkuNameEnumCapacityReservation ...
351	WorkspaceSkuNameEnumCapacityReservation WorkspaceSkuNameEnum = "CapacityReservation"
352	// WorkspaceSkuNameEnumFree ...
353	WorkspaceSkuNameEnumFree WorkspaceSkuNameEnum = "Free"
354	// WorkspaceSkuNameEnumPerGB2018 ...
355	WorkspaceSkuNameEnumPerGB2018 WorkspaceSkuNameEnum = "PerGB2018"
356	// WorkspaceSkuNameEnumPerNode ...
357	WorkspaceSkuNameEnumPerNode WorkspaceSkuNameEnum = "PerNode"
358	// WorkspaceSkuNameEnumPremium ...
359	WorkspaceSkuNameEnumPremium WorkspaceSkuNameEnum = "Premium"
360	// WorkspaceSkuNameEnumStandalone ...
361	WorkspaceSkuNameEnumStandalone WorkspaceSkuNameEnum = "Standalone"
362	// WorkspaceSkuNameEnumStandard ...
363	WorkspaceSkuNameEnumStandard WorkspaceSkuNameEnum = "Standard"
364)
365
366// PossibleWorkspaceSkuNameEnumValues returns an array of possible values for the WorkspaceSkuNameEnum const type.
367func PossibleWorkspaceSkuNameEnumValues() []WorkspaceSkuNameEnum {
368	return []WorkspaceSkuNameEnum{WorkspaceSkuNameEnumCapacityReservation, WorkspaceSkuNameEnumFree, WorkspaceSkuNameEnumPerGB2018, WorkspaceSkuNameEnumPerNode, WorkspaceSkuNameEnumPremium, WorkspaceSkuNameEnumStandalone, WorkspaceSkuNameEnumStandard}
369}
370
371// AvailableServiceTier service Tier details.
372type AvailableServiceTier struct {
373	// ServiceTier - READ-ONLY; The name of the Service Tier. Possible values include: 'SkuNameEnumFree', 'SkuNameEnumStandard', 'SkuNameEnumPremium', 'SkuNameEnumPerNode', 'SkuNameEnumPerGB2018', 'SkuNameEnumStandalone', 'SkuNameEnumCapacityReservation'
374	ServiceTier SkuNameEnum `json:"serviceTier,omitempty"`
375	// Enabled - READ-ONLY; True if the Service Tier is enabled for the workspace.
376	Enabled *bool `json:"enabled,omitempty"`
377	// MinimumRetention - READ-ONLY; The minimum retention for the Service Tier, in days.
378	MinimumRetention *int64 `json:"minimumRetention,omitempty"`
379	// MaximumRetention - READ-ONLY; The maximum retention for the Service Tier, in days.
380	MaximumRetention *int64 `json:"maximumRetention,omitempty"`
381	// DefaultRetention - READ-ONLY; The default retention for the Service Tier, in days.
382	DefaultRetention *int64 `json:"defaultRetention,omitempty"`
383	// CapacityReservationLevel - READ-ONLY; The capacity reservation level in GB per day. Returned for the Capacity Reservation Service Tier.
384	CapacityReservationLevel *int64 `json:"capacityReservationLevel,omitempty"`
385	// LastSkuUpdate - READ-ONLY; Time when the sku was last updated for the workspace. Returned for the Capacity Reservation Service Tier.
386	LastSkuUpdate *string `json:"lastSkuUpdate,omitempty"`
387}
388
389// AzureEntityResource the resource model definition for a Azure Resource Manager resource with an etag.
390type AzureEntityResource struct {
391	// Etag - READ-ONLY; Resource Etag.
392	Etag *string `json:"etag,omitempty"`
393	// ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
394	ID *string `json:"id,omitempty"`
395	// Name - READ-ONLY; The name of the resource
396	Name *string `json:"name,omitempty"`
397	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
398	Type *string `json:"type,omitempty"`
399}
400
401// Cluster the top level Log Analytics cluster resource container.
402type Cluster struct {
403	autorest.Response `json:"-"`
404	// Identity - The identity of the resource.
405	Identity *Identity `json:"identity,omitempty"`
406	// Sku - The sku properties.
407	Sku *ClusterSku `json:"sku,omitempty"`
408	// ClusterProperties - Log Analytics cluster properties.
409	*ClusterProperties `json:"properties,omitempty"`
410	// Tags - Resource tags.
411	Tags map[string]*string `json:"tags"`
412	// Location - The geo-location where the resource lives
413	Location *string `json:"location,omitempty"`
414	// ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
415	ID *string `json:"id,omitempty"`
416	// Name - READ-ONLY; The name of the resource
417	Name *string `json:"name,omitempty"`
418	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
419	Type *string `json:"type,omitempty"`
420}
421
422// MarshalJSON is the custom marshaler for Cluster.
423func (c Cluster) MarshalJSON() ([]byte, error) {
424	objectMap := make(map[string]interface{})
425	if c.Identity != nil {
426		objectMap["identity"] = c.Identity
427	}
428	if c.Sku != nil {
429		objectMap["sku"] = c.Sku
430	}
431	if c.ClusterProperties != nil {
432		objectMap["properties"] = c.ClusterProperties
433	}
434	if c.Tags != nil {
435		objectMap["tags"] = c.Tags
436	}
437	if c.Location != nil {
438		objectMap["location"] = c.Location
439	}
440	return json.Marshal(objectMap)
441}
442
443// UnmarshalJSON is the custom unmarshaler for Cluster struct.
444func (c *Cluster) UnmarshalJSON(body []byte) error {
445	var m map[string]*json.RawMessage
446	err := json.Unmarshal(body, &m)
447	if err != nil {
448		return err
449	}
450	for k, v := range m {
451		switch k {
452		case "identity":
453			if v != nil {
454				var identity Identity
455				err = json.Unmarshal(*v, &identity)
456				if err != nil {
457					return err
458				}
459				c.Identity = &identity
460			}
461		case "sku":
462			if v != nil {
463				var sku ClusterSku
464				err = json.Unmarshal(*v, &sku)
465				if err != nil {
466					return err
467				}
468				c.Sku = &sku
469			}
470		case "properties":
471			if v != nil {
472				var clusterProperties ClusterProperties
473				err = json.Unmarshal(*v, &clusterProperties)
474				if err != nil {
475					return err
476				}
477				c.ClusterProperties = &clusterProperties
478			}
479		case "tags":
480			if v != nil {
481				var tags map[string]*string
482				err = json.Unmarshal(*v, &tags)
483				if err != nil {
484					return err
485				}
486				c.Tags = tags
487			}
488		case "location":
489			if v != nil {
490				var location string
491				err = json.Unmarshal(*v, &location)
492				if err != nil {
493					return err
494				}
495				c.Location = &location
496			}
497		case "id":
498			if v != nil {
499				var ID string
500				err = json.Unmarshal(*v, &ID)
501				if err != nil {
502					return err
503				}
504				c.ID = &ID
505			}
506		case "name":
507			if v != nil {
508				var name string
509				err = json.Unmarshal(*v, &name)
510				if err != nil {
511					return err
512				}
513				c.Name = &name
514			}
515		case "type":
516			if v != nil {
517				var typeVar string
518				err = json.Unmarshal(*v, &typeVar)
519				if err != nil {
520					return err
521				}
522				c.Type = &typeVar
523			}
524		}
525	}
526
527	return nil
528}
529
530// ClusterErrorResponse error response indicates that the service is not able to process the incoming
531// request. The reason is provided in the error message.
532type ClusterErrorResponse struct {
533	// Error - The details of the error.
534	Error *ErrorResponse `json:"error,omitempty"`
535}
536
537// ClusterListResult the list clusters operation response.
538type ClusterListResult struct {
539	autorest.Response `json:"-"`
540	// NextLink - The link used to get the next page of recommendations.
541	NextLink *string `json:"nextLink,omitempty"`
542	// Value - A list of Log Analytics clusters.
543	Value *[]Cluster `json:"value,omitempty"`
544}
545
546// ClusterListResultIterator provides access to a complete listing of Cluster values.
547type ClusterListResultIterator struct {
548	i    int
549	page ClusterListResultPage
550}
551
552// NextWithContext advances to the next value.  If there was an error making
553// the request the iterator does not advance and the error is returned.
554func (iter *ClusterListResultIterator) NextWithContext(ctx context.Context) (err error) {
555	if tracing.IsEnabled() {
556		ctx = tracing.StartSpan(ctx, fqdn+"/ClusterListResultIterator.NextWithContext")
557		defer func() {
558			sc := -1
559			if iter.Response().Response.Response != nil {
560				sc = iter.Response().Response.Response.StatusCode
561			}
562			tracing.EndSpan(ctx, sc, err)
563		}()
564	}
565	iter.i++
566	if iter.i < len(iter.page.Values()) {
567		return nil
568	}
569	err = iter.page.NextWithContext(ctx)
570	if err != nil {
571		iter.i--
572		return err
573	}
574	iter.i = 0
575	return nil
576}
577
578// Next advances to the next value.  If there was an error making
579// the request the iterator does not advance and the error is returned.
580// Deprecated: Use NextWithContext() instead.
581func (iter *ClusterListResultIterator) Next() error {
582	return iter.NextWithContext(context.Background())
583}
584
585// NotDone returns true if the enumeration should be started or is not yet complete.
586func (iter ClusterListResultIterator) NotDone() bool {
587	return iter.page.NotDone() && iter.i < len(iter.page.Values())
588}
589
590// Response returns the raw server response from the last page request.
591func (iter ClusterListResultIterator) Response() ClusterListResult {
592	return iter.page.Response()
593}
594
595// Value returns the current value or a zero-initialized value if the
596// iterator has advanced beyond the end of the collection.
597func (iter ClusterListResultIterator) Value() Cluster {
598	if !iter.page.NotDone() {
599		return Cluster{}
600	}
601	return iter.page.Values()[iter.i]
602}
603
604// Creates a new instance of the ClusterListResultIterator type.
605func NewClusterListResultIterator(page ClusterListResultPage) ClusterListResultIterator {
606	return ClusterListResultIterator{page: page}
607}
608
609// IsEmpty returns true if the ListResult contains no values.
610func (clr ClusterListResult) IsEmpty() bool {
611	return clr.Value == nil || len(*clr.Value) == 0
612}
613
614// clusterListResultPreparer prepares a request to retrieve the next set of results.
615// It returns nil if no more results exist.
616func (clr ClusterListResult) clusterListResultPreparer(ctx context.Context) (*http.Request, error) {
617	if clr.NextLink == nil || len(to.String(clr.NextLink)) < 1 {
618		return nil, nil
619	}
620	return autorest.Prepare((&http.Request{}).WithContext(ctx),
621		autorest.AsJSON(),
622		autorest.AsGet(),
623		autorest.WithBaseURL(to.String(clr.NextLink)))
624}
625
626// ClusterListResultPage contains a page of Cluster values.
627type ClusterListResultPage struct {
628	fn  func(context.Context, ClusterListResult) (ClusterListResult, error)
629	clr ClusterListResult
630}
631
632// NextWithContext advances to the next page of values.  If there was an error making
633// the request the page does not advance and the error is returned.
634func (page *ClusterListResultPage) NextWithContext(ctx context.Context) (err error) {
635	if tracing.IsEnabled() {
636		ctx = tracing.StartSpan(ctx, fqdn+"/ClusterListResultPage.NextWithContext")
637		defer func() {
638			sc := -1
639			if page.Response().Response.Response != nil {
640				sc = page.Response().Response.Response.StatusCode
641			}
642			tracing.EndSpan(ctx, sc, err)
643		}()
644	}
645	next, err := page.fn(ctx, page.clr)
646	if err != nil {
647		return err
648	}
649	page.clr = next
650	return nil
651}
652
653// Next advances to the next page of values.  If there was an error making
654// the request the page does not advance and the error is returned.
655// Deprecated: Use NextWithContext() instead.
656func (page *ClusterListResultPage) Next() error {
657	return page.NextWithContext(context.Background())
658}
659
660// NotDone returns true if the page enumeration should be started or is not yet complete.
661func (page ClusterListResultPage) NotDone() bool {
662	return !page.clr.IsEmpty()
663}
664
665// Response returns the raw server response from the last page request.
666func (page ClusterListResultPage) Response() ClusterListResult {
667	return page.clr
668}
669
670// Values returns the slice of values for the current page or nil if there are no values.
671func (page ClusterListResultPage) Values() []Cluster {
672	if page.clr.IsEmpty() {
673		return nil
674	}
675	return *page.clr.Value
676}
677
678// Creates a new instance of the ClusterListResultPage type.
679func NewClusterListResultPage(getNextPage func(context.Context, ClusterListResult) (ClusterListResult, error)) ClusterListResultPage {
680	return ClusterListResultPage{fn: getNextPage}
681}
682
683// ClusterPatch the top level Log Analytics cluster resource container.
684type ClusterPatch struct {
685	// ClusterPatchProperties - Log Analytics cluster properties.
686	*ClusterPatchProperties `json:"properties,omitempty"`
687	// Sku - The sku properties.
688	Sku *ClusterSku `json:"sku,omitempty"`
689	// Tags - Resource tags.
690	Tags map[string]*string `json:"tags"`
691}
692
693// MarshalJSON is the custom marshaler for ClusterPatch.
694func (cp ClusterPatch) MarshalJSON() ([]byte, error) {
695	objectMap := make(map[string]interface{})
696	if cp.ClusterPatchProperties != nil {
697		objectMap["properties"] = cp.ClusterPatchProperties
698	}
699	if cp.Sku != nil {
700		objectMap["sku"] = cp.Sku
701	}
702	if cp.Tags != nil {
703		objectMap["tags"] = cp.Tags
704	}
705	return json.Marshal(objectMap)
706}
707
708// UnmarshalJSON is the custom unmarshaler for ClusterPatch struct.
709func (cp *ClusterPatch) UnmarshalJSON(body []byte) error {
710	var m map[string]*json.RawMessage
711	err := json.Unmarshal(body, &m)
712	if err != nil {
713		return err
714	}
715	for k, v := range m {
716		switch k {
717		case "properties":
718			if v != nil {
719				var clusterPatchProperties ClusterPatchProperties
720				err = json.Unmarshal(*v, &clusterPatchProperties)
721				if err != nil {
722					return err
723				}
724				cp.ClusterPatchProperties = &clusterPatchProperties
725			}
726		case "sku":
727			if v != nil {
728				var sku ClusterSku
729				err = json.Unmarshal(*v, &sku)
730				if err != nil {
731					return err
732				}
733				cp.Sku = &sku
734			}
735		case "tags":
736			if v != nil {
737				var tags map[string]*string
738				err = json.Unmarshal(*v, &tags)
739				if err != nil {
740					return err
741				}
742				cp.Tags = tags
743			}
744		}
745	}
746
747	return nil
748}
749
750// ClusterPatchProperties log Analytics cluster patch properties.
751type ClusterPatchProperties struct {
752	// KeyVaultProperties - The associated key properties.
753	KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"`
754}
755
756// ClusterProperties cluster properties.
757type ClusterProperties struct {
758	// NextLink - The link used to get the next page of recommendations.
759	NextLink *string `json:"nextLink,omitempty"`
760	// ClusterID - READ-ONLY; The ID associated with the cluster.
761	ClusterID *string `json:"clusterId,omitempty"`
762	// ProvisioningState - READ-ONLY; The provisioning state of the cluster. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', 'Updating'
763	ProvisioningState ClusterEntityStatus `json:"provisioningState,omitempty"`
764	// KeyVaultProperties - The associated key properties.
765	KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"`
766}
767
768// ClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running
769// operation.
770type ClustersCreateOrUpdateFuture struct {
771	azure.Future
772}
773
774// Result returns the result of the asynchronous operation.
775// If the operation has not completed it will return an error.
776func (future *ClustersCreateOrUpdateFuture) Result(client ClustersClient) (c Cluster, err error) {
777	var done bool
778	done, err = future.DoneWithContext(context.Background(), client)
779	if err != nil {
780		err = autorest.NewErrorWithError(err, "operationalinsights.ClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
781		return
782	}
783	if !done {
784		err = azure.NewAsyncOpIncompleteError("operationalinsights.ClustersCreateOrUpdateFuture")
785		return
786	}
787	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
788	if c.Response.Response, err = future.GetResult(sender); err == nil && c.Response.Response.StatusCode != http.StatusNoContent {
789		c, err = client.CreateOrUpdateResponder(c.Response.Response)
790		if err != nil {
791			err = autorest.NewErrorWithError(err, "operationalinsights.ClustersCreateOrUpdateFuture", "Result", c.Response.Response, "Failure responding to request")
792		}
793	}
794	return
795}
796
797// ClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
798// operation.
799type ClustersDeleteFuture struct {
800	azure.Future
801}
802
803// Result returns the result of the asynchronous operation.
804// If the operation has not completed it will return an error.
805func (future *ClustersDeleteFuture) Result(client ClustersClient) (ar autorest.Response, err error) {
806	var done bool
807	done, err = future.DoneWithContext(context.Background(), client)
808	if err != nil {
809		err = autorest.NewErrorWithError(err, "operationalinsights.ClustersDeleteFuture", "Result", future.Response(), "Polling failure")
810		return
811	}
812	if !done {
813		err = azure.NewAsyncOpIncompleteError("operationalinsights.ClustersDeleteFuture")
814		return
815	}
816	ar.Response = future.Response()
817	return
818}
819
820// ClusterSku the cluster sku definition.
821type ClusterSku struct {
822	// Capacity - The capacity value
823	Capacity *int64 `json:"capacity,omitempty"`
824	// Name - The name of the SKU. Possible values include: 'CapacityReservation'
825	Name ClusterSkuNameEnum `json:"name,omitempty"`
826}
827
828// CoreSummary the core summary of a search.
829type CoreSummary struct {
830	// Status - The status of a core summary.
831	Status *string `json:"status,omitempty"`
832	// NumberOfDocuments - The number of documents of a core summary.
833	NumberOfDocuments *int64 `json:"numberOfDocuments,omitempty"`
834}
835
836// DataExport the top level data export resource container.
837type DataExport struct {
838	autorest.Response `json:"-"`
839	// DataExportProperties - data export properties.
840	*DataExportProperties `json:"properties,omitempty"`
841	// ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
842	ID *string `json:"id,omitempty"`
843	// Name - READ-ONLY; The name of the resource
844	Name *string `json:"name,omitempty"`
845	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
846	Type *string `json:"type,omitempty"`
847}
848
849// MarshalJSON is the custom marshaler for DataExport.
850func (de DataExport) MarshalJSON() ([]byte, error) {
851	objectMap := make(map[string]interface{})
852	if de.DataExportProperties != nil {
853		objectMap["properties"] = de.DataExportProperties
854	}
855	return json.Marshal(objectMap)
856}
857
858// UnmarshalJSON is the custom unmarshaler for DataExport struct.
859func (de *DataExport) UnmarshalJSON(body []byte) error {
860	var m map[string]*json.RawMessage
861	err := json.Unmarshal(body, &m)
862	if err != nil {
863		return err
864	}
865	for k, v := range m {
866		switch k {
867		case "properties":
868			if v != nil {
869				var dataExportProperties DataExportProperties
870				err = json.Unmarshal(*v, &dataExportProperties)
871				if err != nil {
872					return err
873				}
874				de.DataExportProperties = &dataExportProperties
875			}
876		case "id":
877			if v != nil {
878				var ID string
879				err = json.Unmarshal(*v, &ID)
880				if err != nil {
881					return err
882				}
883				de.ID = &ID
884			}
885		case "name":
886			if v != nil {
887				var name string
888				err = json.Unmarshal(*v, &name)
889				if err != nil {
890					return err
891				}
892				de.Name = &name
893			}
894		case "type":
895			if v != nil {
896				var typeVar string
897				err = json.Unmarshal(*v, &typeVar)
898				if err != nil {
899					return err
900				}
901				de.Type = &typeVar
902			}
903		}
904	}
905
906	return nil
907}
908
909// DataExportErrorResponse error response indicates that the service is not able to process the incoming
910// request. The reason is provided in the error message.
911type DataExportErrorResponse struct {
912	// Error - The details of the error.
913	Error *ErrorResponse `json:"error,omitempty"`
914}
915
916// DataExportListResult result of the request to list data exports.
917type DataExportListResult struct {
918	autorest.Response `json:"-"`
919	// Value - List of data export instances within a workspace..
920	Value *[]DataExport `json:"value,omitempty"`
921}
922
923// DataExportProperties data Export properties.
924type DataExportProperties struct {
925	// DataExportID - The data export rule ID.
926	DataExportID *string `json:"dataExportId,omitempty"`
927	// AllTables - When ‘true’, all workspace's tables are exported.
928	AllTables *bool `json:"allTables,omitempty"`
929	// TableNames - An array of tables to export, for example: [“Heartbeat, SecurityEvent”].
930	TableNames *[]string `json:"tableNames,omitempty"`
931	// Destination - destination properties.
932	*Destination `json:"destination,omitempty"`
933	// Enable - Active when enabled.
934	Enable *bool `json:"enable,omitempty"`
935	// CreatedDate - The latest data export rule modification time.
936	CreatedDate *string `json:"createdDate,omitempty"`
937	// LastModifiedDate - Date and time when the export was last modified.
938	LastModifiedDate *string `json:"lastModifiedDate,omitempty"`
939}
940
941// MarshalJSON is the custom marshaler for DataExportProperties.
942func (dep DataExportProperties) MarshalJSON() ([]byte, error) {
943	objectMap := make(map[string]interface{})
944	if dep.DataExportID != nil {
945		objectMap["dataExportId"] = dep.DataExportID
946	}
947	if dep.AllTables != nil {
948		objectMap["allTables"] = dep.AllTables
949	}
950	if dep.TableNames != nil {
951		objectMap["tableNames"] = dep.TableNames
952	}
953	if dep.Destination != nil {
954		objectMap["destination"] = dep.Destination
955	}
956	if dep.Enable != nil {
957		objectMap["enable"] = dep.Enable
958	}
959	if dep.CreatedDate != nil {
960		objectMap["createdDate"] = dep.CreatedDate
961	}
962	if dep.LastModifiedDate != nil {
963		objectMap["lastModifiedDate"] = dep.LastModifiedDate
964	}
965	return json.Marshal(objectMap)
966}
967
968// UnmarshalJSON is the custom unmarshaler for DataExportProperties struct.
969func (dep *DataExportProperties) UnmarshalJSON(body []byte) error {
970	var m map[string]*json.RawMessage
971	err := json.Unmarshal(body, &m)
972	if err != nil {
973		return err
974	}
975	for k, v := range m {
976		switch k {
977		case "dataExportId":
978			if v != nil {
979				var dataExportID string
980				err = json.Unmarshal(*v, &dataExportID)
981				if err != nil {
982					return err
983				}
984				dep.DataExportID = &dataExportID
985			}
986		case "allTables":
987			if v != nil {
988				var allTables bool
989				err = json.Unmarshal(*v, &allTables)
990				if err != nil {
991					return err
992				}
993				dep.AllTables = &allTables
994			}
995		case "tableNames":
996			if v != nil {
997				var tableNames []string
998				err = json.Unmarshal(*v, &tableNames)
999				if err != nil {
1000					return err
1001				}
1002				dep.TableNames = &tableNames
1003			}
1004		case "destination":
1005			if v != nil {
1006				var destination Destination
1007				err = json.Unmarshal(*v, &destination)
1008				if err != nil {
1009					return err
1010				}
1011				dep.Destination = &destination
1012			}
1013		case "enable":
1014			if v != nil {
1015				var enable bool
1016				err = json.Unmarshal(*v, &enable)
1017				if err != nil {
1018					return err
1019				}
1020				dep.Enable = &enable
1021			}
1022		case "createdDate":
1023			if v != nil {
1024				var createdDate string
1025				err = json.Unmarshal(*v, &createdDate)
1026				if err != nil {
1027					return err
1028				}
1029				dep.CreatedDate = &createdDate
1030			}
1031		case "lastModifiedDate":
1032			if v != nil {
1033				var lastModifiedDate string
1034				err = json.Unmarshal(*v, &lastModifiedDate)
1035				if err != nil {
1036					return err
1037				}
1038				dep.LastModifiedDate = &lastModifiedDate
1039			}
1040		}
1041	}
1042
1043	return nil
1044}
1045
1046// DataExportsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
1047// long-running operation.
1048type DataExportsCreateOrUpdateFuture struct {
1049	azure.Future
1050}
1051
1052// Result returns the result of the asynchronous operation.
1053// If the operation has not completed it will return an error.
1054func (future *DataExportsCreateOrUpdateFuture) Result(client DataExportsClient) (de DataExport, err error) {
1055	var done bool
1056	done, err = future.DoneWithContext(context.Background(), client)
1057	if err != nil {
1058		err = autorest.NewErrorWithError(err, "operationalinsights.DataExportsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1059		return
1060	}
1061	if !done {
1062		err = azure.NewAsyncOpIncompleteError("operationalinsights.DataExportsCreateOrUpdateFuture")
1063		return
1064	}
1065	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1066	if de.Response.Response, err = future.GetResult(sender); err == nil && de.Response.Response.StatusCode != http.StatusNoContent {
1067		de, err = client.CreateOrUpdateResponder(de.Response.Response)
1068		if err != nil {
1069			err = autorest.NewErrorWithError(err, "operationalinsights.DataExportsCreateOrUpdateFuture", "Result", de.Response.Response, "Failure responding to request")
1070		}
1071	}
1072	return
1073}
1074
1075// DataSource datasources under OMS Workspace.
1076type DataSource struct {
1077	autorest.Response `json:"-"`
1078	// Properties - The data source properties in raw json format, each kind of data source have it's own schema.
1079	Properties interface{} `json:"properties,omitempty"`
1080	// ETag - The ETag of the data source.
1081	ETag *string `json:"eTag,omitempty"`
1082	// Kind - Possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', 'LinuxSyslogCollection', 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', 'ChangeTrackingCustomPath', 'ChangeTrackingPath', 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', 'SecurityWindowsBaselineConfiguration', 'SecurityCenterSecurityWindowsBaselineConfiguration', 'SecurityEventCollectionConfiguration', 'SecurityInsightsSecurityEventCollectionConfiguration', 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DNSAnalytics', 'ApplicationInsights', 'SQLDataClassification'
1083	Kind DataSourceKind `json:"kind,omitempty"`
1084	// Tags - Resource tags.
1085	Tags map[string]*string `json:"tags"`
1086	// ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1087	ID *string `json:"id,omitempty"`
1088	// Name - READ-ONLY; The name of the resource
1089	Name *string `json:"name,omitempty"`
1090	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
1091	Type *string `json:"type,omitempty"`
1092}
1093
1094// MarshalJSON is the custom marshaler for DataSource.
1095func (ds DataSource) MarshalJSON() ([]byte, error) {
1096	objectMap := make(map[string]interface{})
1097	if ds.Properties != nil {
1098		objectMap["properties"] = ds.Properties
1099	}
1100	if ds.ETag != nil {
1101		objectMap["eTag"] = ds.ETag
1102	}
1103	if ds.Kind != "" {
1104		objectMap["kind"] = ds.Kind
1105	}
1106	if ds.Tags != nil {
1107		objectMap["tags"] = ds.Tags
1108	}
1109	return json.Marshal(objectMap)
1110}
1111
1112// DataSourceFilter dataSource filter. Right now, only filter by kind is supported.
1113type DataSourceFilter struct {
1114	// Kind - Possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', 'LinuxSyslogCollection', 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', 'ChangeTrackingCustomPath', 'ChangeTrackingPath', 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', 'SecurityWindowsBaselineConfiguration', 'SecurityCenterSecurityWindowsBaselineConfiguration', 'SecurityEventCollectionConfiguration', 'SecurityInsightsSecurityEventCollectionConfiguration', 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DNSAnalytics', 'ApplicationInsights', 'SQLDataClassification'
1115	Kind DataSourceKind `json:"kind,omitempty"`
1116}
1117
1118// DataSourceListResult the list data source by workspace operation response.
1119type DataSourceListResult struct {
1120	autorest.Response `json:"-"`
1121	// Value - A list of datasources.
1122	Value *[]DataSource `json:"value,omitempty"`
1123	// NextLink - The link (url) to the next page of datasources.
1124	NextLink *string `json:"nextLink,omitempty"`
1125}
1126
1127// DataSourceListResultIterator provides access to a complete listing of DataSource values.
1128type DataSourceListResultIterator struct {
1129	i    int
1130	page DataSourceListResultPage
1131}
1132
1133// NextWithContext advances to the next value.  If there was an error making
1134// the request the iterator does not advance and the error is returned.
1135func (iter *DataSourceListResultIterator) NextWithContext(ctx context.Context) (err error) {
1136	if tracing.IsEnabled() {
1137		ctx = tracing.StartSpan(ctx, fqdn+"/DataSourceListResultIterator.NextWithContext")
1138		defer func() {
1139			sc := -1
1140			if iter.Response().Response.Response != nil {
1141				sc = iter.Response().Response.Response.StatusCode
1142			}
1143			tracing.EndSpan(ctx, sc, err)
1144		}()
1145	}
1146	iter.i++
1147	if iter.i < len(iter.page.Values()) {
1148		return nil
1149	}
1150	err = iter.page.NextWithContext(ctx)
1151	if err != nil {
1152		iter.i--
1153		return err
1154	}
1155	iter.i = 0
1156	return nil
1157}
1158
1159// Next advances to the next value.  If there was an error making
1160// the request the iterator does not advance and the error is returned.
1161// Deprecated: Use NextWithContext() instead.
1162func (iter *DataSourceListResultIterator) Next() error {
1163	return iter.NextWithContext(context.Background())
1164}
1165
1166// NotDone returns true if the enumeration should be started or is not yet complete.
1167func (iter DataSourceListResultIterator) NotDone() bool {
1168	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1169}
1170
1171// Response returns the raw server response from the last page request.
1172func (iter DataSourceListResultIterator) Response() DataSourceListResult {
1173	return iter.page.Response()
1174}
1175
1176// Value returns the current value or a zero-initialized value if the
1177// iterator has advanced beyond the end of the collection.
1178func (iter DataSourceListResultIterator) Value() DataSource {
1179	if !iter.page.NotDone() {
1180		return DataSource{}
1181	}
1182	return iter.page.Values()[iter.i]
1183}
1184
1185// Creates a new instance of the DataSourceListResultIterator type.
1186func NewDataSourceListResultIterator(page DataSourceListResultPage) DataSourceListResultIterator {
1187	return DataSourceListResultIterator{page: page}
1188}
1189
1190// IsEmpty returns true if the ListResult contains no values.
1191func (dslr DataSourceListResult) IsEmpty() bool {
1192	return dslr.Value == nil || len(*dslr.Value) == 0
1193}
1194
1195// dataSourceListResultPreparer prepares a request to retrieve the next set of results.
1196// It returns nil if no more results exist.
1197func (dslr DataSourceListResult) dataSourceListResultPreparer(ctx context.Context) (*http.Request, error) {
1198	if dslr.NextLink == nil || len(to.String(dslr.NextLink)) < 1 {
1199		return nil, nil
1200	}
1201	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1202		autorest.AsJSON(),
1203		autorest.AsGet(),
1204		autorest.WithBaseURL(to.String(dslr.NextLink)))
1205}
1206
1207// DataSourceListResultPage contains a page of DataSource values.
1208type DataSourceListResultPage struct {
1209	fn   func(context.Context, DataSourceListResult) (DataSourceListResult, error)
1210	dslr DataSourceListResult
1211}
1212
1213// NextWithContext advances to the next page of values.  If there was an error making
1214// the request the page does not advance and the error is returned.
1215func (page *DataSourceListResultPage) NextWithContext(ctx context.Context) (err error) {
1216	if tracing.IsEnabled() {
1217		ctx = tracing.StartSpan(ctx, fqdn+"/DataSourceListResultPage.NextWithContext")
1218		defer func() {
1219			sc := -1
1220			if page.Response().Response.Response != nil {
1221				sc = page.Response().Response.Response.StatusCode
1222			}
1223			tracing.EndSpan(ctx, sc, err)
1224		}()
1225	}
1226	next, err := page.fn(ctx, page.dslr)
1227	if err != nil {
1228		return err
1229	}
1230	page.dslr = next
1231	return nil
1232}
1233
1234// Next advances to the next page of values.  If there was an error making
1235// the request the page does not advance and the error is returned.
1236// Deprecated: Use NextWithContext() instead.
1237func (page *DataSourceListResultPage) Next() error {
1238	return page.NextWithContext(context.Background())
1239}
1240
1241// NotDone returns true if the page enumeration should be started or is not yet complete.
1242func (page DataSourceListResultPage) NotDone() bool {
1243	return !page.dslr.IsEmpty()
1244}
1245
1246// Response returns the raw server response from the last page request.
1247func (page DataSourceListResultPage) Response() DataSourceListResult {
1248	return page.dslr
1249}
1250
1251// Values returns the slice of values for the current page or nil if there are no values.
1252func (page DataSourceListResultPage) Values() []DataSource {
1253	if page.dslr.IsEmpty() {
1254		return nil
1255	}
1256	return *page.dslr.Value
1257}
1258
1259// Creates a new instance of the DataSourceListResultPage type.
1260func NewDataSourceListResultPage(getNextPage func(context.Context, DataSourceListResult) (DataSourceListResult, error)) DataSourceListResultPage {
1261	return DataSourceListResultPage{fn: getNextPage}
1262}
1263
1264// Destination destination properties.
1265type Destination struct {
1266	// ResourceID - The destination resource ID. This can be copied from the Properties entry of the destination resource in Azure.
1267	ResourceID *string `json:"resourceId,omitempty"`
1268	// Type - READ-ONLY; The type of the destination resource. Possible values include: 'TypeStorageAccount', 'TypeEventHub'
1269	Type Type `json:"type,omitempty"`
1270	// DestinationMetaData - destination meta data.
1271	*DestinationMetaData `json:"metaData,omitempty"`
1272}
1273
1274// MarshalJSON is the custom marshaler for Destination.
1275func (d Destination) MarshalJSON() ([]byte, error) {
1276	objectMap := make(map[string]interface{})
1277	if d.ResourceID != nil {
1278		objectMap["resourceId"] = d.ResourceID
1279	}
1280	if d.DestinationMetaData != nil {
1281		objectMap["metaData"] = d.DestinationMetaData
1282	}
1283	return json.Marshal(objectMap)
1284}
1285
1286// UnmarshalJSON is the custom unmarshaler for Destination struct.
1287func (d *Destination) UnmarshalJSON(body []byte) error {
1288	var m map[string]*json.RawMessage
1289	err := json.Unmarshal(body, &m)
1290	if err != nil {
1291		return err
1292	}
1293	for k, v := range m {
1294		switch k {
1295		case "resourceId":
1296			if v != nil {
1297				var resourceID string
1298				err = json.Unmarshal(*v, &resourceID)
1299				if err != nil {
1300					return err
1301				}
1302				d.ResourceID = &resourceID
1303			}
1304		case "type":
1305			if v != nil {
1306				var typeVar Type
1307				err = json.Unmarshal(*v, &typeVar)
1308				if err != nil {
1309					return err
1310				}
1311				d.Type = typeVar
1312			}
1313		case "metaData":
1314			if v != nil {
1315				var destinationMetaData DestinationMetaData
1316				err = json.Unmarshal(*v, &destinationMetaData)
1317				if err != nil {
1318					return err
1319				}
1320				d.DestinationMetaData = &destinationMetaData
1321			}
1322		}
1323	}
1324
1325	return nil
1326}
1327
1328// DestinationMetaData destination meta data.
1329type DestinationMetaData struct {
1330	// EventHubName - Optional. Allows to define an Event Hub name. Not applicable when destination is Storage Account.
1331	EventHubName *string `json:"eventHubName,omitempty"`
1332}
1333
1334// ErrorAdditionalInfo the resource management error additional info.
1335type ErrorAdditionalInfo struct {
1336	// Type - READ-ONLY; The additional info type.
1337	Type *string `json:"type,omitempty"`
1338	// Info - READ-ONLY; The additional info.
1339	Info interface{} `json:"info,omitempty"`
1340}
1341
1342// ErrorContract contains details when the response code indicates an error.
1343type ErrorContract struct {
1344	// Error - The details of the error.
1345	Error *ErrorResponse `json:"error,omitempty"`
1346}
1347
1348// ErrorResponse the resource management error response.
1349type ErrorResponse struct {
1350	// Code - READ-ONLY; The error code.
1351	Code *string `json:"code,omitempty"`
1352	// Message - READ-ONLY; The error message.
1353	Message *string `json:"message,omitempty"`
1354	// Target - READ-ONLY; The error target.
1355	Target *string `json:"target,omitempty"`
1356	// Details - READ-ONLY; The error details.
1357	Details *[]ErrorResponse `json:"details,omitempty"`
1358	// AdditionalInfo - READ-ONLY; The error additional info.
1359	AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"`
1360}
1361
1362// Identity identity for the resource.
1363type Identity struct {
1364	// PrincipalID - READ-ONLY; The principal ID of resource identity.
1365	PrincipalID *string `json:"principalId,omitempty"`
1366	// TenantID - READ-ONLY; The tenant ID of resource.
1367	TenantID *string `json:"tenantId,omitempty"`
1368	// Type - The identity type. Possible values include: 'SystemAssigned', 'None'
1369	Type IdentityType `json:"type,omitempty"`
1370}
1371
1372// IntelligencePack intelligence Pack containing a string name and boolean indicating if it's enabled.
1373type IntelligencePack struct {
1374	// Name - The name of the intelligence pack.
1375	Name *string `json:"name,omitempty"`
1376	// Enabled - The enabled boolean for the intelligence pack.
1377	Enabled *bool `json:"enabled,omitempty"`
1378	// DisplayName - The display name of the intelligence pack.
1379	DisplayName *string `json:"displayName,omitempty"`
1380}
1381
1382// KeyVaultProperties the key vault properties.
1383type KeyVaultProperties struct {
1384	// KeyVaultURI - The Key Vault uri which holds they key associated with the Log Analytics cluster.
1385	KeyVaultURI *string `json:"keyVaultUri,omitempty"`
1386	// KeyName - The name of the key associated with the Log Analytics cluster.
1387	KeyName *string `json:"keyName,omitempty"`
1388	// KeyVersion - The version of the key associated with the Log Analytics cluster.
1389	KeyVersion *string `json:"keyVersion,omitempty"`
1390}
1391
1392// LinkedService the top level Linked service resource container.
1393type LinkedService struct {
1394	autorest.Response `json:"-"`
1395	// LinkedServiceProperties - The properties of the linked service.
1396	*LinkedServiceProperties `json:"properties,omitempty"`
1397	// Tags - Resource tags.
1398	Tags map[string]*string `json:"tags"`
1399	// ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1400	ID *string `json:"id,omitempty"`
1401	// Name - READ-ONLY; The name of the resource
1402	Name *string `json:"name,omitempty"`
1403	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
1404	Type *string `json:"type,omitempty"`
1405}
1406
1407// MarshalJSON is the custom marshaler for LinkedService.
1408func (ls LinkedService) MarshalJSON() ([]byte, error) {
1409	objectMap := make(map[string]interface{})
1410	if ls.LinkedServiceProperties != nil {
1411		objectMap["properties"] = ls.LinkedServiceProperties
1412	}
1413	if ls.Tags != nil {
1414		objectMap["tags"] = ls.Tags
1415	}
1416	return json.Marshal(objectMap)
1417}
1418
1419// UnmarshalJSON is the custom unmarshaler for LinkedService struct.
1420func (ls *LinkedService) UnmarshalJSON(body []byte) error {
1421	var m map[string]*json.RawMessage
1422	err := json.Unmarshal(body, &m)
1423	if err != nil {
1424		return err
1425	}
1426	for k, v := range m {
1427		switch k {
1428		case "properties":
1429			if v != nil {
1430				var linkedServiceProperties LinkedServiceProperties
1431				err = json.Unmarshal(*v, &linkedServiceProperties)
1432				if err != nil {
1433					return err
1434				}
1435				ls.LinkedServiceProperties = &linkedServiceProperties
1436			}
1437		case "tags":
1438			if v != nil {
1439				var tags map[string]*string
1440				err = json.Unmarshal(*v, &tags)
1441				if err != nil {
1442					return err
1443				}
1444				ls.Tags = tags
1445			}
1446		case "id":
1447			if v != nil {
1448				var ID string
1449				err = json.Unmarshal(*v, &ID)
1450				if err != nil {
1451					return err
1452				}
1453				ls.ID = &ID
1454			}
1455		case "name":
1456			if v != nil {
1457				var name string
1458				err = json.Unmarshal(*v, &name)
1459				if err != nil {
1460					return err
1461				}
1462				ls.Name = &name
1463			}
1464		case "type":
1465			if v != nil {
1466				var typeVar string
1467				err = json.Unmarshal(*v, &typeVar)
1468				if err != nil {
1469					return err
1470				}
1471				ls.Type = &typeVar
1472			}
1473		}
1474	}
1475
1476	return nil
1477}
1478
1479// LinkedServiceListResult the list linked service operation response.
1480type LinkedServiceListResult struct {
1481	autorest.Response `json:"-"`
1482	// Value - The list of linked service instances
1483	Value *[]LinkedService `json:"value,omitempty"`
1484}
1485
1486// LinkedServiceProperties linked service properties.
1487type LinkedServiceProperties struct {
1488	// ResourceID - The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require read access
1489	ResourceID *string `json:"resourceId,omitempty"`
1490	// WriteAccessResourceID - The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require write access
1491	WriteAccessResourceID *string `json:"writeAccessResourceId,omitempty"`
1492	// ProvisioningState - The provisioning state of the linked service. Possible values include: 'LinkedServiceEntityStatusSucceeded', 'LinkedServiceEntityStatusDeleting', 'LinkedServiceEntityStatusProvisioningAccount', 'LinkedServiceEntityStatusUpdating'
1493	ProvisioningState LinkedServiceEntityStatus `json:"provisioningState,omitempty"`
1494}
1495
1496// LinkedServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
1497// long-running operation.
1498type LinkedServicesCreateOrUpdateFuture struct {
1499	azure.Future
1500}
1501
1502// Result returns the result of the asynchronous operation.
1503// If the operation has not completed it will return an error.
1504func (future *LinkedServicesCreateOrUpdateFuture) Result(client LinkedServicesClient) (ls LinkedService, err error) {
1505	var done bool
1506	done, err = future.DoneWithContext(context.Background(), client)
1507	if err != nil {
1508		err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1509		return
1510	}
1511	if !done {
1512		err = azure.NewAsyncOpIncompleteError("operationalinsights.LinkedServicesCreateOrUpdateFuture")
1513		return
1514	}
1515	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1516	if ls.Response.Response, err = future.GetResult(sender); err == nil && ls.Response.Response.StatusCode != http.StatusNoContent {
1517		ls, err = client.CreateOrUpdateResponder(ls.Response.Response)
1518		if err != nil {
1519			err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesCreateOrUpdateFuture", "Result", ls.Response.Response, "Failure responding to request")
1520		}
1521	}
1522	return
1523}
1524
1525// LinkedServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
1526// operation.
1527type LinkedServicesDeleteFuture struct {
1528	azure.Future
1529}
1530
1531// Result returns the result of the asynchronous operation.
1532// If the operation has not completed it will return an error.
1533func (future *LinkedServicesDeleteFuture) Result(client LinkedServicesClient) (ls LinkedService, err error) {
1534	var done bool
1535	done, err = future.DoneWithContext(context.Background(), client)
1536	if err != nil {
1537		err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesDeleteFuture", "Result", future.Response(), "Polling failure")
1538		return
1539	}
1540	if !done {
1541		err = azure.NewAsyncOpIncompleteError("operationalinsights.LinkedServicesDeleteFuture")
1542		return
1543	}
1544	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1545	if ls.Response.Response, err = future.GetResult(sender); err == nil && ls.Response.Response.StatusCode != http.StatusNoContent {
1546		ls, err = client.DeleteResponder(ls.Response.Response)
1547		if err != nil {
1548			err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesDeleteFuture", "Result", ls.Response.Response, "Failure responding to request")
1549		}
1550	}
1551	return
1552}
1553
1554// LinkedStorageAccountsListResult the list linked storage accounts service operation response.
1555type LinkedStorageAccountsListResult struct {
1556	autorest.Response `json:"-"`
1557	// Value - A list of linked storage accounts instances.
1558	Value *[]LinkedStorageAccountsResource `json:"value,omitempty"`
1559}
1560
1561// LinkedStorageAccountsProperties linked storage accounts properties.
1562type LinkedStorageAccountsProperties struct {
1563	// DataSourceType - READ-ONLY; Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson'
1564	DataSourceType DataSourceType `json:"dataSourceType,omitempty"`
1565	// StorageAccountIds - Linked storage accounts resources ids.
1566	StorageAccountIds *[]string `json:"storageAccountIds,omitempty"`
1567}
1568
1569// LinkedStorageAccountsResource linked storage accounts top level resource container.
1570type LinkedStorageAccountsResource struct {
1571	autorest.Response `json:"-"`
1572	// LinkedStorageAccountsProperties - Linked storage accounts properties.
1573	*LinkedStorageAccountsProperties `json:"properties,omitempty"`
1574	// ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1575	ID *string `json:"id,omitempty"`
1576	// Name - READ-ONLY; The name of the resource
1577	Name *string `json:"name,omitempty"`
1578	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
1579	Type *string `json:"type,omitempty"`
1580}
1581
1582// MarshalJSON is the custom marshaler for LinkedStorageAccountsResource.
1583func (lsar LinkedStorageAccountsResource) MarshalJSON() ([]byte, error) {
1584	objectMap := make(map[string]interface{})
1585	if lsar.LinkedStorageAccountsProperties != nil {
1586		objectMap["properties"] = lsar.LinkedStorageAccountsProperties
1587	}
1588	return json.Marshal(objectMap)
1589}
1590
1591// UnmarshalJSON is the custom unmarshaler for LinkedStorageAccountsResource struct.
1592func (lsar *LinkedStorageAccountsResource) UnmarshalJSON(body []byte) error {
1593	var m map[string]*json.RawMessage
1594	err := json.Unmarshal(body, &m)
1595	if err != nil {
1596		return err
1597	}
1598	for k, v := range m {
1599		switch k {
1600		case "properties":
1601			if v != nil {
1602				var linkedStorageAccountsProperties LinkedStorageAccountsProperties
1603				err = json.Unmarshal(*v, &linkedStorageAccountsProperties)
1604				if err != nil {
1605					return err
1606				}
1607				lsar.LinkedStorageAccountsProperties = &linkedStorageAccountsProperties
1608			}
1609		case "id":
1610			if v != nil {
1611				var ID string
1612				err = json.Unmarshal(*v, &ID)
1613				if err != nil {
1614					return err
1615				}
1616				lsar.ID = &ID
1617			}
1618		case "name":
1619			if v != nil {
1620				var name string
1621				err = json.Unmarshal(*v, &name)
1622				if err != nil {
1623					return err
1624				}
1625				lsar.Name = &name
1626			}
1627		case "type":
1628			if v != nil {
1629				var typeVar string
1630				err = json.Unmarshal(*v, &typeVar)
1631				if err != nil {
1632					return err
1633				}
1634				lsar.Type = &typeVar
1635			}
1636		}
1637	}
1638
1639	return nil
1640}
1641
1642// ListAvailableServiceTier ...
1643type ListAvailableServiceTier struct {
1644	autorest.Response `json:"-"`
1645	Value             *[]AvailableServiceTier `json:"value,omitempty"`
1646}
1647
1648// ListIntelligencePack ...
1649type ListIntelligencePack struct {
1650	autorest.Response `json:"-"`
1651	Value             *[]IntelligencePack `json:"value,omitempty"`
1652}
1653
1654// ManagementGroup a management group that is connected to a workspace
1655type ManagementGroup struct {
1656	// ManagementGroupProperties - The properties of the management group.
1657	*ManagementGroupProperties `json:"properties,omitempty"`
1658}
1659
1660// MarshalJSON is the custom marshaler for ManagementGroup.
1661func (mg ManagementGroup) MarshalJSON() ([]byte, error) {
1662	objectMap := make(map[string]interface{})
1663	if mg.ManagementGroupProperties != nil {
1664		objectMap["properties"] = mg.ManagementGroupProperties
1665	}
1666	return json.Marshal(objectMap)
1667}
1668
1669// UnmarshalJSON is the custom unmarshaler for ManagementGroup struct.
1670func (mg *ManagementGroup) UnmarshalJSON(body []byte) error {
1671	var m map[string]*json.RawMessage
1672	err := json.Unmarshal(body, &m)
1673	if err != nil {
1674		return err
1675	}
1676	for k, v := range m {
1677		switch k {
1678		case "properties":
1679			if v != nil {
1680				var managementGroupProperties ManagementGroupProperties
1681				err = json.Unmarshal(*v, &managementGroupProperties)
1682				if err != nil {
1683					return err
1684				}
1685				mg.ManagementGroupProperties = &managementGroupProperties
1686			}
1687		}
1688	}
1689
1690	return nil
1691}
1692
1693// ManagementGroupProperties management group properties.
1694type ManagementGroupProperties struct {
1695	// ServerCount - The number of servers connected to the management group.
1696	ServerCount *int32 `json:"serverCount,omitempty"`
1697	// IsGateway - Gets or sets a value indicating whether the management group is a gateway.
1698	IsGateway *bool `json:"isGateway,omitempty"`
1699	// Name - The name of the management group.
1700	Name *string `json:"name,omitempty"`
1701	// ID - The unique ID of the management group.
1702	ID *string `json:"id,omitempty"`
1703	// Created - The datetime that the management group was created.
1704	Created *date.Time `json:"created,omitempty"`
1705	// DataReceived - The last datetime that the management group received data.
1706	DataReceived *date.Time `json:"dataReceived,omitempty"`
1707	// Version - The version of System Center that is managing the management group.
1708	Version *string `json:"version,omitempty"`
1709	// Sku - The SKU of System Center that is managing the management group.
1710	Sku *string `json:"sku,omitempty"`
1711}
1712
1713// MetricName the name of a metric.
1714type MetricName struct {
1715	// Value - The system name of the metric.
1716	Value *string `json:"value,omitempty"`
1717	// LocalizedValue - The localized name of the metric.
1718	LocalizedValue *string `json:"localizedValue,omitempty"`
1719}
1720
1721// Operation supported operation of OperationalInsights resource provider.
1722type Operation struct {
1723	// Name - Operation name: {provider}/{resource}/{operation}
1724	Name *string `json:"name,omitempty"`
1725	// Display - Display metadata associated with the operation.
1726	Display *OperationDisplay `json:"display,omitempty"`
1727}
1728
1729// OperationDisplay display metadata associated with the operation.
1730type OperationDisplay struct {
1731	// Provider - Service provider: Microsoft OperationsManagement.
1732	Provider *string `json:"provider,omitempty"`
1733	// Resource - Resource on which the operation is performed etc.
1734	Resource *string `json:"resource,omitempty"`
1735	// Operation - Type of operation: get, read, delete, etc.
1736	Operation *string `json:"operation,omitempty"`
1737	// Description - Description of operation
1738	Description *string `json:"description,omitempty"`
1739}
1740
1741// OperationListResult result of the request to list solution operations.
1742type OperationListResult struct {
1743	autorest.Response `json:"-"`
1744	// Value - List of solution operations supported by the OperationsManagement resource provider.
1745	Value *[]Operation `json:"value,omitempty"`
1746	// NextLink - READ-ONLY; URL to get the next set of operation list results if there are any.
1747	NextLink *string `json:"nextLink,omitempty"`
1748}
1749
1750// OperationListResultIterator provides access to a complete listing of Operation values.
1751type OperationListResultIterator struct {
1752	i    int
1753	page OperationListResultPage
1754}
1755
1756// NextWithContext advances to the next value.  If there was an error making
1757// the request the iterator does not advance and the error is returned.
1758func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
1759	if tracing.IsEnabled() {
1760		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
1761		defer func() {
1762			sc := -1
1763			if iter.Response().Response.Response != nil {
1764				sc = iter.Response().Response.Response.StatusCode
1765			}
1766			tracing.EndSpan(ctx, sc, err)
1767		}()
1768	}
1769	iter.i++
1770	if iter.i < len(iter.page.Values()) {
1771		return nil
1772	}
1773	err = iter.page.NextWithContext(ctx)
1774	if err != nil {
1775		iter.i--
1776		return err
1777	}
1778	iter.i = 0
1779	return nil
1780}
1781
1782// Next advances to the next value.  If there was an error making
1783// the request the iterator does not advance and the error is returned.
1784// Deprecated: Use NextWithContext() instead.
1785func (iter *OperationListResultIterator) Next() error {
1786	return iter.NextWithContext(context.Background())
1787}
1788
1789// NotDone returns true if the enumeration should be started or is not yet complete.
1790func (iter OperationListResultIterator) NotDone() bool {
1791	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1792}
1793
1794// Response returns the raw server response from the last page request.
1795func (iter OperationListResultIterator) Response() OperationListResult {
1796	return iter.page.Response()
1797}
1798
1799// Value returns the current value or a zero-initialized value if the
1800// iterator has advanced beyond the end of the collection.
1801func (iter OperationListResultIterator) Value() Operation {
1802	if !iter.page.NotDone() {
1803		return Operation{}
1804	}
1805	return iter.page.Values()[iter.i]
1806}
1807
1808// Creates a new instance of the OperationListResultIterator type.
1809func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
1810	return OperationListResultIterator{page: page}
1811}
1812
1813// IsEmpty returns true if the ListResult contains no values.
1814func (olr OperationListResult) IsEmpty() bool {
1815	return olr.Value == nil || len(*olr.Value) == 0
1816}
1817
1818// operationListResultPreparer prepares a request to retrieve the next set of results.
1819// It returns nil if no more results exist.
1820func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
1821	if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 {
1822		return nil, nil
1823	}
1824	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1825		autorest.AsJSON(),
1826		autorest.AsGet(),
1827		autorest.WithBaseURL(to.String(olr.NextLink)))
1828}
1829
1830// OperationListResultPage contains a page of Operation values.
1831type OperationListResultPage struct {
1832	fn  func(context.Context, OperationListResult) (OperationListResult, error)
1833	olr OperationListResult
1834}
1835
1836// NextWithContext advances to the next page of values.  If there was an error making
1837// the request the page does not advance and the error is returned.
1838func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
1839	if tracing.IsEnabled() {
1840		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
1841		defer func() {
1842			sc := -1
1843			if page.Response().Response.Response != nil {
1844				sc = page.Response().Response.Response.StatusCode
1845			}
1846			tracing.EndSpan(ctx, sc, err)
1847		}()
1848	}
1849	next, err := page.fn(ctx, page.olr)
1850	if err != nil {
1851		return err
1852	}
1853	page.olr = next
1854	return nil
1855}
1856
1857// Next advances to the next page of values.  If there was an error making
1858// the request the page does not advance and the error is returned.
1859// Deprecated: Use NextWithContext() instead.
1860func (page *OperationListResultPage) Next() error {
1861	return page.NextWithContext(context.Background())
1862}
1863
1864// NotDone returns true if the page enumeration should be started or is not yet complete.
1865func (page OperationListResultPage) NotDone() bool {
1866	return !page.olr.IsEmpty()
1867}
1868
1869// Response returns the raw server response from the last page request.
1870func (page OperationListResultPage) Response() OperationListResult {
1871	return page.olr
1872}
1873
1874// Values returns the slice of values for the current page or nil if there are no values.
1875func (page OperationListResultPage) Values() []Operation {
1876	if page.olr.IsEmpty() {
1877		return nil
1878	}
1879	return *page.olr.Value
1880}
1881
1882// Creates a new instance of the OperationListResultPage type.
1883func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
1884	return OperationListResultPage{fn: getNextPage}
1885}
1886
1887// OperationStatus the status of operation.
1888type OperationStatus struct {
1889	autorest.Response `json:"-"`
1890	// ID - The operation Id.
1891	ID *string `json:"id,omitempty"`
1892	// Name - The operation name.
1893	Name *string `json:"name,omitempty"`
1894	// StartTime - The start time of the operation.
1895	StartTime *string `json:"startTime,omitempty"`
1896	// EndTime - The end time of the operation.
1897	EndTime *string `json:"endTime,omitempty"`
1898	// Status - The status of the operation.
1899	Status *string `json:"status,omitempty"`
1900	// Error - The error detail of the operation if any.
1901	Error *ErrorResponse `json:"error,omitempty"`
1902}
1903
1904// PrivateLinkScopedResource the private link scope resource reference.
1905type PrivateLinkScopedResource struct {
1906	// ResourceID - The full resource Id of the private link scope resource.
1907	ResourceID *string `json:"resourceId,omitempty"`
1908	// ScopeID - The private link scope unique Identifier.
1909	ScopeID *string `json:"scopeId,omitempty"`
1910}
1911
1912// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than
1913// required location and tags
1914type ProxyResource struct {
1915	// ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1916	ID *string `json:"id,omitempty"`
1917	// Name - READ-ONLY; The name of the resource
1918	Name *string `json:"name,omitempty"`
1919	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
1920	Type *string `json:"type,omitempty"`
1921}
1922
1923// Resource ...
1924type Resource struct {
1925	// ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1926	ID *string `json:"id,omitempty"`
1927	// Name - READ-ONLY; The name of the resource
1928	Name *string `json:"name,omitempty"`
1929	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
1930	Type *string `json:"type,omitempty"`
1931}
1932
1933// SavedSearch value object for saved search results.
1934type SavedSearch struct {
1935	autorest.Response `json:"-"`
1936	// ETag - The ETag of the saved search.
1937	ETag *string `json:"eTag,omitempty"`
1938	// SavedSearchProperties - The properties of the saved search.
1939	*SavedSearchProperties `json:"properties,omitempty"`
1940	// ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
1941	ID *string `json:"id,omitempty"`
1942	// Name - READ-ONLY; The name of the resource
1943	Name *string `json:"name,omitempty"`
1944	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
1945	Type *string `json:"type,omitempty"`
1946}
1947
1948// MarshalJSON is the custom marshaler for SavedSearch.
1949func (ss SavedSearch) MarshalJSON() ([]byte, error) {
1950	objectMap := make(map[string]interface{})
1951	if ss.ETag != nil {
1952		objectMap["eTag"] = ss.ETag
1953	}
1954	if ss.SavedSearchProperties != nil {
1955		objectMap["properties"] = ss.SavedSearchProperties
1956	}
1957	return json.Marshal(objectMap)
1958}
1959
1960// UnmarshalJSON is the custom unmarshaler for SavedSearch struct.
1961func (ss *SavedSearch) UnmarshalJSON(body []byte) error {
1962	var m map[string]*json.RawMessage
1963	err := json.Unmarshal(body, &m)
1964	if err != nil {
1965		return err
1966	}
1967	for k, v := range m {
1968		switch k {
1969		case "eTag":
1970			if v != nil {
1971				var eTag string
1972				err = json.Unmarshal(*v, &eTag)
1973				if err != nil {
1974					return err
1975				}
1976				ss.ETag = &eTag
1977			}
1978		case "properties":
1979			if v != nil {
1980				var savedSearchProperties SavedSearchProperties
1981				err = json.Unmarshal(*v, &savedSearchProperties)
1982				if err != nil {
1983					return err
1984				}
1985				ss.SavedSearchProperties = &savedSearchProperties
1986			}
1987		case "id":
1988			if v != nil {
1989				var ID string
1990				err = json.Unmarshal(*v, &ID)
1991				if err != nil {
1992					return err
1993				}
1994				ss.ID = &ID
1995			}
1996		case "name":
1997			if v != nil {
1998				var name string
1999				err = json.Unmarshal(*v, &name)
2000				if err != nil {
2001					return err
2002				}
2003				ss.Name = &name
2004			}
2005		case "type":
2006			if v != nil {
2007				var typeVar string
2008				err = json.Unmarshal(*v, &typeVar)
2009				if err != nil {
2010					return err
2011				}
2012				ss.Type = &typeVar
2013			}
2014		}
2015	}
2016
2017	return nil
2018}
2019
2020// SavedSearchesListResult the saved search list operation response.
2021type SavedSearchesListResult struct {
2022	autorest.Response `json:"-"`
2023	// Value - The array of result values.
2024	Value *[]SavedSearch `json:"value,omitempty"`
2025}
2026
2027// SavedSearchProperties value object for saved search results.
2028type SavedSearchProperties struct {
2029	// Category - The category of the saved search. This helps the user to find a saved search faster.
2030	Category *string `json:"category,omitempty"`
2031	// DisplayName - Saved search display name.
2032	DisplayName *string `json:"displayName,omitempty"`
2033	// Query - The query expression for the saved search.
2034	Query *string `json:"query,omitempty"`
2035	// FunctionAlias - The function alias if query serves as a function.
2036	FunctionAlias *string `json:"functionAlias,omitempty"`
2037	// FunctionParameters - The optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions.
2038	FunctionParameters *string `json:"functionParameters,omitempty"`
2039	// Version - The version number of the query language. The current version is 2 and is the default.
2040	Version *int64 `json:"version,omitempty"`
2041	// Tags - The tags attached to the saved search.
2042	Tags *[]Tag `json:"tags,omitempty"`
2043}
2044
2045// SearchGetSchemaResponse the get schema operation response.
2046type SearchGetSchemaResponse struct {
2047	autorest.Response `json:"-"`
2048	// Metadata - The metadata from search results.
2049	Metadata *SearchMetadata `json:"metadata,omitempty"`
2050	// Value - The array of result values.
2051	Value *[]SearchSchemaValue `json:"value,omitempty"`
2052}
2053
2054// SearchMetadata metadata for search results.
2055type SearchMetadata struct {
2056	// SearchID - The request id of the search.
2057	SearchID *string `json:"requestId,omitempty"`
2058	// ResultType - The search result type.
2059	ResultType *string `json:"resultType,omitempty"`
2060	// Total - The total number of search results.
2061	Total *int64 `json:"total,omitempty"`
2062	// Top - The number of top search results.
2063	Top *int64 `json:"top,omitempty"`
2064	// ID - The id of the search results request.
2065	ID *string `json:"id,omitempty"`
2066	// CoreSummaries - The core summaries.
2067	CoreSummaries *[]CoreSummary `json:"coreSummaries,omitempty"`
2068	// Status - The status of the search results.
2069	Status *string `json:"status,omitempty"`
2070	// StartTime - The start time for the search.
2071	StartTime *date.Time `json:"startTime,omitempty"`
2072	// LastUpdated - The time of last update.
2073	LastUpdated *date.Time `json:"lastUpdated,omitempty"`
2074	// ETag - The ETag of the search results.
2075	ETag *string `json:"eTag,omitempty"`
2076	// Sort - How the results are sorted.
2077	Sort *[]SearchSort `json:"sort,omitempty"`
2078	// RequestTime - The request time.
2079	RequestTime *int64 `json:"requestTime,omitempty"`
2080	// AggregatedValueField - The aggregated value field.
2081	AggregatedValueField *string `json:"aggregatedValueField,omitempty"`
2082	// AggregatedGroupingFields - The aggregated grouping fields.
2083	AggregatedGroupingFields *string `json:"aggregatedGroupingFields,omitempty"`
2084	// Sum - The sum of all aggregates returned in the result set.
2085	Sum *int64 `json:"sum,omitempty"`
2086	// Max - The max of all aggregates returned in the result set.
2087	Max *int64 `json:"max,omitempty"`
2088	// Schema - The schema.
2089	Schema *SearchMetadataSchema `json:"schema,omitempty"`
2090}
2091
2092// SearchMetadataSchema schema metadata for search.
2093type SearchMetadataSchema struct {
2094	// Name - The name of the metadata schema.
2095	Name *string `json:"name,omitempty"`
2096	// Version - The version of the metadata schema.
2097	Version *int32 `json:"version,omitempty"`
2098}
2099
2100// SearchSchemaValue value object for schema results.
2101type SearchSchemaValue struct {
2102	// Name - The name of the schema.
2103	Name *string `json:"name,omitempty"`
2104	// DisplayName - The display name of the schema.
2105	DisplayName *string `json:"displayName,omitempty"`
2106	// Type - The type.
2107	Type *string `json:"type,omitempty"`
2108	// Indexed - The boolean that indicates the field is searchable as free text.
2109	Indexed *bool `json:"indexed,omitempty"`
2110	// Stored - The boolean that indicates whether or not the field is stored.
2111	Stored *bool `json:"stored,omitempty"`
2112	// Facet - The boolean that indicates whether or not the field is a facet.
2113	Facet *bool `json:"facet,omitempty"`
2114	// OwnerType - The array of workflows containing the field.
2115	OwnerType *[]string `json:"ownerType,omitempty"`
2116}
2117
2118// SearchSort the sort parameters for search.
2119type SearchSort struct {
2120	// Name - The name of the field the search query is sorted on.
2121	Name *string `json:"name,omitempty"`
2122	// Order - The sort order of the search. Possible values include: 'Asc', 'Desc'
2123	Order SearchSortEnum `json:"order,omitempty"`
2124}
2125
2126// SharedKeys the shared keys for a workspace.
2127type SharedKeys struct {
2128	autorest.Response `json:"-"`
2129	// PrimarySharedKey - The primary shared key of a workspace.
2130	PrimarySharedKey *string `json:"primarySharedKey,omitempty"`
2131	// SecondarySharedKey - The secondary shared key of a workspace.
2132	SecondarySharedKey *string `json:"secondarySharedKey,omitempty"`
2133}
2134
2135// StorageAccount describes a storage account connection.
2136type StorageAccount struct {
2137	// ID - The Azure Resource Manager ID of the storage account resource.
2138	ID *string `json:"id,omitempty"`
2139	// Key - The storage account key.
2140	Key *string `json:"key,omitempty"`
2141}
2142
2143// StorageInsight the top level storage insight resource container.
2144type StorageInsight struct {
2145	autorest.Response `json:"-"`
2146	// StorageInsightProperties - Storage insight properties.
2147	*StorageInsightProperties `json:"properties,omitempty"`
2148	// ETag - The ETag of the storage insight.
2149	ETag *string `json:"eTag,omitempty"`
2150	// Tags - Resource tags.
2151	Tags map[string]*string `json:"tags"`
2152	// ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
2153	ID *string `json:"id,omitempty"`
2154	// Name - READ-ONLY; The name of the resource
2155	Name *string `json:"name,omitempty"`
2156	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
2157	Type *string `json:"type,omitempty"`
2158}
2159
2160// MarshalJSON is the custom marshaler for StorageInsight.
2161func (si StorageInsight) MarshalJSON() ([]byte, error) {
2162	objectMap := make(map[string]interface{})
2163	if si.StorageInsightProperties != nil {
2164		objectMap["properties"] = si.StorageInsightProperties
2165	}
2166	if si.ETag != nil {
2167		objectMap["eTag"] = si.ETag
2168	}
2169	if si.Tags != nil {
2170		objectMap["tags"] = si.Tags
2171	}
2172	return json.Marshal(objectMap)
2173}
2174
2175// UnmarshalJSON is the custom unmarshaler for StorageInsight struct.
2176func (si *StorageInsight) UnmarshalJSON(body []byte) error {
2177	var m map[string]*json.RawMessage
2178	err := json.Unmarshal(body, &m)
2179	if err != nil {
2180		return err
2181	}
2182	for k, v := range m {
2183		switch k {
2184		case "properties":
2185			if v != nil {
2186				var storageInsightProperties StorageInsightProperties
2187				err = json.Unmarshal(*v, &storageInsightProperties)
2188				if err != nil {
2189					return err
2190				}
2191				si.StorageInsightProperties = &storageInsightProperties
2192			}
2193		case "eTag":
2194			if v != nil {
2195				var eTag string
2196				err = json.Unmarshal(*v, &eTag)
2197				if err != nil {
2198					return err
2199				}
2200				si.ETag = &eTag
2201			}
2202		case "tags":
2203			if v != nil {
2204				var tags map[string]*string
2205				err = json.Unmarshal(*v, &tags)
2206				if err != nil {
2207					return err
2208				}
2209				si.Tags = tags
2210			}
2211		case "id":
2212			if v != nil {
2213				var ID string
2214				err = json.Unmarshal(*v, &ID)
2215				if err != nil {
2216					return err
2217				}
2218				si.ID = &ID
2219			}
2220		case "name":
2221			if v != nil {
2222				var name string
2223				err = json.Unmarshal(*v, &name)
2224				if err != nil {
2225					return err
2226				}
2227				si.Name = &name
2228			}
2229		case "type":
2230			if v != nil {
2231				var typeVar string
2232				err = json.Unmarshal(*v, &typeVar)
2233				if err != nil {
2234					return err
2235				}
2236				si.Type = &typeVar
2237			}
2238		}
2239	}
2240
2241	return nil
2242}
2243
2244// StorageInsightListResult the list storage insights operation response.
2245type StorageInsightListResult struct {
2246	autorest.Response `json:"-"`
2247	// Value - A list of storage insight items.
2248	Value *[]StorageInsight `json:"value,omitempty"`
2249	// OdataNextLink - The link (url) to the next page of results.
2250	OdataNextLink *string `json:"@odata.nextLink,omitempty"`
2251}
2252
2253// StorageInsightListResultIterator provides access to a complete listing of StorageInsight values.
2254type StorageInsightListResultIterator struct {
2255	i    int
2256	page StorageInsightListResultPage
2257}
2258
2259// NextWithContext advances to the next value.  If there was an error making
2260// the request the iterator does not advance and the error is returned.
2261func (iter *StorageInsightListResultIterator) NextWithContext(ctx context.Context) (err error) {
2262	if tracing.IsEnabled() {
2263		ctx = tracing.StartSpan(ctx, fqdn+"/StorageInsightListResultIterator.NextWithContext")
2264		defer func() {
2265			sc := -1
2266			if iter.Response().Response.Response != nil {
2267				sc = iter.Response().Response.Response.StatusCode
2268			}
2269			tracing.EndSpan(ctx, sc, err)
2270		}()
2271	}
2272	iter.i++
2273	if iter.i < len(iter.page.Values()) {
2274		return nil
2275	}
2276	err = iter.page.NextWithContext(ctx)
2277	if err != nil {
2278		iter.i--
2279		return err
2280	}
2281	iter.i = 0
2282	return nil
2283}
2284
2285// Next advances to the next value.  If there was an error making
2286// the request the iterator does not advance and the error is returned.
2287// Deprecated: Use NextWithContext() instead.
2288func (iter *StorageInsightListResultIterator) Next() error {
2289	return iter.NextWithContext(context.Background())
2290}
2291
2292// NotDone returns true if the enumeration should be started or is not yet complete.
2293func (iter StorageInsightListResultIterator) NotDone() bool {
2294	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2295}
2296
2297// Response returns the raw server response from the last page request.
2298func (iter StorageInsightListResultIterator) Response() StorageInsightListResult {
2299	return iter.page.Response()
2300}
2301
2302// Value returns the current value or a zero-initialized value if the
2303// iterator has advanced beyond the end of the collection.
2304func (iter StorageInsightListResultIterator) Value() StorageInsight {
2305	if !iter.page.NotDone() {
2306		return StorageInsight{}
2307	}
2308	return iter.page.Values()[iter.i]
2309}
2310
2311// Creates a new instance of the StorageInsightListResultIterator type.
2312func NewStorageInsightListResultIterator(page StorageInsightListResultPage) StorageInsightListResultIterator {
2313	return StorageInsightListResultIterator{page: page}
2314}
2315
2316// IsEmpty returns true if the ListResult contains no values.
2317func (silr StorageInsightListResult) IsEmpty() bool {
2318	return silr.Value == nil || len(*silr.Value) == 0
2319}
2320
2321// storageInsightListResultPreparer prepares a request to retrieve the next set of results.
2322// It returns nil if no more results exist.
2323func (silr StorageInsightListResult) storageInsightListResultPreparer(ctx context.Context) (*http.Request, error) {
2324	if silr.OdataNextLink == nil || len(to.String(silr.OdataNextLink)) < 1 {
2325		return nil, nil
2326	}
2327	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2328		autorest.AsJSON(),
2329		autorest.AsGet(),
2330		autorest.WithBaseURL(to.String(silr.OdataNextLink)))
2331}
2332
2333// StorageInsightListResultPage contains a page of StorageInsight values.
2334type StorageInsightListResultPage struct {
2335	fn   func(context.Context, StorageInsightListResult) (StorageInsightListResult, error)
2336	silr StorageInsightListResult
2337}
2338
2339// NextWithContext advances to the next page of values.  If there was an error making
2340// the request the page does not advance and the error is returned.
2341func (page *StorageInsightListResultPage) NextWithContext(ctx context.Context) (err error) {
2342	if tracing.IsEnabled() {
2343		ctx = tracing.StartSpan(ctx, fqdn+"/StorageInsightListResultPage.NextWithContext")
2344		defer func() {
2345			sc := -1
2346			if page.Response().Response.Response != nil {
2347				sc = page.Response().Response.Response.StatusCode
2348			}
2349			tracing.EndSpan(ctx, sc, err)
2350		}()
2351	}
2352	next, err := page.fn(ctx, page.silr)
2353	if err != nil {
2354		return err
2355	}
2356	page.silr = next
2357	return nil
2358}
2359
2360// Next advances to the next page of values.  If there was an error making
2361// the request the page does not advance and the error is returned.
2362// Deprecated: Use NextWithContext() instead.
2363func (page *StorageInsightListResultPage) Next() error {
2364	return page.NextWithContext(context.Background())
2365}
2366
2367// NotDone returns true if the page enumeration should be started or is not yet complete.
2368func (page StorageInsightListResultPage) NotDone() bool {
2369	return !page.silr.IsEmpty()
2370}
2371
2372// Response returns the raw server response from the last page request.
2373func (page StorageInsightListResultPage) Response() StorageInsightListResult {
2374	return page.silr
2375}
2376
2377// Values returns the slice of values for the current page or nil if there are no values.
2378func (page StorageInsightListResultPage) Values() []StorageInsight {
2379	if page.silr.IsEmpty() {
2380		return nil
2381	}
2382	return *page.silr.Value
2383}
2384
2385// Creates a new instance of the StorageInsightListResultPage type.
2386func NewStorageInsightListResultPage(getNextPage func(context.Context, StorageInsightListResult) (StorageInsightListResult, error)) StorageInsightListResultPage {
2387	return StorageInsightListResultPage{fn: getNextPage}
2388}
2389
2390// StorageInsightProperties storage insight properties.
2391type StorageInsightProperties struct {
2392	// Containers - The names of the blob containers that the workspace should read
2393	Containers *[]string `json:"containers,omitempty"`
2394	// Tables - The names of the Azure tables that the workspace should read
2395	Tables *[]string `json:"tables,omitempty"`
2396	// StorageAccount - The storage account connection details
2397	StorageAccount *StorageAccount `json:"storageAccount,omitempty"`
2398	// Status - READ-ONLY; The status of the storage insight
2399	Status *StorageInsightStatus `json:"status,omitempty"`
2400}
2401
2402// StorageInsightStatus the status of the storage insight.
2403type StorageInsightStatus struct {
2404	// State - The state of the storage insight connection to the workspace. Possible values include: 'OK', 'ERROR'
2405	State StorageInsightState `json:"state,omitempty"`
2406	// Description - Description of the state of the storage insight.
2407	Description *string `json:"description,omitempty"`
2408}
2409
2410// Table workspace data table definition.
2411type Table struct {
2412	autorest.Response `json:"-"`
2413	// TableProperties - Table properties.
2414	*TableProperties `json:"properties,omitempty"`
2415	// ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
2416	ID *string `json:"id,omitempty"`
2417	// Name - READ-ONLY; The name of the resource
2418	Name *string `json:"name,omitempty"`
2419	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
2420	Type *string `json:"type,omitempty"`
2421}
2422
2423// MarshalJSON is the custom marshaler for Table.
2424func (t Table) MarshalJSON() ([]byte, error) {
2425	objectMap := make(map[string]interface{})
2426	if t.TableProperties != nil {
2427		objectMap["properties"] = t.TableProperties
2428	}
2429	return json.Marshal(objectMap)
2430}
2431
2432// UnmarshalJSON is the custom unmarshaler for Table struct.
2433func (t *Table) UnmarshalJSON(body []byte) error {
2434	var m map[string]*json.RawMessage
2435	err := json.Unmarshal(body, &m)
2436	if err != nil {
2437		return err
2438	}
2439	for k, v := range m {
2440		switch k {
2441		case "properties":
2442			if v != nil {
2443				var tableProperties TableProperties
2444				err = json.Unmarshal(*v, &tableProperties)
2445				if err != nil {
2446					return err
2447				}
2448				t.TableProperties = &tableProperties
2449			}
2450		case "id":
2451			if v != nil {
2452				var ID string
2453				err = json.Unmarshal(*v, &ID)
2454				if err != nil {
2455					return err
2456				}
2457				t.ID = &ID
2458			}
2459		case "name":
2460			if v != nil {
2461				var name string
2462				err = json.Unmarshal(*v, &name)
2463				if err != nil {
2464					return err
2465				}
2466				t.Name = &name
2467			}
2468		case "type":
2469			if v != nil {
2470				var typeVar string
2471				err = json.Unmarshal(*v, &typeVar)
2472				if err != nil {
2473					return err
2474				}
2475				t.Type = &typeVar
2476			}
2477		}
2478	}
2479
2480	return nil
2481}
2482
2483// TableProperties table properties.
2484type TableProperties struct {
2485	// RetentionInDays - The data table data retention in days, between 30 and 730. Setting this property to null will default to the workspace retention.
2486	RetentionInDays *int32 `json:"retentionInDays,omitempty"`
2487}
2488
2489// TablesListResult the list tables operation response.
2490type TablesListResult struct {
2491	autorest.Response `json:"-"`
2492	// Value - A list of data tables.
2493	Value *[]Table `json:"value,omitempty"`
2494}
2495
2496// Tag a tag of a saved search.
2497type Tag struct {
2498	// Name - The tag name.
2499	Name *string `json:"name,omitempty"`
2500	// Value - The tag value.
2501	Value *string `json:"value,omitempty"`
2502}
2503
2504// TrackedResource the resource model definition for a ARM tracked top level resource
2505type TrackedResource struct {
2506	// Tags - Resource tags.
2507	Tags map[string]*string `json:"tags"`
2508	// Location - The geo-location where the resource lives
2509	Location *string `json:"location,omitempty"`
2510	// ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
2511	ID *string `json:"id,omitempty"`
2512	// Name - READ-ONLY; The name of the resource
2513	Name *string `json:"name,omitempty"`
2514	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
2515	Type *string `json:"type,omitempty"`
2516}
2517
2518// MarshalJSON is the custom marshaler for TrackedResource.
2519func (tr TrackedResource) MarshalJSON() ([]byte, error) {
2520	objectMap := make(map[string]interface{})
2521	if tr.Tags != nil {
2522		objectMap["tags"] = tr.Tags
2523	}
2524	if tr.Location != nil {
2525		objectMap["location"] = tr.Location
2526	}
2527	return json.Marshal(objectMap)
2528}
2529
2530// UsageMetric a metric describing the usage of a resource.
2531type UsageMetric struct {
2532	// Name - The name of the metric.
2533	Name *MetricName `json:"name,omitempty"`
2534	// Unit - The units used for the metric.
2535	Unit *string `json:"unit,omitempty"`
2536	// CurrentValue - The current value of the metric.
2537	CurrentValue *float64 `json:"currentValue,omitempty"`
2538	// Limit - The quota limit for the metric.
2539	Limit *float64 `json:"limit,omitempty"`
2540	// NextResetTime - The time that the metric's value will reset.
2541	NextResetTime *date.Time `json:"nextResetTime,omitempty"`
2542	// QuotaPeriod - The quota period that determines the length of time between value resets.
2543	QuotaPeriod *string `json:"quotaPeriod,omitempty"`
2544}
2545
2546// Workspace the top level Workspace resource container.
2547type Workspace struct {
2548	autorest.Response `json:"-"`
2549	// WorkspaceProperties - Workspace properties.
2550	*WorkspaceProperties `json:"properties,omitempty"`
2551	// ETag - The ETag of the workspace.
2552	ETag *string `json:"eTag,omitempty"`
2553	// Tags - Resource tags.
2554	Tags map[string]*string `json:"tags"`
2555	// Location - The geo-location where the resource lives
2556	Location *string `json:"location,omitempty"`
2557	// ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
2558	ID *string `json:"id,omitempty"`
2559	// Name - READ-ONLY; The name of the resource
2560	Name *string `json:"name,omitempty"`
2561	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
2562	Type *string `json:"type,omitempty"`
2563}
2564
2565// MarshalJSON is the custom marshaler for Workspace.
2566func (w Workspace) MarshalJSON() ([]byte, error) {
2567	objectMap := make(map[string]interface{})
2568	if w.WorkspaceProperties != nil {
2569		objectMap["properties"] = w.WorkspaceProperties
2570	}
2571	if w.ETag != nil {
2572		objectMap["eTag"] = w.ETag
2573	}
2574	if w.Tags != nil {
2575		objectMap["tags"] = w.Tags
2576	}
2577	if w.Location != nil {
2578		objectMap["location"] = w.Location
2579	}
2580	return json.Marshal(objectMap)
2581}
2582
2583// UnmarshalJSON is the custom unmarshaler for Workspace struct.
2584func (w *Workspace) UnmarshalJSON(body []byte) error {
2585	var m map[string]*json.RawMessage
2586	err := json.Unmarshal(body, &m)
2587	if err != nil {
2588		return err
2589	}
2590	for k, v := range m {
2591		switch k {
2592		case "properties":
2593			if v != nil {
2594				var workspaceProperties WorkspaceProperties
2595				err = json.Unmarshal(*v, &workspaceProperties)
2596				if err != nil {
2597					return err
2598				}
2599				w.WorkspaceProperties = &workspaceProperties
2600			}
2601		case "eTag":
2602			if v != nil {
2603				var eTag string
2604				err = json.Unmarshal(*v, &eTag)
2605				if err != nil {
2606					return err
2607				}
2608				w.ETag = &eTag
2609			}
2610		case "tags":
2611			if v != nil {
2612				var tags map[string]*string
2613				err = json.Unmarshal(*v, &tags)
2614				if err != nil {
2615					return err
2616				}
2617				w.Tags = tags
2618			}
2619		case "location":
2620			if v != nil {
2621				var location string
2622				err = json.Unmarshal(*v, &location)
2623				if err != nil {
2624					return err
2625				}
2626				w.Location = &location
2627			}
2628		case "id":
2629			if v != nil {
2630				var ID string
2631				err = json.Unmarshal(*v, &ID)
2632				if err != nil {
2633					return err
2634				}
2635				w.ID = &ID
2636			}
2637		case "name":
2638			if v != nil {
2639				var name string
2640				err = json.Unmarshal(*v, &name)
2641				if err != nil {
2642					return err
2643				}
2644				w.Name = &name
2645			}
2646		case "type":
2647			if v != nil {
2648				var typeVar string
2649				err = json.Unmarshal(*v, &typeVar)
2650				if err != nil {
2651					return err
2652				}
2653				w.Type = &typeVar
2654			}
2655		}
2656	}
2657
2658	return nil
2659}
2660
2661// WorkspaceCapping the daily volume cap for ingestion.
2662type WorkspaceCapping struct {
2663	// DailyQuotaGb - The workspace daily quota for ingestion. -1 means unlimited.
2664	DailyQuotaGb *float64 `json:"dailyQuotaGb,omitempty"`
2665	// QuotaNextResetTime - READ-ONLY; The time when the quota will be rest.
2666	QuotaNextResetTime *string `json:"quotaNextResetTime,omitempty"`
2667	// DataIngestionStatus - READ-ONLY; The status of data ingestion for this workspace. Possible values include: 'RespectQuota', 'ForceOn', 'ForceOff', 'OverQuota', 'SubscriptionSuspended', 'ApproachingQuota'
2668	DataIngestionStatus DataIngestionStatus `json:"dataIngestionStatus,omitempty"`
2669}
2670
2671// WorkspaceListManagementGroupsResult the list workspace management groups operation response.
2672type WorkspaceListManagementGroupsResult struct {
2673	autorest.Response `json:"-"`
2674	// Value - Gets or sets a list of management groups attached to the workspace.
2675	Value *[]ManagementGroup `json:"value,omitempty"`
2676}
2677
2678// WorkspaceListResult the list workspaces operation response.
2679type WorkspaceListResult struct {
2680	autorest.Response `json:"-"`
2681	// Value - A list of workspaces.
2682	Value *[]Workspace `json:"value,omitempty"`
2683}
2684
2685// WorkspaceListUsagesResult the list workspace usages operation response.
2686type WorkspaceListUsagesResult struct {
2687	autorest.Response `json:"-"`
2688	// Value - Gets or sets a list of usage metrics for a workspace.
2689	Value *[]UsageMetric `json:"value,omitempty"`
2690}
2691
2692// WorkspacePatch the top level Workspace resource container.
2693type WorkspacePatch struct {
2694	// WorkspaceProperties - Workspace properties.
2695	*WorkspaceProperties `json:"properties,omitempty"`
2696	// Tags - Resource tags. Optional.
2697	Tags map[string]*string `json:"tags"`
2698	// Etag - READ-ONLY; Resource Etag.
2699	Etag *string `json:"etag,omitempty"`
2700	// ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
2701	ID *string `json:"id,omitempty"`
2702	// Name - READ-ONLY; The name of the resource
2703	Name *string `json:"name,omitempty"`
2704	// Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
2705	Type *string `json:"type,omitempty"`
2706}
2707
2708// MarshalJSON is the custom marshaler for WorkspacePatch.
2709func (wp WorkspacePatch) MarshalJSON() ([]byte, error) {
2710	objectMap := make(map[string]interface{})
2711	if wp.WorkspaceProperties != nil {
2712		objectMap["properties"] = wp.WorkspaceProperties
2713	}
2714	if wp.Tags != nil {
2715		objectMap["tags"] = wp.Tags
2716	}
2717	return json.Marshal(objectMap)
2718}
2719
2720// UnmarshalJSON is the custom unmarshaler for WorkspacePatch struct.
2721func (wp *WorkspacePatch) UnmarshalJSON(body []byte) error {
2722	var m map[string]*json.RawMessage
2723	err := json.Unmarshal(body, &m)
2724	if err != nil {
2725		return err
2726	}
2727	for k, v := range m {
2728		switch k {
2729		case "properties":
2730			if v != nil {
2731				var workspaceProperties WorkspaceProperties
2732				err = json.Unmarshal(*v, &workspaceProperties)
2733				if err != nil {
2734					return err
2735				}
2736				wp.WorkspaceProperties = &workspaceProperties
2737			}
2738		case "tags":
2739			if v != nil {
2740				var tags map[string]*string
2741				err = json.Unmarshal(*v, &tags)
2742				if err != nil {
2743					return err
2744				}
2745				wp.Tags = tags
2746			}
2747		case "etag":
2748			if v != nil {
2749				var etag string
2750				err = json.Unmarshal(*v, &etag)
2751				if err != nil {
2752					return err
2753				}
2754				wp.Etag = &etag
2755			}
2756		case "id":
2757			if v != nil {
2758				var ID string
2759				err = json.Unmarshal(*v, &ID)
2760				if err != nil {
2761					return err
2762				}
2763				wp.ID = &ID
2764			}
2765		case "name":
2766			if v != nil {
2767				var name string
2768				err = json.Unmarshal(*v, &name)
2769				if err != nil {
2770					return err
2771				}
2772				wp.Name = &name
2773			}
2774		case "type":
2775			if v != nil {
2776				var typeVar string
2777				err = json.Unmarshal(*v, &typeVar)
2778				if err != nil {
2779					return err
2780				}
2781				wp.Type = &typeVar
2782			}
2783		}
2784	}
2785
2786	return nil
2787}
2788
2789// WorkspaceProperties workspace properties.
2790type WorkspaceProperties struct {
2791	// ProvisioningState - The provisioning state of the workspace. Possible values include: 'WorkspaceEntityStatusCreating', 'WorkspaceEntityStatusSucceeded', 'WorkspaceEntityStatusFailed', 'WorkspaceEntityStatusCanceled', 'WorkspaceEntityStatusDeleting', 'WorkspaceEntityStatusProvisioningAccount', 'WorkspaceEntityStatusUpdating'
2792	ProvisioningState WorkspaceEntityStatus `json:"provisioningState,omitempty"`
2793	// CustomerID - READ-ONLY; This is a read-only property. Represents the ID associated with the workspace.
2794	CustomerID *string `json:"customerId,omitempty"`
2795	// Sku - The SKU of the workspace.
2796	Sku *WorkspaceSku `json:"sku,omitempty"`
2797	// RetentionInDays - The workspace data retention in days. -1 means Unlimited retention for the Unlimited Sku. 730 days is the maximum allowed for all other Skus.
2798	RetentionInDays *int32 `json:"retentionInDays,omitempty"`
2799	// WorkspaceCapping - The daily volume cap for ingestion.
2800	WorkspaceCapping *WorkspaceCapping `json:"workspaceCapping,omitempty"`
2801	// PublicNetworkAccessForIngestion - The network access type for accessing Log Analytics ingestion. Possible values include: 'Enabled', 'Disabled'
2802	PublicNetworkAccessForIngestion PublicNetworkAccessType `json:"publicNetworkAccessForIngestion,omitempty"`
2803	// PublicNetworkAccessForQuery - The network access type for accessing Log Analytics query. Possible values include: 'Enabled', 'Disabled'
2804	PublicNetworkAccessForQuery PublicNetworkAccessType `json:"publicNetworkAccessForQuery,omitempty"`
2805	// PrivateLinkScopedResources - READ-ONLY; List of linked private link scope resources.
2806	PrivateLinkScopedResources *[]PrivateLinkScopedResource `json:"privateLinkScopedResources,omitempty"`
2807}
2808
2809// WorkspacePurgeBody describes the body of a purge request for an App Insights Workspace
2810type WorkspacePurgeBody struct {
2811	// Table - Table from which to purge data.
2812	Table *string `json:"table,omitempty"`
2813	// Filters - The set of columns and filters (queries) to run over them to purge the resulting data.
2814	Filters *[]WorkspacePurgeBodyFilters `json:"filters,omitempty"`
2815}
2816
2817// WorkspacePurgeBodyFilters user-defined filters to return data which will be purged from the table.
2818type WorkspacePurgeBodyFilters struct {
2819	// Column - The column of the table over which the given query should run
2820	Column *string `json:"column,omitempty"`
2821	// Operator - A query operator to evaluate over the provided column and value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would in a KQL query.
2822	Operator *string `json:"operator,omitempty"`
2823	// Value - the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of values.
2824	Value interface{} `json:"value,omitempty"`
2825	// Key - When filtering over custom dimensions, this key will be used as the name of the custom dimension.
2826	Key *string `json:"key,omitempty"`
2827}
2828
2829// WorkspacePurgeResponse response containing operationId for a specific purge action.
2830type WorkspacePurgeResponse struct {
2831	autorest.Response `json:"-"`
2832	// OperationID - Id to use when querying for status for a particular purge operation.
2833	OperationID *string `json:"operationId,omitempty"`
2834}
2835
2836// WorkspacePurgeStatusResponse response containing status for a specific purge operation.
2837type WorkspacePurgeStatusResponse struct {
2838	autorest.Response `json:"-"`
2839	// Status - Status of the operation represented by the requested Id. Possible values include: 'Pending', 'Completed'
2840	Status PurgeState `json:"status,omitempty"`
2841}
2842
2843// WorkspacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
2844// long-running operation.
2845type WorkspacesCreateOrUpdateFuture struct {
2846	azure.Future
2847}
2848
2849// Result returns the result of the asynchronous operation.
2850// If the operation has not completed it will return an error.
2851func (future *WorkspacesCreateOrUpdateFuture) Result(client WorkspacesClient) (w Workspace, err error) {
2852	var done bool
2853	done, err = future.DoneWithContext(context.Background(), client)
2854	if err != nil {
2855		err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
2856		return
2857	}
2858	if !done {
2859		err = azure.NewAsyncOpIncompleteError("operationalinsights.WorkspacesCreateOrUpdateFuture")
2860		return
2861	}
2862	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2863	if w.Response.Response, err = future.GetResult(sender); err == nil && w.Response.Response.StatusCode != http.StatusNoContent {
2864		w, err = client.CreateOrUpdateResponder(w.Response.Response)
2865		if err != nil {
2866			err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesCreateOrUpdateFuture", "Result", w.Response.Response, "Failure responding to request")
2867		}
2868	}
2869	return
2870}
2871
2872// WorkspacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
2873// operation.
2874type WorkspacesDeleteFuture struct {
2875	azure.Future
2876}
2877
2878// Result returns the result of the asynchronous operation.
2879// If the operation has not completed it will return an error.
2880func (future *WorkspacesDeleteFuture) Result(client WorkspacesClient) (ar autorest.Response, err error) {
2881	var done bool
2882	done, err = future.DoneWithContext(context.Background(), client)
2883	if err != nil {
2884		err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesDeleteFuture", "Result", future.Response(), "Polling failure")
2885		return
2886	}
2887	if !done {
2888		err = azure.NewAsyncOpIncompleteError("operationalinsights.WorkspacesDeleteFuture")
2889		return
2890	}
2891	ar.Response = future.Response()
2892	return
2893}
2894
2895// WorkspaceSku the SKU (tier) of a workspace.
2896type WorkspaceSku struct {
2897	// Name - The name of the SKU. Possible values include: 'WorkspaceSkuNameEnumFree', 'WorkspaceSkuNameEnumStandard', 'WorkspaceSkuNameEnumPremium', 'WorkspaceSkuNameEnumPerNode', 'WorkspaceSkuNameEnumPerGB2018', 'WorkspaceSkuNameEnumStandalone', 'WorkspaceSkuNameEnumCapacityReservation'
2898	Name WorkspaceSkuNameEnum `json:"name,omitempty"`
2899	// CapacityReservationLevel - The capacity reservation level for this workspace, when CapacityReservation sku is selected.
2900	CapacityReservationLevel *int32 `json:"capacityReservationLevel,omitempty"`
2901	// MaxCapacityReservationLevel - READ-ONLY; The maximum capacity reservation level available for this workspace, when CapacityReservation sku is selected.
2902	MaxCapacityReservationLevel *int32 `json:"maxCapacityReservationLevel,omitempty"`
2903	// LastSkuUpdate - READ-ONLY; The last time when the sku was updated.
2904	LastSkuUpdate *string `json:"lastSkuUpdate,omitempty"`
2905}
2906