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