1package commitmentplans
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	"encoding/json"
22	"github.com/Azure/go-autorest/autorest"
23	"github.com/Azure/go-autorest/autorest/date"
24	"github.com/Azure/go-autorest/autorest/to"
25	"net/http"
26)
27
28// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
29// ResourceSkuRestrictionsReasonCode enumerates the values for resource sku restrictions reason code.
30type ResourceSkuRestrictionsReasonCode string
31
32const (
33	// NotAvailableForSubscription ...
34	NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription"
35	// QuotaID ...
36	QuotaID ResourceSkuRestrictionsReasonCode = "QuotaId"
37)
38
39// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
40// PossibleResourceSkuRestrictionsReasonCodeValues returns an array of possible values for the ResourceSkuRestrictionsReasonCode const type.
41func PossibleResourceSkuRestrictionsReasonCodeValues() []ResourceSkuRestrictionsReasonCode {
42	return []ResourceSkuRestrictionsReasonCode{NotAvailableForSubscription, QuotaID}
43}
44
45// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
46// ResourceSkuRestrictionsType enumerates the values for resource sku restrictions type.
47type ResourceSkuRestrictionsType string
48
49const (
50	// Location ...
51	Location ResourceSkuRestrictionsType = "location"
52	// Zone ...
53	Zone ResourceSkuRestrictionsType = "zone"
54)
55
56// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
57// PossibleResourceSkuRestrictionsTypeValues returns an array of possible values for the ResourceSkuRestrictionsType const type.
58func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType {
59	return []ResourceSkuRestrictionsType{Location, Zone}
60}
61
62// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
63// SkuCapacityScaleType enumerates the values for sku capacity scale type.
64type SkuCapacityScaleType string
65
66const (
67	// Automatic ...
68	Automatic SkuCapacityScaleType = "Automatic"
69	// Manual ...
70	Manual SkuCapacityScaleType = "Manual"
71	// None ...
72	None SkuCapacityScaleType = "None"
73)
74
75// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
76// PossibleSkuCapacityScaleTypeValues returns an array of possible values for the SkuCapacityScaleType const type.
77func PossibleSkuCapacityScaleTypeValues() []SkuCapacityScaleType {
78	return []SkuCapacityScaleType{Automatic, Manual, None}
79}
80
81// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
82// CatalogSku details of a commitment plan SKU.
83type CatalogSku struct {
84	// ResourceType - Resource type name
85	ResourceType *string `json:"resourceType,omitempty"`
86	// Name - SKU name
87	Name *string `json:"name,omitempty"`
88	// Tier - SKU tier
89	Tier *string `json:"tier,omitempty"`
90	// Locations - Regions where the SKU is available.
91	Locations *[]string `json:"locations,omitempty"`
92	// Capacity - SKU scaling information
93	Capacity *SkuCapacity `json:"capacity,omitempty"`
94	// Capabilities - The capability information for the specified SKU.
95	Capabilities *[]SkuCapability `json:"capabilities,omitempty"`
96	// Costs - The cost information for the specified SKU.
97	Costs *[]SkuCost `json:"costs,omitempty"`
98	// Restrictions - Restrictions which would prevent a SKU from being used. This is empty if there are no restrictions.
99	Restrictions *[]SkuRestrictions `json:"restrictions,omitempty"`
100}
101
102// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
103// CommitmentAssociation represents the association between a commitment plan and some other resource, such as a
104// Machine Learning web service.
105type CommitmentAssociation struct {
106	autorest.Response `json:"-"`
107	// Etag - An entity tag used to enforce optimistic concurrency.
108	Etag *string `json:"etag,omitempty"`
109	// Properties - The properties of the commitment association resource.
110	Properties *CommitmentAssociationProperties `json:"properties,omitempty"`
111	// ID - Resource Id.
112	ID *string `json:"id,omitempty"`
113	// Name - Resource name.
114	Name *string `json:"name,omitempty"`
115	// Location - Resource location.
116	Location *string `json:"location,omitempty"`
117	// Type - Resource type.
118	Type *string `json:"type,omitempty"`
119	// Tags - User-defined tags for the resource.
120	Tags map[string]*string `json:"tags"`
121}
122
123// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
124// MarshalJSON is the custom marshaler for CommitmentAssociation.
125func (ca CommitmentAssociation) MarshalJSON() ([]byte, error) {
126	objectMap := make(map[string]interface{})
127	if ca.Etag != nil {
128		objectMap["etag"] = ca.Etag
129	}
130	if ca.Properties != nil {
131		objectMap["properties"] = ca.Properties
132	}
133	if ca.ID != nil {
134		objectMap["id"] = ca.ID
135	}
136	if ca.Name != nil {
137		objectMap["name"] = ca.Name
138	}
139	if ca.Location != nil {
140		objectMap["location"] = ca.Location
141	}
142	if ca.Type != nil {
143		objectMap["type"] = ca.Type
144	}
145	if ca.Tags != nil {
146		objectMap["tags"] = ca.Tags
147	}
148	return json.Marshal(objectMap)
149}
150
151// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
152// CommitmentAssociationListResult a page of commitment association resources.
153type CommitmentAssociationListResult struct {
154	autorest.Response `json:"-"`
155	// NextLink - A URI to retrieve the next page of results.
156	NextLink *string `json:"nextLink,omitempty"`
157	// Value - The set of results for this page.
158	Value *[]CommitmentAssociation `json:"value,omitempty"`
159}
160
161// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
162// CommitmentAssociationListResultIterator provides access to a complete listing of CommitmentAssociation values.
163type CommitmentAssociationListResultIterator struct {
164	i    int
165	page CommitmentAssociationListResultPage
166}
167
168// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
169// Next advances to the next value.  If there was an error making
170// the request the iterator does not advance and the error is returned.
171func (iter *CommitmentAssociationListResultIterator) Next() error {
172	iter.i++
173	if iter.i < len(iter.page.Values()) {
174		return nil
175	}
176	err := iter.page.Next()
177	if err != nil {
178		iter.i--
179		return err
180	}
181	iter.i = 0
182	return nil
183}
184
185// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
186// NotDone returns true if the enumeration should be started or is not yet complete.
187func (iter CommitmentAssociationListResultIterator) NotDone() bool {
188	return iter.page.NotDone() && iter.i < len(iter.page.Values())
189}
190
191// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
192// Response returns the raw server response from the last page request.
193func (iter CommitmentAssociationListResultIterator) Response() CommitmentAssociationListResult {
194	return iter.page.Response()
195}
196
197// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
198// Value returns the current value or a zero-initialized value if the
199// iterator has advanced beyond the end of the collection.
200func (iter CommitmentAssociationListResultIterator) Value() CommitmentAssociation {
201	if !iter.page.NotDone() {
202		return CommitmentAssociation{}
203	}
204	return iter.page.Values()[iter.i]
205}
206
207// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
208// IsEmpty returns true if the ListResult contains no values.
209func (calr CommitmentAssociationListResult) IsEmpty() bool {
210	return calr.Value == nil || len(*calr.Value) == 0
211}
212
213// commitmentAssociationListResultPreparer prepares a request to retrieve the next set of results.
214// It returns nil if no more results exist.
215func (calr CommitmentAssociationListResult) commitmentAssociationListResultPreparer() (*http.Request, error) {
216	if calr.NextLink == nil || len(to.String(calr.NextLink)) < 1 {
217		return nil, nil
218	}
219	return autorest.Prepare(&http.Request{},
220		autorest.AsJSON(),
221		autorest.AsGet(),
222		autorest.WithBaseURL(to.String(calr.NextLink)))
223}
224
225// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
226// CommitmentAssociationListResultPage contains a page of CommitmentAssociation values.
227type CommitmentAssociationListResultPage struct {
228	fn   func(CommitmentAssociationListResult) (CommitmentAssociationListResult, error)
229	calr CommitmentAssociationListResult
230}
231
232// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
233// Next advances to the next page of values.  If there was an error making
234// the request the page does not advance and the error is returned.
235func (page *CommitmentAssociationListResultPage) Next() error {
236	next, err := page.fn(page.calr)
237	if err != nil {
238		return err
239	}
240	page.calr = next
241	return nil
242}
243
244// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
245// NotDone returns true if the page enumeration should be started or is not yet complete.
246func (page CommitmentAssociationListResultPage) NotDone() bool {
247	return !page.calr.IsEmpty()
248}
249
250// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
251// Response returns the raw server response from the last page request.
252func (page CommitmentAssociationListResultPage) Response() CommitmentAssociationListResult {
253	return page.calr
254}
255
256// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
257// Values returns the slice of values for the current page or nil if there are no values.
258func (page CommitmentAssociationListResultPage) Values() []CommitmentAssociation {
259	if page.calr.IsEmpty() {
260		return nil
261	}
262	return *page.calr.Value
263}
264
265// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
266// CommitmentAssociationProperties properties of an Azure ML commitment association.
267type CommitmentAssociationProperties struct {
268	// AssociatedResourceID - The ID of the resource this association points to, such as the ARM ID of an Azure ML web service.
269	AssociatedResourceID *string `json:"associatedResourceId,omitempty"`
270	// CommitmentPlanID - The ARM ID of the parent Azure ML commitment plan.
271	CommitmentPlanID *string `json:"commitmentPlanId,omitempty"`
272	// CreationDate - The date at which this commitment association was created, in ISO 8601 format.
273	CreationDate *date.Time `json:"creationDate,omitempty"`
274}
275
276// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
277// CommitmentPlan an Azure ML commitment plan resource.
278type CommitmentPlan struct {
279	autorest.Response `json:"-"`
280	// Etag - An entity tag used to enforce optimistic concurrency.
281	Etag *string `json:"etag,omitempty"`
282	// Properties - The commitment plan properties.
283	Properties *Properties `json:"properties,omitempty"`
284	// Sku - The commitment plan SKU.
285	Sku *ResourceSku `json:"sku,omitempty"`
286	// ID - Resource Id.
287	ID *string `json:"id,omitempty"`
288	// Name - Resource name.
289	Name *string `json:"name,omitempty"`
290	// Location - Resource location.
291	Location *string `json:"location,omitempty"`
292	// Type - Resource type.
293	Type *string `json:"type,omitempty"`
294	// Tags - User-defined tags for the resource.
295	Tags map[string]*string `json:"tags"`
296}
297
298// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
299// MarshalJSON is the custom marshaler for CommitmentPlan.
300func (cp CommitmentPlan) MarshalJSON() ([]byte, error) {
301	objectMap := make(map[string]interface{})
302	if cp.Etag != nil {
303		objectMap["etag"] = cp.Etag
304	}
305	if cp.Properties != nil {
306		objectMap["properties"] = cp.Properties
307	}
308	if cp.Sku != nil {
309		objectMap["sku"] = cp.Sku
310	}
311	if cp.ID != nil {
312		objectMap["id"] = cp.ID
313	}
314	if cp.Name != nil {
315		objectMap["name"] = cp.Name
316	}
317	if cp.Location != nil {
318		objectMap["location"] = cp.Location
319	}
320	if cp.Type != nil {
321		objectMap["type"] = cp.Type
322	}
323	if cp.Tags != nil {
324		objectMap["tags"] = cp.Tags
325	}
326	return json.Marshal(objectMap)
327}
328
329// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
330// ListResult a page of commitment plan resources.
331type ListResult struct {
332	autorest.Response `json:"-"`
333	// NextLink - A URI to retrieve the next page of results.
334	NextLink *string `json:"nextLink,omitempty"`
335	// Value - The set of results for this page.
336	Value *[]CommitmentPlan `json:"value,omitempty"`
337}
338
339// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
340// ListResultIterator provides access to a complete listing of CommitmentPlan values.
341type ListResultIterator struct {
342	i    int
343	page ListResultPage
344}
345
346// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
347// Next advances to the next value.  If there was an error making
348// the request the iterator does not advance and the error is returned.
349func (iter *ListResultIterator) Next() error {
350	iter.i++
351	if iter.i < len(iter.page.Values()) {
352		return nil
353	}
354	err := iter.page.Next()
355	if err != nil {
356		iter.i--
357		return err
358	}
359	iter.i = 0
360	return nil
361}
362
363// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
364// NotDone returns true if the enumeration should be started or is not yet complete.
365func (iter ListResultIterator) NotDone() bool {
366	return iter.page.NotDone() && iter.i < len(iter.page.Values())
367}
368
369// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
370// Response returns the raw server response from the last page request.
371func (iter ListResultIterator) Response() ListResult {
372	return iter.page.Response()
373}
374
375// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
376// Value returns the current value or a zero-initialized value if the
377// iterator has advanced beyond the end of the collection.
378func (iter ListResultIterator) Value() CommitmentPlan {
379	if !iter.page.NotDone() {
380		return CommitmentPlan{}
381	}
382	return iter.page.Values()[iter.i]
383}
384
385// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
386// IsEmpty returns true if the ListResult contains no values.
387func (lr ListResult) IsEmpty() bool {
388	return lr.Value == nil || len(*lr.Value) == 0
389}
390
391// listResultPreparer prepares a request to retrieve the next set of results.
392// It returns nil if no more results exist.
393func (lr ListResult) listResultPreparer() (*http.Request, error) {
394	if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 {
395		return nil, nil
396	}
397	return autorest.Prepare(&http.Request{},
398		autorest.AsJSON(),
399		autorest.AsGet(),
400		autorest.WithBaseURL(to.String(lr.NextLink)))
401}
402
403// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
404// ListResultPage contains a page of CommitmentPlan values.
405type ListResultPage struct {
406	fn func(ListResult) (ListResult, error)
407	lr ListResult
408}
409
410// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
411// Next advances to the next page of values.  If there was an error making
412// the request the page does not advance and the error is returned.
413func (page *ListResultPage) Next() error {
414	next, err := page.fn(page.lr)
415	if err != nil {
416		return err
417	}
418	page.lr = next
419	return nil
420}
421
422// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
423// NotDone returns true if the page enumeration should be started or is not yet complete.
424func (page ListResultPage) NotDone() bool {
425	return !page.lr.IsEmpty()
426}
427
428// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
429// Response returns the raw server response from the last page request.
430func (page ListResultPage) Response() ListResult {
431	return page.lr
432}
433
434// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
435// Values returns the slice of values for the current page or nil if there are no values.
436func (page ListResultPage) Values() []CommitmentPlan {
437	if page.lr.IsEmpty() {
438		return nil
439	}
440	return *page.lr.Value
441}
442
443// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
444// MoveCommitmentAssociationRequest specifies the destination Azure ML commitment plan for a move operation.
445type MoveCommitmentAssociationRequest struct {
446	// DestinationPlanID - The ARM ID of the commitment plan to re-parent the commitment association to.
447	DestinationPlanID *string `json:"destinationPlanId,omitempty"`
448}
449
450// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
451// PatchPayload the properties of a commitment plan which may be updated via PATCH.
452type PatchPayload struct {
453	// Tags - User-defined tags for the commitment plan.
454	Tags map[string]*string `json:"tags"`
455	// Sku - The commitment plan SKU.
456	Sku *ResourceSku `json:"sku,omitempty"`
457}
458
459// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
460// MarshalJSON is the custom marshaler for PatchPayload.
461func (pp PatchPayload) MarshalJSON() ([]byte, error) {
462	objectMap := make(map[string]interface{})
463	if pp.Tags != nil {
464		objectMap["tags"] = pp.Tags
465	}
466	if pp.Sku != nil {
467		objectMap["sku"] = pp.Sku
468	}
469	return json.Marshal(objectMap)
470}
471
472// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
473// PlanQuantity represents the quantity a commitment plan provides of a metered resource.
474type PlanQuantity struct {
475	// Allowance - The quantity added to the commitment plan at an interval specified by its allowance frequency.
476	Allowance *float64 `json:"allowance,omitempty"`
477	// Amount - The quantity available to the plan the last time usage was calculated.
478	Amount *float64 `json:"amount,omitempty"`
479	// IncludedQuantityMeter - The Azure meter for usage against included quantities.
480	IncludedQuantityMeter *string `json:"includedQuantityMeter,omitempty"`
481	// OverageMeter - The Azure meter for usage which exceeds included quantities.
482	OverageMeter *string `json:"overageMeter,omitempty"`
483}
484
485// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
486// PlanUsageHistory represents historical information about usage of the Azure resources associated with a
487// commitment plan.
488type PlanUsageHistory struct {
489	// PlanDeletionOverage - Overage incurred as a result of deleting a commitment plan.
490	PlanDeletionOverage map[string]*float64 `json:"planDeletionOverage"`
491	// PlanMigrationOverage - Overage incurred as a result of migrating a commitment plan from one SKU to another.
492	PlanMigrationOverage map[string]*float64 `json:"planMigrationOverage"`
493	// PlanQuantitiesAfterUsage - Included quantities remaining after usage against the commitment plan's associated resources was calculated.
494	PlanQuantitiesAfterUsage map[string]*float64 `json:"planQuantitiesAfterUsage"`
495	// PlanQuantitiesBeforeUsage - Included quantities remaining before usage against the commitment plan's associated resources was calculated.
496	PlanQuantitiesBeforeUsage map[string]*float64 `json:"planQuantitiesBeforeUsage"`
497	// PlanUsageOverage - Usage against the commitment plan's associated resources which was not covered by included quantities and is therefore overage.
498	PlanUsageOverage map[string]*float64 `json:"planUsageOverage"`
499	// Usage - Usage against the commitment plan's associated resources.
500	Usage map[string]*float64 `json:"usage"`
501	// UsageDate - The date of usage, in ISO 8601 format.
502	UsageDate *date.Time `json:"usageDate,omitempty"`
503}
504
505// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
506// MarshalJSON is the custom marshaler for PlanUsageHistory.
507func (puh PlanUsageHistory) MarshalJSON() ([]byte, error) {
508	objectMap := make(map[string]interface{})
509	if puh.PlanDeletionOverage != nil {
510		objectMap["planDeletionOverage"] = puh.PlanDeletionOverage
511	}
512	if puh.PlanMigrationOverage != nil {
513		objectMap["planMigrationOverage"] = puh.PlanMigrationOverage
514	}
515	if puh.PlanQuantitiesAfterUsage != nil {
516		objectMap["planQuantitiesAfterUsage"] = puh.PlanQuantitiesAfterUsage
517	}
518	if puh.PlanQuantitiesBeforeUsage != nil {
519		objectMap["planQuantitiesBeforeUsage"] = puh.PlanQuantitiesBeforeUsage
520	}
521	if puh.PlanUsageOverage != nil {
522		objectMap["planUsageOverage"] = puh.PlanUsageOverage
523	}
524	if puh.Usage != nil {
525		objectMap["usage"] = puh.Usage
526	}
527	if puh.UsageDate != nil {
528		objectMap["usageDate"] = puh.UsageDate
529	}
530	return json.Marshal(objectMap)
531}
532
533// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
534// PlanUsageHistoryListResult a page of usage history.
535type PlanUsageHistoryListResult struct {
536	autorest.Response `json:"-"`
537	// NextLink - A URI to retrieve the next page of results.
538	NextLink *string `json:"nextLink,omitempty"`
539	// Value - The set of results for this page.
540	Value *[]PlanUsageHistory `json:"value,omitempty"`
541}
542
543// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
544// PlanUsageHistoryListResultIterator provides access to a complete listing of PlanUsageHistory values.
545type PlanUsageHistoryListResultIterator struct {
546	i    int
547	page PlanUsageHistoryListResultPage
548}
549
550// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
551// Next advances to the next value.  If there was an error making
552// the request the iterator does not advance and the error is returned.
553func (iter *PlanUsageHistoryListResultIterator) Next() error {
554	iter.i++
555	if iter.i < len(iter.page.Values()) {
556		return nil
557	}
558	err := iter.page.Next()
559	if err != nil {
560		iter.i--
561		return err
562	}
563	iter.i = 0
564	return nil
565}
566
567// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
568// NotDone returns true if the enumeration should be started or is not yet complete.
569func (iter PlanUsageHistoryListResultIterator) NotDone() bool {
570	return iter.page.NotDone() && iter.i < len(iter.page.Values())
571}
572
573// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
574// Response returns the raw server response from the last page request.
575func (iter PlanUsageHistoryListResultIterator) Response() PlanUsageHistoryListResult {
576	return iter.page.Response()
577}
578
579// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
580// Value returns the current value or a zero-initialized value if the
581// iterator has advanced beyond the end of the collection.
582func (iter PlanUsageHistoryListResultIterator) Value() PlanUsageHistory {
583	if !iter.page.NotDone() {
584		return PlanUsageHistory{}
585	}
586	return iter.page.Values()[iter.i]
587}
588
589// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
590// IsEmpty returns true if the ListResult contains no values.
591func (puhlr PlanUsageHistoryListResult) IsEmpty() bool {
592	return puhlr.Value == nil || len(*puhlr.Value) == 0
593}
594
595// planUsageHistoryListResultPreparer prepares a request to retrieve the next set of results.
596// It returns nil if no more results exist.
597func (puhlr PlanUsageHistoryListResult) planUsageHistoryListResultPreparer() (*http.Request, error) {
598	if puhlr.NextLink == nil || len(to.String(puhlr.NextLink)) < 1 {
599		return nil, nil
600	}
601	return autorest.Prepare(&http.Request{},
602		autorest.AsJSON(),
603		autorest.AsGet(),
604		autorest.WithBaseURL(to.String(puhlr.NextLink)))
605}
606
607// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
608// PlanUsageHistoryListResultPage contains a page of PlanUsageHistory values.
609type PlanUsageHistoryListResultPage struct {
610	fn    func(PlanUsageHistoryListResult) (PlanUsageHistoryListResult, error)
611	puhlr PlanUsageHistoryListResult
612}
613
614// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
615// Next advances to the next page of values.  If there was an error making
616// the request the page does not advance and the error is returned.
617func (page *PlanUsageHistoryListResultPage) Next() error {
618	next, err := page.fn(page.puhlr)
619	if err != nil {
620		return err
621	}
622	page.puhlr = next
623	return nil
624}
625
626// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
627// NotDone returns true if the page enumeration should be started or is not yet complete.
628func (page PlanUsageHistoryListResultPage) NotDone() bool {
629	return !page.puhlr.IsEmpty()
630}
631
632// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
633// Response returns the raw server response from the last page request.
634func (page PlanUsageHistoryListResultPage) Response() PlanUsageHistoryListResult {
635	return page.puhlr
636}
637
638// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
639// Values returns the slice of values for the current page or nil if there are no values.
640func (page PlanUsageHistoryListResultPage) Values() []PlanUsageHistory {
641	if page.puhlr.IsEmpty() {
642		return nil
643	}
644	return *page.puhlr.Value
645}
646
647// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
648// Properties properties of an Azure ML commitment plan.
649type Properties struct {
650	// ChargeForOverage - Indicates whether usage beyond the commitment plan's included quantities will be charged.
651	ChargeForOverage *bool `json:"chargeForOverage,omitempty"`
652	// ChargeForPlan - Indicates whether the commitment plan will incur a charge.
653	ChargeForPlan *bool `json:"chargeForPlan,omitempty"`
654	// CreationDate - The date at which this commitment plan was created, in ISO 8601 format.
655	CreationDate *date.Time `json:"creationDate,omitempty"`
656	// IncludedQuantities - The included resource quantities this plan gives you.
657	IncludedQuantities map[string]*PlanQuantity `json:"includedQuantities"`
658	// MaxAssociationLimit - The maximum number of commitment associations that can be children of this commitment plan.
659	MaxAssociationLimit *int32 `json:"maxAssociationLimit,omitempty"`
660	// MaxCapacityLimit - The maximum scale-out capacity for this commitment plan.
661	MaxCapacityLimit *int32 `json:"maxCapacityLimit,omitempty"`
662	// MinCapacityLimit - The minimum scale-out capacity for this commitment plan.
663	MinCapacityLimit *int32 `json:"minCapacityLimit,omitempty"`
664	// PlanMeter - The Azure meter which will be used to charge for this commitment plan.
665	PlanMeter *string `json:"planMeter,omitempty"`
666	// RefillFrequencyInDays - The frequency at which this commitment plan's included quantities are refilled.
667	RefillFrequencyInDays *int32 `json:"refillFrequencyInDays,omitempty"`
668	// SuspendPlanOnOverage - Indicates whether this commitment plan will be moved into a suspended state if usage goes beyond the commitment plan's included quantities.
669	SuspendPlanOnOverage *bool `json:"suspendPlanOnOverage,omitempty"`
670}
671
672// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
673// MarshalJSON is the custom marshaler for Properties.
674func (p Properties) MarshalJSON() ([]byte, error) {
675	objectMap := make(map[string]interface{})
676	if p.ChargeForOverage != nil {
677		objectMap["chargeForOverage"] = p.ChargeForOverage
678	}
679	if p.ChargeForPlan != nil {
680		objectMap["chargeForPlan"] = p.ChargeForPlan
681	}
682	if p.CreationDate != nil {
683		objectMap["creationDate"] = p.CreationDate
684	}
685	if p.IncludedQuantities != nil {
686		objectMap["includedQuantities"] = p.IncludedQuantities
687	}
688	if p.MaxAssociationLimit != nil {
689		objectMap["maxAssociationLimit"] = p.MaxAssociationLimit
690	}
691	if p.MaxCapacityLimit != nil {
692		objectMap["maxCapacityLimit"] = p.MaxCapacityLimit
693	}
694	if p.MinCapacityLimit != nil {
695		objectMap["minCapacityLimit"] = p.MinCapacityLimit
696	}
697	if p.PlanMeter != nil {
698		objectMap["planMeter"] = p.PlanMeter
699	}
700	if p.RefillFrequencyInDays != nil {
701		objectMap["refillFrequencyInDays"] = p.RefillFrequencyInDays
702	}
703	if p.SuspendPlanOnOverage != nil {
704		objectMap["suspendPlanOnOverage"] = p.SuspendPlanOnOverage
705	}
706	return json.Marshal(objectMap)
707}
708
709// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
710// Resource common properties of an ARM resource.
711type Resource struct {
712	// ID - Resource Id.
713	ID *string `json:"id,omitempty"`
714	// Name - Resource name.
715	Name *string `json:"name,omitempty"`
716	// Location - Resource location.
717	Location *string `json:"location,omitempty"`
718	// Type - Resource type.
719	Type *string `json:"type,omitempty"`
720	// Tags - User-defined tags for the resource.
721	Tags map[string]*string `json:"tags"`
722}
723
724// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
725// MarshalJSON is the custom marshaler for Resource.
726func (r Resource) MarshalJSON() ([]byte, error) {
727	objectMap := make(map[string]interface{})
728	if r.ID != nil {
729		objectMap["id"] = r.ID
730	}
731	if r.Name != nil {
732		objectMap["name"] = r.Name
733	}
734	if r.Location != nil {
735		objectMap["location"] = r.Location
736	}
737	if r.Type != nil {
738		objectMap["type"] = r.Type
739	}
740	if r.Tags != nil {
741		objectMap["tags"] = r.Tags
742	}
743	return json.Marshal(objectMap)
744}
745
746// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
747// ResourceSku the SKU of a resource.
748type ResourceSku struct {
749	// Capacity - The scale-out capacity of the resource. 1 is 1x, 2 is 2x, etc. This impacts the quantities and cost of any commitment plan resource.
750	Capacity *int32 `json:"capacity,omitempty"`
751	// Name - The SKU name. Along with tier, uniquely identifies the SKU.
752	Name *string `json:"name,omitempty"`
753	// Tier - The SKU tier. Along with name, uniquely identifies the SKU.
754	Tier *string `json:"tier,omitempty"`
755}
756
757// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
758// SkuCapability describes The SKU capabilites object.
759type SkuCapability struct {
760	// Name - The capability name.
761	Name *string `json:"name,omitempty"`
762	// Value - The capability value.
763	Value *string `json:"value,omitempty"`
764}
765
766// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
767// SkuCapacity describes scaling information of a SKU.
768type SkuCapacity struct {
769	// Minimum - The minimum capacity.
770	Minimum *int64 `json:"minimum,omitempty"`
771	// Maximum - The maximum capacity that can be set.
772	Maximum *int64 `json:"maximum,omitempty"`
773	// Default - The default capacity.
774	Default *int64 `json:"default,omitempty"`
775	// ScaleType - The scale type applicable to the sku. Possible values include: 'Automatic', 'Manual', 'None'
776	ScaleType SkuCapacityScaleType `json:"scaleType,omitempty"`
777}
778
779// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
780// SkuCost describes metadata for SKU cost info.
781type SkuCost struct {
782	// MeterID - The meter used for this part of a SKU's cost.
783	MeterID *string `json:"meterID,omitempty"`
784	// Quantity - The multiplier for the meter ID.
785	Quantity *int64 `json:"quantity,omitempty"`
786	// ExtendedUnit - The overall duration represented by the quantity.
787	ExtendedUnit *string `json:"extendedUnit,omitempty"`
788}
789
790// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
791// SkuListResult the list of commitment plan SKUs.
792type SkuListResult struct {
793	autorest.Response `json:"-"`
794	Value             *[]CatalogSku `json:"value,omitempty"`
795}
796
797// Deprecated: Please use package github.com/Azure/azure-sdk-for-go/services/preview/machinelearning/mgmt/2016-05-01-preview/commitmentplans instead.
798// SkuRestrictions describes restrictions which would prevent a SKU from being used.
799type SkuRestrictions struct {
800	// Type - The type of restrictions. Possible values include: 'Location', 'Zone'
801	Type ResourceSkuRestrictionsType `json:"type,omitempty"`
802	// Values - The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted.
803	Values *[]string `json:"values,omitempty"`
804	// ReasonCode - The reason for restriction. Possible values include: 'QuotaID', 'NotAvailableForSubscription'
805	ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"`
806}
807