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