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