1package costmanagement
2
3// Copyright (c) Microsoft Corporation. All rights reserved.
4// Licensed under the MIT License. See License.txt in the project root for license information.
5//
6// Code generated by Microsoft (R) AutoRest Code Generator.
7// Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
9import (
10	"context"
11	"encoding/json"
12	"github.com/Azure/go-autorest/autorest"
13	"github.com/Azure/go-autorest/autorest/azure"
14	"github.com/Azure/go-autorest/autorest/date"
15	"github.com/Azure/go-autorest/autorest/to"
16	"github.com/Azure/go-autorest/tracing"
17	"github.com/shopspring/decimal"
18	"net/http"
19)
20
21// The package's fully qualified name.
22const fqdn = "github.com/Azure/azure-sdk-for-go/services/costmanagement/mgmt/2019-11-01/costmanagement"
23
24// Alert an individual alert.
25type Alert struct {
26	autorest.Response `json:"-"`
27	*AlertProperties  `json:"properties,omitempty"`
28	// ID - READ-ONLY; Resource Id.
29	ID *string `json:"id,omitempty"`
30	// Name - READ-ONLY; Resource name.
31	Name *string `json:"name,omitempty"`
32	// Type - READ-ONLY; Resource type.
33	Type *string `json:"type,omitempty"`
34	// Tags - READ-ONLY; Resource tags.
35	Tags map[string]*string `json:"tags"`
36}
37
38// MarshalJSON is the custom marshaler for Alert.
39func (a Alert) MarshalJSON() ([]byte, error) {
40	objectMap := make(map[string]interface{})
41	if a.AlertProperties != nil {
42		objectMap["properties"] = a.AlertProperties
43	}
44	return json.Marshal(objectMap)
45}
46
47// UnmarshalJSON is the custom unmarshaler for Alert struct.
48func (a *Alert) UnmarshalJSON(body []byte) error {
49	var m map[string]*json.RawMessage
50	err := json.Unmarshal(body, &m)
51	if err != nil {
52		return err
53	}
54	for k, v := range m {
55		switch k {
56		case "properties":
57			if v != nil {
58				var alertProperties AlertProperties
59				err = json.Unmarshal(*v, &alertProperties)
60				if err != nil {
61					return err
62				}
63				a.AlertProperties = &alertProperties
64			}
65		case "id":
66			if v != nil {
67				var ID string
68				err = json.Unmarshal(*v, &ID)
69				if err != nil {
70					return err
71				}
72				a.ID = &ID
73			}
74		case "name":
75			if v != nil {
76				var name string
77				err = json.Unmarshal(*v, &name)
78				if err != nil {
79					return err
80				}
81				a.Name = &name
82			}
83		case "type":
84			if v != nil {
85				var typeVar string
86				err = json.Unmarshal(*v, &typeVar)
87				if err != nil {
88					return err
89				}
90				a.Type = &typeVar
91			}
92		case "tags":
93			if v != nil {
94				var tags map[string]*string
95				err = json.Unmarshal(*v, &tags)
96				if err != nil {
97					return err
98				}
99				a.Tags = tags
100			}
101		}
102	}
103
104	return nil
105}
106
107// AlertProperties ...
108type AlertProperties struct {
109	// Definition - defines the type of alert
110	Definition *AlertPropertiesDefinition `json:"definition,omitempty"`
111	// Description - Alert description
112	Description *string `json:"description,omitempty"`
113	// Source - Source of alert. Possible values include: 'AlertSourcePreset', 'AlertSourceUser'
114	Source AlertSource `json:"source,omitempty"`
115	// Details - Alert details
116	Details *AlertPropertiesDetails `json:"details,omitempty"`
117	// CostEntityID - related budget
118	CostEntityID *string `json:"costEntityId,omitempty"`
119	// Status - alert status. Possible values include: 'AlertStatusNone', 'AlertStatusActive', 'AlertStatusOverridden', 'AlertStatusResolved', 'AlertStatusDismissed'
120	Status AlertStatus `json:"status,omitempty"`
121	// CreationTime - dateTime in which alert was created
122	CreationTime *string `json:"creationTime,omitempty"`
123	// CloseTime - dateTime in which alert was closed
124	CloseTime *string `json:"closeTime,omitempty"`
125	// ModificationTime - dateTime in which alert was last modified
126	ModificationTime           *string `json:"modificationTime,omitempty"`
127	StatusModificationUserName *string `json:"statusModificationUserName,omitempty"`
128	// StatusModificationTime - dateTime in which the alert status was last modified
129	StatusModificationTime *string `json:"statusModificationTime,omitempty"`
130}
131
132// AlertPropertiesDefinition defines the type of alert
133type AlertPropertiesDefinition struct {
134	// Type - type of alert. Possible values include: 'AlertTypeBudget', 'AlertTypeInvoice', 'AlertTypeCredit', 'AlertTypeQuota', 'AlertTypeGeneral', 'AlertTypeXCloud', 'AlertTypeBudgetForecast'
135	Type AlertType `json:"type,omitempty"`
136	// Category - Alert category. Possible values include: 'AlertCategoryCost', 'AlertCategoryUsage', 'AlertCategoryBilling', 'AlertCategorySystem'
137	Category AlertCategory `json:"category,omitempty"`
138	// Criteria - Criteria that triggered alert. Possible values include: 'AlertCriteriaCostThresholdExceeded', 'AlertCriteriaUsageThresholdExceeded', 'AlertCriteriaCreditThresholdApproaching', 'AlertCriteriaCreditThresholdReached', 'AlertCriteriaQuotaThresholdApproaching', 'AlertCriteriaQuotaThresholdReached', 'AlertCriteriaMultiCurrency', 'AlertCriteriaForecastCostThresholdExceeded', 'AlertCriteriaForecastUsageThresholdExceeded', 'AlertCriteriaInvoiceDueDateApproaching', 'AlertCriteriaInvoiceDueDateReached', 'AlertCriteriaCrossCloudNewDataAvailable', 'AlertCriteriaCrossCloudCollectionError', 'AlertCriteriaGeneralThresholdError'
139	Criteria AlertCriteria `json:"criteria,omitempty"`
140}
141
142// AlertPropertiesDetails alert details
143type AlertPropertiesDetails struct {
144	// TimeGrainType - Type of timegrain cadence. Possible values include: 'AlertTimeGrainTypeNone', 'AlertTimeGrainTypeMonthly', 'AlertTimeGrainTypeQuarterly', 'AlertTimeGrainTypeAnnually', 'AlertTimeGrainTypeBillingMonth', 'AlertTimeGrainTypeBillingQuarter', 'AlertTimeGrainTypeBillingAnnual'
145	TimeGrainType AlertTimeGrainType `json:"timeGrainType,omitempty"`
146	// PeriodStartDate - datetime of periodStartDate
147	PeriodStartDate *string `json:"periodStartDate,omitempty"`
148	// TriggeredBy - notificationId that triggered this alert
149	TriggeredBy *string `json:"triggeredBy,omitempty"`
150	// ResourceGroupFilter - array of resourceGroups to filter by
151	ResourceGroupFilter *[]interface{} `json:"resourceGroupFilter,omitempty"`
152	// ResourceFilter - array of resources to filter by
153	ResourceFilter *[]interface{} `json:"resourceFilter,omitempty"`
154	// MeterFilter - array of meters to filter by
155	MeterFilter *[]interface{} `json:"meterFilter,omitempty"`
156	// TagFilter - tags to filter by
157	TagFilter interface{} `json:"tagFilter,omitempty"`
158	// Threshold - notification threshold percentage as a decimal which activated this alert
159	Threshold *decimal.Decimal `json:"threshold,omitempty"`
160	// Operator - operator used to compare currentSpend with amount. Possible values include: 'AlertOperatorNone', 'AlertOperatorEqualTo', 'AlertOperatorGreaterThan', 'AlertOperatorGreaterThanOrEqualTo', 'AlertOperatorLessThan', 'AlertOperatorLessThanOrEqualTo'
161	Operator AlertOperator `json:"operator,omitempty"`
162	// Amount - budget threshold amount
163	Amount *decimal.Decimal `json:"amount,omitempty"`
164	// Unit - unit of currency being used
165	Unit *string `json:"unit,omitempty"`
166	// CurrentSpend - current spend
167	CurrentSpend *decimal.Decimal `json:"currentSpend,omitempty"`
168	// ContactEmails - list of emails to contact
169	ContactEmails *[]string `json:"contactEmails,omitempty"`
170	// ContactGroups - list of action groups to broadcast to
171	ContactGroups *[]string `json:"contactGroups,omitempty"`
172	// ContactRoles - list of contact roles
173	ContactRoles *[]string `json:"contactRoles,omitempty"`
174	// OverridingAlert - overriding alert
175	OverridingAlert *string `json:"overridingAlert,omitempty"`
176}
177
178// AlertsResult result of alerts.
179type AlertsResult struct {
180	autorest.Response `json:"-"`
181	// Value - READ-ONLY; List of alerts.
182	Value *[]Alert `json:"value,omitempty"`
183	// NextLink - READ-ONLY; URL to get the next set of alerts results if there are any.
184	NextLink *string `json:"nextLink,omitempty"`
185}
186
187// MarshalJSON is the custom marshaler for AlertsResult.
188func (ar AlertsResult) MarshalJSON() ([]byte, error) {
189	objectMap := make(map[string]interface{})
190	return json.Marshal(objectMap)
191}
192
193// CacheItem ...
194type CacheItem struct {
195	// ID - Resource ID used by Resource Manager to uniquely identify the scope.
196	ID *string `json:"id,omitempty"`
197	// Name - Display name for the scope.
198	Name *string `json:"name,omitempty"`
199	// Channel - Indicates the account type. Allowed values include: EA, PAYG, Modern, Internal, Unknown.
200	Channel *string `json:"channel,omitempty"`
201	// Subchannel - Indicates the type of modern account. Allowed values include: Individual, Enterprise, Partner, Indirect, NotApplicable
202	Subchannel *string `json:"subchannel,omitempty"`
203	// Parent - Resource ID of the parent scope. For instance, subscription's resource ID for a resource group or a management group resource ID for a subscription.
204	Parent *string `json:"parent,omitempty"`
205	// Status - Indicates the status of the scope. Status only applies to subscriptions and billing accounts.
206	Status *string `json:"status,omitempty"`
207}
208
209// CommonExportProperties the common properties of the export.
210type CommonExportProperties struct {
211	// Format - The format of the export being delivered. Possible values include: 'FormatTypeCsv'
212	Format FormatType `json:"format,omitempty"`
213	// DeliveryInfo - Has delivery information for the export.
214	DeliveryInfo *ExportDeliveryInfo `json:"deliveryInfo,omitempty"`
215	// Definition - Has definition for the export.
216	Definition *ExportDefinition `json:"definition,omitempty"`
217}
218
219// Dimension ...
220type Dimension struct {
221	*DimensionProperties `json:"properties,omitempty"`
222	// ID - READ-ONLY; Resource Id.
223	ID *string `json:"id,omitempty"`
224	// Name - READ-ONLY; Resource name.
225	Name *string `json:"name,omitempty"`
226	// Type - READ-ONLY; Resource type.
227	Type *string `json:"type,omitempty"`
228	// Tags - READ-ONLY; Resource tags.
229	Tags map[string]*string `json:"tags"`
230}
231
232// MarshalJSON is the custom marshaler for Dimension.
233func (d Dimension) MarshalJSON() ([]byte, error) {
234	objectMap := make(map[string]interface{})
235	if d.DimensionProperties != nil {
236		objectMap["properties"] = d.DimensionProperties
237	}
238	return json.Marshal(objectMap)
239}
240
241// UnmarshalJSON is the custom unmarshaler for Dimension struct.
242func (d *Dimension) UnmarshalJSON(body []byte) error {
243	var m map[string]*json.RawMessage
244	err := json.Unmarshal(body, &m)
245	if err != nil {
246		return err
247	}
248	for k, v := range m {
249		switch k {
250		case "properties":
251			if v != nil {
252				var dimensionProperties DimensionProperties
253				err = json.Unmarshal(*v, &dimensionProperties)
254				if err != nil {
255					return err
256				}
257				d.DimensionProperties = &dimensionProperties
258			}
259		case "id":
260			if v != nil {
261				var ID string
262				err = json.Unmarshal(*v, &ID)
263				if err != nil {
264					return err
265				}
266				d.ID = &ID
267			}
268		case "name":
269			if v != nil {
270				var name string
271				err = json.Unmarshal(*v, &name)
272				if err != nil {
273					return err
274				}
275				d.Name = &name
276			}
277		case "type":
278			if v != nil {
279				var typeVar string
280				err = json.Unmarshal(*v, &typeVar)
281				if err != nil {
282					return err
283				}
284				d.Type = &typeVar
285			}
286		case "tags":
287			if v != nil {
288				var tags map[string]*string
289				err = json.Unmarshal(*v, &tags)
290				if err != nil {
291					return err
292				}
293				d.Tags = tags
294			}
295		}
296	}
297
298	return nil
299}
300
301// DimensionProperties ...
302type DimensionProperties struct {
303	// Description - READ-ONLY; Dimension description.
304	Description *string `json:"description,omitempty"`
305	// FilterEnabled - READ-ONLY; Filter enabled.
306	FilterEnabled *bool `json:"filterEnabled,omitempty"`
307	// GroupingEnabled - READ-ONLY; Grouping enabled.
308	GroupingEnabled *bool     `json:"groupingEnabled,omitempty"`
309	Data            *[]string `json:"data,omitempty"`
310	// Total - READ-ONLY; Total number of data for the dimension.
311	Total *int32 `json:"total,omitempty"`
312	// Category - READ-ONLY; Dimension category.
313	Category *string `json:"category,omitempty"`
314	// UsageStart - READ-ONLY; Usage start.
315	UsageStart *date.Time `json:"usageStart,omitempty"`
316	// UsageEnd - READ-ONLY; Usage end.
317	UsageEnd *date.Time `json:"usageEnd,omitempty"`
318	// NextLink - READ-ONLY; The link (url) to the next page of results.
319	NextLink *string `json:"nextLink,omitempty"`
320}
321
322// MarshalJSON is the custom marshaler for DimensionProperties.
323func (dp DimensionProperties) MarshalJSON() ([]byte, error) {
324	objectMap := make(map[string]interface{})
325	if dp.Data != nil {
326		objectMap["data"] = dp.Data
327	}
328	return json.Marshal(objectMap)
329}
330
331// DimensionsListResult result of listing dimensions. It contains a list of available dimensions.
332type DimensionsListResult struct {
333	autorest.Response `json:"-"`
334	// Value - READ-ONLY; The list of dimensions.
335	Value *[]Dimension `json:"value,omitempty"`
336}
337
338// MarshalJSON is the custom marshaler for DimensionsListResult.
339func (dlr DimensionsListResult) MarshalJSON() ([]byte, error) {
340	objectMap := make(map[string]interface{})
341	return json.Marshal(objectMap)
342}
343
344// DismissAlertPayload the request payload to update an alert
345type DismissAlertPayload struct {
346	*AlertProperties `json:"properties,omitempty"`
347}
348
349// MarshalJSON is the custom marshaler for DismissAlertPayload.
350func (dap DismissAlertPayload) MarshalJSON() ([]byte, error) {
351	objectMap := make(map[string]interface{})
352	if dap.AlertProperties != nil {
353		objectMap["properties"] = dap.AlertProperties
354	}
355	return json.Marshal(objectMap)
356}
357
358// UnmarshalJSON is the custom unmarshaler for DismissAlertPayload struct.
359func (dap *DismissAlertPayload) UnmarshalJSON(body []byte) error {
360	var m map[string]*json.RawMessage
361	err := json.Unmarshal(body, &m)
362	if err != nil {
363		return err
364	}
365	for k, v := range m {
366		switch k {
367		case "properties":
368			if v != nil {
369				var alertProperties AlertProperties
370				err = json.Unmarshal(*v, &alertProperties)
371				if err != nil {
372					return err
373				}
374				dap.AlertProperties = &alertProperties
375			}
376		}
377	}
378
379	return nil
380}
381
382// ErrorDetails the details of the error.
383type ErrorDetails struct {
384	// Code - READ-ONLY; Error code.
385	Code *string `json:"code,omitempty"`
386	// Message - READ-ONLY; Error message indicating why the operation failed.
387	Message *string `json:"message,omitempty"`
388}
389
390// MarshalJSON is the custom marshaler for ErrorDetails.
391func (ed ErrorDetails) MarshalJSON() ([]byte, error) {
392	objectMap := make(map[string]interface{})
393	return json.Marshal(objectMap)
394}
395
396// ErrorResponse error response indicates that the service is not able to process the incoming request. The
397// reason is provided in the error message.
398//
399// Some Error responses:
400//
401// * 429 TooManyRequests - Request is throttled. Retry after waiting for the time specified in the
402// "x-ms-ratelimit-microsoft.consumption-retry-after" header.
403//
404// * 503 ServiceUnavailable - Service is temporarily unavailable. Retry after waiting for the time
405// specified in the "Retry-After" header.
406type ErrorResponse struct {
407	// Error - The details of the error.
408	Error *ErrorDetails `json:"error,omitempty"`
409}
410
411// Export a export resource.
412type Export struct {
413	autorest.Response `json:"-"`
414	*ExportProperties `json:"properties,omitempty"`
415	// ID - READ-ONLY; Resource Id.
416	ID *string `json:"id,omitempty"`
417	// Name - READ-ONLY; Resource name.
418	Name *string `json:"name,omitempty"`
419	// Type - READ-ONLY; Resource type.
420	Type *string `json:"type,omitempty"`
421	// ETag - eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.
422	ETag *string `json:"eTag,omitempty"`
423}
424
425// MarshalJSON is the custom marshaler for Export.
426func (e Export) MarshalJSON() ([]byte, error) {
427	objectMap := make(map[string]interface{})
428	if e.ExportProperties != nil {
429		objectMap["properties"] = e.ExportProperties
430	}
431	if e.ETag != nil {
432		objectMap["eTag"] = e.ETag
433	}
434	return json.Marshal(objectMap)
435}
436
437// UnmarshalJSON is the custom unmarshaler for Export struct.
438func (e *Export) UnmarshalJSON(body []byte) error {
439	var m map[string]*json.RawMessage
440	err := json.Unmarshal(body, &m)
441	if err != nil {
442		return err
443	}
444	for k, v := range m {
445		switch k {
446		case "properties":
447			if v != nil {
448				var exportProperties ExportProperties
449				err = json.Unmarshal(*v, &exportProperties)
450				if err != nil {
451					return err
452				}
453				e.ExportProperties = &exportProperties
454			}
455		case "id":
456			if v != nil {
457				var ID string
458				err = json.Unmarshal(*v, &ID)
459				if err != nil {
460					return err
461				}
462				e.ID = &ID
463			}
464		case "name":
465			if v != nil {
466				var name string
467				err = json.Unmarshal(*v, &name)
468				if err != nil {
469					return err
470				}
471				e.Name = &name
472			}
473		case "type":
474			if v != nil {
475				var typeVar string
476				err = json.Unmarshal(*v, &typeVar)
477				if err != nil {
478					return err
479				}
480				e.Type = &typeVar
481			}
482		case "eTag":
483			if v != nil {
484				var eTag string
485				err = json.Unmarshal(*v, &eTag)
486				if err != nil {
487					return err
488				}
489				e.ETag = &eTag
490			}
491		}
492	}
493
494	return nil
495}
496
497// ExportDefinition the definition of a query.
498type ExportDefinition struct {
499	// Type - The type of the query. Possible values include: 'ExportTypeUsage', 'ExportTypeActualCost', 'ExportTypeAmortizedCost'
500	Type ExportType `json:"type,omitempty"`
501	// Timeframe - The time frame for pulling data for the query. If custom, then a specific time period must be provided. Possible values include: 'TimeframeTypeMonthToDate', 'TimeframeTypeBillingMonthToDate', 'TimeframeTypeTheLastMonth', 'TimeframeTypeTheLastBillingMonth', 'TimeframeTypeWeekToDate', 'TimeframeTypeCustom'
502	Timeframe TimeframeType `json:"timeframe,omitempty"`
503	// TimePeriod - Has time period for pulling data for the query.
504	TimePeriod *QueryTimePeriod `json:"timePeriod,omitempty"`
505	// DataSet - Has definition for data in this query.
506	DataSet *QueryDataset `json:"dataSet,omitempty"`
507}
508
509// ExportDeliveryDestination the destination information for the delivery of the export. To allow access to
510// a storage account, you must register the account's subscription with the Microsoft.CostManagementExports
511// resource provider. This is required once per subscription. When creating an export in the Azure portal,
512// it is done automatically, however API users need to register the subscription. For more information see
513// https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-supported-services .
514type ExportDeliveryDestination struct {
515	// ResourceID - The resource id of the storage account where exports will be delivered.
516	ResourceID *string `json:"resourceId,omitempty"`
517	// Container - The name of the container where exports will be uploaded.
518	Container *string `json:"container,omitempty"`
519	// RootFolderPath - The name of the directory where exports will be uploaded.
520	RootFolderPath *string `json:"rootFolderPath,omitempty"`
521}
522
523// ExportDeliveryInfo the delivery information associated with a export.
524type ExportDeliveryInfo struct {
525	// Destination - Has destination for the export being delivered.
526	Destination *ExportDeliveryDestination `json:"destination,omitempty"`
527}
528
529// ExportExecution a export execution.
530type ExportExecution struct {
531	*ExportExecutionProperties `json:"properties,omitempty"`
532	// ID - READ-ONLY; Resource Id.
533	ID *string `json:"id,omitempty"`
534	// Name - READ-ONLY; Resource name.
535	Name *string `json:"name,omitempty"`
536	// Type - READ-ONLY; Resource type.
537	Type *string `json:"type,omitempty"`
538	// Tags - READ-ONLY; Resource tags.
539	Tags map[string]*string `json:"tags"`
540}
541
542// MarshalJSON is the custom marshaler for ExportExecution.
543func (ee ExportExecution) MarshalJSON() ([]byte, error) {
544	objectMap := make(map[string]interface{})
545	if ee.ExportExecutionProperties != nil {
546		objectMap["properties"] = ee.ExportExecutionProperties
547	}
548	return json.Marshal(objectMap)
549}
550
551// UnmarshalJSON is the custom unmarshaler for ExportExecution struct.
552func (ee *ExportExecution) UnmarshalJSON(body []byte) error {
553	var m map[string]*json.RawMessage
554	err := json.Unmarshal(body, &m)
555	if err != nil {
556		return err
557	}
558	for k, v := range m {
559		switch k {
560		case "properties":
561			if v != nil {
562				var exportExecutionProperties ExportExecutionProperties
563				err = json.Unmarshal(*v, &exportExecutionProperties)
564				if err != nil {
565					return err
566				}
567				ee.ExportExecutionProperties = &exportExecutionProperties
568			}
569		case "id":
570			if v != nil {
571				var ID string
572				err = json.Unmarshal(*v, &ID)
573				if err != nil {
574					return err
575				}
576				ee.ID = &ID
577			}
578		case "name":
579			if v != nil {
580				var name string
581				err = json.Unmarshal(*v, &name)
582				if err != nil {
583					return err
584				}
585				ee.Name = &name
586			}
587		case "type":
588			if v != nil {
589				var typeVar string
590				err = json.Unmarshal(*v, &typeVar)
591				if err != nil {
592					return err
593				}
594				ee.Type = &typeVar
595			}
596		case "tags":
597			if v != nil {
598				var tags map[string]*string
599				err = json.Unmarshal(*v, &tags)
600				if err != nil {
601					return err
602				}
603				ee.Tags = tags
604			}
605		}
606	}
607
608	return nil
609}
610
611// ExportExecutionListResult result of listing exports execution history of a export by name
612type ExportExecutionListResult struct {
613	autorest.Response `json:"-"`
614	// Value - READ-ONLY; The list of export executions.
615	Value *[]ExportExecution `json:"value,omitempty"`
616}
617
618// MarshalJSON is the custom marshaler for ExportExecutionListResult.
619func (eelr ExportExecutionListResult) MarshalJSON() ([]byte, error) {
620	objectMap := make(map[string]interface{})
621	return json.Marshal(objectMap)
622}
623
624// ExportExecutionProperties the properties of the export execution.
625type ExportExecutionProperties struct {
626	// ExecutionType - The type of the export execution. Possible values include: 'ExecutionTypeOnDemand', 'ExecutionTypeScheduled'
627	ExecutionType ExecutionType `json:"executionType,omitempty"`
628	// Status - The status of the export execution. Possible values include: 'ExecutionStatusQueued', 'ExecutionStatusInProgress', 'ExecutionStatusCompleted', 'ExecutionStatusFailed', 'ExecutionStatusTimeout', 'ExecutionStatusNewDataNotAvailable', 'ExecutionStatusDataNotAvailable'
629	Status ExecutionStatus `json:"status,omitempty"`
630	// SubmittedBy - The identifier for the entity that executed the export. For OnDemand executions, it is the email id. For Scheduled executions, it is the constant value - System.
631	SubmittedBy *string `json:"submittedBy,omitempty"`
632	// SubmittedTime - The time when export was queued to be executed.
633	SubmittedTime *date.Time `json:"submittedTime,omitempty"`
634	// ProcessingStartTime - The time when export was picked up to be executed.
635	ProcessingStartTime *date.Time `json:"processingStartTime,omitempty"`
636	// ProcessingEndTime - The time when export execution finished.
637	ProcessingEndTime *date.Time `json:"processingEndTime,omitempty"`
638	// FileName - The name of the file export got written to.
639	FileName    *string                 `json:"fileName,omitempty"`
640	RunSettings *CommonExportProperties `json:"runSettings,omitempty"`
641}
642
643// ExportListResult result of listing exports. It contains a list of available exports in the scope
644// provided.
645type ExportListResult struct {
646	autorest.Response `json:"-"`
647	// Value - READ-ONLY; The list of exports.
648	Value *[]Export `json:"value,omitempty"`
649}
650
651// MarshalJSON is the custom marshaler for ExportListResult.
652func (elr ExportListResult) MarshalJSON() ([]byte, error) {
653	objectMap := make(map[string]interface{})
654	return json.Marshal(objectMap)
655}
656
657// ExportProperties the properties of the export.
658type ExportProperties struct {
659	// Schedule - Has schedule information for the export.
660	Schedule *ExportSchedule `json:"schedule,omitempty"`
661	// Format - The format of the export being delivered. Possible values include: 'FormatTypeCsv'
662	Format FormatType `json:"format,omitempty"`
663	// DeliveryInfo - Has delivery information for the export.
664	DeliveryInfo *ExportDeliveryInfo `json:"deliveryInfo,omitempty"`
665	// Definition - Has definition for the export.
666	Definition *ExportDefinition `json:"definition,omitempty"`
667}
668
669// ExportRecurrencePeriod the start and end date for recurrence schedule.
670type ExportRecurrencePeriod struct {
671	// From - The start date of recurrence.
672	From *date.Time `json:"from,omitempty"`
673	// To - The end date of recurrence.
674	To *date.Time `json:"to,omitempty"`
675}
676
677// ExportSchedule the schedule associated with a export.
678type ExportSchedule struct {
679	// Status - The status of the schedule. Whether active or not. If inactive, the export's scheduled execution is paused. Possible values include: 'StatusTypeActive', 'StatusTypeInactive'
680	Status StatusType `json:"status,omitempty"`
681	// Recurrence - The schedule recurrence. Possible values include: 'RecurrenceTypeDaily', 'RecurrenceTypeWeekly', 'RecurrenceTypeMonthly', 'RecurrenceTypeAnnually'
682	Recurrence RecurrenceType `json:"recurrence,omitempty"`
683	// RecurrencePeriod - Has start and end date of the recurrence. The start date must be in future. If present, the end date must be greater than start date.
684	RecurrencePeriod *ExportRecurrencePeriod `json:"recurrencePeriod,omitempty"`
685}
686
687// ForecastDefinition the definition of a forecast.
688type ForecastDefinition struct {
689	// Type - The type of the forecast. Possible values include: 'ForecastTypeUsage', 'ForecastTypeActualCost', 'ForecastTypeAmortizedCost'
690	Type ForecastType `json:"type,omitempty"`
691	// Timeframe - The time frame for pulling data for the forecast. If custom, then a specific time period must be provided. Possible values include: 'ForecastTimeframeTypeMonthToDate', 'ForecastTimeframeTypeBillingMonthToDate', 'ForecastTimeframeTypeTheLastMonth', 'ForecastTimeframeTypeTheLastBillingMonth', 'ForecastTimeframeTypeWeekToDate', 'ForecastTimeframeTypeCustom'
692	Timeframe ForecastTimeframeType `json:"timeframe,omitempty"`
693	// TimePeriod - Has time period for pulling data for the forecast.
694	TimePeriod *QueryTimePeriod `json:"timePeriod,omitempty"`
695	// Dataset - Has definition for data in this forecast.
696	Dataset *QueryDataset `json:"dataset,omitempty"`
697	// IncludeActualCost - a boolean determining if actualCost will be included
698	IncludeActualCost *bool `json:"includeActualCost,omitempty"`
699	// IncludeFreshPartialCost - a boolean determining if FreshPartialCost will be included
700	IncludeFreshPartialCost *bool `json:"includeFreshPartialCost,omitempty"`
701}
702
703// GenerateReservationDetailsReportByBillingAccountIDFuture an abstraction for monitoring and retrieving
704// the results of a long-running operation.
705type GenerateReservationDetailsReportByBillingAccountIDFuture struct {
706	azure.FutureAPI
707	// Result returns the result of the asynchronous operation.
708	// If the operation has not completed it will return an error.
709	Result func(GenerateReservationDetailsReportClient) (OperationStatus, error)
710}
711
712// UnmarshalJSON is the custom unmarshaller for CreateFuture.
713func (future *GenerateReservationDetailsReportByBillingAccountIDFuture) UnmarshalJSON(body []byte) error {
714	var azFuture azure.Future
715	if err := json.Unmarshal(body, &azFuture); err != nil {
716		return err
717	}
718	future.FutureAPI = &azFuture
719	future.Result = future.result
720	return nil
721}
722
723// result is the default implementation for GenerateReservationDetailsReportByBillingAccountIDFuture.Result.
724func (future *GenerateReservationDetailsReportByBillingAccountIDFuture) result(client GenerateReservationDetailsReportClient) (osVar OperationStatus, err error) {
725	var done bool
726	done, err = future.DoneWithContext(context.Background(), client)
727	if err != nil {
728		err = autorest.NewErrorWithError(err, "costmanagement.GenerateReservationDetailsReportByBillingAccountIDFuture", "Result", future.Response(), "Polling failure")
729		return
730	}
731	if !done {
732		osVar.Response.Response = future.Response()
733		err = azure.NewAsyncOpIncompleteError("costmanagement.GenerateReservationDetailsReportByBillingAccountIDFuture")
734		return
735	}
736	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
737	if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent {
738		osVar, err = client.ByBillingAccountIDResponder(osVar.Response.Response)
739		if err != nil {
740			err = autorest.NewErrorWithError(err, "costmanagement.GenerateReservationDetailsReportByBillingAccountIDFuture", "Result", osVar.Response.Response, "Failure responding to request")
741		}
742	}
743	return
744}
745
746// GenerateReservationDetailsReportByBillingProfileIDFuture an abstraction for monitoring and retrieving
747// the results of a long-running operation.
748type GenerateReservationDetailsReportByBillingProfileIDFuture struct {
749	azure.FutureAPI
750	// Result returns the result of the asynchronous operation.
751	// If the operation has not completed it will return an error.
752	Result func(GenerateReservationDetailsReportClient) (OperationStatus, error)
753}
754
755// UnmarshalJSON is the custom unmarshaller for CreateFuture.
756func (future *GenerateReservationDetailsReportByBillingProfileIDFuture) UnmarshalJSON(body []byte) error {
757	var azFuture azure.Future
758	if err := json.Unmarshal(body, &azFuture); err != nil {
759		return err
760	}
761	future.FutureAPI = &azFuture
762	future.Result = future.result
763	return nil
764}
765
766// result is the default implementation for GenerateReservationDetailsReportByBillingProfileIDFuture.Result.
767func (future *GenerateReservationDetailsReportByBillingProfileIDFuture) result(client GenerateReservationDetailsReportClient) (osVar OperationStatus, err error) {
768	var done bool
769	done, err = future.DoneWithContext(context.Background(), client)
770	if err != nil {
771		err = autorest.NewErrorWithError(err, "costmanagement.GenerateReservationDetailsReportByBillingProfileIDFuture", "Result", future.Response(), "Polling failure")
772		return
773	}
774	if !done {
775		osVar.Response.Response = future.Response()
776		err = azure.NewAsyncOpIncompleteError("costmanagement.GenerateReservationDetailsReportByBillingProfileIDFuture")
777		return
778	}
779	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
780	if osVar.Response.Response, err = future.GetResult(sender); err == nil && osVar.Response.Response.StatusCode != http.StatusNoContent {
781		osVar, err = client.ByBillingProfileIDResponder(osVar.Response.Response)
782		if err != nil {
783			err = autorest.NewErrorWithError(err, "costmanagement.GenerateReservationDetailsReportByBillingProfileIDFuture", "Result", osVar.Response.Response, "Failure responding to request")
784		}
785	}
786	return
787}
788
789// KpiProperties each KPI must contain a 'type' and 'enabled' key.
790type KpiProperties struct {
791	// Type - KPI type (Forecast, Budget). Possible values include: 'KpiTypeTypeForecast', 'KpiTypeTypeBudget'
792	Type KpiTypeType `json:"type,omitempty"`
793	// ID - ID of resource related to metric (budget).
794	ID *string `json:"id,omitempty"`
795	// Enabled - show the KPI in the UI?
796	Enabled *bool `json:"enabled,omitempty"`
797}
798
799// Operation a Cost management REST API operation.
800type Operation struct {
801	// Name - READ-ONLY; Operation name: {provider}/{resource}/{operation}.
802	Name *string `json:"name,omitempty"`
803	// Display - The object that represents the operation.
804	Display *OperationDisplay `json:"display,omitempty"`
805}
806
807// MarshalJSON is the custom marshaler for Operation.
808func (o Operation) MarshalJSON() ([]byte, error) {
809	objectMap := make(map[string]interface{})
810	if o.Display != nil {
811		objectMap["display"] = o.Display
812	}
813	return json.Marshal(objectMap)
814}
815
816// OperationDisplay the object that represents the operation.
817type OperationDisplay struct {
818	// Provider - READ-ONLY; Service provider: Microsoft.CostManagement.
819	Provider *string `json:"provider,omitempty"`
820	// Resource - READ-ONLY; Resource on which the operation is performed: Dimensions, Query.
821	Resource *string `json:"resource,omitempty"`
822	// Operation - READ-ONLY; Operation type: Read, write, delete, etc.
823	Operation *string `json:"operation,omitempty"`
824}
825
826// MarshalJSON is the custom marshaler for OperationDisplay.
827func (o OperationDisplay) MarshalJSON() ([]byte, error) {
828	objectMap := make(map[string]interface{})
829	return json.Marshal(objectMap)
830}
831
832// OperationListResult result of listing cost management operations. It contains a list of operations and a
833// URL link to get the next set of results.
834type OperationListResult struct {
835	autorest.Response `json:"-"`
836	// Value - READ-ONLY; List of cost management operations supported by the Microsoft.CostManagement resource provider.
837	Value *[]Operation `json:"value,omitempty"`
838	// NextLink - READ-ONLY; URL to get the next set of operation list results if there are any.
839	NextLink *string `json:"nextLink,omitempty"`
840}
841
842// MarshalJSON is the custom marshaler for OperationListResult.
843func (olr OperationListResult) MarshalJSON() ([]byte, error) {
844	objectMap := make(map[string]interface{})
845	return json.Marshal(objectMap)
846}
847
848// OperationListResultIterator provides access to a complete listing of Operation values.
849type OperationListResultIterator struct {
850	i    int
851	page OperationListResultPage
852}
853
854// NextWithContext advances to the next value.  If there was an error making
855// the request the iterator does not advance and the error is returned.
856func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) {
857	if tracing.IsEnabled() {
858		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext")
859		defer func() {
860			sc := -1
861			if iter.Response().Response.Response != nil {
862				sc = iter.Response().Response.Response.StatusCode
863			}
864			tracing.EndSpan(ctx, sc, err)
865		}()
866	}
867	iter.i++
868	if iter.i < len(iter.page.Values()) {
869		return nil
870	}
871	err = iter.page.NextWithContext(ctx)
872	if err != nil {
873		iter.i--
874		return err
875	}
876	iter.i = 0
877	return nil
878}
879
880// Next advances to the next value.  If there was an error making
881// the request the iterator does not advance and the error is returned.
882// Deprecated: Use NextWithContext() instead.
883func (iter *OperationListResultIterator) Next() error {
884	return iter.NextWithContext(context.Background())
885}
886
887// NotDone returns true if the enumeration should be started or is not yet complete.
888func (iter OperationListResultIterator) NotDone() bool {
889	return iter.page.NotDone() && iter.i < len(iter.page.Values())
890}
891
892// Response returns the raw server response from the last page request.
893func (iter OperationListResultIterator) Response() OperationListResult {
894	return iter.page.Response()
895}
896
897// Value returns the current value or a zero-initialized value if the
898// iterator has advanced beyond the end of the collection.
899func (iter OperationListResultIterator) Value() Operation {
900	if !iter.page.NotDone() {
901		return Operation{}
902	}
903	return iter.page.Values()[iter.i]
904}
905
906// Creates a new instance of the OperationListResultIterator type.
907func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator {
908	return OperationListResultIterator{page: page}
909}
910
911// IsEmpty returns true if the ListResult contains no values.
912func (olr OperationListResult) IsEmpty() bool {
913	return olr.Value == nil || len(*olr.Value) == 0
914}
915
916// hasNextLink returns true if the NextLink is not empty.
917func (olr OperationListResult) hasNextLink() bool {
918	return olr.NextLink != nil && len(*olr.NextLink) != 0
919}
920
921// operationListResultPreparer prepares a request to retrieve the next set of results.
922// It returns nil if no more results exist.
923func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) {
924	if !olr.hasNextLink() {
925		return nil, nil
926	}
927	return autorest.Prepare((&http.Request{}).WithContext(ctx),
928		autorest.AsJSON(),
929		autorest.AsGet(),
930		autorest.WithBaseURL(to.String(olr.NextLink)))
931}
932
933// OperationListResultPage contains a page of Operation values.
934type OperationListResultPage struct {
935	fn  func(context.Context, OperationListResult) (OperationListResult, error)
936	olr OperationListResult
937}
938
939// NextWithContext advances to the next page of values.  If there was an error making
940// the request the page does not advance and the error is returned.
941func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) {
942	if tracing.IsEnabled() {
943		ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext")
944		defer func() {
945			sc := -1
946			if page.Response().Response.Response != nil {
947				sc = page.Response().Response.Response.StatusCode
948			}
949			tracing.EndSpan(ctx, sc, err)
950		}()
951	}
952	for {
953		next, err := page.fn(ctx, page.olr)
954		if err != nil {
955			return err
956		}
957		page.olr = next
958		if !next.hasNextLink() || !next.IsEmpty() {
959			break
960		}
961	}
962	return nil
963}
964
965// Next advances to the next page of values.  If there was an error making
966// the request the page does not advance and the error is returned.
967// Deprecated: Use NextWithContext() instead.
968func (page *OperationListResultPage) Next() error {
969	return page.NextWithContext(context.Background())
970}
971
972// NotDone returns true if the page enumeration should be started or is not yet complete.
973func (page OperationListResultPage) NotDone() bool {
974	return !page.olr.IsEmpty()
975}
976
977// Response returns the raw server response from the last page request.
978func (page OperationListResultPage) Response() OperationListResult {
979	return page.olr
980}
981
982// Values returns the slice of values for the current page or nil if there are no values.
983func (page OperationListResultPage) Values() []Operation {
984	if page.olr.IsEmpty() {
985		return nil
986	}
987	return *page.olr.Value
988}
989
990// Creates a new instance of the OperationListResultPage type.
991func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage {
992	return OperationListResultPage{
993		fn:  getNextPage,
994		olr: cur,
995	}
996}
997
998// OperationStatus the status of the long running operation.
999type OperationStatus struct {
1000	autorest.Response `json:"-"`
1001	// Status - The status of the long running operation.
1002	Status *Status `json:"status,omitempty"`
1003	// ReportURL - The properties of the resource generated.
1004	*ReportURL `json:"properties,omitempty"`
1005}
1006
1007// MarshalJSON is the custom marshaler for OperationStatus.
1008func (osVar OperationStatus) MarshalJSON() ([]byte, error) {
1009	objectMap := make(map[string]interface{})
1010	if osVar.Status != nil {
1011		objectMap["status"] = osVar.Status
1012	}
1013	if osVar.ReportURL != nil {
1014		objectMap["properties"] = osVar.ReportURL
1015	}
1016	return json.Marshal(objectMap)
1017}
1018
1019// UnmarshalJSON is the custom unmarshaler for OperationStatus struct.
1020func (osVar *OperationStatus) UnmarshalJSON(body []byte) error {
1021	var m map[string]*json.RawMessage
1022	err := json.Unmarshal(body, &m)
1023	if err != nil {
1024		return err
1025	}
1026	for k, v := range m {
1027		switch k {
1028		case "status":
1029			if v != nil {
1030				var status Status
1031				err = json.Unmarshal(*v, &status)
1032				if err != nil {
1033					return err
1034				}
1035				osVar.Status = &status
1036			}
1037		case "properties":
1038			if v != nil {
1039				var reportURL ReportURL
1040				err = json.Unmarshal(*v, &reportURL)
1041				if err != nil {
1042					return err
1043				}
1044				osVar.ReportURL = &reportURL
1045			}
1046		}
1047	}
1048
1049	return nil
1050}
1051
1052// PivotProperties each pivot must contain a 'type' and 'name'.
1053type PivotProperties struct {
1054	// Type - Data type to show in view. Possible values include: 'PivotTypeTypeDimension', 'PivotTypeTypeTagKey'
1055	Type PivotTypeType `json:"type,omitempty"`
1056	// Name - Data field to show in view.
1057	Name *string `json:"name,omitempty"`
1058}
1059
1060// ProxyResource the Resource model definition.
1061type ProxyResource struct {
1062	// ID - READ-ONLY; Resource Id.
1063	ID *string `json:"id,omitempty"`
1064	// Name - READ-ONLY; Resource name.
1065	Name *string `json:"name,omitempty"`
1066	// Type - READ-ONLY; Resource type.
1067	Type *string `json:"type,omitempty"`
1068	// ETag - eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.
1069	ETag *string `json:"eTag,omitempty"`
1070}
1071
1072// MarshalJSON is the custom marshaler for ProxyResource.
1073func (pr ProxyResource) MarshalJSON() ([]byte, error) {
1074	objectMap := make(map[string]interface{})
1075	if pr.ETag != nil {
1076		objectMap["eTag"] = pr.ETag
1077	}
1078	return json.Marshal(objectMap)
1079}
1080
1081// ProxySettingResource the Resource model definition.
1082type ProxySettingResource struct {
1083	// ID - READ-ONLY; Resource Id.
1084	ID *string `json:"id,omitempty"`
1085	// Name - READ-ONLY; Resource name.
1086	Name *string `json:"name,omitempty"`
1087	// Kind - READ-ONLY; Resource kind.
1088	Kind *string `json:"kind,omitempty"`
1089	// Type - READ-ONLY; Resource type.
1090	Type *string `json:"type,omitempty"`
1091}
1092
1093// MarshalJSON is the custom marshaler for ProxySettingResource.
1094func (psr ProxySettingResource) MarshalJSON() ([]byte, error) {
1095	objectMap := make(map[string]interface{})
1096	return json.Marshal(objectMap)
1097}
1098
1099// QueryAggregation the aggregation expression to be used in the query.
1100type QueryAggregation struct {
1101	// Name - The name of the column to aggregate.
1102	Name *string `json:"name,omitempty"`
1103	// Function - The name of the aggregation function to use. Possible values include: 'FunctionTypeAvg', 'FunctionTypeMax', 'FunctionTypeMin', 'FunctionTypeSum'
1104	Function FunctionType `json:"function,omitempty"`
1105}
1106
1107// QueryColumn ...
1108type QueryColumn struct {
1109	// Name - The name of column.
1110	Name *string `json:"name,omitempty"`
1111	// Type - The type of column.
1112	Type *string `json:"type,omitempty"`
1113}
1114
1115// QueryComparisonExpression the comparison expression to be used in the query.
1116type QueryComparisonExpression struct {
1117	// Name - The name of the column to use in comparison.
1118	Name *string `json:"name,omitempty"`
1119	// Operator - The operator to use for comparison.
1120	Operator *string `json:"operator,omitempty"`
1121	// Values - Array of values to use for comparison
1122	Values *[]string `json:"values,omitempty"`
1123}
1124
1125// QueryDataset the definition of data present in the query.
1126type QueryDataset struct {
1127	// Granularity - The granularity of rows in the query. Possible values include: 'GranularityTypeDaily'
1128	Granularity GranularityType `json:"granularity,omitempty"`
1129	// Configuration - Has configuration information for the data in the export. The configuration will be ignored if aggregation and grouping are provided.
1130	Configuration *QueryDatasetConfiguration `json:"configuration,omitempty"`
1131	// Aggregation - Dictionary of aggregation expression to use in the query. The key of each item in the dictionary is the alias for the aggregated column. Query can have up to 2 aggregation clauses.
1132	Aggregation map[string]*QueryAggregation `json:"aggregation"`
1133	// Grouping - Array of group by expression to use in the query. Query can have up to 2 group by clauses.
1134	Grouping *[]QueryGrouping `json:"grouping,omitempty"`
1135	// Filter - The filter expression to use in the query. Please reference our Query API REST documentation for how to properly format the filter.
1136	Filter *QueryFilter `json:"filter,omitempty"`
1137}
1138
1139// MarshalJSON is the custom marshaler for QueryDataset.
1140func (qd QueryDataset) MarshalJSON() ([]byte, error) {
1141	objectMap := make(map[string]interface{})
1142	if qd.Granularity != "" {
1143		objectMap["granularity"] = qd.Granularity
1144	}
1145	if qd.Configuration != nil {
1146		objectMap["configuration"] = qd.Configuration
1147	}
1148	if qd.Aggregation != nil {
1149		objectMap["aggregation"] = qd.Aggregation
1150	}
1151	if qd.Grouping != nil {
1152		objectMap["grouping"] = qd.Grouping
1153	}
1154	if qd.Filter != nil {
1155		objectMap["filter"] = qd.Filter
1156	}
1157	return json.Marshal(objectMap)
1158}
1159
1160// QueryDatasetConfiguration the configuration of dataset in the query.
1161type QueryDatasetConfiguration struct {
1162	// Columns - Array of column names to be included in the query. Any valid query column name is allowed. If not provided, then query includes all columns.
1163	Columns *[]string `json:"columns,omitempty"`
1164}
1165
1166// QueryDefinition the definition of a query.
1167type QueryDefinition struct {
1168	// Type - The type of the query. Possible values include: 'ExportTypeUsage', 'ExportTypeActualCost', 'ExportTypeAmortizedCost'
1169	Type ExportType `json:"type,omitempty"`
1170	// Timeframe - The time frame for pulling data for the query. If custom, then a specific time period must be provided. Possible values include: 'TimeframeTypeMonthToDate', 'TimeframeTypeBillingMonthToDate', 'TimeframeTypeTheLastMonth', 'TimeframeTypeTheLastBillingMonth', 'TimeframeTypeWeekToDate', 'TimeframeTypeCustom'
1171	Timeframe TimeframeType `json:"timeframe,omitempty"`
1172	// TimePeriod - Has time period for pulling data for the query.
1173	TimePeriod *QueryTimePeriod `json:"timePeriod,omitempty"`
1174	// Dataset - Has definition for data in this query.
1175	Dataset *QueryDataset `json:"dataset,omitempty"`
1176}
1177
1178// QueryFilter the filter expression to be used in the export.
1179type QueryFilter struct {
1180	// And - The logical "AND" expression. Must have at least 2 items.
1181	And *[]QueryFilter `json:"and,omitempty"`
1182	// Or - The logical "OR" expression. Must have at least 2 items.
1183	Or *[]QueryFilter `json:"or,omitempty"`
1184	// Dimensions - Has comparison expression for a dimension
1185	Dimensions *QueryComparisonExpression `json:"dimensions,omitempty"`
1186	// Tags - Has comparison expression for a tag
1187	Tags *QueryComparisonExpression `json:"tags,omitempty"`
1188}
1189
1190// QueryGrouping the group by expression to be used in the query.
1191type QueryGrouping struct {
1192	// Type - Has type of the column to group. Possible values include: 'QueryColumnTypeTag', 'QueryColumnTypeDimension'
1193	Type QueryColumnType `json:"type,omitempty"`
1194	// Name - The name of the column to group.
1195	Name *string `json:"name,omitempty"`
1196}
1197
1198// QueryProperties ...
1199type QueryProperties struct {
1200	// NextLink - The link (url) to the next page of results.
1201	NextLink *string `json:"nextLink,omitempty"`
1202	// Columns - Array of columns
1203	Columns *[]QueryColumn `json:"columns,omitempty"`
1204	// Rows - Array of rows
1205	Rows *[][]interface{} `json:"rows,omitempty"`
1206}
1207
1208// QueryResult result of query. It contains all columns listed under groupings and aggregation.
1209type QueryResult struct {
1210	autorest.Response `json:"-"`
1211	// ETag - eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.
1212	ETag *string `json:"eTag,omitempty"`
1213	// Location - READ-ONLY; Resource location
1214	Location *string `json:"location,omitempty"`
1215	// Sku - READ-ONLY; Resource SKU
1216	Sku              *string `json:"sku,omitempty"`
1217	*QueryProperties `json:"properties,omitempty"`
1218	// ID - READ-ONLY; Resource Id.
1219	ID *string `json:"id,omitempty"`
1220	// Name - READ-ONLY; Resource name.
1221	Name *string `json:"name,omitempty"`
1222	// Type - READ-ONLY; Resource type.
1223	Type *string `json:"type,omitempty"`
1224	// Tags - READ-ONLY; Resource tags.
1225	Tags map[string]*string `json:"tags"`
1226}
1227
1228// MarshalJSON is the custom marshaler for QueryResult.
1229func (qr QueryResult) MarshalJSON() ([]byte, error) {
1230	objectMap := make(map[string]interface{})
1231	if qr.ETag != nil {
1232		objectMap["eTag"] = qr.ETag
1233	}
1234	if qr.QueryProperties != nil {
1235		objectMap["properties"] = qr.QueryProperties
1236	}
1237	return json.Marshal(objectMap)
1238}
1239
1240// UnmarshalJSON is the custom unmarshaler for QueryResult struct.
1241func (qr *QueryResult) UnmarshalJSON(body []byte) error {
1242	var m map[string]*json.RawMessage
1243	err := json.Unmarshal(body, &m)
1244	if err != nil {
1245		return err
1246	}
1247	for k, v := range m {
1248		switch k {
1249		case "eTag":
1250			if v != nil {
1251				var eTag string
1252				err = json.Unmarshal(*v, &eTag)
1253				if err != nil {
1254					return err
1255				}
1256				qr.ETag = &eTag
1257			}
1258		case "location":
1259			if v != nil {
1260				var location string
1261				err = json.Unmarshal(*v, &location)
1262				if err != nil {
1263					return err
1264				}
1265				qr.Location = &location
1266			}
1267		case "sku":
1268			if v != nil {
1269				var sku string
1270				err = json.Unmarshal(*v, &sku)
1271				if err != nil {
1272					return err
1273				}
1274				qr.Sku = &sku
1275			}
1276		case "properties":
1277			if v != nil {
1278				var queryProperties QueryProperties
1279				err = json.Unmarshal(*v, &queryProperties)
1280				if err != nil {
1281					return err
1282				}
1283				qr.QueryProperties = &queryProperties
1284			}
1285		case "id":
1286			if v != nil {
1287				var ID string
1288				err = json.Unmarshal(*v, &ID)
1289				if err != nil {
1290					return err
1291				}
1292				qr.ID = &ID
1293			}
1294		case "name":
1295			if v != nil {
1296				var name string
1297				err = json.Unmarshal(*v, &name)
1298				if err != nil {
1299					return err
1300				}
1301				qr.Name = &name
1302			}
1303		case "type":
1304			if v != nil {
1305				var typeVar string
1306				err = json.Unmarshal(*v, &typeVar)
1307				if err != nil {
1308					return err
1309				}
1310				qr.Type = &typeVar
1311			}
1312		case "tags":
1313			if v != nil {
1314				var tags map[string]*string
1315				err = json.Unmarshal(*v, &tags)
1316				if err != nil {
1317					return err
1318				}
1319				qr.Tags = tags
1320			}
1321		}
1322	}
1323
1324	return nil
1325}
1326
1327// QueryTimePeriod the start and end date for pulling data for the query.
1328type QueryTimePeriod struct {
1329	// From - The start date to pull data from.
1330	From *date.Time `json:"from,omitempty"`
1331	// To - The end date to pull data to.
1332	To *date.Time `json:"to,omitempty"`
1333}
1334
1335// ReportConfigAggregation the aggregation expression to be used in the report.
1336type ReportConfigAggregation struct {
1337	// Name - The name of the column to aggregate.
1338	Name *string `json:"name,omitempty"`
1339	// Function - The name of the aggregation function to use. Possible values include: 'FunctionTypeAvg', 'FunctionTypeMax', 'FunctionTypeMin', 'FunctionTypeSum'
1340	Function FunctionType `json:"function,omitempty"`
1341}
1342
1343// ReportConfigComparisonExpression the comparison expression to be used in the report.
1344type ReportConfigComparisonExpression struct {
1345	// Name - The name of the column to use in comparison.
1346	Name *string `json:"name,omitempty"`
1347	// Operator - The operator to use for comparison. Possible values include: 'OperatorTypeIn', 'OperatorTypeContains'
1348	Operator OperatorType `json:"operator,omitempty"`
1349	// Values - Array of values to use for comparison
1350	Values *[]string `json:"values,omitempty"`
1351}
1352
1353// ReportConfigDataset the definition of data present in the report.
1354type ReportConfigDataset struct {
1355	// Granularity - The granularity of rows in the report. Possible values include: 'ReportGranularityTypeDaily', 'ReportGranularityTypeMonthly'
1356	Granularity ReportGranularityType `json:"granularity,omitempty"`
1357	// Configuration - Has configuration information for the data in the report. The configuration will be ignored if aggregation and grouping are provided.
1358	Configuration *ReportConfigDatasetConfiguration `json:"configuration,omitempty"`
1359	// Aggregation - Dictionary of aggregation expression to use in the report. The key of each item in the dictionary is the alias for the aggregated column. Report can have up to 2 aggregation clauses.
1360	Aggregation map[string]*ReportConfigAggregation `json:"aggregation"`
1361	// Grouping - Array of group by expression to use in the report. Report can have up to 2 group by clauses.
1362	Grouping *[]ReportConfigGrouping `json:"grouping,omitempty"`
1363	// Sorting - Array of order by expression to use in the report.
1364	Sorting *[]ReportConfigSorting `json:"sorting,omitempty"`
1365	// Filter - Has filter expression to use in the report.
1366	Filter *ReportConfigFilter `json:"filter,omitempty"`
1367}
1368
1369// MarshalJSON is the custom marshaler for ReportConfigDataset.
1370func (rcd ReportConfigDataset) MarshalJSON() ([]byte, error) {
1371	objectMap := make(map[string]interface{})
1372	if rcd.Granularity != "" {
1373		objectMap["granularity"] = rcd.Granularity
1374	}
1375	if rcd.Configuration != nil {
1376		objectMap["configuration"] = rcd.Configuration
1377	}
1378	if rcd.Aggregation != nil {
1379		objectMap["aggregation"] = rcd.Aggregation
1380	}
1381	if rcd.Grouping != nil {
1382		objectMap["grouping"] = rcd.Grouping
1383	}
1384	if rcd.Sorting != nil {
1385		objectMap["sorting"] = rcd.Sorting
1386	}
1387	if rcd.Filter != nil {
1388		objectMap["filter"] = rcd.Filter
1389	}
1390	return json.Marshal(objectMap)
1391}
1392
1393// ReportConfigDatasetConfiguration the configuration of dataset in the report.
1394type ReportConfigDatasetConfiguration struct {
1395	// Columns - Array of column names to be included in the report. Any valid report column name is allowed. If not provided, then report includes all columns.
1396	Columns *[]string `json:"columns,omitempty"`
1397}
1398
1399// ReportConfigDefinition the definition of a report config.
1400type ReportConfigDefinition struct {
1401	// Type - The type of the report. Usage represents actual usage, forecast represents forecasted data and UsageAndForecast represents both usage and forecasted data. Actual usage and forecasted data can be differentiated based on dates.
1402	Type *string `json:"type,omitempty"`
1403	// Timeframe - The time frame for pulling data for the report. If custom, then a specific time period must be provided. Possible values include: 'ReportTimeframeTypeWeekToDate', 'ReportTimeframeTypeMonthToDate', 'ReportTimeframeTypeYearToDate', 'ReportTimeframeTypeCustom'
1404	Timeframe ReportTimeframeType `json:"timeframe,omitempty"`
1405	// TimePeriod - Has time period for pulling data for the report.
1406	TimePeriod *ReportConfigTimePeriod `json:"timePeriod,omitempty"`
1407	// DataSet - Has definition for data in this report config.
1408	DataSet *ReportConfigDataset `json:"dataSet,omitempty"`
1409	// IncludeMonetaryCommitment - READ-ONLY; Include monetary commitment
1410	IncludeMonetaryCommitment *bool `json:"includeMonetaryCommitment,omitempty"`
1411}
1412
1413// MarshalJSON is the custom marshaler for ReportConfigDefinition.
1414func (rcd ReportConfigDefinition) MarshalJSON() ([]byte, error) {
1415	objectMap := make(map[string]interface{})
1416	if rcd.Type != nil {
1417		objectMap["type"] = rcd.Type
1418	}
1419	if rcd.Timeframe != "" {
1420		objectMap["timeframe"] = rcd.Timeframe
1421	}
1422	if rcd.TimePeriod != nil {
1423		objectMap["timePeriod"] = rcd.TimePeriod
1424	}
1425	if rcd.DataSet != nil {
1426		objectMap["dataSet"] = rcd.DataSet
1427	}
1428	return json.Marshal(objectMap)
1429}
1430
1431// ReportConfigFilter the filter expression to be used in the report.
1432type ReportConfigFilter struct {
1433	// And - The logical "AND" expression. Must have at least 2 items.
1434	And *[]ReportConfigFilter `json:"and,omitempty"`
1435	// Or - The logical "OR" expression. Must have at least 2 items.
1436	Or *[]ReportConfigFilter `json:"or,omitempty"`
1437	// Dimensions - Has comparison expression for a dimension
1438	Dimensions *ReportConfigComparisonExpression `json:"dimensions,omitempty"`
1439	// Tags - Has comparison expression for a tag
1440	Tags *ReportConfigComparisonExpression `json:"tags,omitempty"`
1441	// TagKey - Has comparison expression for a tag key
1442	TagKey *ReportConfigComparisonExpression `json:"tagKey,omitempty"`
1443	// TagValue - Has comparison expression for a tag value
1444	TagValue *ReportConfigComparisonExpression `json:"tagValue,omitempty"`
1445}
1446
1447// ReportConfigGrouping the group by expression to be used in the report.
1448type ReportConfigGrouping struct {
1449	// Type - Has type of the column to group. Possible values include: 'ReportConfigColumnTypeTag', 'ReportConfigColumnTypeDimension'
1450	Type ReportConfigColumnType `json:"type,omitempty"`
1451	// Name - The name of the column to group. This version supports subscription lowest possible grain.
1452	Name *string `json:"name,omitempty"`
1453}
1454
1455// ReportConfigSorting the order by expression to be used in the report.
1456type ReportConfigSorting struct {
1457	// Direction - Direction of sort. Possible values include: 'DirectionAscending', 'DirectionDescending'
1458	Direction Direction `json:"direction,omitempty"`
1459	// Name - The name of the column to sort.
1460	Name *string `json:"name,omitempty"`
1461}
1462
1463// ReportConfigTimePeriod the start and end date for pulling data for the report.
1464type ReportConfigTimePeriod struct {
1465	// From - The start date to pull data from.
1466	From *date.Time `json:"from,omitempty"`
1467	// To - The end date to pull data to.
1468	To *date.Time `json:"to,omitempty"`
1469}
1470
1471// ReportURL the URL to download the generated report.
1472type ReportURL struct {
1473	// ReportURL - The URL to download the generated report.
1474	ReportURL *string `json:"reportUrl,omitempty"`
1475	// ValidUntil - The time at which report URL becomes invalid.
1476	ValidUntil *date.Time `json:"validUntil,omitempty"`
1477}
1478
1479// Resource the Resource model definition.
1480type Resource struct {
1481	// ID - READ-ONLY; Resource Id.
1482	ID *string `json:"id,omitempty"`
1483	// Name - READ-ONLY; Resource name.
1484	Name *string `json:"name,omitempty"`
1485	// Type - READ-ONLY; Resource type.
1486	Type *string `json:"type,omitempty"`
1487	// Tags - READ-ONLY; Resource tags.
1488	Tags map[string]*string `json:"tags"`
1489}
1490
1491// MarshalJSON is the custom marshaler for Resource.
1492func (r Resource) MarshalJSON() ([]byte, error) {
1493	objectMap := make(map[string]interface{})
1494	return json.Marshal(objectMap)
1495}
1496
1497// Setting state of the myscope setting.
1498type Setting struct {
1499	autorest.Response   `json:"-"`
1500	*SettingsProperties `json:"properties,omitempty"`
1501	// ID - READ-ONLY; Resource Id.
1502	ID *string `json:"id,omitempty"`
1503	// Name - READ-ONLY; Resource name.
1504	Name *string `json:"name,omitempty"`
1505	// Kind - READ-ONLY; Resource kind.
1506	Kind *string `json:"kind,omitempty"`
1507	// Type - READ-ONLY; Resource type.
1508	Type *string `json:"type,omitempty"`
1509}
1510
1511// MarshalJSON is the custom marshaler for Setting.
1512func (s Setting) MarshalJSON() ([]byte, error) {
1513	objectMap := make(map[string]interface{})
1514	if s.SettingsProperties != nil {
1515		objectMap["properties"] = s.SettingsProperties
1516	}
1517	return json.Marshal(objectMap)
1518}
1519
1520// UnmarshalJSON is the custom unmarshaler for Setting struct.
1521func (s *Setting) UnmarshalJSON(body []byte) error {
1522	var m map[string]*json.RawMessage
1523	err := json.Unmarshal(body, &m)
1524	if err != nil {
1525		return err
1526	}
1527	for k, v := range m {
1528		switch k {
1529		case "properties":
1530			if v != nil {
1531				var settingsProperties SettingsProperties
1532				err = json.Unmarshal(*v, &settingsProperties)
1533				if err != nil {
1534					return err
1535				}
1536				s.SettingsProperties = &settingsProperties
1537			}
1538		case "id":
1539			if v != nil {
1540				var ID string
1541				err = json.Unmarshal(*v, &ID)
1542				if err != nil {
1543					return err
1544				}
1545				s.ID = &ID
1546			}
1547		case "name":
1548			if v != nil {
1549				var name string
1550				err = json.Unmarshal(*v, &name)
1551				if err != nil {
1552					return err
1553				}
1554				s.Name = &name
1555			}
1556		case "kind":
1557			if v != nil {
1558				var kind string
1559				err = json.Unmarshal(*v, &kind)
1560				if err != nil {
1561					return err
1562				}
1563				s.Kind = &kind
1564			}
1565		case "type":
1566			if v != nil {
1567				var typeVar string
1568				err = json.Unmarshal(*v, &typeVar)
1569				if err != nil {
1570					return err
1571				}
1572				s.Type = &typeVar
1573			}
1574		}
1575	}
1576
1577	return nil
1578}
1579
1580// SettingsListResult result of listing settings. It contains a list of available settings.
1581type SettingsListResult struct {
1582	autorest.Response `json:"-"`
1583	// Value - READ-ONLY; The list of settings.
1584	Value *[]Setting `json:"value,omitempty"`
1585	// NextLink - READ-ONLY; The link (url) to the next page of results.
1586	NextLink *string `json:"nextLink,omitempty"`
1587}
1588
1589// MarshalJSON is the custom marshaler for SettingsListResult.
1590func (slr SettingsListResult) MarshalJSON() ([]byte, error) {
1591	objectMap := make(map[string]interface{})
1592	return json.Marshal(objectMap)
1593}
1594
1595// SettingsListResultIterator provides access to a complete listing of Setting values.
1596type SettingsListResultIterator struct {
1597	i    int
1598	page SettingsListResultPage
1599}
1600
1601// NextWithContext advances to the next value.  If there was an error making
1602// the request the iterator does not advance and the error is returned.
1603func (iter *SettingsListResultIterator) NextWithContext(ctx context.Context) (err error) {
1604	if tracing.IsEnabled() {
1605		ctx = tracing.StartSpan(ctx, fqdn+"/SettingsListResultIterator.NextWithContext")
1606		defer func() {
1607			sc := -1
1608			if iter.Response().Response.Response != nil {
1609				sc = iter.Response().Response.Response.StatusCode
1610			}
1611			tracing.EndSpan(ctx, sc, err)
1612		}()
1613	}
1614	iter.i++
1615	if iter.i < len(iter.page.Values()) {
1616		return nil
1617	}
1618	err = iter.page.NextWithContext(ctx)
1619	if err != nil {
1620		iter.i--
1621		return err
1622	}
1623	iter.i = 0
1624	return nil
1625}
1626
1627// Next advances to the next value.  If there was an error making
1628// the request the iterator does not advance and the error is returned.
1629// Deprecated: Use NextWithContext() instead.
1630func (iter *SettingsListResultIterator) Next() error {
1631	return iter.NextWithContext(context.Background())
1632}
1633
1634// NotDone returns true if the enumeration should be started or is not yet complete.
1635func (iter SettingsListResultIterator) NotDone() bool {
1636	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1637}
1638
1639// Response returns the raw server response from the last page request.
1640func (iter SettingsListResultIterator) Response() SettingsListResult {
1641	return iter.page.Response()
1642}
1643
1644// Value returns the current value or a zero-initialized value if the
1645// iterator has advanced beyond the end of the collection.
1646func (iter SettingsListResultIterator) Value() Setting {
1647	if !iter.page.NotDone() {
1648		return Setting{}
1649	}
1650	return iter.page.Values()[iter.i]
1651}
1652
1653// Creates a new instance of the SettingsListResultIterator type.
1654func NewSettingsListResultIterator(page SettingsListResultPage) SettingsListResultIterator {
1655	return SettingsListResultIterator{page: page}
1656}
1657
1658// IsEmpty returns true if the ListResult contains no values.
1659func (slr SettingsListResult) IsEmpty() bool {
1660	return slr.Value == nil || len(*slr.Value) == 0
1661}
1662
1663// hasNextLink returns true if the NextLink is not empty.
1664func (slr SettingsListResult) hasNextLink() bool {
1665	return slr.NextLink != nil && len(*slr.NextLink) != 0
1666}
1667
1668// settingsListResultPreparer prepares a request to retrieve the next set of results.
1669// It returns nil if no more results exist.
1670func (slr SettingsListResult) settingsListResultPreparer(ctx context.Context) (*http.Request, error) {
1671	if !slr.hasNextLink() {
1672		return nil, nil
1673	}
1674	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1675		autorest.AsJSON(),
1676		autorest.AsGet(),
1677		autorest.WithBaseURL(to.String(slr.NextLink)))
1678}
1679
1680// SettingsListResultPage contains a page of Setting values.
1681type SettingsListResultPage struct {
1682	fn  func(context.Context, SettingsListResult) (SettingsListResult, error)
1683	slr SettingsListResult
1684}
1685
1686// NextWithContext advances to the next page of values.  If there was an error making
1687// the request the page does not advance and the error is returned.
1688func (page *SettingsListResultPage) NextWithContext(ctx context.Context) (err error) {
1689	if tracing.IsEnabled() {
1690		ctx = tracing.StartSpan(ctx, fqdn+"/SettingsListResultPage.NextWithContext")
1691		defer func() {
1692			sc := -1
1693			if page.Response().Response.Response != nil {
1694				sc = page.Response().Response.Response.StatusCode
1695			}
1696			tracing.EndSpan(ctx, sc, err)
1697		}()
1698	}
1699	for {
1700		next, err := page.fn(ctx, page.slr)
1701		if err != nil {
1702			return err
1703		}
1704		page.slr = next
1705		if !next.hasNextLink() || !next.IsEmpty() {
1706			break
1707		}
1708	}
1709	return nil
1710}
1711
1712// Next advances to the next page of values.  If there was an error making
1713// the request the page does not advance and the error is returned.
1714// Deprecated: Use NextWithContext() instead.
1715func (page *SettingsListResultPage) Next() error {
1716	return page.NextWithContext(context.Background())
1717}
1718
1719// NotDone returns true if the page enumeration should be started or is not yet complete.
1720func (page SettingsListResultPage) NotDone() bool {
1721	return !page.slr.IsEmpty()
1722}
1723
1724// Response returns the raw server response from the last page request.
1725func (page SettingsListResultPage) Response() SettingsListResult {
1726	return page.slr
1727}
1728
1729// Values returns the slice of values for the current page or nil if there are no values.
1730func (page SettingsListResultPage) Values() []Setting {
1731	if page.slr.IsEmpty() {
1732		return nil
1733	}
1734	return *page.slr.Value
1735}
1736
1737// Creates a new instance of the SettingsListResultPage type.
1738func NewSettingsListResultPage(cur SettingsListResult, getNextPage func(context.Context, SettingsListResult) (SettingsListResult, error)) SettingsListResultPage {
1739	return SettingsListResultPage{
1740		fn:  getNextPage,
1741		slr: cur,
1742	}
1743}
1744
1745// SettingsProperties the properties of the setting.
1746type SettingsProperties struct {
1747	// Scope - Sets the default scope the current user will see when they sign into Azure Cost Management in the Azure portal.
1748	Scope *string `json:"scope,omitempty"`
1749	// StartOn - Indicates what scope Cost Management in the Azure portal should default to. Allowed values: LastUsed. Possible values include: 'StartOnLastUsed', 'StartOnScopePicker', 'StartOnSpecificScope'
1750	StartOn StartOn      `json:"startOn,omitempty"`
1751	Cache   *[]CacheItem `json:"cache,omitempty"`
1752}
1753
1754// Status the status of the long running operation.
1755type Status struct {
1756	// Status - The status of the long running operation. Possible values include: 'OperationStatusTypeRunning', 'OperationStatusTypeCompleted', 'OperationStatusTypeFailed'
1757	Status OperationStatusType `json:"status,omitempty"`
1758}
1759
1760// View states and configurations of Cost Analysis.
1761type View struct {
1762	autorest.Response `json:"-"`
1763	*ViewProperties   `json:"properties,omitempty"`
1764	// ID - READ-ONLY; Resource Id.
1765	ID *string `json:"id,omitempty"`
1766	// Name - READ-ONLY; Resource name.
1767	Name *string `json:"name,omitempty"`
1768	// Type - READ-ONLY; Resource type.
1769	Type *string `json:"type,omitempty"`
1770	// ETag - eTag of the resource. To handle concurrent update scenario, this field will be used to determine whether the user is updating the latest version or not.
1771	ETag *string `json:"eTag,omitempty"`
1772}
1773
1774// MarshalJSON is the custom marshaler for View.
1775func (vVar View) MarshalJSON() ([]byte, error) {
1776	objectMap := make(map[string]interface{})
1777	if vVar.ViewProperties != nil {
1778		objectMap["properties"] = vVar.ViewProperties
1779	}
1780	if vVar.ETag != nil {
1781		objectMap["eTag"] = vVar.ETag
1782	}
1783	return json.Marshal(objectMap)
1784}
1785
1786// UnmarshalJSON is the custom unmarshaler for View struct.
1787func (vVar *View) UnmarshalJSON(body []byte) error {
1788	var m map[string]*json.RawMessage
1789	err := json.Unmarshal(body, &m)
1790	if err != nil {
1791		return err
1792	}
1793	for k, v := range m {
1794		switch k {
1795		case "properties":
1796			if v != nil {
1797				var viewProperties ViewProperties
1798				err = json.Unmarshal(*v, &viewProperties)
1799				if err != nil {
1800					return err
1801				}
1802				vVar.ViewProperties = &viewProperties
1803			}
1804		case "id":
1805			if v != nil {
1806				var ID string
1807				err = json.Unmarshal(*v, &ID)
1808				if err != nil {
1809					return err
1810				}
1811				vVar.ID = &ID
1812			}
1813		case "name":
1814			if v != nil {
1815				var name string
1816				err = json.Unmarshal(*v, &name)
1817				if err != nil {
1818					return err
1819				}
1820				vVar.Name = &name
1821			}
1822		case "type":
1823			if v != nil {
1824				var typeVar string
1825				err = json.Unmarshal(*v, &typeVar)
1826				if err != nil {
1827					return err
1828				}
1829				vVar.Type = &typeVar
1830			}
1831		case "eTag":
1832			if v != nil {
1833				var eTag string
1834				err = json.Unmarshal(*v, &eTag)
1835				if err != nil {
1836					return err
1837				}
1838				vVar.ETag = &eTag
1839			}
1840		}
1841	}
1842
1843	return nil
1844}
1845
1846// ViewListResult result of listing views. It contains a list of available views.
1847type ViewListResult struct {
1848	autorest.Response `json:"-"`
1849	// Value - READ-ONLY; The list of views.
1850	Value *[]View `json:"value,omitempty"`
1851	// NextLink - READ-ONLY; The link (url) to the next page of results.
1852	NextLink *string `json:"nextLink,omitempty"`
1853}
1854
1855// MarshalJSON is the custom marshaler for ViewListResult.
1856func (vlr ViewListResult) MarshalJSON() ([]byte, error) {
1857	objectMap := make(map[string]interface{})
1858	return json.Marshal(objectMap)
1859}
1860
1861// ViewListResultIterator provides access to a complete listing of View values.
1862type ViewListResultIterator struct {
1863	i    int
1864	page ViewListResultPage
1865}
1866
1867// NextWithContext advances to the next value.  If there was an error making
1868// the request the iterator does not advance and the error is returned.
1869func (iter *ViewListResultIterator) NextWithContext(ctx context.Context) (err error) {
1870	if tracing.IsEnabled() {
1871		ctx = tracing.StartSpan(ctx, fqdn+"/ViewListResultIterator.NextWithContext")
1872		defer func() {
1873			sc := -1
1874			if iter.Response().Response.Response != nil {
1875				sc = iter.Response().Response.Response.StatusCode
1876			}
1877			tracing.EndSpan(ctx, sc, err)
1878		}()
1879	}
1880	iter.i++
1881	if iter.i < len(iter.page.Values()) {
1882		return nil
1883	}
1884	err = iter.page.NextWithContext(ctx)
1885	if err != nil {
1886		iter.i--
1887		return err
1888	}
1889	iter.i = 0
1890	return nil
1891}
1892
1893// Next advances to the next value.  If there was an error making
1894// the request the iterator does not advance and the error is returned.
1895// Deprecated: Use NextWithContext() instead.
1896func (iter *ViewListResultIterator) Next() error {
1897	return iter.NextWithContext(context.Background())
1898}
1899
1900// NotDone returns true if the enumeration should be started or is not yet complete.
1901func (iter ViewListResultIterator) NotDone() bool {
1902	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1903}
1904
1905// Response returns the raw server response from the last page request.
1906func (iter ViewListResultIterator) Response() ViewListResult {
1907	return iter.page.Response()
1908}
1909
1910// Value returns the current value or a zero-initialized value if the
1911// iterator has advanced beyond the end of the collection.
1912func (iter ViewListResultIterator) Value() View {
1913	if !iter.page.NotDone() {
1914		return View{}
1915	}
1916	return iter.page.Values()[iter.i]
1917}
1918
1919// Creates a new instance of the ViewListResultIterator type.
1920func NewViewListResultIterator(page ViewListResultPage) ViewListResultIterator {
1921	return ViewListResultIterator{page: page}
1922}
1923
1924// IsEmpty returns true if the ListResult contains no values.
1925func (vlr ViewListResult) IsEmpty() bool {
1926	return vlr.Value == nil || len(*vlr.Value) == 0
1927}
1928
1929// hasNextLink returns true if the NextLink is not empty.
1930func (vlr ViewListResult) hasNextLink() bool {
1931	return vlr.NextLink != nil && len(*vlr.NextLink) != 0
1932}
1933
1934// viewListResultPreparer prepares a request to retrieve the next set of results.
1935// It returns nil if no more results exist.
1936func (vlr ViewListResult) viewListResultPreparer(ctx context.Context) (*http.Request, error) {
1937	if !vlr.hasNextLink() {
1938		return nil, nil
1939	}
1940	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1941		autorest.AsJSON(),
1942		autorest.AsGet(),
1943		autorest.WithBaseURL(to.String(vlr.NextLink)))
1944}
1945
1946// ViewListResultPage contains a page of View values.
1947type ViewListResultPage struct {
1948	fn  func(context.Context, ViewListResult) (ViewListResult, error)
1949	vlr ViewListResult
1950}
1951
1952// NextWithContext advances to the next page of values.  If there was an error making
1953// the request the page does not advance and the error is returned.
1954func (page *ViewListResultPage) NextWithContext(ctx context.Context) (err error) {
1955	if tracing.IsEnabled() {
1956		ctx = tracing.StartSpan(ctx, fqdn+"/ViewListResultPage.NextWithContext")
1957		defer func() {
1958			sc := -1
1959			if page.Response().Response.Response != nil {
1960				sc = page.Response().Response.Response.StatusCode
1961			}
1962			tracing.EndSpan(ctx, sc, err)
1963		}()
1964	}
1965	for {
1966		next, err := page.fn(ctx, page.vlr)
1967		if err != nil {
1968			return err
1969		}
1970		page.vlr = next
1971		if !next.hasNextLink() || !next.IsEmpty() {
1972			break
1973		}
1974	}
1975	return nil
1976}
1977
1978// Next advances to the next page of values.  If there was an error making
1979// the request the page does not advance and the error is returned.
1980// Deprecated: Use NextWithContext() instead.
1981func (page *ViewListResultPage) Next() error {
1982	return page.NextWithContext(context.Background())
1983}
1984
1985// NotDone returns true if the page enumeration should be started or is not yet complete.
1986func (page ViewListResultPage) NotDone() bool {
1987	return !page.vlr.IsEmpty()
1988}
1989
1990// Response returns the raw server response from the last page request.
1991func (page ViewListResultPage) Response() ViewListResult {
1992	return page.vlr
1993}
1994
1995// Values returns the slice of values for the current page or nil if there are no values.
1996func (page ViewListResultPage) Values() []View {
1997	if page.vlr.IsEmpty() {
1998		return nil
1999	}
2000	return *page.vlr.Value
2001}
2002
2003// Creates a new instance of the ViewListResultPage type.
2004func NewViewListResultPage(cur ViewListResult, getNextPage func(context.Context, ViewListResult) (ViewListResult, error)) ViewListResultPage {
2005	return ViewListResultPage{
2006		fn:  getNextPage,
2007		vlr: cur,
2008	}
2009}
2010
2011// ViewProperties the properties of the view.
2012type ViewProperties struct {
2013	// DisplayName - User input name of the view. Required.
2014	DisplayName *string `json:"displayName,omitempty"`
2015	// Scope - Cost Management scope to save the view on. This includes 'subscriptions/{subscriptionId}' for subscription scope, 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}' for resourceGroup scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}' for Billing Account scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/departments/{departmentId}' for Department scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/enrollmentAccounts/{enrollmentAccountId}' for EnrollmentAccount scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}' for BillingProfile scope, 'providers/Microsoft.Billing/billingAccounts/{billingAccountId}/invoiceSections/{invoiceSectionId}' for InvoiceSection scope, 'providers/Microsoft.Management/managementGroups/{managementGroupId}' for Management Group scope, '/providers/Microsoft.CostManagement/externalBillingAccounts/{externalBillingAccountName}' for ExternalBillingAccount scope, and '/providers/Microsoft.CostManagement/externalSubscriptions/{externalSubscriptionName}' for ExternalSubscription scope.
2016	Scope *string `json:"scope,omitempty"`
2017	// CreatedOn - READ-ONLY; Date the user created this view.
2018	CreatedOn *date.Time `json:"createdOn,omitempty"`
2019	// ModifiedOn - READ-ONLY; Date when the user last modified this view.
2020	ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
2021	// DateRange - READ-ONLY; Selected date range for viewing cost in.
2022	DateRange *string `json:"dateRange,omitempty"`
2023	// Currency - READ-ONLY; Selected currency.
2024	Currency *string `json:"currency,omitempty"`
2025	// ReportConfigDefinition - Query body configuration. Required.
2026	*ReportConfigDefinition `json:"query,omitempty"`
2027	// Chart - Chart type of the main view in Cost Analysis. Required. Possible values include: 'ChartTypeArea', 'ChartTypeLine', 'ChartTypeStackedColumn', 'ChartTypeGroupedColumn', 'ChartTypeTable'
2028	Chart ChartType `json:"chart,omitempty"`
2029	// Accumulated - Show costs accumulated over time. Possible values include: 'AccumulatedTypeTrue', 'AccumulatedTypeFalse'
2030	Accumulated AccumulatedType `json:"accumulated,omitempty"`
2031	// Metric - Metric to use when displaying costs. Possible values include: 'MetricTypeActualCost', 'MetricTypeAmortizedCost', 'MetricTypeAHUB'
2032	Metric MetricType `json:"metric,omitempty"`
2033	// Kpis - List of KPIs to show in Cost Analysis UI.
2034	Kpis *[]KpiProperties `json:"kpis,omitempty"`
2035	// Pivots - Configuration of 3 sub-views in the Cost Analysis UI.
2036	Pivots *[]PivotProperties `json:"pivots,omitempty"`
2037}
2038
2039// MarshalJSON is the custom marshaler for ViewProperties.
2040func (vp ViewProperties) MarshalJSON() ([]byte, error) {
2041	objectMap := make(map[string]interface{})
2042	if vp.DisplayName != nil {
2043		objectMap["displayName"] = vp.DisplayName
2044	}
2045	if vp.Scope != nil {
2046		objectMap["scope"] = vp.Scope
2047	}
2048	if vp.ReportConfigDefinition != nil {
2049		objectMap["query"] = vp.ReportConfigDefinition
2050	}
2051	if vp.Chart != "" {
2052		objectMap["chart"] = vp.Chart
2053	}
2054	if vp.Accumulated != "" {
2055		objectMap["accumulated"] = vp.Accumulated
2056	}
2057	if vp.Metric != "" {
2058		objectMap["metric"] = vp.Metric
2059	}
2060	if vp.Kpis != nil {
2061		objectMap["kpis"] = vp.Kpis
2062	}
2063	if vp.Pivots != nil {
2064		objectMap["pivots"] = vp.Pivots
2065	}
2066	return json.Marshal(objectMap)
2067}
2068
2069// UnmarshalJSON is the custom unmarshaler for ViewProperties struct.
2070func (vp *ViewProperties) UnmarshalJSON(body []byte) error {
2071	var m map[string]*json.RawMessage
2072	err := json.Unmarshal(body, &m)
2073	if err != nil {
2074		return err
2075	}
2076	for k, v := range m {
2077		switch k {
2078		case "displayName":
2079			if v != nil {
2080				var displayName string
2081				err = json.Unmarshal(*v, &displayName)
2082				if err != nil {
2083					return err
2084				}
2085				vp.DisplayName = &displayName
2086			}
2087		case "scope":
2088			if v != nil {
2089				var scope string
2090				err = json.Unmarshal(*v, &scope)
2091				if err != nil {
2092					return err
2093				}
2094				vp.Scope = &scope
2095			}
2096		case "createdOn":
2097			if v != nil {
2098				var createdOn date.Time
2099				err = json.Unmarshal(*v, &createdOn)
2100				if err != nil {
2101					return err
2102				}
2103				vp.CreatedOn = &createdOn
2104			}
2105		case "modifiedOn":
2106			if v != nil {
2107				var modifiedOn date.Time
2108				err = json.Unmarshal(*v, &modifiedOn)
2109				if err != nil {
2110					return err
2111				}
2112				vp.ModifiedOn = &modifiedOn
2113			}
2114		case "dateRange":
2115			if v != nil {
2116				var dateRange string
2117				err = json.Unmarshal(*v, &dateRange)
2118				if err != nil {
2119					return err
2120				}
2121				vp.DateRange = &dateRange
2122			}
2123		case "currency":
2124			if v != nil {
2125				var currency string
2126				err = json.Unmarshal(*v, &currency)
2127				if err != nil {
2128					return err
2129				}
2130				vp.Currency = &currency
2131			}
2132		case "query":
2133			if v != nil {
2134				var reportConfigDefinition ReportConfigDefinition
2135				err = json.Unmarshal(*v, &reportConfigDefinition)
2136				if err != nil {
2137					return err
2138				}
2139				vp.ReportConfigDefinition = &reportConfigDefinition
2140			}
2141		case "chart":
2142			if v != nil {
2143				var chart ChartType
2144				err = json.Unmarshal(*v, &chart)
2145				if err != nil {
2146					return err
2147				}
2148				vp.Chart = chart
2149			}
2150		case "accumulated":
2151			if v != nil {
2152				var accumulated AccumulatedType
2153				err = json.Unmarshal(*v, &accumulated)
2154				if err != nil {
2155					return err
2156				}
2157				vp.Accumulated = accumulated
2158			}
2159		case "metric":
2160			if v != nil {
2161				var metric MetricType
2162				err = json.Unmarshal(*v, &metric)
2163				if err != nil {
2164					return err
2165				}
2166				vp.Metric = metric
2167			}
2168		case "kpis":
2169			if v != nil {
2170				var kpis []KpiProperties
2171				err = json.Unmarshal(*v, &kpis)
2172				if err != nil {
2173					return err
2174				}
2175				vp.Kpis = &kpis
2176			}
2177		case "pivots":
2178			if v != nil {
2179				var pivots []PivotProperties
2180				err = json.Unmarshal(*v, &pivots)
2181				if err != nil {
2182					return err
2183				}
2184				vp.Pivots = &pivots
2185			}
2186		}
2187	}
2188
2189	return nil
2190}
2191