1package machinelearningservices
2
3// Copyright (c) Microsoft Corporation. All rights reserved.
4// Licensed under the MIT License. See License.txt in the project root for license information.
5//
6// Code generated by Microsoft (R) AutoRest Code Generator.
7// Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
9import (
10	"context"
11	"encoding/json"
12	"github.com/Azure/go-autorest/autorest"
13	"github.com/Azure/go-autorest/autorest/azure"
14	"github.com/Azure/go-autorest/autorest/date"
15	"github.com/Azure/go-autorest/autorest/to"
16	"github.com/Azure/go-autorest/tracing"
17	"net/http"
18)
19
20// The package's fully qualified name.
21const fqdn = "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2019-06-01/machinelearningservices"
22
23// AKS a Machine Learning compute based on AKS.
24type AKS struct {
25	// Properties - AKS properties
26	Properties *AKSProperties `json:"properties,omitempty"`
27	// ComputeLocation - Location for the underlying compute
28	ComputeLocation *string `json:"computeLocation,omitempty"`
29	// ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
30	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
31	// Description - The description of the Machine Learning compute.
32	Description *string `json:"description,omitempty"`
33	// CreatedOn - READ-ONLY; The date and time when the compute was created.
34	CreatedOn *date.Time `json:"createdOn,omitempty"`
35	// ModifiedOn - READ-ONLY; The date and time when the compute was last modified.
36	ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
37	// ResourceID - ARM resource id of the underlying compute
38	ResourceID *string `json:"resourceId,omitempty"`
39	// ProvisioningErrors - READ-ONLY; Errors during provisioning
40	ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"`
41	// IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false.
42	IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"`
43	// ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1'
44	ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"`
45}
46
47// MarshalJSON is the custom marshaler for AKS.
48func (a AKS) MarshalJSON() ([]byte, error) {
49	a.ComputeType = ComputeTypeAKS1
50	objectMap := make(map[string]interface{})
51	if a.Properties != nil {
52		objectMap["properties"] = a.Properties
53	}
54	if a.ComputeLocation != nil {
55		objectMap["computeLocation"] = a.ComputeLocation
56	}
57	if a.Description != nil {
58		objectMap["description"] = a.Description
59	}
60	if a.ResourceID != nil {
61		objectMap["resourceId"] = a.ResourceID
62	}
63	if a.ComputeType != "" {
64		objectMap["computeType"] = a.ComputeType
65	}
66	return json.Marshal(objectMap)
67}
68
69// AsAKS is the BasicCompute implementation for AKS.
70func (a AKS) AsAKS() (*AKS, bool) {
71	return &a, true
72}
73
74// AsAmlCompute is the BasicCompute implementation for AKS.
75func (a AKS) AsAmlCompute() (*AmlCompute, bool) {
76	return nil, false
77}
78
79// AsVirtualMachine is the BasicCompute implementation for AKS.
80func (a AKS) AsVirtualMachine() (*VirtualMachine, bool) {
81	return nil, false
82}
83
84// AsHDInsight is the BasicCompute implementation for AKS.
85func (a AKS) AsHDInsight() (*HDInsight, bool) {
86	return nil, false
87}
88
89// AsDataFactory is the BasicCompute implementation for AKS.
90func (a AKS) AsDataFactory() (*DataFactory, bool) {
91	return nil, false
92}
93
94// AsDatabricks is the BasicCompute implementation for AKS.
95func (a AKS) AsDatabricks() (*Databricks, bool) {
96	return nil, false
97}
98
99// AsDataLakeAnalytics is the BasicCompute implementation for AKS.
100func (a AKS) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) {
101	return nil, false
102}
103
104// AsCompute is the BasicCompute implementation for AKS.
105func (a AKS) AsCompute() (*Compute, bool) {
106	return nil, false
107}
108
109// AsBasicCompute is the BasicCompute implementation for AKS.
110func (a AKS) AsBasicCompute() (BasicCompute, bool) {
111	return &a, true
112}
113
114// AksComputeSecrets secrets related to a Machine Learning compute based on AKS.
115type AksComputeSecrets struct {
116	// UserKubeConfig - Content of kubeconfig file that can be used to connect to the Kubernetes cluster.
117	UserKubeConfig *string `json:"userKubeConfig,omitempty"`
118	// AdminKubeConfig - Content of kubeconfig file that can be used to connect to the Kubernetes cluster.
119	AdminKubeConfig *string `json:"adminKubeConfig,omitempty"`
120	// ImagePullSecretName - Image registry pull secret.
121	ImagePullSecretName *string `json:"imagePullSecretName,omitempty"`
122	// ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine', 'ComputeTypeBasicComputeSecretsComputeTypeDatabricks'
123	ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"`
124}
125
126// MarshalJSON is the custom marshaler for AksComputeSecrets.
127func (acs AksComputeSecrets) MarshalJSON() ([]byte, error) {
128	acs.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeAKS
129	objectMap := make(map[string]interface{})
130	if acs.UserKubeConfig != nil {
131		objectMap["userKubeConfig"] = acs.UserKubeConfig
132	}
133	if acs.AdminKubeConfig != nil {
134		objectMap["adminKubeConfig"] = acs.AdminKubeConfig
135	}
136	if acs.ImagePullSecretName != nil {
137		objectMap["imagePullSecretName"] = acs.ImagePullSecretName
138	}
139	if acs.ComputeType != "" {
140		objectMap["computeType"] = acs.ComputeType
141	}
142	return json.Marshal(objectMap)
143}
144
145// AsAksComputeSecrets is the BasicComputeSecrets implementation for AksComputeSecrets.
146func (acs AksComputeSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) {
147	return &acs, true
148}
149
150// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for AksComputeSecrets.
151func (acs AksComputeSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) {
152	return nil, false
153}
154
155// AsDatabricksComputeSecrets is the BasicComputeSecrets implementation for AksComputeSecrets.
156func (acs AksComputeSecrets) AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) {
157	return nil, false
158}
159
160// AsComputeSecrets is the BasicComputeSecrets implementation for AksComputeSecrets.
161func (acs AksComputeSecrets) AsComputeSecrets() (*ComputeSecrets, bool) {
162	return nil, false
163}
164
165// AsBasicComputeSecrets is the BasicComputeSecrets implementation for AksComputeSecrets.
166func (acs AksComputeSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) {
167	return &acs, true
168}
169
170// AksNetworkingConfiguration advance configuration for AKS networking
171type AksNetworkingConfiguration struct {
172	// SubnetID - Virtual network subnet resource ID the compute nodes belong to
173	SubnetID *string `json:"subnetId,omitempty"`
174	// ServiceCidr - A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges.
175	ServiceCidr *string `json:"serviceCidr,omitempty"`
176	// DNSServiceIP - An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr.
177	DNSServiceIP *string `json:"dnsServiceIP,omitempty"`
178	// DockerBridgeCidr - A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range.
179	DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"`
180}
181
182// AKSProperties AKS properties
183type AKSProperties struct {
184	// ClusterFqdn - Cluster full qualified domain name
185	ClusterFqdn *string `json:"clusterFqdn,omitempty"`
186	// SystemServices - READ-ONLY; System services
187	SystemServices *[]SystemService `json:"systemServices,omitempty"`
188	// AgentCount - Number of agents
189	AgentCount *int32 `json:"agentCount,omitempty"`
190	// AgentVMSize - Agent virtual machine size
191	AgentVMSize *string `json:"agentVMSize,omitempty"`
192	// SslConfiguration - SSL configuration
193	SslConfiguration *SslConfiguration `json:"sslConfiguration,omitempty"`
194	// AksNetworkingConfiguration - AKS networking configuration for vnet
195	AksNetworkingConfiguration *AksNetworkingConfiguration `json:"aksNetworkingConfiguration,omitempty"`
196}
197
198// MarshalJSON is the custom marshaler for AKSProperties.
199func (a AKSProperties) MarshalJSON() ([]byte, error) {
200	objectMap := make(map[string]interface{})
201	if a.ClusterFqdn != nil {
202		objectMap["clusterFqdn"] = a.ClusterFqdn
203	}
204	if a.AgentCount != nil {
205		objectMap["agentCount"] = a.AgentCount
206	}
207	if a.AgentVMSize != nil {
208		objectMap["agentVMSize"] = a.AgentVMSize
209	}
210	if a.SslConfiguration != nil {
211		objectMap["sslConfiguration"] = a.SslConfiguration
212	}
213	if a.AksNetworkingConfiguration != nil {
214		objectMap["aksNetworkingConfiguration"] = a.AksNetworkingConfiguration
215	}
216	return json.Marshal(objectMap)
217}
218
219// AmlCompute an Azure Machine Learning compute.
220type AmlCompute struct {
221	// Properties - AML Compute properties
222	Properties *AmlComputeProperties `json:"properties,omitempty"`
223	// ComputeLocation - Location for the underlying compute
224	ComputeLocation *string `json:"computeLocation,omitempty"`
225	// ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
226	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
227	// Description - The description of the Machine Learning compute.
228	Description *string `json:"description,omitempty"`
229	// CreatedOn - READ-ONLY; The date and time when the compute was created.
230	CreatedOn *date.Time `json:"createdOn,omitempty"`
231	// ModifiedOn - READ-ONLY; The date and time when the compute was last modified.
232	ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
233	// ResourceID - ARM resource id of the underlying compute
234	ResourceID *string `json:"resourceId,omitempty"`
235	// ProvisioningErrors - READ-ONLY; Errors during provisioning
236	ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"`
237	// IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false.
238	IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"`
239	// ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1'
240	ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"`
241}
242
243// MarshalJSON is the custom marshaler for AmlCompute.
244func (ac AmlCompute) MarshalJSON() ([]byte, error) {
245	ac.ComputeType = ComputeTypeAmlCompute1
246	objectMap := make(map[string]interface{})
247	if ac.Properties != nil {
248		objectMap["properties"] = ac.Properties
249	}
250	if ac.ComputeLocation != nil {
251		objectMap["computeLocation"] = ac.ComputeLocation
252	}
253	if ac.Description != nil {
254		objectMap["description"] = ac.Description
255	}
256	if ac.ResourceID != nil {
257		objectMap["resourceId"] = ac.ResourceID
258	}
259	if ac.ComputeType != "" {
260		objectMap["computeType"] = ac.ComputeType
261	}
262	return json.Marshal(objectMap)
263}
264
265// AsAKS is the BasicCompute implementation for AmlCompute.
266func (ac AmlCompute) AsAKS() (*AKS, bool) {
267	return nil, false
268}
269
270// AsAmlCompute is the BasicCompute implementation for AmlCompute.
271func (ac AmlCompute) AsAmlCompute() (*AmlCompute, bool) {
272	return &ac, true
273}
274
275// AsVirtualMachine is the BasicCompute implementation for AmlCompute.
276func (ac AmlCompute) AsVirtualMachine() (*VirtualMachine, bool) {
277	return nil, false
278}
279
280// AsHDInsight is the BasicCompute implementation for AmlCompute.
281func (ac AmlCompute) AsHDInsight() (*HDInsight, bool) {
282	return nil, false
283}
284
285// AsDataFactory is the BasicCompute implementation for AmlCompute.
286func (ac AmlCompute) AsDataFactory() (*DataFactory, bool) {
287	return nil, false
288}
289
290// AsDatabricks is the BasicCompute implementation for AmlCompute.
291func (ac AmlCompute) AsDatabricks() (*Databricks, bool) {
292	return nil, false
293}
294
295// AsDataLakeAnalytics is the BasicCompute implementation for AmlCompute.
296func (ac AmlCompute) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) {
297	return nil, false
298}
299
300// AsCompute is the BasicCompute implementation for AmlCompute.
301func (ac AmlCompute) AsCompute() (*Compute, bool) {
302	return nil, false
303}
304
305// AsBasicCompute is the BasicCompute implementation for AmlCompute.
306func (ac AmlCompute) AsBasicCompute() (BasicCompute, bool) {
307	return &ac, true
308}
309
310// AmlComputeNodeInformation compute node information related to a AmlCompute.
311type AmlComputeNodeInformation struct {
312	// NodeID - READ-ONLY; ID of the compute node.
313	NodeID *string `json:"nodeId,omitempty"`
314	// PrivateIPAddress - READ-ONLY; Private IP address of the compute node.
315	PrivateIPAddress *string `json:"privateIpAddress,omitempty"`
316	// PublicIPAddress - READ-ONLY; Public IP address of the compute node.
317	PublicIPAddress *string `json:"publicIpAddress,omitempty"`
318	// Port - READ-ONLY; SSH port number of the node.
319	Port *float64 `json:"port,omitempty"`
320	// NodeState - READ-ONLY; State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted. Possible values include: 'Idle', 'Running', 'Preparing', 'Unusable', 'Leaving', 'Preempted'
321	NodeState NodeState `json:"nodeState,omitempty"`
322	// RunID - READ-ONLY; ID of the Experiment running on the node, if any else null.
323	RunID *string `json:"runId,omitempty"`
324}
325
326// MarshalJSON is the custom marshaler for AmlComputeNodeInformation.
327func (acni AmlComputeNodeInformation) MarshalJSON() ([]byte, error) {
328	objectMap := make(map[string]interface{})
329	return json.Marshal(objectMap)
330}
331
332// AmlComputeNodesInformation compute node information related to a AmlCompute.
333type AmlComputeNodesInformation struct {
334	autorest.Response `json:"-"`
335	// Nodes - READ-ONLY; The collection of returned AmlCompute nodes details.
336	Nodes *[]AmlComputeNodeInformation `json:"nodes,omitempty"`
337	// NextLink - READ-ONLY; The continuation token.
338	NextLink *string `json:"nextLink,omitempty"`
339	// ComputeType - Possible values include: 'ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation', 'ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute'
340	ComputeType ComputeTypeBasicComputeNodesInformation `json:"computeType,omitempty"`
341}
342
343// MarshalJSON is the custom marshaler for AmlComputeNodesInformation.
344func (acni AmlComputeNodesInformation) MarshalJSON() ([]byte, error) {
345	acni.ComputeType = ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute
346	objectMap := make(map[string]interface{})
347	if acni.ComputeType != "" {
348		objectMap["computeType"] = acni.ComputeType
349	}
350	return json.Marshal(objectMap)
351}
352
353// AsAmlComputeNodesInformation is the BasicComputeNodesInformation implementation for AmlComputeNodesInformation.
354func (acni AmlComputeNodesInformation) AsAmlComputeNodesInformation() (*AmlComputeNodesInformation, bool) {
355	return &acni, true
356}
357
358// AsComputeNodesInformation is the BasicComputeNodesInformation implementation for AmlComputeNodesInformation.
359func (acni AmlComputeNodesInformation) AsComputeNodesInformation() (*ComputeNodesInformation, bool) {
360	return nil, false
361}
362
363// AsBasicComputeNodesInformation is the BasicComputeNodesInformation implementation for AmlComputeNodesInformation.
364func (acni AmlComputeNodesInformation) AsBasicComputeNodesInformation() (BasicComputeNodesInformation, bool) {
365	return &acni, true
366}
367
368// AmlComputeProperties AML Compute properties
369type AmlComputeProperties struct {
370	// VMSize - Virtual Machine Size
371	VMSize *string `json:"vmSize,omitempty"`
372	// VMPriority - Virtual Machine priority. Possible values include: 'Dedicated', 'LowPriority'
373	VMPriority VMPriority `json:"vmPriority,omitempty"`
374	// ScaleSettings - Scale settings for AML Compute
375	ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"`
376	// UserAccountCredentials - Credentials for an administrator user account that will be created on each compute node.
377	UserAccountCredentials *UserAccountCredentials `json:"userAccountCredentials,omitempty"`
378	// Subnet - Virtual network subnet resource ID the compute nodes belong to.
379	Subnet *ResourceID `json:"subnet,omitempty"`
380	// RemoteLoginPortPublicAccess - State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be default only during cluster creation time, after creation it will be either enabled or disabled. Possible values include: 'Enabled', 'Disabled', 'NotSpecified'
381	RemoteLoginPortPublicAccess RemoteLoginPortPublicAccess `json:"remoteLoginPortPublicAccess,omitempty"`
382	// AllocationState - READ-ONLY; Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There are no changes to the number of compute nodes in the compute in progress. A compute enters this state when it is created and when no operations are being performed on the compute to change the number of compute nodes. resizing - Indicates that the compute is resizing; that is, compute nodes are being added to or removed from the compute. Possible values include: 'Steady', 'Resizing'
383	AllocationState AllocationState `json:"allocationState,omitempty"`
384	// AllocationStateTransitionTime - READ-ONLY; The time at which the compute entered its current allocation state.
385	AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"`
386	// Errors - READ-ONLY; Collection of errors encountered by various compute nodes during node setup.
387	Errors *[]Error `json:"errors,omitempty"`
388	// CurrentNodeCount - READ-ONLY; The number of compute nodes currently assigned to the compute.
389	CurrentNodeCount *int32 `json:"currentNodeCount,omitempty"`
390	// TargetNodeCount - READ-ONLY; The target number of compute nodes for the compute. If the allocationState is resizing, this property denotes the target node count for the ongoing resize operation. If the allocationState is steady, this property denotes the target node count for the previous resize operation.
391	TargetNodeCount *int32 `json:"targetNodeCount,omitempty"`
392	// NodeStateCounts - READ-ONLY; Counts of various node states on the compute.
393	NodeStateCounts *NodeStateCounts `json:"nodeStateCounts,omitempty"`
394}
395
396// MarshalJSON is the custom marshaler for AmlComputeProperties.
397func (ac AmlComputeProperties) MarshalJSON() ([]byte, error) {
398	objectMap := make(map[string]interface{})
399	if ac.VMSize != nil {
400		objectMap["vmSize"] = ac.VMSize
401	}
402	if ac.VMPriority != "" {
403		objectMap["vmPriority"] = ac.VMPriority
404	}
405	if ac.ScaleSettings != nil {
406		objectMap["scaleSettings"] = ac.ScaleSettings
407	}
408	if ac.UserAccountCredentials != nil {
409		objectMap["userAccountCredentials"] = ac.UserAccountCredentials
410	}
411	if ac.Subnet != nil {
412		objectMap["subnet"] = ac.Subnet
413	}
414	if ac.RemoteLoginPortPublicAccess != "" {
415		objectMap["remoteLoginPortPublicAccess"] = ac.RemoteLoginPortPublicAccess
416	}
417	return json.Marshal(objectMap)
418}
419
420// ClusterUpdateParameters amlCompute update parameters.
421type ClusterUpdateParameters struct {
422	// ClusterUpdateProperties - The properties of the amlCompute.
423	*ClusterUpdateProperties `json:"properties,omitempty"`
424}
425
426// MarshalJSON is the custom marshaler for ClusterUpdateParameters.
427func (cup ClusterUpdateParameters) MarshalJSON() ([]byte, error) {
428	objectMap := make(map[string]interface{})
429	if cup.ClusterUpdateProperties != nil {
430		objectMap["properties"] = cup.ClusterUpdateProperties
431	}
432	return json.Marshal(objectMap)
433}
434
435// UnmarshalJSON is the custom unmarshaler for ClusterUpdateParameters struct.
436func (cup *ClusterUpdateParameters) UnmarshalJSON(body []byte) error {
437	var m map[string]*json.RawMessage
438	err := json.Unmarshal(body, &m)
439	if err != nil {
440		return err
441	}
442	for k, v := range m {
443		switch k {
444		case "properties":
445			if v != nil {
446				var clusterUpdateProperties ClusterUpdateProperties
447				err = json.Unmarshal(*v, &clusterUpdateProperties)
448				if err != nil {
449					return err
450				}
451				cup.ClusterUpdateProperties = &clusterUpdateProperties
452			}
453		}
454	}
455
456	return nil
457}
458
459// ClusterUpdateProperties the properties of a amlCompute that need to be updated.
460type ClusterUpdateProperties struct {
461	// ScaleSettings - Desired scale settings for the amlCompute.
462	ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"`
463}
464
465// BasicCompute machine Learning compute object.
466type BasicCompute interface {
467	AsAKS() (*AKS, bool)
468	AsAmlCompute() (*AmlCompute, bool)
469	AsVirtualMachine() (*VirtualMachine, bool)
470	AsHDInsight() (*HDInsight, bool)
471	AsDataFactory() (*DataFactory, bool)
472	AsDatabricks() (*Databricks, bool)
473	AsDataLakeAnalytics() (*DataLakeAnalytics, bool)
474	AsCompute() (*Compute, bool)
475}
476
477// Compute machine Learning compute object.
478type Compute struct {
479	// ComputeLocation - Location for the underlying compute
480	ComputeLocation *string `json:"computeLocation,omitempty"`
481	// ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
482	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
483	// Description - The description of the Machine Learning compute.
484	Description *string `json:"description,omitempty"`
485	// CreatedOn - READ-ONLY; The date and time when the compute was created.
486	CreatedOn *date.Time `json:"createdOn,omitempty"`
487	// ModifiedOn - READ-ONLY; The date and time when the compute was last modified.
488	ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
489	// ResourceID - ARM resource id of the underlying compute
490	ResourceID *string `json:"resourceId,omitempty"`
491	// ProvisioningErrors - READ-ONLY; Errors during provisioning
492	ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"`
493	// IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false.
494	IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"`
495	// ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1'
496	ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"`
497}
498
499func unmarshalBasicCompute(body []byte) (BasicCompute, error) {
500	var m map[string]interface{}
501	err := json.Unmarshal(body, &m)
502	if err != nil {
503		return nil, err
504	}
505
506	switch m["computeType"] {
507	case string(ComputeTypeAKS1):
508		var a AKS
509		err := json.Unmarshal(body, &a)
510		return a, err
511	case string(ComputeTypeAmlCompute1):
512		var ac AmlCompute
513		err := json.Unmarshal(body, &ac)
514		return ac, err
515	case string(ComputeTypeVirtualMachine1):
516		var VM VirtualMachine
517		err := json.Unmarshal(body, &VM)
518		return VM, err
519	case string(ComputeTypeHDInsight1):
520		var hi HDInsight
521		err := json.Unmarshal(body, &hi)
522		return hi, err
523	case string(ComputeTypeDataFactory1):
524		var df DataFactory
525		err := json.Unmarshal(body, &df)
526		return df, err
527	case string(ComputeTypeDatabricks1):
528		var d Databricks
529		err := json.Unmarshal(body, &d)
530		return d, err
531	case string(ComputeTypeDataLakeAnalytics1):
532		var dla DataLakeAnalytics
533		err := json.Unmarshal(body, &dla)
534		return dla, err
535	default:
536		var c Compute
537		err := json.Unmarshal(body, &c)
538		return c, err
539	}
540}
541func unmarshalBasicComputeArray(body []byte) ([]BasicCompute, error) {
542	var rawMessages []*json.RawMessage
543	err := json.Unmarshal(body, &rawMessages)
544	if err != nil {
545		return nil, err
546	}
547
548	cArray := make([]BasicCompute, len(rawMessages))
549
550	for index, rawMessage := range rawMessages {
551		c, err := unmarshalBasicCompute(*rawMessage)
552		if err != nil {
553			return nil, err
554		}
555		cArray[index] = c
556	}
557	return cArray, nil
558}
559
560// MarshalJSON is the custom marshaler for Compute.
561func (c Compute) MarshalJSON() ([]byte, error) {
562	c.ComputeType = ComputeTypeCompute
563	objectMap := make(map[string]interface{})
564	if c.ComputeLocation != nil {
565		objectMap["computeLocation"] = c.ComputeLocation
566	}
567	if c.Description != nil {
568		objectMap["description"] = c.Description
569	}
570	if c.ResourceID != nil {
571		objectMap["resourceId"] = c.ResourceID
572	}
573	if c.ComputeType != "" {
574		objectMap["computeType"] = c.ComputeType
575	}
576	return json.Marshal(objectMap)
577}
578
579// AsAKS is the BasicCompute implementation for Compute.
580func (c Compute) AsAKS() (*AKS, bool) {
581	return nil, false
582}
583
584// AsAmlCompute is the BasicCompute implementation for Compute.
585func (c Compute) AsAmlCompute() (*AmlCompute, bool) {
586	return nil, false
587}
588
589// AsVirtualMachine is the BasicCompute implementation for Compute.
590func (c Compute) AsVirtualMachine() (*VirtualMachine, bool) {
591	return nil, false
592}
593
594// AsHDInsight is the BasicCompute implementation for Compute.
595func (c Compute) AsHDInsight() (*HDInsight, bool) {
596	return nil, false
597}
598
599// AsDataFactory is the BasicCompute implementation for Compute.
600func (c Compute) AsDataFactory() (*DataFactory, bool) {
601	return nil, false
602}
603
604// AsDatabricks is the BasicCompute implementation for Compute.
605func (c Compute) AsDatabricks() (*Databricks, bool) {
606	return nil, false
607}
608
609// AsDataLakeAnalytics is the BasicCompute implementation for Compute.
610func (c Compute) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) {
611	return nil, false
612}
613
614// AsCompute is the BasicCompute implementation for Compute.
615func (c Compute) AsCompute() (*Compute, bool) {
616	return &c, true
617}
618
619// AsBasicCompute is the BasicCompute implementation for Compute.
620func (c Compute) AsBasicCompute() (BasicCompute, bool) {
621	return &c, true
622}
623
624// BasicComputeNodesInformation compute nodes information related to a Machine Learning compute. Might differ for every
625// type of compute.
626type BasicComputeNodesInformation interface {
627	AsAmlComputeNodesInformation() (*AmlComputeNodesInformation, bool)
628	AsComputeNodesInformation() (*ComputeNodesInformation, bool)
629}
630
631// ComputeNodesInformation compute nodes information related to a Machine Learning compute. Might differ for
632// every type of compute.
633type ComputeNodesInformation struct {
634	// NextLink - READ-ONLY; The continuation token.
635	NextLink *string `json:"nextLink,omitempty"`
636	// ComputeType - Possible values include: 'ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation', 'ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute'
637	ComputeType ComputeTypeBasicComputeNodesInformation `json:"computeType,omitempty"`
638}
639
640func unmarshalBasicComputeNodesInformation(body []byte) (BasicComputeNodesInformation, error) {
641	var m map[string]interface{}
642	err := json.Unmarshal(body, &m)
643	if err != nil {
644		return nil, err
645	}
646
647	switch m["computeType"] {
648	case string(ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute):
649		var acni AmlComputeNodesInformation
650		err := json.Unmarshal(body, &acni)
651		return acni, err
652	default:
653		var cni ComputeNodesInformation
654		err := json.Unmarshal(body, &cni)
655		return cni, err
656	}
657}
658func unmarshalBasicComputeNodesInformationArray(body []byte) ([]BasicComputeNodesInformation, error) {
659	var rawMessages []*json.RawMessage
660	err := json.Unmarshal(body, &rawMessages)
661	if err != nil {
662		return nil, err
663	}
664
665	cniArray := make([]BasicComputeNodesInformation, len(rawMessages))
666
667	for index, rawMessage := range rawMessages {
668		cni, err := unmarshalBasicComputeNodesInformation(*rawMessage)
669		if err != nil {
670			return nil, err
671		}
672		cniArray[index] = cni
673	}
674	return cniArray, nil
675}
676
677// MarshalJSON is the custom marshaler for ComputeNodesInformation.
678func (cni ComputeNodesInformation) MarshalJSON() ([]byte, error) {
679	cni.ComputeType = ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation
680	objectMap := make(map[string]interface{})
681	if cni.ComputeType != "" {
682		objectMap["computeType"] = cni.ComputeType
683	}
684	return json.Marshal(objectMap)
685}
686
687// AsAmlComputeNodesInformation is the BasicComputeNodesInformation implementation for ComputeNodesInformation.
688func (cni ComputeNodesInformation) AsAmlComputeNodesInformation() (*AmlComputeNodesInformation, bool) {
689	return nil, false
690}
691
692// AsComputeNodesInformation is the BasicComputeNodesInformation implementation for ComputeNodesInformation.
693func (cni ComputeNodesInformation) AsComputeNodesInformation() (*ComputeNodesInformation, bool) {
694	return &cni, true
695}
696
697// AsBasicComputeNodesInformation is the BasicComputeNodesInformation implementation for ComputeNodesInformation.
698func (cni ComputeNodesInformation) AsBasicComputeNodesInformation() (BasicComputeNodesInformation, bool) {
699	return &cni, true
700}
701
702// ComputeResource machine Learning compute object wrapped into ARM resource envelope.
703type ComputeResource struct {
704	autorest.Response `json:"-"`
705	// Properties - Compute properties
706	Properties BasicCompute `json:"properties,omitempty"`
707	// ID - READ-ONLY; Specifies the resource ID.
708	ID *string `json:"id,omitempty"`
709	// Name - READ-ONLY; Specifies the name of the resource.
710	Name *string `json:"name,omitempty"`
711	// Identity - The identity of the resource.
712	Identity *Identity `json:"identity,omitempty"`
713	// Location - Specifies the location of the resource.
714	Location *string `json:"location,omitempty"`
715	// Type - READ-ONLY; Specifies the type of the resource.
716	Type *string `json:"type,omitempty"`
717	// Tags - Contains resource tags defined as key/value pairs.
718	Tags map[string]*string `json:"tags"`
719}
720
721// MarshalJSON is the custom marshaler for ComputeResource.
722func (cr ComputeResource) MarshalJSON() ([]byte, error) {
723	objectMap := make(map[string]interface{})
724	objectMap["properties"] = cr.Properties
725	if cr.Identity != nil {
726		objectMap["identity"] = cr.Identity
727	}
728	if cr.Location != nil {
729		objectMap["location"] = cr.Location
730	}
731	if cr.Tags != nil {
732		objectMap["tags"] = cr.Tags
733	}
734	return json.Marshal(objectMap)
735}
736
737// UnmarshalJSON is the custom unmarshaler for ComputeResource struct.
738func (cr *ComputeResource) UnmarshalJSON(body []byte) error {
739	var m map[string]*json.RawMessage
740	err := json.Unmarshal(body, &m)
741	if err != nil {
742		return err
743	}
744	for k, v := range m {
745		switch k {
746		case "properties":
747			if v != nil {
748				properties, err := unmarshalBasicCompute(*v)
749				if err != nil {
750					return err
751				}
752				cr.Properties = properties
753			}
754		case "id":
755			if v != nil {
756				var ID string
757				err = json.Unmarshal(*v, &ID)
758				if err != nil {
759					return err
760				}
761				cr.ID = &ID
762			}
763		case "name":
764			if v != nil {
765				var name string
766				err = json.Unmarshal(*v, &name)
767				if err != nil {
768					return err
769				}
770				cr.Name = &name
771			}
772		case "identity":
773			if v != nil {
774				var identity Identity
775				err = json.Unmarshal(*v, &identity)
776				if err != nil {
777					return err
778				}
779				cr.Identity = &identity
780			}
781		case "location":
782			if v != nil {
783				var location string
784				err = json.Unmarshal(*v, &location)
785				if err != nil {
786					return err
787				}
788				cr.Location = &location
789			}
790		case "type":
791			if v != nil {
792				var typeVar string
793				err = json.Unmarshal(*v, &typeVar)
794				if err != nil {
795					return err
796				}
797				cr.Type = &typeVar
798			}
799		case "tags":
800			if v != nil {
801				var tags map[string]*string
802				err = json.Unmarshal(*v, &tags)
803				if err != nil {
804					return err
805				}
806				cr.Tags = tags
807			}
808		}
809	}
810
811	return nil
812}
813
814// BasicComputeSecrets secrets related to a Machine Learning compute. Might differ for every type of compute.
815type BasicComputeSecrets interface {
816	AsAksComputeSecrets() (*AksComputeSecrets, bool)
817	AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool)
818	AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool)
819	AsComputeSecrets() (*ComputeSecrets, bool)
820}
821
822// ComputeSecrets secrets related to a Machine Learning compute. Might differ for every type of compute.
823type ComputeSecrets struct {
824	autorest.Response `json:"-"`
825	// ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine', 'ComputeTypeBasicComputeSecretsComputeTypeDatabricks'
826	ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"`
827}
828
829func unmarshalBasicComputeSecrets(body []byte) (BasicComputeSecrets, error) {
830	var m map[string]interface{}
831	err := json.Unmarshal(body, &m)
832	if err != nil {
833		return nil, err
834	}
835
836	switch m["computeType"] {
837	case string(ComputeTypeBasicComputeSecretsComputeTypeAKS):
838		var acs AksComputeSecrets
839		err := json.Unmarshal(body, &acs)
840		return acs, err
841	case string(ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine):
842		var vms VirtualMachineSecrets
843		err := json.Unmarshal(body, &vms)
844		return vms, err
845	case string(ComputeTypeBasicComputeSecretsComputeTypeDatabricks):
846		var dcs DatabricksComputeSecrets
847		err := json.Unmarshal(body, &dcs)
848		return dcs, err
849	default:
850		var cs ComputeSecrets
851		err := json.Unmarshal(body, &cs)
852		return cs, err
853	}
854}
855func unmarshalBasicComputeSecretsArray(body []byte) ([]BasicComputeSecrets, error) {
856	var rawMessages []*json.RawMessage
857	err := json.Unmarshal(body, &rawMessages)
858	if err != nil {
859		return nil, err
860	}
861
862	csArray := make([]BasicComputeSecrets, len(rawMessages))
863
864	for index, rawMessage := range rawMessages {
865		cs, err := unmarshalBasicComputeSecrets(*rawMessage)
866		if err != nil {
867			return nil, err
868		}
869		csArray[index] = cs
870	}
871	return csArray, nil
872}
873
874// MarshalJSON is the custom marshaler for ComputeSecrets.
875func (cs ComputeSecrets) MarshalJSON() ([]byte, error) {
876	cs.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets
877	objectMap := make(map[string]interface{})
878	if cs.ComputeType != "" {
879		objectMap["computeType"] = cs.ComputeType
880	}
881	return json.Marshal(objectMap)
882}
883
884// AsAksComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets.
885func (cs ComputeSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) {
886	return nil, false
887}
888
889// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for ComputeSecrets.
890func (cs ComputeSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) {
891	return nil, false
892}
893
894// AsDatabricksComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets.
895func (cs ComputeSecrets) AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) {
896	return nil, false
897}
898
899// AsComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets.
900func (cs ComputeSecrets) AsComputeSecrets() (*ComputeSecrets, bool) {
901	return &cs, true
902}
903
904// AsBasicComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets.
905func (cs ComputeSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) {
906	return &cs, true
907}
908
909// ComputeSecretsModel ...
910type ComputeSecretsModel struct {
911	autorest.Response `json:"-"`
912	Value             BasicComputeSecrets `json:"value,omitempty"`
913}
914
915// UnmarshalJSON is the custom unmarshaler for ComputeSecretsModel struct.
916func (csm *ComputeSecretsModel) UnmarshalJSON(body []byte) error {
917	cs, err := unmarshalBasicComputeSecrets(body)
918	if err != nil {
919		return err
920	}
921	csm.Value = cs
922
923	return nil
924}
925
926// Databricks a DataFactory compute.
927type Databricks struct {
928	Properties *DatabricksProperties `json:"properties,omitempty"`
929	// ComputeLocation - Location for the underlying compute
930	ComputeLocation *string `json:"computeLocation,omitempty"`
931	// ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
932	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
933	// Description - The description of the Machine Learning compute.
934	Description *string `json:"description,omitempty"`
935	// CreatedOn - READ-ONLY; The date and time when the compute was created.
936	CreatedOn *date.Time `json:"createdOn,omitempty"`
937	// ModifiedOn - READ-ONLY; The date and time when the compute was last modified.
938	ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
939	// ResourceID - ARM resource id of the underlying compute
940	ResourceID *string `json:"resourceId,omitempty"`
941	// ProvisioningErrors - READ-ONLY; Errors during provisioning
942	ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"`
943	// IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false.
944	IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"`
945	// ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1'
946	ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"`
947}
948
949// MarshalJSON is the custom marshaler for Databricks.
950func (d Databricks) MarshalJSON() ([]byte, error) {
951	d.ComputeType = ComputeTypeDatabricks1
952	objectMap := make(map[string]interface{})
953	if d.Properties != nil {
954		objectMap["properties"] = d.Properties
955	}
956	if d.ComputeLocation != nil {
957		objectMap["computeLocation"] = d.ComputeLocation
958	}
959	if d.Description != nil {
960		objectMap["description"] = d.Description
961	}
962	if d.ResourceID != nil {
963		objectMap["resourceId"] = d.ResourceID
964	}
965	if d.ComputeType != "" {
966		objectMap["computeType"] = d.ComputeType
967	}
968	return json.Marshal(objectMap)
969}
970
971// AsAKS is the BasicCompute implementation for Databricks.
972func (d Databricks) AsAKS() (*AKS, bool) {
973	return nil, false
974}
975
976// AsAmlCompute is the BasicCompute implementation for Databricks.
977func (d Databricks) AsAmlCompute() (*AmlCompute, bool) {
978	return nil, false
979}
980
981// AsVirtualMachine is the BasicCompute implementation for Databricks.
982func (d Databricks) AsVirtualMachine() (*VirtualMachine, bool) {
983	return nil, false
984}
985
986// AsHDInsight is the BasicCompute implementation for Databricks.
987func (d Databricks) AsHDInsight() (*HDInsight, bool) {
988	return nil, false
989}
990
991// AsDataFactory is the BasicCompute implementation for Databricks.
992func (d Databricks) AsDataFactory() (*DataFactory, bool) {
993	return nil, false
994}
995
996// AsDatabricks is the BasicCompute implementation for Databricks.
997func (d Databricks) AsDatabricks() (*Databricks, bool) {
998	return &d, true
999}
1000
1001// AsDataLakeAnalytics is the BasicCompute implementation for Databricks.
1002func (d Databricks) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) {
1003	return nil, false
1004}
1005
1006// AsCompute is the BasicCompute implementation for Databricks.
1007func (d Databricks) AsCompute() (*Compute, bool) {
1008	return nil, false
1009}
1010
1011// AsBasicCompute is the BasicCompute implementation for Databricks.
1012func (d Databricks) AsBasicCompute() (BasicCompute, bool) {
1013	return &d, true
1014}
1015
1016// DatabricksComputeSecrets secrets related to a Machine Learning compute based on Databricks.
1017type DatabricksComputeSecrets struct {
1018	// DatabricksAccessToken - access token for databricks account.
1019	DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"`
1020	// ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine', 'ComputeTypeBasicComputeSecretsComputeTypeDatabricks'
1021	ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"`
1022}
1023
1024// MarshalJSON is the custom marshaler for DatabricksComputeSecrets.
1025func (dcs DatabricksComputeSecrets) MarshalJSON() ([]byte, error) {
1026	dcs.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeDatabricks
1027	objectMap := make(map[string]interface{})
1028	if dcs.DatabricksAccessToken != nil {
1029		objectMap["databricksAccessToken"] = dcs.DatabricksAccessToken
1030	}
1031	if dcs.ComputeType != "" {
1032		objectMap["computeType"] = dcs.ComputeType
1033	}
1034	return json.Marshal(objectMap)
1035}
1036
1037// AsAksComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets.
1038func (dcs DatabricksComputeSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) {
1039	return nil, false
1040}
1041
1042// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets.
1043func (dcs DatabricksComputeSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) {
1044	return nil, false
1045}
1046
1047// AsDatabricksComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets.
1048func (dcs DatabricksComputeSecrets) AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) {
1049	return &dcs, true
1050}
1051
1052// AsComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets.
1053func (dcs DatabricksComputeSecrets) AsComputeSecrets() (*ComputeSecrets, bool) {
1054	return nil, false
1055}
1056
1057// AsBasicComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets.
1058func (dcs DatabricksComputeSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) {
1059	return &dcs, true
1060}
1061
1062// DatabricksProperties ...
1063type DatabricksProperties struct {
1064	// DatabricksAccessToken - Databricks access token
1065	DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"`
1066}
1067
1068// DataFactory a DataFactory compute.
1069type DataFactory struct {
1070	// ComputeLocation - Location for the underlying compute
1071	ComputeLocation *string `json:"computeLocation,omitempty"`
1072	// ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
1073	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1074	// Description - The description of the Machine Learning compute.
1075	Description *string `json:"description,omitempty"`
1076	// CreatedOn - READ-ONLY; The date and time when the compute was created.
1077	CreatedOn *date.Time `json:"createdOn,omitempty"`
1078	// ModifiedOn - READ-ONLY; The date and time when the compute was last modified.
1079	ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
1080	// ResourceID - ARM resource id of the underlying compute
1081	ResourceID *string `json:"resourceId,omitempty"`
1082	// ProvisioningErrors - READ-ONLY; Errors during provisioning
1083	ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"`
1084	// IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false.
1085	IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"`
1086	// ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1'
1087	ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"`
1088}
1089
1090// MarshalJSON is the custom marshaler for DataFactory.
1091func (df DataFactory) MarshalJSON() ([]byte, error) {
1092	df.ComputeType = ComputeTypeDataFactory1
1093	objectMap := make(map[string]interface{})
1094	if df.ComputeLocation != nil {
1095		objectMap["computeLocation"] = df.ComputeLocation
1096	}
1097	if df.Description != nil {
1098		objectMap["description"] = df.Description
1099	}
1100	if df.ResourceID != nil {
1101		objectMap["resourceId"] = df.ResourceID
1102	}
1103	if df.ComputeType != "" {
1104		objectMap["computeType"] = df.ComputeType
1105	}
1106	return json.Marshal(objectMap)
1107}
1108
1109// AsAKS is the BasicCompute implementation for DataFactory.
1110func (df DataFactory) AsAKS() (*AKS, bool) {
1111	return nil, false
1112}
1113
1114// AsAmlCompute is the BasicCompute implementation for DataFactory.
1115func (df DataFactory) AsAmlCompute() (*AmlCompute, bool) {
1116	return nil, false
1117}
1118
1119// AsVirtualMachine is the BasicCompute implementation for DataFactory.
1120func (df DataFactory) AsVirtualMachine() (*VirtualMachine, bool) {
1121	return nil, false
1122}
1123
1124// AsHDInsight is the BasicCompute implementation for DataFactory.
1125func (df DataFactory) AsHDInsight() (*HDInsight, bool) {
1126	return nil, false
1127}
1128
1129// AsDataFactory is the BasicCompute implementation for DataFactory.
1130func (df DataFactory) AsDataFactory() (*DataFactory, bool) {
1131	return &df, true
1132}
1133
1134// AsDatabricks is the BasicCompute implementation for DataFactory.
1135func (df DataFactory) AsDatabricks() (*Databricks, bool) {
1136	return nil, false
1137}
1138
1139// AsDataLakeAnalytics is the BasicCompute implementation for DataFactory.
1140func (df DataFactory) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) {
1141	return nil, false
1142}
1143
1144// AsCompute is the BasicCompute implementation for DataFactory.
1145func (df DataFactory) AsCompute() (*Compute, bool) {
1146	return nil, false
1147}
1148
1149// AsBasicCompute is the BasicCompute implementation for DataFactory.
1150func (df DataFactory) AsBasicCompute() (BasicCompute, bool) {
1151	return &df, true
1152}
1153
1154// DataLakeAnalytics a DataLakeAnalytics compute.
1155type DataLakeAnalytics struct {
1156	Properties *DataLakeAnalyticsProperties `json:"properties,omitempty"`
1157	// ComputeLocation - Location for the underlying compute
1158	ComputeLocation *string `json:"computeLocation,omitempty"`
1159	// ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
1160	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1161	// Description - The description of the Machine Learning compute.
1162	Description *string `json:"description,omitempty"`
1163	// CreatedOn - READ-ONLY; The date and time when the compute was created.
1164	CreatedOn *date.Time `json:"createdOn,omitempty"`
1165	// ModifiedOn - READ-ONLY; The date and time when the compute was last modified.
1166	ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
1167	// ResourceID - ARM resource id of the underlying compute
1168	ResourceID *string `json:"resourceId,omitempty"`
1169	// ProvisioningErrors - READ-ONLY; Errors during provisioning
1170	ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"`
1171	// IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false.
1172	IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"`
1173	// ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1'
1174	ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"`
1175}
1176
1177// MarshalJSON is the custom marshaler for DataLakeAnalytics.
1178func (dla DataLakeAnalytics) MarshalJSON() ([]byte, error) {
1179	dla.ComputeType = ComputeTypeDataLakeAnalytics1
1180	objectMap := make(map[string]interface{})
1181	if dla.Properties != nil {
1182		objectMap["properties"] = dla.Properties
1183	}
1184	if dla.ComputeLocation != nil {
1185		objectMap["computeLocation"] = dla.ComputeLocation
1186	}
1187	if dla.Description != nil {
1188		objectMap["description"] = dla.Description
1189	}
1190	if dla.ResourceID != nil {
1191		objectMap["resourceId"] = dla.ResourceID
1192	}
1193	if dla.ComputeType != "" {
1194		objectMap["computeType"] = dla.ComputeType
1195	}
1196	return json.Marshal(objectMap)
1197}
1198
1199// AsAKS is the BasicCompute implementation for DataLakeAnalytics.
1200func (dla DataLakeAnalytics) AsAKS() (*AKS, bool) {
1201	return nil, false
1202}
1203
1204// AsAmlCompute is the BasicCompute implementation for DataLakeAnalytics.
1205func (dla DataLakeAnalytics) AsAmlCompute() (*AmlCompute, bool) {
1206	return nil, false
1207}
1208
1209// AsVirtualMachine is the BasicCompute implementation for DataLakeAnalytics.
1210func (dla DataLakeAnalytics) AsVirtualMachine() (*VirtualMachine, bool) {
1211	return nil, false
1212}
1213
1214// AsHDInsight is the BasicCompute implementation for DataLakeAnalytics.
1215func (dla DataLakeAnalytics) AsHDInsight() (*HDInsight, bool) {
1216	return nil, false
1217}
1218
1219// AsDataFactory is the BasicCompute implementation for DataLakeAnalytics.
1220func (dla DataLakeAnalytics) AsDataFactory() (*DataFactory, bool) {
1221	return nil, false
1222}
1223
1224// AsDatabricks is the BasicCompute implementation for DataLakeAnalytics.
1225func (dla DataLakeAnalytics) AsDatabricks() (*Databricks, bool) {
1226	return nil, false
1227}
1228
1229// AsDataLakeAnalytics is the BasicCompute implementation for DataLakeAnalytics.
1230func (dla DataLakeAnalytics) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) {
1231	return &dla, true
1232}
1233
1234// AsCompute is the BasicCompute implementation for DataLakeAnalytics.
1235func (dla DataLakeAnalytics) AsCompute() (*Compute, bool) {
1236	return nil, false
1237}
1238
1239// AsBasicCompute is the BasicCompute implementation for DataLakeAnalytics.
1240func (dla DataLakeAnalytics) AsBasicCompute() (BasicCompute, bool) {
1241	return &dla, true
1242}
1243
1244// DataLakeAnalyticsProperties ...
1245type DataLakeAnalyticsProperties struct {
1246	// DataLakeStoreAccountName - DataLake Store Account Name
1247	DataLakeStoreAccountName *string `json:"dataLakeStoreAccountName,omitempty"`
1248}
1249
1250// Error wrapper for error response to follow ARM guidelines.
1251type Error struct {
1252	// Error - READ-ONLY; The error response.
1253	Error *ErrorResponse `json:"error,omitempty"`
1254}
1255
1256// MarshalJSON is the custom marshaler for Error.
1257func (e Error) MarshalJSON() ([]byte, error) {
1258	objectMap := make(map[string]interface{})
1259	return json.Marshal(objectMap)
1260}
1261
1262// ErrorDetail error detail information.
1263type ErrorDetail struct {
1264	// Code - Error code.
1265	Code *string `json:"code,omitempty"`
1266	// Message - Error message.
1267	Message *string `json:"message,omitempty"`
1268}
1269
1270// ErrorResponse error response information.
1271type ErrorResponse struct {
1272	// Code - READ-ONLY; Error code.
1273	Code *string `json:"code,omitempty"`
1274	// Message - READ-ONLY; Error message.
1275	Message *string `json:"message,omitempty"`
1276	// Details - READ-ONLY; An array of error detail objects.
1277	Details *[]ErrorDetail `json:"details,omitempty"`
1278}
1279
1280// MarshalJSON is the custom marshaler for ErrorResponse.
1281func (er ErrorResponse) MarshalJSON() ([]byte, error) {
1282	objectMap := make(map[string]interface{})
1283	return json.Marshal(objectMap)
1284}
1285
1286// HDInsight a HDInsight compute.
1287type HDInsight struct {
1288	Properties *HDInsightProperties `json:"properties,omitempty"`
1289	// ComputeLocation - Location for the underlying compute
1290	ComputeLocation *string `json:"computeLocation,omitempty"`
1291	// ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
1292	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1293	// Description - The description of the Machine Learning compute.
1294	Description *string `json:"description,omitempty"`
1295	// CreatedOn - READ-ONLY; The date and time when the compute was created.
1296	CreatedOn *date.Time `json:"createdOn,omitempty"`
1297	// ModifiedOn - READ-ONLY; The date and time when the compute was last modified.
1298	ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
1299	// ResourceID - ARM resource id of the underlying compute
1300	ResourceID *string `json:"resourceId,omitempty"`
1301	// ProvisioningErrors - READ-ONLY; Errors during provisioning
1302	ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"`
1303	// IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false.
1304	IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"`
1305	// ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1'
1306	ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"`
1307}
1308
1309// MarshalJSON is the custom marshaler for HDInsight.
1310func (hi HDInsight) MarshalJSON() ([]byte, error) {
1311	hi.ComputeType = ComputeTypeHDInsight1
1312	objectMap := make(map[string]interface{})
1313	if hi.Properties != nil {
1314		objectMap["properties"] = hi.Properties
1315	}
1316	if hi.ComputeLocation != nil {
1317		objectMap["computeLocation"] = hi.ComputeLocation
1318	}
1319	if hi.Description != nil {
1320		objectMap["description"] = hi.Description
1321	}
1322	if hi.ResourceID != nil {
1323		objectMap["resourceId"] = hi.ResourceID
1324	}
1325	if hi.ComputeType != "" {
1326		objectMap["computeType"] = hi.ComputeType
1327	}
1328	return json.Marshal(objectMap)
1329}
1330
1331// AsAKS is the BasicCompute implementation for HDInsight.
1332func (hi HDInsight) AsAKS() (*AKS, bool) {
1333	return nil, false
1334}
1335
1336// AsAmlCompute is the BasicCompute implementation for HDInsight.
1337func (hi HDInsight) AsAmlCompute() (*AmlCompute, bool) {
1338	return nil, false
1339}
1340
1341// AsVirtualMachine is the BasicCompute implementation for HDInsight.
1342func (hi HDInsight) AsVirtualMachine() (*VirtualMachine, bool) {
1343	return nil, false
1344}
1345
1346// AsHDInsight is the BasicCompute implementation for HDInsight.
1347func (hi HDInsight) AsHDInsight() (*HDInsight, bool) {
1348	return &hi, true
1349}
1350
1351// AsDataFactory is the BasicCompute implementation for HDInsight.
1352func (hi HDInsight) AsDataFactory() (*DataFactory, bool) {
1353	return nil, false
1354}
1355
1356// AsDatabricks is the BasicCompute implementation for HDInsight.
1357func (hi HDInsight) AsDatabricks() (*Databricks, bool) {
1358	return nil, false
1359}
1360
1361// AsDataLakeAnalytics is the BasicCompute implementation for HDInsight.
1362func (hi HDInsight) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) {
1363	return nil, false
1364}
1365
1366// AsCompute is the BasicCompute implementation for HDInsight.
1367func (hi HDInsight) AsCompute() (*Compute, bool) {
1368	return nil, false
1369}
1370
1371// AsBasicCompute is the BasicCompute implementation for HDInsight.
1372func (hi HDInsight) AsBasicCompute() (BasicCompute, bool) {
1373	return &hi, true
1374}
1375
1376// HDInsightProperties ...
1377type HDInsightProperties struct {
1378	// SSHPort - Port open for ssh connections on the master node of the cluster.
1379	SSHPort *int32 `json:"sshPort,omitempty"`
1380	// Address - Public IP address of the master node of the cluster.
1381	Address *string `json:"address,omitempty"`
1382	// AdministratorAccount - Admin credentials for master node of the cluster
1383	AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"`
1384}
1385
1386// Identity identity for the resource.
1387type Identity struct {
1388	// PrincipalID - READ-ONLY; The principal ID of resource identity.
1389	PrincipalID *string `json:"principalId,omitempty"`
1390	// TenantID - READ-ONLY; The tenant ID of resource.
1391	TenantID *string `json:"tenantId,omitempty"`
1392	// Type - The identity type. Possible values include: 'SystemAssigned'
1393	Type ResourceIdentityType `json:"type,omitempty"`
1394}
1395
1396// MarshalJSON is the custom marshaler for Identity.
1397func (i Identity) MarshalJSON() ([]byte, error) {
1398	objectMap := make(map[string]interface{})
1399	if i.Type != "" {
1400		objectMap["type"] = i.Type
1401	}
1402	return json.Marshal(objectMap)
1403}
1404
1405// ListUsagesResult the List Usages operation response.
1406type ListUsagesResult struct {
1407	autorest.Response `json:"-"`
1408	// Value - READ-ONLY; The list of AML resource usages.
1409	Value *[]Usage `json:"value,omitempty"`
1410	// NextLink - READ-ONLY; The URI to fetch the next page of AML resource usage information. Call ListNext() with this to fetch the next page of AML resource usage information.
1411	NextLink *string `json:"nextLink,omitempty"`
1412}
1413
1414// MarshalJSON is the custom marshaler for ListUsagesResult.
1415func (lur ListUsagesResult) MarshalJSON() ([]byte, error) {
1416	objectMap := make(map[string]interface{})
1417	return json.Marshal(objectMap)
1418}
1419
1420// ListUsagesResultIterator provides access to a complete listing of Usage values.
1421type ListUsagesResultIterator struct {
1422	i    int
1423	page ListUsagesResultPage
1424}
1425
1426// NextWithContext advances to the next value.  If there was an error making
1427// the request the iterator does not advance and the error is returned.
1428func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) {
1429	if tracing.IsEnabled() {
1430		ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext")
1431		defer func() {
1432			sc := -1
1433			if iter.Response().Response.Response != nil {
1434				sc = iter.Response().Response.Response.StatusCode
1435			}
1436			tracing.EndSpan(ctx, sc, err)
1437		}()
1438	}
1439	iter.i++
1440	if iter.i < len(iter.page.Values()) {
1441		return nil
1442	}
1443	err = iter.page.NextWithContext(ctx)
1444	if err != nil {
1445		iter.i--
1446		return err
1447	}
1448	iter.i = 0
1449	return nil
1450}
1451
1452// Next advances to the next value.  If there was an error making
1453// the request the iterator does not advance and the error is returned.
1454// Deprecated: Use NextWithContext() instead.
1455func (iter *ListUsagesResultIterator) Next() error {
1456	return iter.NextWithContext(context.Background())
1457}
1458
1459// NotDone returns true if the enumeration should be started or is not yet complete.
1460func (iter ListUsagesResultIterator) NotDone() bool {
1461	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1462}
1463
1464// Response returns the raw server response from the last page request.
1465func (iter ListUsagesResultIterator) Response() ListUsagesResult {
1466	return iter.page.Response()
1467}
1468
1469// Value returns the current value or a zero-initialized value if the
1470// iterator has advanced beyond the end of the collection.
1471func (iter ListUsagesResultIterator) Value() Usage {
1472	if !iter.page.NotDone() {
1473		return Usage{}
1474	}
1475	return iter.page.Values()[iter.i]
1476}
1477
1478// Creates a new instance of the ListUsagesResultIterator type.
1479func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator {
1480	return ListUsagesResultIterator{page: page}
1481}
1482
1483// IsEmpty returns true if the ListResult contains no values.
1484func (lur ListUsagesResult) IsEmpty() bool {
1485	return lur.Value == nil || len(*lur.Value) == 0
1486}
1487
1488// hasNextLink returns true if the NextLink is not empty.
1489func (lur ListUsagesResult) hasNextLink() bool {
1490	return lur.NextLink != nil && len(*lur.NextLink) != 0
1491}
1492
1493// listUsagesResultPreparer prepares a request to retrieve the next set of results.
1494// It returns nil if no more results exist.
1495func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) {
1496	if !lur.hasNextLink() {
1497		return nil, nil
1498	}
1499	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1500		autorest.AsJSON(),
1501		autorest.AsGet(),
1502		autorest.WithBaseURL(to.String(lur.NextLink)))
1503}
1504
1505// ListUsagesResultPage contains a page of Usage values.
1506type ListUsagesResultPage struct {
1507	fn  func(context.Context, ListUsagesResult) (ListUsagesResult, error)
1508	lur ListUsagesResult
1509}
1510
1511// NextWithContext advances to the next page of values.  If there was an error making
1512// the request the page does not advance and the error is returned.
1513func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) {
1514	if tracing.IsEnabled() {
1515		ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext")
1516		defer func() {
1517			sc := -1
1518			if page.Response().Response.Response != nil {
1519				sc = page.Response().Response.Response.StatusCode
1520			}
1521			tracing.EndSpan(ctx, sc, err)
1522		}()
1523	}
1524	for {
1525		next, err := page.fn(ctx, page.lur)
1526		if err != nil {
1527			return err
1528		}
1529		page.lur = next
1530		if !next.hasNextLink() || !next.IsEmpty() {
1531			break
1532		}
1533	}
1534	return nil
1535}
1536
1537// Next advances to the next page of values.  If there was an error making
1538// the request the page does not advance and the error is returned.
1539// Deprecated: Use NextWithContext() instead.
1540func (page *ListUsagesResultPage) Next() error {
1541	return page.NextWithContext(context.Background())
1542}
1543
1544// NotDone returns true if the page enumeration should be started or is not yet complete.
1545func (page ListUsagesResultPage) NotDone() bool {
1546	return !page.lur.IsEmpty()
1547}
1548
1549// Response returns the raw server response from the last page request.
1550func (page ListUsagesResultPage) Response() ListUsagesResult {
1551	return page.lur
1552}
1553
1554// Values returns the slice of values for the current page or nil if there are no values.
1555func (page ListUsagesResultPage) Values() []Usage {
1556	if page.lur.IsEmpty() {
1557		return nil
1558	}
1559	return *page.lur.Value
1560}
1561
1562// Creates a new instance of the ListUsagesResultPage type.
1563func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage {
1564	return ListUsagesResultPage{
1565		fn:  getNextPage,
1566		lur: cur,
1567	}
1568}
1569
1570// ListWorkspaceKeysResult ...
1571type ListWorkspaceKeysResult struct {
1572	autorest.Response `json:"-"`
1573	// UserStorageKey - READ-ONLY
1574	UserStorageKey *string `json:"userStorageKey,omitempty"`
1575	// UserStorageResourceID - READ-ONLY
1576	UserStorageResourceID *string `json:"userStorageResourceId,omitempty"`
1577	// AppInsightsInstrumentationKey - READ-ONLY
1578	AppInsightsInstrumentationKey *string `json:"appInsightsInstrumentationKey,omitempty"`
1579	// ContainerRegistryCredentials - READ-ONLY
1580	ContainerRegistryCredentials *RegistryListCredentialsResult `json:"containerRegistryCredentials,omitempty"`
1581}
1582
1583// MarshalJSON is the custom marshaler for ListWorkspaceKeysResult.
1584func (lwkr ListWorkspaceKeysResult) MarshalJSON() ([]byte, error) {
1585	objectMap := make(map[string]interface{})
1586	return json.Marshal(objectMap)
1587}
1588
1589// ListWorkspaceQuotas the List WorkspaceQuotasByVMFamily operation response.
1590type ListWorkspaceQuotas struct {
1591	autorest.Response `json:"-"`
1592	// Value - READ-ONLY; The list of Workspace Quotas by VM Family
1593	Value *[]ResourceQuota `json:"value,omitempty"`
1594	// NextLink - READ-ONLY; The URI to fetch the next page of workspace quota information by VM Family. Call ListNext() with this to fetch the next page of Workspace Quota information.
1595	NextLink *string `json:"nextLink,omitempty"`
1596}
1597
1598// MarshalJSON is the custom marshaler for ListWorkspaceQuotas.
1599func (lwq ListWorkspaceQuotas) MarshalJSON() ([]byte, error) {
1600	objectMap := make(map[string]interface{})
1601	return json.Marshal(objectMap)
1602}
1603
1604// ListWorkspaceQuotasIterator provides access to a complete listing of ResourceQuota values.
1605type ListWorkspaceQuotasIterator struct {
1606	i    int
1607	page ListWorkspaceQuotasPage
1608}
1609
1610// NextWithContext advances to the next value.  If there was an error making
1611// the request the iterator does not advance and the error is returned.
1612func (iter *ListWorkspaceQuotasIterator) NextWithContext(ctx context.Context) (err error) {
1613	if tracing.IsEnabled() {
1614		ctx = tracing.StartSpan(ctx, fqdn+"/ListWorkspaceQuotasIterator.NextWithContext")
1615		defer func() {
1616			sc := -1
1617			if iter.Response().Response.Response != nil {
1618				sc = iter.Response().Response.Response.StatusCode
1619			}
1620			tracing.EndSpan(ctx, sc, err)
1621		}()
1622	}
1623	iter.i++
1624	if iter.i < len(iter.page.Values()) {
1625		return nil
1626	}
1627	err = iter.page.NextWithContext(ctx)
1628	if err != nil {
1629		iter.i--
1630		return err
1631	}
1632	iter.i = 0
1633	return nil
1634}
1635
1636// Next advances to the next value.  If there was an error making
1637// the request the iterator does not advance and the error is returned.
1638// Deprecated: Use NextWithContext() instead.
1639func (iter *ListWorkspaceQuotasIterator) Next() error {
1640	return iter.NextWithContext(context.Background())
1641}
1642
1643// NotDone returns true if the enumeration should be started or is not yet complete.
1644func (iter ListWorkspaceQuotasIterator) NotDone() bool {
1645	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1646}
1647
1648// Response returns the raw server response from the last page request.
1649func (iter ListWorkspaceQuotasIterator) Response() ListWorkspaceQuotas {
1650	return iter.page.Response()
1651}
1652
1653// Value returns the current value or a zero-initialized value if the
1654// iterator has advanced beyond the end of the collection.
1655func (iter ListWorkspaceQuotasIterator) Value() ResourceQuota {
1656	if !iter.page.NotDone() {
1657		return ResourceQuota{}
1658	}
1659	return iter.page.Values()[iter.i]
1660}
1661
1662// Creates a new instance of the ListWorkspaceQuotasIterator type.
1663func NewListWorkspaceQuotasIterator(page ListWorkspaceQuotasPage) ListWorkspaceQuotasIterator {
1664	return ListWorkspaceQuotasIterator{page: page}
1665}
1666
1667// IsEmpty returns true if the ListResult contains no values.
1668func (lwq ListWorkspaceQuotas) IsEmpty() bool {
1669	return lwq.Value == nil || len(*lwq.Value) == 0
1670}
1671
1672// hasNextLink returns true if the NextLink is not empty.
1673func (lwq ListWorkspaceQuotas) hasNextLink() bool {
1674	return lwq.NextLink != nil && len(*lwq.NextLink) != 0
1675}
1676
1677// listWorkspaceQuotasPreparer prepares a request to retrieve the next set of results.
1678// It returns nil if no more results exist.
1679func (lwq ListWorkspaceQuotas) listWorkspaceQuotasPreparer(ctx context.Context) (*http.Request, error) {
1680	if !lwq.hasNextLink() {
1681		return nil, nil
1682	}
1683	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1684		autorest.AsJSON(),
1685		autorest.AsGet(),
1686		autorest.WithBaseURL(to.String(lwq.NextLink)))
1687}
1688
1689// ListWorkspaceQuotasPage contains a page of ResourceQuota values.
1690type ListWorkspaceQuotasPage struct {
1691	fn  func(context.Context, ListWorkspaceQuotas) (ListWorkspaceQuotas, error)
1692	lwq ListWorkspaceQuotas
1693}
1694
1695// NextWithContext advances to the next page of values.  If there was an error making
1696// the request the page does not advance and the error is returned.
1697func (page *ListWorkspaceQuotasPage) NextWithContext(ctx context.Context) (err error) {
1698	if tracing.IsEnabled() {
1699		ctx = tracing.StartSpan(ctx, fqdn+"/ListWorkspaceQuotasPage.NextWithContext")
1700		defer func() {
1701			sc := -1
1702			if page.Response().Response.Response != nil {
1703				sc = page.Response().Response.Response.StatusCode
1704			}
1705			tracing.EndSpan(ctx, sc, err)
1706		}()
1707	}
1708	for {
1709		next, err := page.fn(ctx, page.lwq)
1710		if err != nil {
1711			return err
1712		}
1713		page.lwq = next
1714		if !next.hasNextLink() || !next.IsEmpty() {
1715			break
1716		}
1717	}
1718	return nil
1719}
1720
1721// Next advances to the next page of values.  If there was an error making
1722// the request the page does not advance and the error is returned.
1723// Deprecated: Use NextWithContext() instead.
1724func (page *ListWorkspaceQuotasPage) Next() error {
1725	return page.NextWithContext(context.Background())
1726}
1727
1728// NotDone returns true if the page enumeration should be started or is not yet complete.
1729func (page ListWorkspaceQuotasPage) NotDone() bool {
1730	return !page.lwq.IsEmpty()
1731}
1732
1733// Response returns the raw server response from the last page request.
1734func (page ListWorkspaceQuotasPage) Response() ListWorkspaceQuotas {
1735	return page.lwq
1736}
1737
1738// Values returns the slice of values for the current page or nil if there are no values.
1739func (page ListWorkspaceQuotasPage) Values() []ResourceQuota {
1740	if page.lwq.IsEmpty() {
1741		return nil
1742	}
1743	return *page.lwq.Value
1744}
1745
1746// Creates a new instance of the ListWorkspaceQuotasPage type.
1747func NewListWorkspaceQuotasPage(cur ListWorkspaceQuotas, getNextPage func(context.Context, ListWorkspaceQuotas) (ListWorkspaceQuotas, error)) ListWorkspaceQuotasPage {
1748	return ListWorkspaceQuotasPage{
1749		fn:  getNextPage,
1750		lwq: cur,
1751	}
1752}
1753
1754// MachineLearningComputeCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
1755// long-running operation.
1756type MachineLearningComputeCreateOrUpdateFuture struct {
1757	azure.FutureAPI
1758	// Result returns the result of the asynchronous operation.
1759	// If the operation has not completed it will return an error.
1760	Result func(MachineLearningComputeClient) (ComputeResource, error)
1761}
1762
1763// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1764func (future *MachineLearningComputeCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1765	var azFuture azure.Future
1766	if err := json.Unmarshal(body, &azFuture); err != nil {
1767		return err
1768	}
1769	future.FutureAPI = &azFuture
1770	future.Result = future.result
1771	return nil
1772}
1773
1774// result is the default implementation for MachineLearningComputeCreateOrUpdateFuture.Result.
1775func (future *MachineLearningComputeCreateOrUpdateFuture) result(client MachineLearningComputeClient) (cr ComputeResource, err error) {
1776	var done bool
1777	done, err = future.DoneWithContext(context.Background(), client)
1778	if err != nil {
1779		err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1780		return
1781	}
1782	if !done {
1783		cr.Response.Response = future.Response()
1784		err = azure.NewAsyncOpIncompleteError("machinelearningservices.MachineLearningComputeCreateOrUpdateFuture")
1785		return
1786	}
1787	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1788	if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent {
1789		cr, err = client.CreateOrUpdateResponder(cr.Response.Response)
1790		if err != nil {
1791			err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeCreateOrUpdateFuture", "Result", cr.Response.Response, "Failure responding to request")
1792		}
1793	}
1794	return
1795}
1796
1797// MachineLearningComputeDeleteFuture an abstraction for monitoring and retrieving the results of a
1798// long-running operation.
1799type MachineLearningComputeDeleteFuture struct {
1800	azure.FutureAPI
1801	// Result returns the result of the asynchronous operation.
1802	// If the operation has not completed it will return an error.
1803	Result func(MachineLearningComputeClient) (autorest.Response, error)
1804}
1805
1806// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1807func (future *MachineLearningComputeDeleteFuture) UnmarshalJSON(body []byte) error {
1808	var azFuture azure.Future
1809	if err := json.Unmarshal(body, &azFuture); err != nil {
1810		return err
1811	}
1812	future.FutureAPI = &azFuture
1813	future.Result = future.result
1814	return nil
1815}
1816
1817// result is the default implementation for MachineLearningComputeDeleteFuture.Result.
1818func (future *MachineLearningComputeDeleteFuture) result(client MachineLearningComputeClient) (ar autorest.Response, err error) {
1819	var done bool
1820	done, err = future.DoneWithContext(context.Background(), client)
1821	if err != nil {
1822		err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeDeleteFuture", "Result", future.Response(), "Polling failure")
1823		return
1824	}
1825	if !done {
1826		ar.Response = future.Response()
1827		err = azure.NewAsyncOpIncompleteError("machinelearningservices.MachineLearningComputeDeleteFuture")
1828		return
1829	}
1830	ar.Response = future.Response()
1831	return
1832}
1833
1834// MachineLearningComputeUpdateFuture an abstraction for monitoring and retrieving the results of a
1835// long-running operation.
1836type MachineLearningComputeUpdateFuture struct {
1837	azure.FutureAPI
1838	// Result returns the result of the asynchronous operation.
1839	// If the operation has not completed it will return an error.
1840	Result func(MachineLearningComputeClient) (ComputeResource, error)
1841}
1842
1843// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1844func (future *MachineLearningComputeUpdateFuture) UnmarshalJSON(body []byte) error {
1845	var azFuture azure.Future
1846	if err := json.Unmarshal(body, &azFuture); err != nil {
1847		return err
1848	}
1849	future.FutureAPI = &azFuture
1850	future.Result = future.result
1851	return nil
1852}
1853
1854// result is the default implementation for MachineLearningComputeUpdateFuture.Result.
1855func (future *MachineLearningComputeUpdateFuture) result(client MachineLearningComputeClient) (cr ComputeResource, err error) {
1856	var done bool
1857	done, err = future.DoneWithContext(context.Background(), client)
1858	if err != nil {
1859		err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeUpdateFuture", "Result", future.Response(), "Polling failure")
1860		return
1861	}
1862	if !done {
1863		cr.Response.Response = future.Response()
1864		err = azure.NewAsyncOpIncompleteError("machinelearningservices.MachineLearningComputeUpdateFuture")
1865		return
1866	}
1867	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1868	if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent {
1869		cr, err = client.UpdateResponder(cr.Response.Response)
1870		if err != nil {
1871			err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeUpdateFuture", "Result", cr.Response.Response, "Failure responding to request")
1872		}
1873	}
1874	return
1875}
1876
1877// NodeStateCounts counts of various compute node states on the amlCompute.
1878type NodeStateCounts struct {
1879	// IdleNodeCount - READ-ONLY; Number of compute nodes in idle state.
1880	IdleNodeCount *int32 `json:"idleNodeCount,omitempty"`
1881	// RunningNodeCount - READ-ONLY; Number of compute nodes which are running jobs.
1882	RunningNodeCount *int32 `json:"runningNodeCount,omitempty"`
1883	// PreparingNodeCount - READ-ONLY; Number of compute nodes which are being prepared.
1884	PreparingNodeCount *int32 `json:"preparingNodeCount,omitempty"`
1885	// UnusableNodeCount - READ-ONLY; Number of compute nodes which are in unusable state.
1886	UnusableNodeCount *int32 `json:"unusableNodeCount,omitempty"`
1887	// LeavingNodeCount - READ-ONLY; Number of compute nodes which are leaving the amlCompute.
1888	LeavingNodeCount *int32 `json:"leavingNodeCount,omitempty"`
1889	// PreemptedNodeCount - READ-ONLY; Number of compute nodes which are in preempted state.
1890	PreemptedNodeCount *int32 `json:"preemptedNodeCount,omitempty"`
1891}
1892
1893// MarshalJSON is the custom marshaler for NodeStateCounts.
1894func (nsc NodeStateCounts) MarshalJSON() ([]byte, error) {
1895	objectMap := make(map[string]interface{})
1896	return json.Marshal(objectMap)
1897}
1898
1899// Operation azure Machine Learning workspace REST API operation
1900type Operation struct {
1901	// Name - Operation name: {provider}/{resource}/{operation}
1902	Name *string `json:"name,omitempty"`
1903	// Display - Display name of operation
1904	Display *OperationDisplay `json:"display,omitempty"`
1905}
1906
1907// OperationDisplay display name of operation
1908type OperationDisplay struct {
1909	// Provider - The resource provider name: Microsoft.MachineLearningExperimentation
1910	Provider *string `json:"provider,omitempty"`
1911	// Resource - The resource on which the operation is performed.
1912	Resource *string `json:"resource,omitempty"`
1913	// Operation - The operation that users can perform.
1914	Operation *string `json:"operation,omitempty"`
1915	// Description - The description for the operation.
1916	Description *string `json:"description,omitempty"`
1917}
1918
1919// OperationListResult an array of operations supported by the resource provider.
1920type OperationListResult struct {
1921	autorest.Response `json:"-"`
1922	// Value - List of AML workspace operations supported by the AML workspace resource provider.
1923	Value *[]Operation `json:"value,omitempty"`
1924}
1925
1926// PaginatedComputeResourcesList paginated list of Machine Learning compute objects wrapped in ARM resource
1927// envelope.
1928type PaginatedComputeResourcesList struct {
1929	autorest.Response `json:"-"`
1930	// Value - An array of Machine Learning compute objects wrapped in ARM resource envelope.
1931	Value *[]ComputeResource `json:"value,omitempty"`
1932	// NextLink - A continuation link (absolute URI) to the next page of results in the list.
1933	NextLink *string `json:"nextLink,omitempty"`
1934}
1935
1936// PaginatedComputeResourcesListIterator provides access to a complete listing of ComputeResource values.
1937type PaginatedComputeResourcesListIterator struct {
1938	i    int
1939	page PaginatedComputeResourcesListPage
1940}
1941
1942// NextWithContext advances to the next value.  If there was an error making
1943// the request the iterator does not advance and the error is returned.
1944func (iter *PaginatedComputeResourcesListIterator) NextWithContext(ctx context.Context) (err error) {
1945	if tracing.IsEnabled() {
1946		ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedComputeResourcesListIterator.NextWithContext")
1947		defer func() {
1948			sc := -1
1949			if iter.Response().Response.Response != nil {
1950				sc = iter.Response().Response.Response.StatusCode
1951			}
1952			tracing.EndSpan(ctx, sc, err)
1953		}()
1954	}
1955	iter.i++
1956	if iter.i < len(iter.page.Values()) {
1957		return nil
1958	}
1959	err = iter.page.NextWithContext(ctx)
1960	if err != nil {
1961		iter.i--
1962		return err
1963	}
1964	iter.i = 0
1965	return nil
1966}
1967
1968// Next advances to the next value.  If there was an error making
1969// the request the iterator does not advance and the error is returned.
1970// Deprecated: Use NextWithContext() instead.
1971func (iter *PaginatedComputeResourcesListIterator) Next() error {
1972	return iter.NextWithContext(context.Background())
1973}
1974
1975// NotDone returns true if the enumeration should be started or is not yet complete.
1976func (iter PaginatedComputeResourcesListIterator) NotDone() bool {
1977	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1978}
1979
1980// Response returns the raw server response from the last page request.
1981func (iter PaginatedComputeResourcesListIterator) Response() PaginatedComputeResourcesList {
1982	return iter.page.Response()
1983}
1984
1985// Value returns the current value or a zero-initialized value if the
1986// iterator has advanced beyond the end of the collection.
1987func (iter PaginatedComputeResourcesListIterator) Value() ComputeResource {
1988	if !iter.page.NotDone() {
1989		return ComputeResource{}
1990	}
1991	return iter.page.Values()[iter.i]
1992}
1993
1994// Creates a new instance of the PaginatedComputeResourcesListIterator type.
1995func NewPaginatedComputeResourcesListIterator(page PaginatedComputeResourcesListPage) PaginatedComputeResourcesListIterator {
1996	return PaginatedComputeResourcesListIterator{page: page}
1997}
1998
1999// IsEmpty returns true if the ListResult contains no values.
2000func (pcrl PaginatedComputeResourcesList) IsEmpty() bool {
2001	return pcrl.Value == nil || len(*pcrl.Value) == 0
2002}
2003
2004// hasNextLink returns true if the NextLink is not empty.
2005func (pcrl PaginatedComputeResourcesList) hasNextLink() bool {
2006	return pcrl.NextLink != nil && len(*pcrl.NextLink) != 0
2007}
2008
2009// paginatedComputeResourcesListPreparer prepares a request to retrieve the next set of results.
2010// It returns nil if no more results exist.
2011func (pcrl PaginatedComputeResourcesList) paginatedComputeResourcesListPreparer(ctx context.Context) (*http.Request, error) {
2012	if !pcrl.hasNextLink() {
2013		return nil, nil
2014	}
2015	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2016		autorest.AsJSON(),
2017		autorest.AsGet(),
2018		autorest.WithBaseURL(to.String(pcrl.NextLink)))
2019}
2020
2021// PaginatedComputeResourcesListPage contains a page of ComputeResource values.
2022type PaginatedComputeResourcesListPage struct {
2023	fn   func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error)
2024	pcrl PaginatedComputeResourcesList
2025}
2026
2027// NextWithContext advances to the next page of values.  If there was an error making
2028// the request the page does not advance and the error is returned.
2029func (page *PaginatedComputeResourcesListPage) NextWithContext(ctx context.Context) (err error) {
2030	if tracing.IsEnabled() {
2031		ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedComputeResourcesListPage.NextWithContext")
2032		defer func() {
2033			sc := -1
2034			if page.Response().Response.Response != nil {
2035				sc = page.Response().Response.Response.StatusCode
2036			}
2037			tracing.EndSpan(ctx, sc, err)
2038		}()
2039	}
2040	for {
2041		next, err := page.fn(ctx, page.pcrl)
2042		if err != nil {
2043			return err
2044		}
2045		page.pcrl = next
2046		if !next.hasNextLink() || !next.IsEmpty() {
2047			break
2048		}
2049	}
2050	return nil
2051}
2052
2053// Next advances to the next page of values.  If there was an error making
2054// the request the page does not advance and the error is returned.
2055// Deprecated: Use NextWithContext() instead.
2056func (page *PaginatedComputeResourcesListPage) Next() error {
2057	return page.NextWithContext(context.Background())
2058}
2059
2060// NotDone returns true if the page enumeration should be started or is not yet complete.
2061func (page PaginatedComputeResourcesListPage) NotDone() bool {
2062	return !page.pcrl.IsEmpty()
2063}
2064
2065// Response returns the raw server response from the last page request.
2066func (page PaginatedComputeResourcesListPage) Response() PaginatedComputeResourcesList {
2067	return page.pcrl
2068}
2069
2070// Values returns the slice of values for the current page or nil if there are no values.
2071func (page PaginatedComputeResourcesListPage) Values() []ComputeResource {
2072	if page.pcrl.IsEmpty() {
2073		return nil
2074	}
2075	return *page.pcrl.Value
2076}
2077
2078// Creates a new instance of the PaginatedComputeResourcesListPage type.
2079func NewPaginatedComputeResourcesListPage(cur PaginatedComputeResourcesList, getNextPage func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error)) PaginatedComputeResourcesListPage {
2080	return PaginatedComputeResourcesListPage{
2081		fn:   getNextPage,
2082		pcrl: cur,
2083	}
2084}
2085
2086// Password ...
2087type Password struct {
2088	// Name - READ-ONLY
2089	Name *string `json:"name,omitempty"`
2090	// Value - READ-ONLY
2091	Value *string `json:"value,omitempty"`
2092}
2093
2094// MarshalJSON is the custom marshaler for Password.
2095func (p Password) MarshalJSON() ([]byte, error) {
2096	objectMap := make(map[string]interface{})
2097	return json.Marshal(objectMap)
2098}
2099
2100// QuotaBaseProperties the properties for Quota update or retrieval.
2101type QuotaBaseProperties struct {
2102	// ID - Specifies the resource ID.
2103	ID *string `json:"id,omitempty"`
2104	// Type - Specifies the resource type.
2105	Type *string `json:"type,omitempty"`
2106	// Limit - The maximum permitted quota of the resource.
2107	Limit *int64 `json:"limit,omitempty"`
2108	// Unit - An enum describing the unit of quota measurement. Possible values include: 'Count'
2109	Unit QuotaUnit `json:"unit,omitempty"`
2110}
2111
2112// QuotaUpdateParameters quota update parameters.
2113type QuotaUpdateParameters struct {
2114	// Value - The list for update quota.
2115	Value *[]QuotaBaseProperties `json:"value,omitempty"`
2116}
2117
2118// RegistryListCredentialsResult ...
2119type RegistryListCredentialsResult struct {
2120	// Location - READ-ONLY
2121	Location *string `json:"location,omitempty"`
2122	// Username - READ-ONLY
2123	Username  *string     `json:"username,omitempty"`
2124	Passwords *[]Password `json:"passwords,omitempty"`
2125}
2126
2127// MarshalJSON is the custom marshaler for RegistryListCredentialsResult.
2128func (rlcr RegistryListCredentialsResult) MarshalJSON() ([]byte, error) {
2129	objectMap := make(map[string]interface{})
2130	if rlcr.Passwords != nil {
2131		objectMap["passwords"] = rlcr.Passwords
2132	}
2133	return json.Marshal(objectMap)
2134}
2135
2136// Resource azure Resource Manager resource envelope.
2137type Resource struct {
2138	// ID - READ-ONLY; Specifies the resource ID.
2139	ID *string `json:"id,omitempty"`
2140	// Name - READ-ONLY; Specifies the name of the resource.
2141	Name *string `json:"name,omitempty"`
2142	// Identity - The identity of the resource.
2143	Identity *Identity `json:"identity,omitempty"`
2144	// Location - Specifies the location of the resource.
2145	Location *string `json:"location,omitempty"`
2146	// Type - READ-ONLY; Specifies the type of the resource.
2147	Type *string `json:"type,omitempty"`
2148	// Tags - Contains resource tags defined as key/value pairs.
2149	Tags map[string]*string `json:"tags"`
2150}
2151
2152// MarshalJSON is the custom marshaler for Resource.
2153func (r Resource) MarshalJSON() ([]byte, error) {
2154	objectMap := make(map[string]interface{})
2155	if r.Identity != nil {
2156		objectMap["identity"] = r.Identity
2157	}
2158	if r.Location != nil {
2159		objectMap["location"] = r.Location
2160	}
2161	if r.Tags != nil {
2162		objectMap["tags"] = r.Tags
2163	}
2164	return json.Marshal(objectMap)
2165}
2166
2167// ResourceID represents a resource ID. For example, for a subnet, it is the resource URL for the subnet.
2168type ResourceID struct {
2169	// ID - The ID of the resource
2170	ID *string `json:"id,omitempty"`
2171}
2172
2173// ResourceName the Resource Name.
2174type ResourceName struct {
2175	// Value - READ-ONLY; The name of the resource.
2176	Value *string `json:"value,omitempty"`
2177	// LocalizedValue - READ-ONLY; The localized name of the resource.
2178	LocalizedValue *string `json:"localizedValue,omitempty"`
2179}
2180
2181// MarshalJSON is the custom marshaler for ResourceName.
2182func (rn ResourceName) MarshalJSON() ([]byte, error) {
2183	objectMap := make(map[string]interface{})
2184	return json.Marshal(objectMap)
2185}
2186
2187// ResourceQuota the quota assigned to a resource.
2188type ResourceQuota struct {
2189	// ID - READ-ONLY; Specifies the resource ID.
2190	ID *string `json:"id,omitempty"`
2191	// Type - READ-ONLY; Specifies the resource type.
2192	Type *string `json:"type,omitempty"`
2193	// Name - READ-ONLY; Name of the resource.
2194	Name *ResourceName `json:"name,omitempty"`
2195	// Limit - READ-ONLY; The maximum permitted quota of the resource.
2196	Limit *int64 `json:"limit,omitempty"`
2197	// Unit - READ-ONLY; An enum describing the unit of quota measurement. Possible values include: 'Count'
2198	Unit QuotaUnit `json:"unit,omitempty"`
2199}
2200
2201// MarshalJSON is the custom marshaler for ResourceQuota.
2202func (rq ResourceQuota) MarshalJSON() ([]byte, error) {
2203	objectMap := make(map[string]interface{})
2204	return json.Marshal(objectMap)
2205}
2206
2207// ScaleSettings scale settings for AML Compute
2208type ScaleSettings struct {
2209	// MaxNodeCount - Max number of nodes to use
2210	MaxNodeCount *int32 `json:"maxNodeCount,omitempty"`
2211	// MinNodeCount - Min number of nodes to use
2212	MinNodeCount *int32 `json:"minNodeCount,omitempty"`
2213	// NodeIdleTimeBeforeScaleDown - Node Idle Time before scaling down amlCompute
2214	NodeIdleTimeBeforeScaleDown *string `json:"nodeIdleTimeBeforeScaleDown,omitempty"`
2215}
2216
2217// ServicePrincipalCredentials service principal credentials.
2218type ServicePrincipalCredentials struct {
2219	// ClientID - Client Id
2220	ClientID *string `json:"clientId,omitempty"`
2221	// ClientSecret - Client secret
2222	ClientSecret *string `json:"clientSecret,omitempty"`
2223}
2224
2225// SslConfiguration the ssl configuration for scoring
2226type SslConfiguration struct {
2227	// Status - Enable or disable ssl for scoring. Possible values include: 'Status1Disabled', 'Status1Enabled'
2228	Status Status1 `json:"status,omitempty"`
2229	// Cert - Cert data
2230	Cert *string `json:"cert,omitempty"`
2231	// Key - Key data
2232	Key *string `json:"key,omitempty"`
2233	// Cname - CNAME of the cert
2234	Cname *string `json:"cname,omitempty"`
2235}
2236
2237// SystemService a system service running on a compute.
2238type SystemService struct {
2239	// SystemServiceType - READ-ONLY; The type of this system service.
2240	SystemServiceType *string `json:"systemServiceType,omitempty"`
2241	// PublicIPAddress - READ-ONLY; Public IP address
2242	PublicIPAddress *string `json:"publicIpAddress,omitempty"`
2243	// Version - READ-ONLY; The version for this type.
2244	Version *string `json:"version,omitempty"`
2245}
2246
2247// MarshalJSON is the custom marshaler for SystemService.
2248func (ss SystemService) MarshalJSON() ([]byte, error) {
2249	objectMap := make(map[string]interface{})
2250	return json.Marshal(objectMap)
2251}
2252
2253// UpdateWorkspaceQuotas the properties for update Quota response.
2254type UpdateWorkspaceQuotas struct {
2255	// ID - READ-ONLY; Specifies the resource ID.
2256	ID *string `json:"id,omitempty"`
2257	// Type - READ-ONLY; Specifies the resource type.
2258	Type *string `json:"type,omitempty"`
2259	// Limit - The maximum permitted quota of the resource.
2260	Limit *int64 `json:"limit,omitempty"`
2261	// Unit - READ-ONLY; An enum describing the unit of quota measurement. Possible values include: 'Count'
2262	Unit QuotaUnit `json:"unit,omitempty"`
2263	// Status - Status of update workspace quota. Possible values include: 'Undefined', 'Success', 'Failure', 'InvalidQuotaBelowClusterMinimum', 'InvalidQuotaExceedsSubscriptionLimit', 'InvalidVMFamilyName'
2264	Status Status `json:"status,omitempty"`
2265}
2266
2267// MarshalJSON is the custom marshaler for UpdateWorkspaceQuotas.
2268func (uwq UpdateWorkspaceQuotas) MarshalJSON() ([]byte, error) {
2269	objectMap := make(map[string]interface{})
2270	if uwq.Limit != nil {
2271		objectMap["limit"] = uwq.Limit
2272	}
2273	if uwq.Status != "" {
2274		objectMap["status"] = uwq.Status
2275	}
2276	return json.Marshal(objectMap)
2277}
2278
2279// UpdateWorkspaceQuotasResult the result of update workspace quota.
2280type UpdateWorkspaceQuotasResult struct {
2281	autorest.Response `json:"-"`
2282	// Value - READ-ONLY; The list of workspace quota update result.
2283	Value *[]UpdateWorkspaceQuotas `json:"value,omitempty"`
2284	// NextLink - READ-ONLY; The URI to fetch the next page of workspace quota update result. Call ListNext() with this to fetch the next page of Workspace Quota update result.
2285	NextLink *string `json:"nextLink,omitempty"`
2286}
2287
2288// MarshalJSON is the custom marshaler for UpdateWorkspaceQuotasResult.
2289func (uwqr UpdateWorkspaceQuotasResult) MarshalJSON() ([]byte, error) {
2290	objectMap := make(map[string]interface{})
2291	return json.Marshal(objectMap)
2292}
2293
2294// Usage describes AML Resource Usage.
2295type Usage struct {
2296	// ID - READ-ONLY; Specifies the resource ID.
2297	ID *string `json:"id,omitempty"`
2298	// Type - READ-ONLY; Specifies the resource type.
2299	Type *string `json:"type,omitempty"`
2300	// Unit - READ-ONLY; An enum describing the unit of usage measurement. Possible values include: 'UsageUnitCount'
2301	Unit UsageUnit `json:"unit,omitempty"`
2302	// CurrentValue - READ-ONLY; The current usage of the resource.
2303	CurrentValue *int64 `json:"currentValue,omitempty"`
2304	// Limit - READ-ONLY; The maximum permitted usage of the resource.
2305	Limit *int64 `json:"limit,omitempty"`
2306	// Name - READ-ONLY; The name of the type of usage.
2307	Name *UsageName `json:"name,omitempty"`
2308}
2309
2310// MarshalJSON is the custom marshaler for Usage.
2311func (u Usage) MarshalJSON() ([]byte, error) {
2312	objectMap := make(map[string]interface{})
2313	return json.Marshal(objectMap)
2314}
2315
2316// UsageName the Usage Names.
2317type UsageName struct {
2318	// Value - READ-ONLY; The name of the resource.
2319	Value *string `json:"value,omitempty"`
2320	// LocalizedValue - READ-ONLY; The localized name of the resource.
2321	LocalizedValue *string `json:"localizedValue,omitempty"`
2322}
2323
2324// MarshalJSON is the custom marshaler for UsageName.
2325func (un UsageName) MarshalJSON() ([]byte, error) {
2326	objectMap := make(map[string]interface{})
2327	return json.Marshal(objectMap)
2328}
2329
2330// UserAccountCredentials settings for user account that gets created on each on the nodes of a compute.
2331type UserAccountCredentials struct {
2332	// AdminUserName - Name of the administrator user account which can be used to SSH to nodes.
2333	AdminUserName *string `json:"adminUserName,omitempty"`
2334	// AdminUserSSHPublicKey - SSH public key of the administrator user account.
2335	AdminUserSSHPublicKey *string `json:"adminUserSshPublicKey,omitempty"`
2336	// AdminUserPassword - Password of the administrator user account.
2337	AdminUserPassword *string `json:"adminUserPassword,omitempty"`
2338}
2339
2340// VirtualMachine a Machine Learning compute based on Azure Virtual Machines.
2341type VirtualMachine struct {
2342	Properties *VirtualMachineProperties `json:"properties,omitempty"`
2343	// ComputeLocation - Location for the underlying compute
2344	ComputeLocation *string `json:"computeLocation,omitempty"`
2345	// ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
2346	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
2347	// Description - The description of the Machine Learning compute.
2348	Description *string `json:"description,omitempty"`
2349	// CreatedOn - READ-ONLY; The date and time when the compute was created.
2350	CreatedOn *date.Time `json:"createdOn,omitempty"`
2351	// ModifiedOn - READ-ONLY; The date and time when the compute was last modified.
2352	ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
2353	// ResourceID - ARM resource id of the underlying compute
2354	ResourceID *string `json:"resourceId,omitempty"`
2355	// ProvisioningErrors - READ-ONLY; Errors during provisioning
2356	ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"`
2357	// IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false.
2358	IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"`
2359	// ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1'
2360	ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"`
2361}
2362
2363// MarshalJSON is the custom marshaler for VirtualMachine.
2364func (VM VirtualMachine) MarshalJSON() ([]byte, error) {
2365	VM.ComputeType = ComputeTypeVirtualMachine1
2366	objectMap := make(map[string]interface{})
2367	if VM.Properties != nil {
2368		objectMap["properties"] = VM.Properties
2369	}
2370	if VM.ComputeLocation != nil {
2371		objectMap["computeLocation"] = VM.ComputeLocation
2372	}
2373	if VM.Description != nil {
2374		objectMap["description"] = VM.Description
2375	}
2376	if VM.ResourceID != nil {
2377		objectMap["resourceId"] = VM.ResourceID
2378	}
2379	if VM.ComputeType != "" {
2380		objectMap["computeType"] = VM.ComputeType
2381	}
2382	return json.Marshal(objectMap)
2383}
2384
2385// AsAKS is the BasicCompute implementation for VirtualMachine.
2386func (VM VirtualMachine) AsAKS() (*AKS, bool) {
2387	return nil, false
2388}
2389
2390// AsAmlCompute is the BasicCompute implementation for VirtualMachine.
2391func (VM VirtualMachine) AsAmlCompute() (*AmlCompute, bool) {
2392	return nil, false
2393}
2394
2395// AsVirtualMachine is the BasicCompute implementation for VirtualMachine.
2396func (VM VirtualMachine) AsVirtualMachine() (*VirtualMachine, bool) {
2397	return &VM, true
2398}
2399
2400// AsHDInsight is the BasicCompute implementation for VirtualMachine.
2401func (VM VirtualMachine) AsHDInsight() (*HDInsight, bool) {
2402	return nil, false
2403}
2404
2405// AsDataFactory is the BasicCompute implementation for VirtualMachine.
2406func (VM VirtualMachine) AsDataFactory() (*DataFactory, bool) {
2407	return nil, false
2408}
2409
2410// AsDatabricks is the BasicCompute implementation for VirtualMachine.
2411func (VM VirtualMachine) AsDatabricks() (*Databricks, bool) {
2412	return nil, false
2413}
2414
2415// AsDataLakeAnalytics is the BasicCompute implementation for VirtualMachine.
2416func (VM VirtualMachine) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) {
2417	return nil, false
2418}
2419
2420// AsCompute is the BasicCompute implementation for VirtualMachine.
2421func (VM VirtualMachine) AsCompute() (*Compute, bool) {
2422	return nil, false
2423}
2424
2425// AsBasicCompute is the BasicCompute implementation for VirtualMachine.
2426func (VM VirtualMachine) AsBasicCompute() (BasicCompute, bool) {
2427	return &VM, true
2428}
2429
2430// VirtualMachineProperties ...
2431type VirtualMachineProperties struct {
2432	// VirtualMachineSize - Virtual Machine size
2433	VirtualMachineSize *string `json:"virtualMachineSize,omitempty"`
2434	// SSHPort - Port open for ssh connections.
2435	SSHPort *int32 `json:"sshPort,omitempty"`
2436	// Address - Public IP address of the virtual machine.
2437	Address *string `json:"address,omitempty"`
2438	// AdministratorAccount - Admin credentials for virtual machine
2439	AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"`
2440}
2441
2442// VirtualMachineSecrets secrets related to a Machine Learning compute based on AKS.
2443type VirtualMachineSecrets struct {
2444	// AdministratorAccount - Admin credentials for virtual machine.
2445	AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"`
2446	// ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine', 'ComputeTypeBasicComputeSecretsComputeTypeDatabricks'
2447	ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"`
2448}
2449
2450// MarshalJSON is the custom marshaler for VirtualMachineSecrets.
2451func (vms VirtualMachineSecrets) MarshalJSON() ([]byte, error) {
2452	vms.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine
2453	objectMap := make(map[string]interface{})
2454	if vms.AdministratorAccount != nil {
2455		objectMap["administratorAccount"] = vms.AdministratorAccount
2456	}
2457	if vms.ComputeType != "" {
2458		objectMap["computeType"] = vms.ComputeType
2459	}
2460	return json.Marshal(objectMap)
2461}
2462
2463// AsAksComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets.
2464func (vms VirtualMachineSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) {
2465	return nil, false
2466}
2467
2468// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets.
2469func (vms VirtualMachineSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) {
2470	return &vms, true
2471}
2472
2473// AsDatabricksComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets.
2474func (vms VirtualMachineSecrets) AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) {
2475	return nil, false
2476}
2477
2478// AsComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets.
2479func (vms VirtualMachineSecrets) AsComputeSecrets() (*ComputeSecrets, bool) {
2480	return nil, false
2481}
2482
2483// AsBasicComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets.
2484func (vms VirtualMachineSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) {
2485	return &vms, true
2486}
2487
2488// VirtualMachineSize describes the properties of a VM size.
2489type VirtualMachineSize struct {
2490	// Name - READ-ONLY; The name of the virtual machine size.
2491	Name *string `json:"name,omitempty"`
2492	// Family - READ-ONLY; The family name of the virtual machine size.
2493	Family *string `json:"family,omitempty"`
2494	// VCPUs - READ-ONLY; The number of vCPUs supported by the virtual machine size.
2495	VCPUs *int32 `json:"vCPUs,omitempty"`
2496	// Gpus - READ-ONLY; The number of gPUs supported by the virtual machine size.
2497	Gpus *int32 `json:"gpus,omitempty"`
2498	// OsVhdSizeMB - READ-ONLY; The OS VHD disk size, in MB, allowed by the virtual machine size.
2499	OsVhdSizeMB *int32 `json:"osVhdSizeMB,omitempty"`
2500	// MaxResourceVolumeMB - READ-ONLY; The resource volume size, in MB, allowed by the virtual machine size.
2501	MaxResourceVolumeMB *int32 `json:"maxResourceVolumeMB,omitempty"`
2502	// MemoryGB - READ-ONLY; The amount of memory, in GB, supported by the virtual machine size.
2503	MemoryGB *float64 `json:"memoryGB,omitempty"`
2504	// LowPriorityCapable - READ-ONLY; Specifies if the virtual machine size supports low priority VMs.
2505	LowPriorityCapable *bool `json:"lowPriorityCapable,omitempty"`
2506	// PremiumIO - READ-ONLY; Specifies if the virtual machine size supports premium IO.
2507	PremiumIO *bool `json:"premiumIO,omitempty"`
2508}
2509
2510// MarshalJSON is the custom marshaler for VirtualMachineSize.
2511func (vms VirtualMachineSize) MarshalJSON() ([]byte, error) {
2512	objectMap := make(map[string]interface{})
2513	return json.Marshal(objectMap)
2514}
2515
2516// VirtualMachineSizeListResult the List Virtual Machine size operation response.
2517type VirtualMachineSizeListResult struct {
2518	autorest.Response `json:"-"`
2519	// AmlCompute - The list of virtual machine sizes supported by AmlCompute.
2520	AmlCompute *[]VirtualMachineSize `json:"amlCompute,omitempty"`
2521}
2522
2523// VirtualMachineSSHCredentials admin credentials for virtual machine
2524type VirtualMachineSSHCredentials struct {
2525	// Username - Username of admin account
2526	Username *string `json:"username,omitempty"`
2527	// Password - Password of admin account
2528	Password *string `json:"password,omitempty"`
2529	// PublicKeyData - Public key data
2530	PublicKeyData *string `json:"publicKeyData,omitempty"`
2531	// PrivateKeyData - Private key data
2532	PrivateKeyData *string `json:"privateKeyData,omitempty"`
2533}
2534
2535// Workspace an object that represents a machine learning workspace.
2536type Workspace struct {
2537	autorest.Response `json:"-"`
2538	// WorkspaceProperties - The properties of the machine learning workspace.
2539	*WorkspaceProperties `json:"properties,omitempty"`
2540	// ID - READ-ONLY; Specifies the resource ID.
2541	ID *string `json:"id,omitempty"`
2542	// Name - READ-ONLY; Specifies the name of the resource.
2543	Name *string `json:"name,omitempty"`
2544	// Identity - The identity of the resource.
2545	Identity *Identity `json:"identity,omitempty"`
2546	// Location - Specifies the location of the resource.
2547	Location *string `json:"location,omitempty"`
2548	// Type - READ-ONLY; Specifies the type of the resource.
2549	Type *string `json:"type,omitempty"`
2550	// Tags - Contains resource tags defined as key/value pairs.
2551	Tags map[string]*string `json:"tags"`
2552}
2553
2554// MarshalJSON is the custom marshaler for Workspace.
2555func (w Workspace) MarshalJSON() ([]byte, error) {
2556	objectMap := make(map[string]interface{})
2557	if w.WorkspaceProperties != nil {
2558		objectMap["properties"] = w.WorkspaceProperties
2559	}
2560	if w.Identity != nil {
2561		objectMap["identity"] = w.Identity
2562	}
2563	if w.Location != nil {
2564		objectMap["location"] = w.Location
2565	}
2566	if w.Tags != nil {
2567		objectMap["tags"] = w.Tags
2568	}
2569	return json.Marshal(objectMap)
2570}
2571
2572// UnmarshalJSON is the custom unmarshaler for Workspace struct.
2573func (w *Workspace) UnmarshalJSON(body []byte) error {
2574	var m map[string]*json.RawMessage
2575	err := json.Unmarshal(body, &m)
2576	if err != nil {
2577		return err
2578	}
2579	for k, v := range m {
2580		switch k {
2581		case "properties":
2582			if v != nil {
2583				var workspaceProperties WorkspaceProperties
2584				err = json.Unmarshal(*v, &workspaceProperties)
2585				if err != nil {
2586					return err
2587				}
2588				w.WorkspaceProperties = &workspaceProperties
2589			}
2590		case "id":
2591			if v != nil {
2592				var ID string
2593				err = json.Unmarshal(*v, &ID)
2594				if err != nil {
2595					return err
2596				}
2597				w.ID = &ID
2598			}
2599		case "name":
2600			if v != nil {
2601				var name string
2602				err = json.Unmarshal(*v, &name)
2603				if err != nil {
2604					return err
2605				}
2606				w.Name = &name
2607			}
2608		case "identity":
2609			if v != nil {
2610				var identity Identity
2611				err = json.Unmarshal(*v, &identity)
2612				if err != nil {
2613					return err
2614				}
2615				w.Identity = &identity
2616			}
2617		case "location":
2618			if v != nil {
2619				var location string
2620				err = json.Unmarshal(*v, &location)
2621				if err != nil {
2622					return err
2623				}
2624				w.Location = &location
2625			}
2626		case "type":
2627			if v != nil {
2628				var typeVar string
2629				err = json.Unmarshal(*v, &typeVar)
2630				if err != nil {
2631					return err
2632				}
2633				w.Type = &typeVar
2634			}
2635		case "tags":
2636			if v != nil {
2637				var tags map[string]*string
2638				err = json.Unmarshal(*v, &tags)
2639				if err != nil {
2640					return err
2641				}
2642				w.Tags = tags
2643			}
2644		}
2645	}
2646
2647	return nil
2648}
2649
2650// WorkspaceListResult the result of a request to list machine learning workspaces.
2651type WorkspaceListResult struct {
2652	autorest.Response `json:"-"`
2653	// Value - The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces.
2654	Value *[]Workspace `json:"value,omitempty"`
2655	// NextLink - The URI that can be used to request the next list of machine learning workspaces.
2656	NextLink *string `json:"nextLink,omitempty"`
2657}
2658
2659// WorkspaceListResultIterator provides access to a complete listing of Workspace values.
2660type WorkspaceListResultIterator struct {
2661	i    int
2662	page WorkspaceListResultPage
2663}
2664
2665// NextWithContext advances to the next value.  If there was an error making
2666// the request the iterator does not advance and the error is returned.
2667func (iter *WorkspaceListResultIterator) NextWithContext(ctx context.Context) (err error) {
2668	if tracing.IsEnabled() {
2669		ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListResultIterator.NextWithContext")
2670		defer func() {
2671			sc := -1
2672			if iter.Response().Response.Response != nil {
2673				sc = iter.Response().Response.Response.StatusCode
2674			}
2675			tracing.EndSpan(ctx, sc, err)
2676		}()
2677	}
2678	iter.i++
2679	if iter.i < len(iter.page.Values()) {
2680		return nil
2681	}
2682	err = iter.page.NextWithContext(ctx)
2683	if err != nil {
2684		iter.i--
2685		return err
2686	}
2687	iter.i = 0
2688	return nil
2689}
2690
2691// Next advances to the next value.  If there was an error making
2692// the request the iterator does not advance and the error is returned.
2693// Deprecated: Use NextWithContext() instead.
2694func (iter *WorkspaceListResultIterator) Next() error {
2695	return iter.NextWithContext(context.Background())
2696}
2697
2698// NotDone returns true if the enumeration should be started or is not yet complete.
2699func (iter WorkspaceListResultIterator) NotDone() bool {
2700	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2701}
2702
2703// Response returns the raw server response from the last page request.
2704func (iter WorkspaceListResultIterator) Response() WorkspaceListResult {
2705	return iter.page.Response()
2706}
2707
2708// Value returns the current value or a zero-initialized value if the
2709// iterator has advanced beyond the end of the collection.
2710func (iter WorkspaceListResultIterator) Value() Workspace {
2711	if !iter.page.NotDone() {
2712		return Workspace{}
2713	}
2714	return iter.page.Values()[iter.i]
2715}
2716
2717// Creates a new instance of the WorkspaceListResultIterator type.
2718func NewWorkspaceListResultIterator(page WorkspaceListResultPage) WorkspaceListResultIterator {
2719	return WorkspaceListResultIterator{page: page}
2720}
2721
2722// IsEmpty returns true if the ListResult contains no values.
2723func (wlr WorkspaceListResult) IsEmpty() bool {
2724	return wlr.Value == nil || len(*wlr.Value) == 0
2725}
2726
2727// hasNextLink returns true if the NextLink is not empty.
2728func (wlr WorkspaceListResult) hasNextLink() bool {
2729	return wlr.NextLink != nil && len(*wlr.NextLink) != 0
2730}
2731
2732// workspaceListResultPreparer prepares a request to retrieve the next set of results.
2733// It returns nil if no more results exist.
2734func (wlr WorkspaceListResult) workspaceListResultPreparer(ctx context.Context) (*http.Request, error) {
2735	if !wlr.hasNextLink() {
2736		return nil, nil
2737	}
2738	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2739		autorest.AsJSON(),
2740		autorest.AsGet(),
2741		autorest.WithBaseURL(to.String(wlr.NextLink)))
2742}
2743
2744// WorkspaceListResultPage contains a page of Workspace values.
2745type WorkspaceListResultPage struct {
2746	fn  func(context.Context, WorkspaceListResult) (WorkspaceListResult, error)
2747	wlr WorkspaceListResult
2748}
2749
2750// NextWithContext advances to the next page of values.  If there was an error making
2751// the request the page does not advance and the error is returned.
2752func (page *WorkspaceListResultPage) NextWithContext(ctx context.Context) (err error) {
2753	if tracing.IsEnabled() {
2754		ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListResultPage.NextWithContext")
2755		defer func() {
2756			sc := -1
2757			if page.Response().Response.Response != nil {
2758				sc = page.Response().Response.Response.StatusCode
2759			}
2760			tracing.EndSpan(ctx, sc, err)
2761		}()
2762	}
2763	for {
2764		next, err := page.fn(ctx, page.wlr)
2765		if err != nil {
2766			return err
2767		}
2768		page.wlr = next
2769		if !next.hasNextLink() || !next.IsEmpty() {
2770			break
2771		}
2772	}
2773	return nil
2774}
2775
2776// Next advances to the next page of values.  If there was an error making
2777// the request the page does not advance and the error is returned.
2778// Deprecated: Use NextWithContext() instead.
2779func (page *WorkspaceListResultPage) Next() error {
2780	return page.NextWithContext(context.Background())
2781}
2782
2783// NotDone returns true if the page enumeration should be started or is not yet complete.
2784func (page WorkspaceListResultPage) NotDone() bool {
2785	return !page.wlr.IsEmpty()
2786}
2787
2788// Response returns the raw server response from the last page request.
2789func (page WorkspaceListResultPage) Response() WorkspaceListResult {
2790	return page.wlr
2791}
2792
2793// Values returns the slice of values for the current page or nil if there are no values.
2794func (page WorkspaceListResultPage) Values() []Workspace {
2795	if page.wlr.IsEmpty() {
2796		return nil
2797	}
2798	return *page.wlr.Value
2799}
2800
2801// Creates a new instance of the WorkspaceListResultPage type.
2802func NewWorkspaceListResultPage(cur WorkspaceListResult, getNextPage func(context.Context, WorkspaceListResult) (WorkspaceListResult, error)) WorkspaceListResultPage {
2803	return WorkspaceListResultPage{
2804		fn:  getNextPage,
2805		wlr: cur,
2806	}
2807}
2808
2809// WorkspaceProperties the properties of a machine learning workspace.
2810type WorkspaceProperties struct {
2811	// WorkspaceID - READ-ONLY; The immutable id associated with this workspace.
2812	WorkspaceID *string `json:"workspaceId,omitempty"`
2813	// Description - The description of this workspace.
2814	Description *string `json:"description,omitempty"`
2815	// FriendlyName - The friendly name for this workspace. This name in mutable
2816	FriendlyName *string `json:"friendlyName,omitempty"`
2817	// CreationTime - READ-ONLY; The creation time of the machine learning workspace in ISO8601 format.
2818	CreationTime *date.Time `json:"creationTime,omitempty"`
2819	// KeyVault - ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created
2820	KeyVault *string `json:"keyVault,omitempty"`
2821	// ApplicationInsights - ARM id of the application insights associated with this workspace. This cannot be changed once the workspace has been created
2822	ApplicationInsights *string `json:"applicationInsights,omitempty"`
2823	// ContainerRegistry - ARM id of the container registry associated with this workspace. This cannot be changed once the workspace has been created
2824	ContainerRegistry *string `json:"containerRegistry,omitempty"`
2825	// StorageAccount - ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been created
2826	StorageAccount *string `json:"storageAccount,omitempty"`
2827	// DiscoveryURL - Url for the discovery service to identify regional endpoints for machine learning experimentation services
2828	DiscoveryURL *string `json:"discoveryUrl,omitempty"`
2829	// ProvisioningState - READ-ONLY; The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled'
2830	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
2831}
2832
2833// MarshalJSON is the custom marshaler for WorkspaceProperties.
2834func (wp WorkspaceProperties) MarshalJSON() ([]byte, error) {
2835	objectMap := make(map[string]interface{})
2836	if wp.Description != nil {
2837		objectMap["description"] = wp.Description
2838	}
2839	if wp.FriendlyName != nil {
2840		objectMap["friendlyName"] = wp.FriendlyName
2841	}
2842	if wp.KeyVault != nil {
2843		objectMap["keyVault"] = wp.KeyVault
2844	}
2845	if wp.ApplicationInsights != nil {
2846		objectMap["applicationInsights"] = wp.ApplicationInsights
2847	}
2848	if wp.ContainerRegistry != nil {
2849		objectMap["containerRegistry"] = wp.ContainerRegistry
2850	}
2851	if wp.StorageAccount != nil {
2852		objectMap["storageAccount"] = wp.StorageAccount
2853	}
2854	if wp.DiscoveryURL != nil {
2855		objectMap["discoveryUrl"] = wp.DiscoveryURL
2856	}
2857	return json.Marshal(objectMap)
2858}
2859
2860// WorkspacePropertiesUpdateParameters the parameters for updating the properties of a machine learning
2861// workspace.
2862type WorkspacePropertiesUpdateParameters struct {
2863	// Description - The description of this workspace.
2864	Description *string `json:"description,omitempty"`
2865	// FriendlyName - The friendly name for this workspace.
2866	FriendlyName *string `json:"friendlyName,omitempty"`
2867}
2868
2869// WorkspacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
2870// long-running operation.
2871type WorkspacesCreateOrUpdateFuture struct {
2872	azure.FutureAPI
2873	// Result returns the result of the asynchronous operation.
2874	// If the operation has not completed it will return an error.
2875	Result func(WorkspacesClient) (Workspace, error)
2876}
2877
2878// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2879func (future *WorkspacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
2880	var azFuture azure.Future
2881	if err := json.Unmarshal(body, &azFuture); err != nil {
2882		return err
2883	}
2884	future.FutureAPI = &azFuture
2885	future.Result = future.result
2886	return nil
2887}
2888
2889// result is the default implementation for WorkspacesCreateOrUpdateFuture.Result.
2890func (future *WorkspacesCreateOrUpdateFuture) result(client WorkspacesClient) (w Workspace, err error) {
2891	var done bool
2892	done, err = future.DoneWithContext(context.Background(), client)
2893	if err != nil {
2894		err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
2895		return
2896	}
2897	if !done {
2898		w.Response.Response = future.Response()
2899		err = azure.NewAsyncOpIncompleteError("machinelearningservices.WorkspacesCreateOrUpdateFuture")
2900		return
2901	}
2902	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2903	if w.Response.Response, err = future.GetResult(sender); err == nil && w.Response.Response.StatusCode != http.StatusNoContent {
2904		w, err = client.CreateOrUpdateResponder(w.Response.Response)
2905		if err != nil {
2906			err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesCreateOrUpdateFuture", "Result", w.Response.Response, "Failure responding to request")
2907		}
2908	}
2909	return
2910}
2911
2912// WorkspacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
2913// operation.
2914type WorkspacesDeleteFuture struct {
2915	azure.FutureAPI
2916	// Result returns the result of the asynchronous operation.
2917	// If the operation has not completed it will return an error.
2918	Result func(WorkspacesClient) (autorest.Response, error)
2919}
2920
2921// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2922func (future *WorkspacesDeleteFuture) UnmarshalJSON(body []byte) error {
2923	var azFuture azure.Future
2924	if err := json.Unmarshal(body, &azFuture); err != nil {
2925		return err
2926	}
2927	future.FutureAPI = &azFuture
2928	future.Result = future.result
2929	return nil
2930}
2931
2932// result is the default implementation for WorkspacesDeleteFuture.Result.
2933func (future *WorkspacesDeleteFuture) result(client WorkspacesClient) (ar autorest.Response, err error) {
2934	var done bool
2935	done, err = future.DoneWithContext(context.Background(), client)
2936	if err != nil {
2937		err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesDeleteFuture", "Result", future.Response(), "Polling failure")
2938		return
2939	}
2940	if !done {
2941		ar.Response = future.Response()
2942		err = azure.NewAsyncOpIncompleteError("machinelearningservices.WorkspacesDeleteFuture")
2943		return
2944	}
2945	ar.Response = future.Response()
2946	return
2947}
2948
2949// WorkspaceUpdateParameters the parameters for updating a machine learning workspace.
2950type WorkspaceUpdateParameters struct {
2951	// Tags - The resource tags for the machine learning workspace.
2952	Tags map[string]*string `json:"tags"`
2953	// WorkspacePropertiesUpdateParameters - The properties that the machine learning workspace will be updated with.
2954	*WorkspacePropertiesUpdateParameters `json:"properties,omitempty"`
2955}
2956
2957// MarshalJSON is the custom marshaler for WorkspaceUpdateParameters.
2958func (wup WorkspaceUpdateParameters) MarshalJSON() ([]byte, error) {
2959	objectMap := make(map[string]interface{})
2960	if wup.Tags != nil {
2961		objectMap["tags"] = wup.Tags
2962	}
2963	if wup.WorkspacePropertiesUpdateParameters != nil {
2964		objectMap["properties"] = wup.WorkspacePropertiesUpdateParameters
2965	}
2966	return json.Marshal(objectMap)
2967}
2968
2969// UnmarshalJSON is the custom unmarshaler for WorkspaceUpdateParameters struct.
2970func (wup *WorkspaceUpdateParameters) UnmarshalJSON(body []byte) error {
2971	var m map[string]*json.RawMessage
2972	err := json.Unmarshal(body, &m)
2973	if err != nil {
2974		return err
2975	}
2976	for k, v := range m {
2977		switch k {
2978		case "tags":
2979			if v != nil {
2980				var tags map[string]*string
2981				err = json.Unmarshal(*v, &tags)
2982				if err != nil {
2983					return err
2984				}
2985				wup.Tags = tags
2986			}
2987		case "properties":
2988			if v != nil {
2989				var workspacePropertiesUpdateParameters WorkspacePropertiesUpdateParameters
2990				err = json.Unmarshal(*v, &workspacePropertiesUpdateParameters)
2991				if err != nil {
2992					return err
2993				}
2994				wup.WorkspacePropertiesUpdateParameters = &workspacePropertiesUpdateParameters
2995			}
2996		}
2997	}
2998
2999	return nil
3000}
3001