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/2020-01-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: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled'
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: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled'
226	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
227	// Description - The description of the Machine Learning compute.
228	Description *string `json:"description,omitempty"`
229	// CreatedOn - READ-ONLY; The date and time when the compute was created.
230	CreatedOn *date.Time `json:"createdOn,omitempty"`
231	// ModifiedOn - READ-ONLY; The date and time when the compute was last modified.
232	ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
233	// ResourceID - ARM resource id of the underlying compute
234	ResourceID *string `json:"resourceId,omitempty"`
235	// ProvisioningErrors - READ-ONLY; Errors during provisioning
236	ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"`
237	// IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false.
238	IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"`
239	// ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1'
240	ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"`
241}
242
243// MarshalJSON is the custom marshaler for AmlCompute.
244func (ac AmlCompute) MarshalJSON() ([]byte, error) {
245	ac.ComputeType = ComputeTypeAmlCompute1
246	objectMap := make(map[string]interface{})
247	if ac.Properties != nil {
248		objectMap["properties"] = ac.Properties
249	}
250	if ac.ComputeLocation != nil {
251		objectMap["computeLocation"] = ac.ComputeLocation
252	}
253	if ac.Description != nil {
254		objectMap["description"] = ac.Description
255	}
256	if ac.ResourceID != nil {
257		objectMap["resourceId"] = ac.ResourceID
258	}
259	if ac.ComputeType != "" {
260		objectMap["computeType"] = ac.ComputeType
261	}
262	return json.Marshal(objectMap)
263}
264
265// AsAKS is the BasicCompute implementation for AmlCompute.
266func (ac AmlCompute) AsAKS() (*AKS, bool) {
267	return nil, false
268}
269
270// AsAmlCompute is the BasicCompute implementation for AmlCompute.
271func (ac AmlCompute) AsAmlCompute() (*AmlCompute, bool) {
272	return &ac, true
273}
274
275// AsVirtualMachine is the BasicCompute implementation for AmlCompute.
276func (ac AmlCompute) AsVirtualMachine() (*VirtualMachine, bool) {
277	return nil, false
278}
279
280// AsHDInsight is the BasicCompute implementation for AmlCompute.
281func (ac AmlCompute) AsHDInsight() (*HDInsight, bool) {
282	return nil, false
283}
284
285// AsDataFactory is the BasicCompute implementation for AmlCompute.
286func (ac AmlCompute) AsDataFactory() (*DataFactory, bool) {
287	return nil, false
288}
289
290// AsDatabricks is the BasicCompute implementation for AmlCompute.
291func (ac AmlCompute) AsDatabricks() (*Databricks, bool) {
292	return nil, false
293}
294
295// AsDataLakeAnalytics is the BasicCompute implementation for AmlCompute.
296func (ac AmlCompute) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) {
297	return nil, false
298}
299
300// AsCompute is the BasicCompute implementation for AmlCompute.
301func (ac AmlCompute) AsCompute() (*Compute, bool) {
302	return nil, false
303}
304
305// AsBasicCompute is the BasicCompute implementation for AmlCompute.
306func (ac AmlCompute) AsBasicCompute() (BasicCompute, bool) {
307	return &ac, true
308}
309
310// AmlComputeNodeInformation compute node information related to a AmlCompute.
311type AmlComputeNodeInformation struct {
312	// NodeID - READ-ONLY; ID of the compute node.
313	NodeID *string `json:"nodeId,omitempty"`
314	// PrivateIPAddress - READ-ONLY; Private IP address of the compute node.
315	PrivateIPAddress *string `json:"privateIpAddress,omitempty"`
316	// PublicIPAddress - READ-ONLY; Public IP address of the compute node.
317	PublicIPAddress *string `json:"publicIpAddress,omitempty"`
318	// Port - READ-ONLY; SSH port number of the node.
319	Port *float64 `json:"port,omitempty"`
320	// NodeState - READ-ONLY; State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted. Possible values include: 'Idle', 'Running', 'Preparing', 'Unusable', 'Leaving', 'Preempted'
321	NodeState NodeState `json:"nodeState,omitempty"`
322	// RunID - READ-ONLY; ID of the Experiment running on the node, if any else null.
323	RunID *string `json:"runId,omitempty"`
324}
325
326// MarshalJSON is the custom marshaler for AmlComputeNodeInformation.
327func (acni AmlComputeNodeInformation) MarshalJSON() ([]byte, error) {
328	objectMap := make(map[string]interface{})
329	return json.Marshal(objectMap)
330}
331
332// AmlComputeNodesInformation compute node information related to a AmlCompute.
333type AmlComputeNodesInformation struct {
334	autorest.Response `json:"-"`
335	// Nodes - READ-ONLY; The collection of returned AmlCompute nodes details.
336	Nodes *[]AmlComputeNodeInformation `json:"nodes,omitempty"`
337	// NextLink - READ-ONLY; The continuation token.
338	NextLink *string `json:"nextLink,omitempty"`
339	// ComputeType - Possible values include: 'ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation', 'ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute'
340	ComputeType ComputeTypeBasicComputeNodesInformation `json:"computeType,omitempty"`
341}
342
343// MarshalJSON is the custom marshaler for AmlComputeNodesInformation.
344func (acni AmlComputeNodesInformation) MarshalJSON() ([]byte, error) {
345	acni.ComputeType = ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute
346	objectMap := make(map[string]interface{})
347	if acni.ComputeType != "" {
348		objectMap["computeType"] = acni.ComputeType
349	}
350	return json.Marshal(objectMap)
351}
352
353// AsAmlComputeNodesInformation is the BasicComputeNodesInformation implementation for AmlComputeNodesInformation.
354func (acni AmlComputeNodesInformation) AsAmlComputeNodesInformation() (*AmlComputeNodesInformation, bool) {
355	return &acni, true
356}
357
358// AsComputeNodesInformation is the BasicComputeNodesInformation implementation for AmlComputeNodesInformation.
359func (acni AmlComputeNodesInformation) AsComputeNodesInformation() (*ComputeNodesInformation, bool) {
360	return nil, false
361}
362
363// AsBasicComputeNodesInformation is the BasicComputeNodesInformation implementation for AmlComputeNodesInformation.
364func (acni AmlComputeNodesInformation) AsBasicComputeNodesInformation() (BasicComputeNodesInformation, bool) {
365	return &acni, true
366}
367
368// AmlComputeProperties AML Compute properties
369type AmlComputeProperties struct {
370	// VMSize - Virtual Machine Size
371	VMSize *string `json:"vmSize,omitempty"`
372	// VMPriority - Virtual Machine priority. Possible values include: 'Dedicated', 'LowPriority'
373	VMPriority VMPriority `json:"vmPriority,omitempty"`
374	// ScaleSettings - Scale settings for AML Compute
375	ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"`
376	// UserAccountCredentials - Credentials for an administrator user account that will be created on each compute node.
377	UserAccountCredentials *UserAccountCredentials `json:"userAccountCredentials,omitempty"`
378	// Subnet - Virtual network subnet resource ID the compute nodes belong to.
379	Subnet *ResourceID `json:"subnet,omitempty"`
380	// RemoteLoginPortPublicAccess - State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be default only during cluster creation time, after creation it will be either enabled or disabled. Possible values include: 'RemoteLoginPortPublicAccessEnabled', 'RemoteLoginPortPublicAccessDisabled', 'RemoteLoginPortPublicAccessNotSpecified'
381	RemoteLoginPortPublicAccess RemoteLoginPortPublicAccess `json:"remoteLoginPortPublicAccess,omitempty"`
382	// AllocationState - READ-ONLY; Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There are no changes to the number of compute nodes in the compute in progress. A compute enters this state when it is created and when no operations are being performed on the compute to change the number of compute nodes. resizing - Indicates that the compute is resizing; that is, compute nodes are being added to or removed from the compute. Possible values include: 'Steady', 'Resizing'
383	AllocationState AllocationState `json:"allocationState,omitempty"`
384	// AllocationStateTransitionTime - READ-ONLY; The time at which the compute entered its current allocation state.
385	AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"`
386	// Errors - READ-ONLY; Collection of errors encountered by various compute nodes during node setup.
387	Errors *[]Error `json:"errors,omitempty"`
388	// CurrentNodeCount - READ-ONLY; The number of compute nodes currently assigned to the compute.
389	CurrentNodeCount *int32 `json:"currentNodeCount,omitempty"`
390	// TargetNodeCount - READ-ONLY; The target number of compute nodes for the compute. If the allocationState is resizing, this property denotes the target node count for the ongoing resize operation. If the allocationState is steady, this property denotes the target node count for the previous resize operation.
391	TargetNodeCount *int32 `json:"targetNodeCount,omitempty"`
392	// NodeStateCounts - READ-ONLY; Counts of various node states on the compute.
393	NodeStateCounts *NodeStateCounts `json:"nodeStateCounts,omitempty"`
394}
395
396// MarshalJSON is the custom marshaler for AmlComputeProperties.
397func (ac AmlComputeProperties) MarshalJSON() ([]byte, error) {
398	objectMap := make(map[string]interface{})
399	if ac.VMSize != nil {
400		objectMap["vmSize"] = ac.VMSize
401	}
402	if ac.VMPriority != "" {
403		objectMap["vmPriority"] = ac.VMPriority
404	}
405	if ac.ScaleSettings != nil {
406		objectMap["scaleSettings"] = ac.ScaleSettings
407	}
408	if ac.UserAccountCredentials != nil {
409		objectMap["userAccountCredentials"] = ac.UserAccountCredentials
410	}
411	if ac.Subnet != nil {
412		objectMap["subnet"] = ac.Subnet
413	}
414	if ac.RemoteLoginPortPublicAccess != "" {
415		objectMap["remoteLoginPortPublicAccess"] = ac.RemoteLoginPortPublicAccess
416	}
417	return json.Marshal(objectMap)
418}
419
420// AmlUserFeature features enabled for a workspace
421type AmlUserFeature struct {
422	// ID - Specifies the feature ID
423	ID *string `json:"id,omitempty"`
424	// DisplayName - Specifies the feature name
425	DisplayName *string `json:"displayName,omitempty"`
426	// Description - Describes the feature for user experience
427	Description *string `json:"description,omitempty"`
428}
429
430// ClusterUpdateParameters amlCompute update parameters.
431type ClusterUpdateParameters struct {
432	// ClusterUpdateProperties - The properties of the amlCompute.
433	*ClusterUpdateProperties `json:"properties,omitempty"`
434}
435
436// MarshalJSON is the custom marshaler for ClusterUpdateParameters.
437func (cup ClusterUpdateParameters) MarshalJSON() ([]byte, error) {
438	objectMap := make(map[string]interface{})
439	if cup.ClusterUpdateProperties != nil {
440		objectMap["properties"] = cup.ClusterUpdateProperties
441	}
442	return json.Marshal(objectMap)
443}
444
445// UnmarshalJSON is the custom unmarshaler for ClusterUpdateParameters struct.
446func (cup *ClusterUpdateParameters) UnmarshalJSON(body []byte) error {
447	var m map[string]*json.RawMessage
448	err := json.Unmarshal(body, &m)
449	if err != nil {
450		return err
451	}
452	for k, v := range m {
453		switch k {
454		case "properties":
455			if v != nil {
456				var clusterUpdateProperties ClusterUpdateProperties
457				err = json.Unmarshal(*v, &clusterUpdateProperties)
458				if err != nil {
459					return err
460				}
461				cup.ClusterUpdateProperties = &clusterUpdateProperties
462			}
463		}
464	}
465
466	return nil
467}
468
469// ClusterUpdateProperties the properties of a amlCompute that need to be updated.
470type ClusterUpdateProperties struct {
471	// ScaleSettings - Desired scale settings for the amlCompute.
472	ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"`
473}
474
475// BasicCompute machine Learning compute object.
476type BasicCompute interface {
477	AsAKS() (*AKS, bool)
478	AsAmlCompute() (*AmlCompute, bool)
479	AsVirtualMachine() (*VirtualMachine, bool)
480	AsHDInsight() (*HDInsight, bool)
481	AsDataFactory() (*DataFactory, bool)
482	AsDatabricks() (*Databricks, bool)
483	AsDataLakeAnalytics() (*DataLakeAnalytics, bool)
484	AsCompute() (*Compute, bool)
485}
486
487// Compute machine Learning compute object.
488type Compute struct {
489	// ComputeLocation - Location for the underlying compute
490	ComputeLocation *string `json:"computeLocation,omitempty"`
491	// ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled'
492	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
493	// Description - The description of the Machine Learning compute.
494	Description *string `json:"description,omitempty"`
495	// CreatedOn - READ-ONLY; The date and time when the compute was created.
496	CreatedOn *date.Time `json:"createdOn,omitempty"`
497	// ModifiedOn - READ-ONLY; The date and time when the compute was last modified.
498	ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
499	// ResourceID - ARM resource id of the underlying compute
500	ResourceID *string `json:"resourceId,omitempty"`
501	// ProvisioningErrors - READ-ONLY; Errors during provisioning
502	ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"`
503	// 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.
504	IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"`
505	// ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1'
506	ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"`
507}
508
509func unmarshalBasicCompute(body []byte) (BasicCompute, error) {
510	var m map[string]interface{}
511	err := json.Unmarshal(body, &m)
512	if err != nil {
513		return nil, err
514	}
515
516	switch m["computeType"] {
517	case string(ComputeTypeAKS1):
518		var a AKS
519		err := json.Unmarshal(body, &a)
520		return a, err
521	case string(ComputeTypeAmlCompute1):
522		var ac AmlCompute
523		err := json.Unmarshal(body, &ac)
524		return ac, err
525	case string(ComputeTypeVirtualMachine1):
526		var VM VirtualMachine
527		err := json.Unmarshal(body, &VM)
528		return VM, err
529	case string(ComputeTypeHDInsight1):
530		var hi HDInsight
531		err := json.Unmarshal(body, &hi)
532		return hi, err
533	case string(ComputeTypeDataFactory1):
534		var df DataFactory
535		err := json.Unmarshal(body, &df)
536		return df, err
537	case string(ComputeTypeDatabricks1):
538		var d Databricks
539		err := json.Unmarshal(body, &d)
540		return d, err
541	case string(ComputeTypeDataLakeAnalytics1):
542		var dla DataLakeAnalytics
543		err := json.Unmarshal(body, &dla)
544		return dla, err
545	default:
546		var c Compute
547		err := json.Unmarshal(body, &c)
548		return c, err
549	}
550}
551func unmarshalBasicComputeArray(body []byte) ([]BasicCompute, error) {
552	var rawMessages []*json.RawMessage
553	err := json.Unmarshal(body, &rawMessages)
554	if err != nil {
555		return nil, err
556	}
557
558	cArray := make([]BasicCompute, len(rawMessages))
559
560	for index, rawMessage := range rawMessages {
561		c, err := unmarshalBasicCompute(*rawMessage)
562		if err != nil {
563			return nil, err
564		}
565		cArray[index] = c
566	}
567	return cArray, nil
568}
569
570// MarshalJSON is the custom marshaler for Compute.
571func (c Compute) MarshalJSON() ([]byte, error) {
572	c.ComputeType = ComputeTypeCompute
573	objectMap := make(map[string]interface{})
574	if c.ComputeLocation != nil {
575		objectMap["computeLocation"] = c.ComputeLocation
576	}
577	if c.Description != nil {
578		objectMap["description"] = c.Description
579	}
580	if c.ResourceID != nil {
581		objectMap["resourceId"] = c.ResourceID
582	}
583	if c.ComputeType != "" {
584		objectMap["computeType"] = c.ComputeType
585	}
586	return json.Marshal(objectMap)
587}
588
589// AsAKS is the BasicCompute implementation for Compute.
590func (c Compute) AsAKS() (*AKS, bool) {
591	return nil, false
592}
593
594// AsAmlCompute is the BasicCompute implementation for Compute.
595func (c Compute) AsAmlCompute() (*AmlCompute, bool) {
596	return nil, false
597}
598
599// AsVirtualMachine is the BasicCompute implementation for Compute.
600func (c Compute) AsVirtualMachine() (*VirtualMachine, bool) {
601	return nil, false
602}
603
604// AsHDInsight is the BasicCompute implementation for Compute.
605func (c Compute) AsHDInsight() (*HDInsight, bool) {
606	return nil, false
607}
608
609// AsDataFactory is the BasicCompute implementation for Compute.
610func (c Compute) AsDataFactory() (*DataFactory, bool) {
611	return nil, false
612}
613
614// AsDatabricks is the BasicCompute implementation for Compute.
615func (c Compute) AsDatabricks() (*Databricks, bool) {
616	return nil, false
617}
618
619// AsDataLakeAnalytics is the BasicCompute implementation for Compute.
620func (c Compute) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) {
621	return nil, false
622}
623
624// AsCompute is the BasicCompute implementation for Compute.
625func (c Compute) AsCompute() (*Compute, bool) {
626	return &c, true
627}
628
629// AsBasicCompute is the BasicCompute implementation for Compute.
630func (c Compute) AsBasicCompute() (BasicCompute, bool) {
631	return &c, true
632}
633
634// BasicComputeNodesInformation compute nodes information related to a Machine Learning compute. Might differ for every
635// type of compute.
636type BasicComputeNodesInformation interface {
637	AsAmlComputeNodesInformation() (*AmlComputeNodesInformation, bool)
638	AsComputeNodesInformation() (*ComputeNodesInformation, bool)
639}
640
641// ComputeNodesInformation compute nodes information related to a Machine Learning compute. Might differ for
642// every type of compute.
643type ComputeNodesInformation struct {
644	// NextLink - READ-ONLY; The continuation token.
645	NextLink *string `json:"nextLink,omitempty"`
646	// ComputeType - Possible values include: 'ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation', 'ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute'
647	ComputeType ComputeTypeBasicComputeNodesInformation `json:"computeType,omitempty"`
648}
649
650func unmarshalBasicComputeNodesInformation(body []byte) (BasicComputeNodesInformation, error) {
651	var m map[string]interface{}
652	err := json.Unmarshal(body, &m)
653	if err != nil {
654		return nil, err
655	}
656
657	switch m["computeType"] {
658	case string(ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute):
659		var acni AmlComputeNodesInformation
660		err := json.Unmarshal(body, &acni)
661		return acni, err
662	default:
663		var cni ComputeNodesInformation
664		err := json.Unmarshal(body, &cni)
665		return cni, err
666	}
667}
668func unmarshalBasicComputeNodesInformationArray(body []byte) ([]BasicComputeNodesInformation, error) {
669	var rawMessages []*json.RawMessage
670	err := json.Unmarshal(body, &rawMessages)
671	if err != nil {
672		return nil, err
673	}
674
675	cniArray := make([]BasicComputeNodesInformation, len(rawMessages))
676
677	for index, rawMessage := range rawMessages {
678		cni, err := unmarshalBasicComputeNodesInformation(*rawMessage)
679		if err != nil {
680			return nil, err
681		}
682		cniArray[index] = cni
683	}
684	return cniArray, nil
685}
686
687// MarshalJSON is the custom marshaler for ComputeNodesInformation.
688func (cni ComputeNodesInformation) MarshalJSON() ([]byte, error) {
689	cni.ComputeType = ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation
690	objectMap := make(map[string]interface{})
691	if cni.ComputeType != "" {
692		objectMap["computeType"] = cni.ComputeType
693	}
694	return json.Marshal(objectMap)
695}
696
697// AsAmlComputeNodesInformation is the BasicComputeNodesInformation implementation for ComputeNodesInformation.
698func (cni ComputeNodesInformation) AsAmlComputeNodesInformation() (*AmlComputeNodesInformation, bool) {
699	return nil, false
700}
701
702// AsComputeNodesInformation is the BasicComputeNodesInformation implementation for ComputeNodesInformation.
703func (cni ComputeNodesInformation) AsComputeNodesInformation() (*ComputeNodesInformation, bool) {
704	return &cni, true
705}
706
707// AsBasicComputeNodesInformation is the BasicComputeNodesInformation implementation for ComputeNodesInformation.
708func (cni ComputeNodesInformation) AsBasicComputeNodesInformation() (BasicComputeNodesInformation, bool) {
709	return &cni, true
710}
711
712// ComputeResource machine Learning compute object wrapped into ARM resource envelope.
713type ComputeResource struct {
714	autorest.Response `json:"-"`
715	// Properties - Compute properties
716	Properties BasicCompute `json:"properties,omitempty"`
717	// ID - READ-ONLY; Specifies the resource ID.
718	ID *string `json:"id,omitempty"`
719	// Name - READ-ONLY; Specifies the name of the resource.
720	Name *string `json:"name,omitempty"`
721	// Identity - The identity of the resource.
722	Identity *Identity `json:"identity,omitempty"`
723	// Location - Specifies the location of the resource.
724	Location *string `json:"location,omitempty"`
725	// Type - READ-ONLY; Specifies the type of the resource.
726	Type *string `json:"type,omitempty"`
727	// Tags - Contains resource tags defined as key/value pairs.
728	Tags map[string]*string `json:"tags"`
729	// Sku - The sku of the workspace.
730	Sku *Sku `json:"sku,omitempty"`
731}
732
733// MarshalJSON is the custom marshaler for ComputeResource.
734func (cr ComputeResource) MarshalJSON() ([]byte, error) {
735	objectMap := make(map[string]interface{})
736	objectMap["properties"] = cr.Properties
737	if cr.Identity != nil {
738		objectMap["identity"] = cr.Identity
739	}
740	if cr.Location != nil {
741		objectMap["location"] = cr.Location
742	}
743	if cr.Tags != nil {
744		objectMap["tags"] = cr.Tags
745	}
746	if cr.Sku != nil {
747		objectMap["sku"] = cr.Sku
748	}
749	return json.Marshal(objectMap)
750}
751
752// UnmarshalJSON is the custom unmarshaler for ComputeResource struct.
753func (cr *ComputeResource) UnmarshalJSON(body []byte) error {
754	var m map[string]*json.RawMessage
755	err := json.Unmarshal(body, &m)
756	if err != nil {
757		return err
758	}
759	for k, v := range m {
760		switch k {
761		case "properties":
762			if v != nil {
763				properties, err := unmarshalBasicCompute(*v)
764				if err != nil {
765					return err
766				}
767				cr.Properties = properties
768			}
769		case "id":
770			if v != nil {
771				var ID string
772				err = json.Unmarshal(*v, &ID)
773				if err != nil {
774					return err
775				}
776				cr.ID = &ID
777			}
778		case "name":
779			if v != nil {
780				var name string
781				err = json.Unmarshal(*v, &name)
782				if err != nil {
783					return err
784				}
785				cr.Name = &name
786			}
787		case "identity":
788			if v != nil {
789				var identity Identity
790				err = json.Unmarshal(*v, &identity)
791				if err != nil {
792					return err
793				}
794				cr.Identity = &identity
795			}
796		case "location":
797			if v != nil {
798				var location string
799				err = json.Unmarshal(*v, &location)
800				if err != nil {
801					return err
802				}
803				cr.Location = &location
804			}
805		case "type":
806			if v != nil {
807				var typeVar string
808				err = json.Unmarshal(*v, &typeVar)
809				if err != nil {
810					return err
811				}
812				cr.Type = &typeVar
813			}
814		case "tags":
815			if v != nil {
816				var tags map[string]*string
817				err = json.Unmarshal(*v, &tags)
818				if err != nil {
819					return err
820				}
821				cr.Tags = tags
822			}
823		case "sku":
824			if v != nil {
825				var sku Sku
826				err = json.Unmarshal(*v, &sku)
827				if err != nil {
828					return err
829				}
830				cr.Sku = &sku
831			}
832		}
833	}
834
835	return nil
836}
837
838// BasicComputeSecrets secrets related to a Machine Learning compute. Might differ for every type of compute.
839type BasicComputeSecrets interface {
840	AsAksComputeSecrets() (*AksComputeSecrets, bool)
841	AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool)
842	AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool)
843	AsComputeSecrets() (*ComputeSecrets, bool)
844}
845
846// ComputeSecrets secrets related to a Machine Learning compute. Might differ for every type of compute.
847type ComputeSecrets struct {
848	autorest.Response `json:"-"`
849	// ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine', 'ComputeTypeBasicComputeSecretsComputeTypeDatabricks'
850	ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"`
851}
852
853func unmarshalBasicComputeSecrets(body []byte) (BasicComputeSecrets, error) {
854	var m map[string]interface{}
855	err := json.Unmarshal(body, &m)
856	if err != nil {
857		return nil, err
858	}
859
860	switch m["computeType"] {
861	case string(ComputeTypeBasicComputeSecretsComputeTypeAKS):
862		var acs AksComputeSecrets
863		err := json.Unmarshal(body, &acs)
864		return acs, err
865	case string(ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine):
866		var vms VirtualMachineSecrets
867		err := json.Unmarshal(body, &vms)
868		return vms, err
869	case string(ComputeTypeBasicComputeSecretsComputeTypeDatabricks):
870		var dcs DatabricksComputeSecrets
871		err := json.Unmarshal(body, &dcs)
872		return dcs, err
873	default:
874		var cs ComputeSecrets
875		err := json.Unmarshal(body, &cs)
876		return cs, err
877	}
878}
879func unmarshalBasicComputeSecretsArray(body []byte) ([]BasicComputeSecrets, error) {
880	var rawMessages []*json.RawMessage
881	err := json.Unmarshal(body, &rawMessages)
882	if err != nil {
883		return nil, err
884	}
885
886	csArray := make([]BasicComputeSecrets, len(rawMessages))
887
888	for index, rawMessage := range rawMessages {
889		cs, err := unmarshalBasicComputeSecrets(*rawMessage)
890		if err != nil {
891			return nil, err
892		}
893		csArray[index] = cs
894	}
895	return csArray, nil
896}
897
898// MarshalJSON is the custom marshaler for ComputeSecrets.
899func (cs ComputeSecrets) MarshalJSON() ([]byte, error) {
900	cs.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets
901	objectMap := make(map[string]interface{})
902	if cs.ComputeType != "" {
903		objectMap["computeType"] = cs.ComputeType
904	}
905	return json.Marshal(objectMap)
906}
907
908// AsAksComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets.
909func (cs ComputeSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) {
910	return nil, false
911}
912
913// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for ComputeSecrets.
914func (cs ComputeSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) {
915	return nil, false
916}
917
918// AsDatabricksComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets.
919func (cs ComputeSecrets) AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) {
920	return nil, false
921}
922
923// AsComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets.
924func (cs ComputeSecrets) AsComputeSecrets() (*ComputeSecrets, bool) {
925	return &cs, true
926}
927
928// AsBasicComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets.
929func (cs ComputeSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) {
930	return &cs, true
931}
932
933// ComputeSecretsModel ...
934type ComputeSecretsModel struct {
935	autorest.Response `json:"-"`
936	Value             BasicComputeSecrets `json:"value,omitempty"`
937}
938
939// UnmarshalJSON is the custom unmarshaler for ComputeSecretsModel struct.
940func (csm *ComputeSecretsModel) UnmarshalJSON(body []byte) error {
941	cs, err := unmarshalBasicComputeSecrets(body)
942	if err != nil {
943		return err
944	}
945	csm.Value = cs
946
947	return nil
948}
949
950// Databricks a DataFactory compute.
951type Databricks struct {
952	Properties *DatabricksProperties `json:"properties,omitempty"`
953	// ComputeLocation - Location for the underlying compute
954	ComputeLocation *string `json:"computeLocation,omitempty"`
955	// ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled'
956	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
957	// Description - The description of the Machine Learning compute.
958	Description *string `json:"description,omitempty"`
959	// CreatedOn - READ-ONLY; The date and time when the compute was created.
960	CreatedOn *date.Time `json:"createdOn,omitempty"`
961	// ModifiedOn - READ-ONLY; The date and time when the compute was last modified.
962	ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
963	// ResourceID - ARM resource id of the underlying compute
964	ResourceID *string `json:"resourceId,omitempty"`
965	// ProvisioningErrors - READ-ONLY; Errors during provisioning
966	ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"`
967	// 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.
968	IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"`
969	// ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1'
970	ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"`
971}
972
973// MarshalJSON is the custom marshaler for Databricks.
974func (d Databricks) MarshalJSON() ([]byte, error) {
975	d.ComputeType = ComputeTypeDatabricks1
976	objectMap := make(map[string]interface{})
977	if d.Properties != nil {
978		objectMap["properties"] = d.Properties
979	}
980	if d.ComputeLocation != nil {
981		objectMap["computeLocation"] = d.ComputeLocation
982	}
983	if d.Description != nil {
984		objectMap["description"] = d.Description
985	}
986	if d.ResourceID != nil {
987		objectMap["resourceId"] = d.ResourceID
988	}
989	if d.ComputeType != "" {
990		objectMap["computeType"] = d.ComputeType
991	}
992	return json.Marshal(objectMap)
993}
994
995// AsAKS is the BasicCompute implementation for Databricks.
996func (d Databricks) AsAKS() (*AKS, bool) {
997	return nil, false
998}
999
1000// AsAmlCompute is the BasicCompute implementation for Databricks.
1001func (d Databricks) AsAmlCompute() (*AmlCompute, bool) {
1002	return nil, false
1003}
1004
1005// AsVirtualMachine is the BasicCompute implementation for Databricks.
1006func (d Databricks) AsVirtualMachine() (*VirtualMachine, bool) {
1007	return nil, false
1008}
1009
1010// AsHDInsight is the BasicCompute implementation for Databricks.
1011func (d Databricks) AsHDInsight() (*HDInsight, bool) {
1012	return nil, false
1013}
1014
1015// AsDataFactory is the BasicCompute implementation for Databricks.
1016func (d Databricks) AsDataFactory() (*DataFactory, bool) {
1017	return nil, false
1018}
1019
1020// AsDatabricks is the BasicCompute implementation for Databricks.
1021func (d Databricks) AsDatabricks() (*Databricks, bool) {
1022	return &d, true
1023}
1024
1025// AsDataLakeAnalytics is the BasicCompute implementation for Databricks.
1026func (d Databricks) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) {
1027	return nil, false
1028}
1029
1030// AsCompute is the BasicCompute implementation for Databricks.
1031func (d Databricks) AsCompute() (*Compute, bool) {
1032	return nil, false
1033}
1034
1035// AsBasicCompute is the BasicCompute implementation for Databricks.
1036func (d Databricks) AsBasicCompute() (BasicCompute, bool) {
1037	return &d, true
1038}
1039
1040// DatabricksComputeSecrets secrets related to a Machine Learning compute based on Databricks.
1041type DatabricksComputeSecrets struct {
1042	// DatabricksAccessToken - access token for databricks account.
1043	DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"`
1044	// ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine', 'ComputeTypeBasicComputeSecretsComputeTypeDatabricks'
1045	ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"`
1046}
1047
1048// MarshalJSON is the custom marshaler for DatabricksComputeSecrets.
1049func (dcs DatabricksComputeSecrets) MarshalJSON() ([]byte, error) {
1050	dcs.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeDatabricks
1051	objectMap := make(map[string]interface{})
1052	if dcs.DatabricksAccessToken != nil {
1053		objectMap["databricksAccessToken"] = dcs.DatabricksAccessToken
1054	}
1055	if dcs.ComputeType != "" {
1056		objectMap["computeType"] = dcs.ComputeType
1057	}
1058	return json.Marshal(objectMap)
1059}
1060
1061// AsAksComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets.
1062func (dcs DatabricksComputeSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) {
1063	return nil, false
1064}
1065
1066// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets.
1067func (dcs DatabricksComputeSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) {
1068	return nil, false
1069}
1070
1071// AsDatabricksComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets.
1072func (dcs DatabricksComputeSecrets) AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) {
1073	return &dcs, true
1074}
1075
1076// AsComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets.
1077func (dcs DatabricksComputeSecrets) AsComputeSecrets() (*ComputeSecrets, bool) {
1078	return nil, false
1079}
1080
1081// AsBasicComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets.
1082func (dcs DatabricksComputeSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) {
1083	return &dcs, true
1084}
1085
1086// DatabricksProperties ...
1087type DatabricksProperties struct {
1088	// DatabricksAccessToken - Databricks access token
1089	DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"`
1090}
1091
1092// DataFactory a DataFactory compute.
1093type DataFactory struct {
1094	// ComputeLocation - Location for the underlying compute
1095	ComputeLocation *string `json:"computeLocation,omitempty"`
1096	// ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled'
1097	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1098	// Description - The description of the Machine Learning compute.
1099	Description *string `json:"description,omitempty"`
1100	// CreatedOn - READ-ONLY; The date and time when the compute was created.
1101	CreatedOn *date.Time `json:"createdOn,omitempty"`
1102	// ModifiedOn - READ-ONLY; The date and time when the compute was last modified.
1103	ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
1104	// ResourceID - ARM resource id of the underlying compute
1105	ResourceID *string `json:"resourceId,omitempty"`
1106	// ProvisioningErrors - READ-ONLY; Errors during provisioning
1107	ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"`
1108	// 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.
1109	IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"`
1110	// ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1'
1111	ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"`
1112}
1113
1114// MarshalJSON is the custom marshaler for DataFactory.
1115func (df DataFactory) MarshalJSON() ([]byte, error) {
1116	df.ComputeType = ComputeTypeDataFactory1
1117	objectMap := make(map[string]interface{})
1118	if df.ComputeLocation != nil {
1119		objectMap["computeLocation"] = df.ComputeLocation
1120	}
1121	if df.Description != nil {
1122		objectMap["description"] = df.Description
1123	}
1124	if df.ResourceID != nil {
1125		objectMap["resourceId"] = df.ResourceID
1126	}
1127	if df.ComputeType != "" {
1128		objectMap["computeType"] = df.ComputeType
1129	}
1130	return json.Marshal(objectMap)
1131}
1132
1133// AsAKS is the BasicCompute implementation for DataFactory.
1134func (df DataFactory) AsAKS() (*AKS, bool) {
1135	return nil, false
1136}
1137
1138// AsAmlCompute is the BasicCompute implementation for DataFactory.
1139func (df DataFactory) AsAmlCompute() (*AmlCompute, bool) {
1140	return nil, false
1141}
1142
1143// AsVirtualMachine is the BasicCompute implementation for DataFactory.
1144func (df DataFactory) AsVirtualMachine() (*VirtualMachine, bool) {
1145	return nil, false
1146}
1147
1148// AsHDInsight is the BasicCompute implementation for DataFactory.
1149func (df DataFactory) AsHDInsight() (*HDInsight, bool) {
1150	return nil, false
1151}
1152
1153// AsDataFactory is the BasicCompute implementation for DataFactory.
1154func (df DataFactory) AsDataFactory() (*DataFactory, bool) {
1155	return &df, true
1156}
1157
1158// AsDatabricks is the BasicCompute implementation for DataFactory.
1159func (df DataFactory) AsDatabricks() (*Databricks, bool) {
1160	return nil, false
1161}
1162
1163// AsDataLakeAnalytics is the BasicCompute implementation for DataFactory.
1164func (df DataFactory) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) {
1165	return nil, false
1166}
1167
1168// AsCompute is the BasicCompute implementation for DataFactory.
1169func (df DataFactory) AsCompute() (*Compute, bool) {
1170	return nil, false
1171}
1172
1173// AsBasicCompute is the BasicCompute implementation for DataFactory.
1174func (df DataFactory) AsBasicCompute() (BasicCompute, bool) {
1175	return &df, true
1176}
1177
1178// DataLakeAnalytics a DataLakeAnalytics compute.
1179type DataLakeAnalytics struct {
1180	Properties *DataLakeAnalyticsProperties `json:"properties,omitempty"`
1181	// ComputeLocation - Location for the underlying compute
1182	ComputeLocation *string `json:"computeLocation,omitempty"`
1183	// ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled'
1184	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1185	// Description - The description of the Machine Learning compute.
1186	Description *string `json:"description,omitempty"`
1187	// CreatedOn - READ-ONLY; The date and time when the compute was created.
1188	CreatedOn *date.Time `json:"createdOn,omitempty"`
1189	// ModifiedOn - READ-ONLY; The date and time when the compute was last modified.
1190	ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
1191	// ResourceID - ARM resource id of the underlying compute
1192	ResourceID *string `json:"resourceId,omitempty"`
1193	// ProvisioningErrors - READ-ONLY; Errors during provisioning
1194	ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"`
1195	// 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.
1196	IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"`
1197	// ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1'
1198	ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"`
1199}
1200
1201// MarshalJSON is the custom marshaler for DataLakeAnalytics.
1202func (dla DataLakeAnalytics) MarshalJSON() ([]byte, error) {
1203	dla.ComputeType = ComputeTypeDataLakeAnalytics1
1204	objectMap := make(map[string]interface{})
1205	if dla.Properties != nil {
1206		objectMap["properties"] = dla.Properties
1207	}
1208	if dla.ComputeLocation != nil {
1209		objectMap["computeLocation"] = dla.ComputeLocation
1210	}
1211	if dla.Description != nil {
1212		objectMap["description"] = dla.Description
1213	}
1214	if dla.ResourceID != nil {
1215		objectMap["resourceId"] = dla.ResourceID
1216	}
1217	if dla.ComputeType != "" {
1218		objectMap["computeType"] = dla.ComputeType
1219	}
1220	return json.Marshal(objectMap)
1221}
1222
1223// AsAKS is the BasicCompute implementation for DataLakeAnalytics.
1224func (dla DataLakeAnalytics) AsAKS() (*AKS, bool) {
1225	return nil, false
1226}
1227
1228// AsAmlCompute is the BasicCompute implementation for DataLakeAnalytics.
1229func (dla DataLakeAnalytics) AsAmlCompute() (*AmlCompute, bool) {
1230	return nil, false
1231}
1232
1233// AsVirtualMachine is the BasicCompute implementation for DataLakeAnalytics.
1234func (dla DataLakeAnalytics) AsVirtualMachine() (*VirtualMachine, bool) {
1235	return nil, false
1236}
1237
1238// AsHDInsight is the BasicCompute implementation for DataLakeAnalytics.
1239func (dla DataLakeAnalytics) AsHDInsight() (*HDInsight, bool) {
1240	return nil, false
1241}
1242
1243// AsDataFactory is the BasicCompute implementation for DataLakeAnalytics.
1244func (dla DataLakeAnalytics) AsDataFactory() (*DataFactory, bool) {
1245	return nil, false
1246}
1247
1248// AsDatabricks is the BasicCompute implementation for DataLakeAnalytics.
1249func (dla DataLakeAnalytics) AsDatabricks() (*Databricks, bool) {
1250	return nil, false
1251}
1252
1253// AsDataLakeAnalytics is the BasicCompute implementation for DataLakeAnalytics.
1254func (dla DataLakeAnalytics) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) {
1255	return &dla, true
1256}
1257
1258// AsCompute is the BasicCompute implementation for DataLakeAnalytics.
1259func (dla DataLakeAnalytics) AsCompute() (*Compute, bool) {
1260	return nil, false
1261}
1262
1263// AsBasicCompute is the BasicCompute implementation for DataLakeAnalytics.
1264func (dla DataLakeAnalytics) AsBasicCompute() (BasicCompute, bool) {
1265	return &dla, true
1266}
1267
1268// DataLakeAnalyticsProperties ...
1269type DataLakeAnalyticsProperties struct {
1270	// DataLakeStoreAccountName - DataLake Store Account Name
1271	DataLakeStoreAccountName *string `json:"dataLakeStoreAccountName,omitempty"`
1272}
1273
1274// EncryptionProperty ...
1275type EncryptionProperty struct {
1276	// Status - Indicates whether or not the encryption is enabled for the workspace. Possible values include: 'Enabled', 'Disabled'
1277	Status EncryptionStatus `json:"status,omitempty"`
1278	// KeyVaultProperties - Customer Key vault properties.
1279	KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"`
1280}
1281
1282// Error wrapper for error response to follow ARM guidelines.
1283type Error struct {
1284	// Error - READ-ONLY; The error response.
1285	Error *ErrorResponse `json:"error,omitempty"`
1286}
1287
1288// MarshalJSON is the custom marshaler for Error.
1289func (e Error) MarshalJSON() ([]byte, error) {
1290	objectMap := make(map[string]interface{})
1291	return json.Marshal(objectMap)
1292}
1293
1294// ErrorDetail error detail information.
1295type ErrorDetail struct {
1296	// Code - Error code.
1297	Code *string `json:"code,omitempty"`
1298	// Message - Error message.
1299	Message *string `json:"message,omitempty"`
1300}
1301
1302// ErrorResponse error response information.
1303type ErrorResponse struct {
1304	// Code - READ-ONLY; Error code.
1305	Code *string `json:"code,omitempty"`
1306	// Message - READ-ONLY; Error message.
1307	Message *string `json:"message,omitempty"`
1308	// Details - READ-ONLY; An array of error detail objects.
1309	Details *[]ErrorDetail `json:"details,omitempty"`
1310}
1311
1312// MarshalJSON is the custom marshaler for ErrorResponse.
1313func (er ErrorResponse) MarshalJSON() ([]byte, error) {
1314	objectMap := make(map[string]interface{})
1315	return json.Marshal(objectMap)
1316}
1317
1318// HDInsight a HDInsight compute.
1319type HDInsight struct {
1320	Properties *HDInsightProperties `json:"properties,omitempty"`
1321	// ComputeLocation - Location for the underlying compute
1322	ComputeLocation *string `json:"computeLocation,omitempty"`
1323	// ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled'
1324	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
1325	// Description - The description of the Machine Learning compute.
1326	Description *string `json:"description,omitempty"`
1327	// CreatedOn - READ-ONLY; The date and time when the compute was created.
1328	CreatedOn *date.Time `json:"createdOn,omitempty"`
1329	// ModifiedOn - READ-ONLY; The date and time when the compute was last modified.
1330	ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
1331	// ResourceID - ARM resource id of the underlying compute
1332	ResourceID *string `json:"resourceId,omitempty"`
1333	// ProvisioningErrors - READ-ONLY; Errors during provisioning
1334	ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"`
1335	// 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.
1336	IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"`
1337	// ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1'
1338	ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"`
1339}
1340
1341// MarshalJSON is the custom marshaler for HDInsight.
1342func (hi HDInsight) MarshalJSON() ([]byte, error) {
1343	hi.ComputeType = ComputeTypeHDInsight1
1344	objectMap := make(map[string]interface{})
1345	if hi.Properties != nil {
1346		objectMap["properties"] = hi.Properties
1347	}
1348	if hi.ComputeLocation != nil {
1349		objectMap["computeLocation"] = hi.ComputeLocation
1350	}
1351	if hi.Description != nil {
1352		objectMap["description"] = hi.Description
1353	}
1354	if hi.ResourceID != nil {
1355		objectMap["resourceId"] = hi.ResourceID
1356	}
1357	if hi.ComputeType != "" {
1358		objectMap["computeType"] = hi.ComputeType
1359	}
1360	return json.Marshal(objectMap)
1361}
1362
1363// AsAKS is the BasicCompute implementation for HDInsight.
1364func (hi HDInsight) AsAKS() (*AKS, bool) {
1365	return nil, false
1366}
1367
1368// AsAmlCompute is the BasicCompute implementation for HDInsight.
1369func (hi HDInsight) AsAmlCompute() (*AmlCompute, bool) {
1370	return nil, false
1371}
1372
1373// AsVirtualMachine is the BasicCompute implementation for HDInsight.
1374func (hi HDInsight) AsVirtualMachine() (*VirtualMachine, bool) {
1375	return nil, false
1376}
1377
1378// AsHDInsight is the BasicCompute implementation for HDInsight.
1379func (hi HDInsight) AsHDInsight() (*HDInsight, bool) {
1380	return &hi, true
1381}
1382
1383// AsDataFactory is the BasicCompute implementation for HDInsight.
1384func (hi HDInsight) AsDataFactory() (*DataFactory, bool) {
1385	return nil, false
1386}
1387
1388// AsDatabricks is the BasicCompute implementation for HDInsight.
1389func (hi HDInsight) AsDatabricks() (*Databricks, bool) {
1390	return nil, false
1391}
1392
1393// AsDataLakeAnalytics is the BasicCompute implementation for HDInsight.
1394func (hi HDInsight) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) {
1395	return nil, false
1396}
1397
1398// AsCompute is the BasicCompute implementation for HDInsight.
1399func (hi HDInsight) AsCompute() (*Compute, bool) {
1400	return nil, false
1401}
1402
1403// AsBasicCompute is the BasicCompute implementation for HDInsight.
1404func (hi HDInsight) AsBasicCompute() (BasicCompute, bool) {
1405	return &hi, true
1406}
1407
1408// HDInsightProperties ...
1409type HDInsightProperties struct {
1410	// SSHPort - Port open for ssh connections on the master node of the cluster.
1411	SSHPort *int32 `json:"sshPort,omitempty"`
1412	// Address - Public IP address of the master node of the cluster.
1413	Address *string `json:"address,omitempty"`
1414	// AdministratorAccount - Admin credentials for master node of the cluster
1415	AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"`
1416}
1417
1418// Identity identity for the resource.
1419type Identity struct {
1420	// PrincipalID - READ-ONLY; The principal ID of resource identity.
1421	PrincipalID *string `json:"principalId,omitempty"`
1422	// TenantID - READ-ONLY; The tenant ID of resource.
1423	TenantID *string `json:"tenantId,omitempty"`
1424	// Type - The identity type. Possible values include: 'SystemAssigned'
1425	Type ResourceIdentityType `json:"type,omitempty"`
1426}
1427
1428// MarshalJSON is the custom marshaler for Identity.
1429func (i Identity) MarshalJSON() ([]byte, error) {
1430	objectMap := make(map[string]interface{})
1431	if i.Type != "" {
1432		objectMap["type"] = i.Type
1433	}
1434	return json.Marshal(objectMap)
1435}
1436
1437// KeyVaultProperties ...
1438type KeyVaultProperties struct {
1439	// KeyVaultArmID - The ArmId of the keyVault where the customer owned encryption key is present.
1440	KeyVaultArmID *string `json:"keyVaultArmId,omitempty"`
1441	// KeyIdentifier - Key vault uri to access the encryption key.
1442	KeyIdentifier *string `json:"keyIdentifier,omitempty"`
1443	// IdentityClientID - For future use - The client id of the identity which will be used to access key vault.
1444	IdentityClientID *string `json:"identityClientId,omitempty"`
1445}
1446
1447// ListAmlUserFeatureResult the List Aml user feature operation response.
1448type ListAmlUserFeatureResult struct {
1449	autorest.Response `json:"-"`
1450	// Value - READ-ONLY; The list of AML user facing features.
1451	Value *[]AmlUserFeature `json:"value,omitempty"`
1452	// NextLink - READ-ONLY; The URI to fetch the next page of AML user features information. Call ListNext() with this to fetch the next page of AML user features information.
1453	NextLink *string `json:"nextLink,omitempty"`
1454}
1455
1456// MarshalJSON is the custom marshaler for ListAmlUserFeatureResult.
1457func (laufr ListAmlUserFeatureResult) MarshalJSON() ([]byte, error) {
1458	objectMap := make(map[string]interface{})
1459	return json.Marshal(objectMap)
1460}
1461
1462// ListAmlUserFeatureResultIterator provides access to a complete listing of AmlUserFeature values.
1463type ListAmlUserFeatureResultIterator struct {
1464	i    int
1465	page ListAmlUserFeatureResultPage
1466}
1467
1468// NextWithContext advances to the next value.  If there was an error making
1469// the request the iterator does not advance and the error is returned.
1470func (iter *ListAmlUserFeatureResultIterator) NextWithContext(ctx context.Context) (err error) {
1471	if tracing.IsEnabled() {
1472		ctx = tracing.StartSpan(ctx, fqdn+"/ListAmlUserFeatureResultIterator.NextWithContext")
1473		defer func() {
1474			sc := -1
1475			if iter.Response().Response.Response != nil {
1476				sc = iter.Response().Response.Response.StatusCode
1477			}
1478			tracing.EndSpan(ctx, sc, err)
1479		}()
1480	}
1481	iter.i++
1482	if iter.i < len(iter.page.Values()) {
1483		return nil
1484	}
1485	err = iter.page.NextWithContext(ctx)
1486	if err != nil {
1487		iter.i--
1488		return err
1489	}
1490	iter.i = 0
1491	return nil
1492}
1493
1494// Next advances to the next value.  If there was an error making
1495// the request the iterator does not advance and the error is returned.
1496// Deprecated: Use NextWithContext() instead.
1497func (iter *ListAmlUserFeatureResultIterator) Next() error {
1498	return iter.NextWithContext(context.Background())
1499}
1500
1501// NotDone returns true if the enumeration should be started or is not yet complete.
1502func (iter ListAmlUserFeatureResultIterator) NotDone() bool {
1503	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1504}
1505
1506// Response returns the raw server response from the last page request.
1507func (iter ListAmlUserFeatureResultIterator) Response() ListAmlUserFeatureResult {
1508	return iter.page.Response()
1509}
1510
1511// Value returns the current value or a zero-initialized value if the
1512// iterator has advanced beyond the end of the collection.
1513func (iter ListAmlUserFeatureResultIterator) Value() AmlUserFeature {
1514	if !iter.page.NotDone() {
1515		return AmlUserFeature{}
1516	}
1517	return iter.page.Values()[iter.i]
1518}
1519
1520// Creates a new instance of the ListAmlUserFeatureResultIterator type.
1521func NewListAmlUserFeatureResultIterator(page ListAmlUserFeatureResultPage) ListAmlUserFeatureResultIterator {
1522	return ListAmlUserFeatureResultIterator{page: page}
1523}
1524
1525// IsEmpty returns true if the ListResult contains no values.
1526func (laufr ListAmlUserFeatureResult) IsEmpty() bool {
1527	return laufr.Value == nil || len(*laufr.Value) == 0
1528}
1529
1530// hasNextLink returns true if the NextLink is not empty.
1531func (laufr ListAmlUserFeatureResult) hasNextLink() bool {
1532	return laufr.NextLink != nil && len(*laufr.NextLink) != 0
1533}
1534
1535// listAmlUserFeatureResultPreparer prepares a request to retrieve the next set of results.
1536// It returns nil if no more results exist.
1537func (laufr ListAmlUserFeatureResult) listAmlUserFeatureResultPreparer(ctx context.Context) (*http.Request, error) {
1538	if !laufr.hasNextLink() {
1539		return nil, nil
1540	}
1541	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1542		autorest.AsJSON(),
1543		autorest.AsGet(),
1544		autorest.WithBaseURL(to.String(laufr.NextLink)))
1545}
1546
1547// ListAmlUserFeatureResultPage contains a page of AmlUserFeature values.
1548type ListAmlUserFeatureResultPage struct {
1549	fn    func(context.Context, ListAmlUserFeatureResult) (ListAmlUserFeatureResult, error)
1550	laufr ListAmlUserFeatureResult
1551}
1552
1553// NextWithContext advances to the next page of values.  If there was an error making
1554// the request the page does not advance and the error is returned.
1555func (page *ListAmlUserFeatureResultPage) NextWithContext(ctx context.Context) (err error) {
1556	if tracing.IsEnabled() {
1557		ctx = tracing.StartSpan(ctx, fqdn+"/ListAmlUserFeatureResultPage.NextWithContext")
1558		defer func() {
1559			sc := -1
1560			if page.Response().Response.Response != nil {
1561				sc = page.Response().Response.Response.StatusCode
1562			}
1563			tracing.EndSpan(ctx, sc, err)
1564		}()
1565	}
1566	for {
1567		next, err := page.fn(ctx, page.laufr)
1568		if err != nil {
1569			return err
1570		}
1571		page.laufr = next
1572		if !next.hasNextLink() || !next.IsEmpty() {
1573			break
1574		}
1575	}
1576	return nil
1577}
1578
1579// Next advances to the next page of values.  If there was an error making
1580// the request the page does not advance and the error is returned.
1581// Deprecated: Use NextWithContext() instead.
1582func (page *ListAmlUserFeatureResultPage) Next() error {
1583	return page.NextWithContext(context.Background())
1584}
1585
1586// NotDone returns true if the page enumeration should be started or is not yet complete.
1587func (page ListAmlUserFeatureResultPage) NotDone() bool {
1588	return !page.laufr.IsEmpty()
1589}
1590
1591// Response returns the raw server response from the last page request.
1592func (page ListAmlUserFeatureResultPage) Response() ListAmlUserFeatureResult {
1593	return page.laufr
1594}
1595
1596// Values returns the slice of values for the current page or nil if there are no values.
1597func (page ListAmlUserFeatureResultPage) Values() []AmlUserFeature {
1598	if page.laufr.IsEmpty() {
1599		return nil
1600	}
1601	return *page.laufr.Value
1602}
1603
1604// Creates a new instance of the ListAmlUserFeatureResultPage type.
1605func NewListAmlUserFeatureResultPage(cur ListAmlUserFeatureResult, getNextPage func(context.Context, ListAmlUserFeatureResult) (ListAmlUserFeatureResult, error)) ListAmlUserFeatureResultPage {
1606	return ListAmlUserFeatureResultPage{
1607		fn:    getNextPage,
1608		laufr: cur,
1609	}
1610}
1611
1612// ListUsagesResult the List Usages operation response.
1613type ListUsagesResult struct {
1614	autorest.Response `json:"-"`
1615	// Value - READ-ONLY; The list of AML resource usages.
1616	Value *[]Usage `json:"value,omitempty"`
1617	// 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.
1618	NextLink *string `json:"nextLink,omitempty"`
1619}
1620
1621// MarshalJSON is the custom marshaler for ListUsagesResult.
1622func (lur ListUsagesResult) MarshalJSON() ([]byte, error) {
1623	objectMap := make(map[string]interface{})
1624	return json.Marshal(objectMap)
1625}
1626
1627// ListUsagesResultIterator provides access to a complete listing of Usage values.
1628type ListUsagesResultIterator struct {
1629	i    int
1630	page ListUsagesResultPage
1631}
1632
1633// NextWithContext advances to the next value.  If there was an error making
1634// the request the iterator does not advance and the error is returned.
1635func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) {
1636	if tracing.IsEnabled() {
1637		ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext")
1638		defer func() {
1639			sc := -1
1640			if iter.Response().Response.Response != nil {
1641				sc = iter.Response().Response.Response.StatusCode
1642			}
1643			tracing.EndSpan(ctx, sc, err)
1644		}()
1645	}
1646	iter.i++
1647	if iter.i < len(iter.page.Values()) {
1648		return nil
1649	}
1650	err = iter.page.NextWithContext(ctx)
1651	if err != nil {
1652		iter.i--
1653		return err
1654	}
1655	iter.i = 0
1656	return nil
1657}
1658
1659// Next advances to the next value.  If there was an error making
1660// the request the iterator does not advance and the error is returned.
1661// Deprecated: Use NextWithContext() instead.
1662func (iter *ListUsagesResultIterator) Next() error {
1663	return iter.NextWithContext(context.Background())
1664}
1665
1666// NotDone returns true if the enumeration should be started or is not yet complete.
1667func (iter ListUsagesResultIterator) NotDone() bool {
1668	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1669}
1670
1671// Response returns the raw server response from the last page request.
1672func (iter ListUsagesResultIterator) Response() ListUsagesResult {
1673	return iter.page.Response()
1674}
1675
1676// Value returns the current value or a zero-initialized value if the
1677// iterator has advanced beyond the end of the collection.
1678func (iter ListUsagesResultIterator) Value() Usage {
1679	if !iter.page.NotDone() {
1680		return Usage{}
1681	}
1682	return iter.page.Values()[iter.i]
1683}
1684
1685// Creates a new instance of the ListUsagesResultIterator type.
1686func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator {
1687	return ListUsagesResultIterator{page: page}
1688}
1689
1690// IsEmpty returns true if the ListResult contains no values.
1691func (lur ListUsagesResult) IsEmpty() bool {
1692	return lur.Value == nil || len(*lur.Value) == 0
1693}
1694
1695// hasNextLink returns true if the NextLink is not empty.
1696func (lur ListUsagesResult) hasNextLink() bool {
1697	return lur.NextLink != nil && len(*lur.NextLink) != 0
1698}
1699
1700// listUsagesResultPreparer prepares a request to retrieve the next set of results.
1701// It returns nil if no more results exist.
1702func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) {
1703	if !lur.hasNextLink() {
1704		return nil, nil
1705	}
1706	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1707		autorest.AsJSON(),
1708		autorest.AsGet(),
1709		autorest.WithBaseURL(to.String(lur.NextLink)))
1710}
1711
1712// ListUsagesResultPage contains a page of Usage values.
1713type ListUsagesResultPage struct {
1714	fn  func(context.Context, ListUsagesResult) (ListUsagesResult, error)
1715	lur ListUsagesResult
1716}
1717
1718// NextWithContext advances to the next page of values.  If there was an error making
1719// the request the page does not advance and the error is returned.
1720func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) {
1721	if tracing.IsEnabled() {
1722		ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext")
1723		defer func() {
1724			sc := -1
1725			if page.Response().Response.Response != nil {
1726				sc = page.Response().Response.Response.StatusCode
1727			}
1728			tracing.EndSpan(ctx, sc, err)
1729		}()
1730	}
1731	for {
1732		next, err := page.fn(ctx, page.lur)
1733		if err != nil {
1734			return err
1735		}
1736		page.lur = next
1737		if !next.hasNextLink() || !next.IsEmpty() {
1738			break
1739		}
1740	}
1741	return nil
1742}
1743
1744// Next advances to the next page of values.  If there was an error making
1745// the request the page does not advance and the error is returned.
1746// Deprecated: Use NextWithContext() instead.
1747func (page *ListUsagesResultPage) Next() error {
1748	return page.NextWithContext(context.Background())
1749}
1750
1751// NotDone returns true if the page enumeration should be started or is not yet complete.
1752func (page ListUsagesResultPage) NotDone() bool {
1753	return !page.lur.IsEmpty()
1754}
1755
1756// Response returns the raw server response from the last page request.
1757func (page ListUsagesResultPage) Response() ListUsagesResult {
1758	return page.lur
1759}
1760
1761// Values returns the slice of values for the current page or nil if there are no values.
1762func (page ListUsagesResultPage) Values() []Usage {
1763	if page.lur.IsEmpty() {
1764		return nil
1765	}
1766	return *page.lur.Value
1767}
1768
1769// Creates a new instance of the ListUsagesResultPage type.
1770func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage {
1771	return ListUsagesResultPage{
1772		fn:  getNextPage,
1773		lur: cur,
1774	}
1775}
1776
1777// ListWorkspaceKeysResult ...
1778type ListWorkspaceKeysResult struct {
1779	autorest.Response `json:"-"`
1780	// UserStorageKey - READ-ONLY
1781	UserStorageKey *string `json:"userStorageKey,omitempty"`
1782	// UserStorageResourceID - READ-ONLY
1783	UserStorageResourceID *string `json:"userStorageResourceId,omitempty"`
1784	// AppInsightsInstrumentationKey - READ-ONLY
1785	AppInsightsInstrumentationKey *string `json:"appInsightsInstrumentationKey,omitempty"`
1786	// ContainerRegistryCredentials - READ-ONLY
1787	ContainerRegistryCredentials *RegistryListCredentialsResult `json:"containerRegistryCredentials,omitempty"`
1788}
1789
1790// MarshalJSON is the custom marshaler for ListWorkspaceKeysResult.
1791func (lwkr ListWorkspaceKeysResult) MarshalJSON() ([]byte, error) {
1792	objectMap := make(map[string]interface{})
1793	return json.Marshal(objectMap)
1794}
1795
1796// ListWorkspaceQuotas the List WorkspaceQuotasByVMFamily operation response.
1797type ListWorkspaceQuotas struct {
1798	autorest.Response `json:"-"`
1799	// Value - READ-ONLY; The list of Workspace Quotas by VM Family
1800	Value *[]ResourceQuota `json:"value,omitempty"`
1801	// NextLink - READ-ONLY; The URI to fetch the next page of workspace quota information by VM Family. Call ListNext() with this to fetch the next page of Workspace Quota information.
1802	NextLink *string `json:"nextLink,omitempty"`
1803}
1804
1805// MarshalJSON is the custom marshaler for ListWorkspaceQuotas.
1806func (lwq ListWorkspaceQuotas) MarshalJSON() ([]byte, error) {
1807	objectMap := make(map[string]interface{})
1808	return json.Marshal(objectMap)
1809}
1810
1811// ListWorkspaceQuotasIterator provides access to a complete listing of ResourceQuota values.
1812type ListWorkspaceQuotasIterator struct {
1813	i    int
1814	page ListWorkspaceQuotasPage
1815}
1816
1817// NextWithContext advances to the next value.  If there was an error making
1818// the request the iterator does not advance and the error is returned.
1819func (iter *ListWorkspaceQuotasIterator) NextWithContext(ctx context.Context) (err error) {
1820	if tracing.IsEnabled() {
1821		ctx = tracing.StartSpan(ctx, fqdn+"/ListWorkspaceQuotasIterator.NextWithContext")
1822		defer func() {
1823			sc := -1
1824			if iter.Response().Response.Response != nil {
1825				sc = iter.Response().Response.Response.StatusCode
1826			}
1827			tracing.EndSpan(ctx, sc, err)
1828		}()
1829	}
1830	iter.i++
1831	if iter.i < len(iter.page.Values()) {
1832		return nil
1833	}
1834	err = iter.page.NextWithContext(ctx)
1835	if err != nil {
1836		iter.i--
1837		return err
1838	}
1839	iter.i = 0
1840	return nil
1841}
1842
1843// Next advances to the next value.  If there was an error making
1844// the request the iterator does not advance and the error is returned.
1845// Deprecated: Use NextWithContext() instead.
1846func (iter *ListWorkspaceQuotasIterator) Next() error {
1847	return iter.NextWithContext(context.Background())
1848}
1849
1850// NotDone returns true if the enumeration should be started or is not yet complete.
1851func (iter ListWorkspaceQuotasIterator) NotDone() bool {
1852	return iter.page.NotDone() && iter.i < len(iter.page.Values())
1853}
1854
1855// Response returns the raw server response from the last page request.
1856func (iter ListWorkspaceQuotasIterator) Response() ListWorkspaceQuotas {
1857	return iter.page.Response()
1858}
1859
1860// Value returns the current value or a zero-initialized value if the
1861// iterator has advanced beyond the end of the collection.
1862func (iter ListWorkspaceQuotasIterator) Value() ResourceQuota {
1863	if !iter.page.NotDone() {
1864		return ResourceQuota{}
1865	}
1866	return iter.page.Values()[iter.i]
1867}
1868
1869// Creates a new instance of the ListWorkspaceQuotasIterator type.
1870func NewListWorkspaceQuotasIterator(page ListWorkspaceQuotasPage) ListWorkspaceQuotasIterator {
1871	return ListWorkspaceQuotasIterator{page: page}
1872}
1873
1874// IsEmpty returns true if the ListResult contains no values.
1875func (lwq ListWorkspaceQuotas) IsEmpty() bool {
1876	return lwq.Value == nil || len(*lwq.Value) == 0
1877}
1878
1879// hasNextLink returns true if the NextLink is not empty.
1880func (lwq ListWorkspaceQuotas) hasNextLink() bool {
1881	return lwq.NextLink != nil && len(*lwq.NextLink) != 0
1882}
1883
1884// listWorkspaceQuotasPreparer prepares a request to retrieve the next set of results.
1885// It returns nil if no more results exist.
1886func (lwq ListWorkspaceQuotas) listWorkspaceQuotasPreparer(ctx context.Context) (*http.Request, error) {
1887	if !lwq.hasNextLink() {
1888		return nil, nil
1889	}
1890	return autorest.Prepare((&http.Request{}).WithContext(ctx),
1891		autorest.AsJSON(),
1892		autorest.AsGet(),
1893		autorest.WithBaseURL(to.String(lwq.NextLink)))
1894}
1895
1896// ListWorkspaceQuotasPage contains a page of ResourceQuota values.
1897type ListWorkspaceQuotasPage struct {
1898	fn  func(context.Context, ListWorkspaceQuotas) (ListWorkspaceQuotas, error)
1899	lwq ListWorkspaceQuotas
1900}
1901
1902// NextWithContext advances to the next page of values.  If there was an error making
1903// the request the page does not advance and the error is returned.
1904func (page *ListWorkspaceQuotasPage) NextWithContext(ctx context.Context) (err error) {
1905	if tracing.IsEnabled() {
1906		ctx = tracing.StartSpan(ctx, fqdn+"/ListWorkspaceQuotasPage.NextWithContext")
1907		defer func() {
1908			sc := -1
1909			if page.Response().Response.Response != nil {
1910				sc = page.Response().Response.Response.StatusCode
1911			}
1912			tracing.EndSpan(ctx, sc, err)
1913		}()
1914	}
1915	for {
1916		next, err := page.fn(ctx, page.lwq)
1917		if err != nil {
1918			return err
1919		}
1920		page.lwq = next
1921		if !next.hasNextLink() || !next.IsEmpty() {
1922			break
1923		}
1924	}
1925	return nil
1926}
1927
1928// Next advances to the next page of values.  If there was an error making
1929// the request the page does not advance and the error is returned.
1930// Deprecated: Use NextWithContext() instead.
1931func (page *ListWorkspaceQuotasPage) Next() error {
1932	return page.NextWithContext(context.Background())
1933}
1934
1935// NotDone returns true if the page enumeration should be started or is not yet complete.
1936func (page ListWorkspaceQuotasPage) NotDone() bool {
1937	return !page.lwq.IsEmpty()
1938}
1939
1940// Response returns the raw server response from the last page request.
1941func (page ListWorkspaceQuotasPage) Response() ListWorkspaceQuotas {
1942	return page.lwq
1943}
1944
1945// Values returns the slice of values for the current page or nil if there are no values.
1946func (page ListWorkspaceQuotasPage) Values() []ResourceQuota {
1947	if page.lwq.IsEmpty() {
1948		return nil
1949	}
1950	return *page.lwq.Value
1951}
1952
1953// Creates a new instance of the ListWorkspaceQuotasPage type.
1954func NewListWorkspaceQuotasPage(cur ListWorkspaceQuotas, getNextPage func(context.Context, ListWorkspaceQuotas) (ListWorkspaceQuotas, error)) ListWorkspaceQuotasPage {
1955	return ListWorkspaceQuotasPage{
1956		fn:  getNextPage,
1957		lwq: cur,
1958	}
1959}
1960
1961// MachineLearningComputeCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
1962// long-running operation.
1963type MachineLearningComputeCreateOrUpdateFuture struct {
1964	azure.FutureAPI
1965	// Result returns the result of the asynchronous operation.
1966	// If the operation has not completed it will return an error.
1967	Result func(MachineLearningComputeClient) (ComputeResource, error)
1968}
1969
1970// UnmarshalJSON is the custom unmarshaller for CreateFuture.
1971func (future *MachineLearningComputeCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
1972	var azFuture azure.Future
1973	if err := json.Unmarshal(body, &azFuture); err != nil {
1974		return err
1975	}
1976	future.FutureAPI = &azFuture
1977	future.Result = future.result
1978	return nil
1979}
1980
1981// result is the default implementation for MachineLearningComputeCreateOrUpdateFuture.Result.
1982func (future *MachineLearningComputeCreateOrUpdateFuture) result(client MachineLearningComputeClient) (cr ComputeResource, err error) {
1983	var done bool
1984	done, err = future.DoneWithContext(context.Background(), client)
1985	if err != nil {
1986		err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
1987		return
1988	}
1989	if !done {
1990		cr.Response.Response = future.Response()
1991		err = azure.NewAsyncOpIncompleteError("machinelearningservices.MachineLearningComputeCreateOrUpdateFuture")
1992		return
1993	}
1994	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
1995	if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent {
1996		cr, err = client.CreateOrUpdateResponder(cr.Response.Response)
1997		if err != nil {
1998			err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeCreateOrUpdateFuture", "Result", cr.Response.Response, "Failure responding to request")
1999		}
2000	}
2001	return
2002}
2003
2004// MachineLearningComputeDeleteFuture an abstraction for monitoring and retrieving the results of a
2005// long-running operation.
2006type MachineLearningComputeDeleteFuture struct {
2007	azure.FutureAPI
2008	// Result returns the result of the asynchronous operation.
2009	// If the operation has not completed it will return an error.
2010	Result func(MachineLearningComputeClient) (autorest.Response, error)
2011}
2012
2013// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2014func (future *MachineLearningComputeDeleteFuture) UnmarshalJSON(body []byte) error {
2015	var azFuture azure.Future
2016	if err := json.Unmarshal(body, &azFuture); err != nil {
2017		return err
2018	}
2019	future.FutureAPI = &azFuture
2020	future.Result = future.result
2021	return nil
2022}
2023
2024// result is the default implementation for MachineLearningComputeDeleteFuture.Result.
2025func (future *MachineLearningComputeDeleteFuture) result(client MachineLearningComputeClient) (ar autorest.Response, err error) {
2026	var done bool
2027	done, err = future.DoneWithContext(context.Background(), client)
2028	if err != nil {
2029		err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeDeleteFuture", "Result", future.Response(), "Polling failure")
2030		return
2031	}
2032	if !done {
2033		ar.Response = future.Response()
2034		err = azure.NewAsyncOpIncompleteError("machinelearningservices.MachineLearningComputeDeleteFuture")
2035		return
2036	}
2037	ar.Response = future.Response()
2038	return
2039}
2040
2041// MachineLearningComputeUpdateFuture an abstraction for monitoring and retrieving the results of a
2042// long-running operation.
2043type MachineLearningComputeUpdateFuture struct {
2044	azure.FutureAPI
2045	// Result returns the result of the asynchronous operation.
2046	// If the operation has not completed it will return an error.
2047	Result func(MachineLearningComputeClient) (ComputeResource, error)
2048}
2049
2050// UnmarshalJSON is the custom unmarshaller for CreateFuture.
2051func (future *MachineLearningComputeUpdateFuture) UnmarshalJSON(body []byte) error {
2052	var azFuture azure.Future
2053	if err := json.Unmarshal(body, &azFuture); err != nil {
2054		return err
2055	}
2056	future.FutureAPI = &azFuture
2057	future.Result = future.result
2058	return nil
2059}
2060
2061// result is the default implementation for MachineLearningComputeUpdateFuture.Result.
2062func (future *MachineLearningComputeUpdateFuture) result(client MachineLearningComputeClient) (cr ComputeResource, err error) {
2063	var done bool
2064	done, err = future.DoneWithContext(context.Background(), client)
2065	if err != nil {
2066		err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeUpdateFuture", "Result", future.Response(), "Polling failure")
2067		return
2068	}
2069	if !done {
2070		cr.Response.Response = future.Response()
2071		err = azure.NewAsyncOpIncompleteError("machinelearningservices.MachineLearningComputeUpdateFuture")
2072		return
2073	}
2074	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
2075	if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent {
2076		cr, err = client.UpdateResponder(cr.Response.Response)
2077		if err != nil {
2078			err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeUpdateFuture", "Result", cr.Response.Response, "Failure responding to request")
2079		}
2080	}
2081	return
2082}
2083
2084// NodeStateCounts counts of various compute node states on the amlCompute.
2085type NodeStateCounts struct {
2086	// IdleNodeCount - READ-ONLY; Number of compute nodes in idle state.
2087	IdleNodeCount *int32 `json:"idleNodeCount,omitempty"`
2088	// RunningNodeCount - READ-ONLY; Number of compute nodes which are running jobs.
2089	RunningNodeCount *int32 `json:"runningNodeCount,omitempty"`
2090	// PreparingNodeCount - READ-ONLY; Number of compute nodes which are being prepared.
2091	PreparingNodeCount *int32 `json:"preparingNodeCount,omitempty"`
2092	// UnusableNodeCount - READ-ONLY; Number of compute nodes which are in unusable state.
2093	UnusableNodeCount *int32 `json:"unusableNodeCount,omitempty"`
2094	// LeavingNodeCount - READ-ONLY; Number of compute nodes which are leaving the amlCompute.
2095	LeavingNodeCount *int32 `json:"leavingNodeCount,omitempty"`
2096	// PreemptedNodeCount - READ-ONLY; Number of compute nodes which are in preempted state.
2097	PreemptedNodeCount *int32 `json:"preemptedNodeCount,omitempty"`
2098}
2099
2100// MarshalJSON is the custom marshaler for NodeStateCounts.
2101func (nsc NodeStateCounts) MarshalJSON() ([]byte, error) {
2102	objectMap := make(map[string]interface{})
2103	return json.Marshal(objectMap)
2104}
2105
2106// Operation azure Machine Learning workspace REST API operation
2107type Operation struct {
2108	// Name - Operation name: {provider}/{resource}/{operation}
2109	Name *string `json:"name,omitempty"`
2110	// Display - Display name of operation
2111	Display *OperationDisplay `json:"display,omitempty"`
2112}
2113
2114// OperationDisplay display name of operation
2115type OperationDisplay struct {
2116	// Provider - The resource provider name: Microsoft.MachineLearningExperimentation
2117	Provider *string `json:"provider,omitempty"`
2118	// Resource - The resource on which the operation is performed.
2119	Resource *string `json:"resource,omitempty"`
2120	// Operation - The operation that users can perform.
2121	Operation *string `json:"operation,omitempty"`
2122	// Description - The description for the operation.
2123	Description *string `json:"description,omitempty"`
2124}
2125
2126// OperationListResult an array of operations supported by the resource provider.
2127type OperationListResult struct {
2128	autorest.Response `json:"-"`
2129	// Value - List of AML workspace operations supported by the AML workspace resource provider.
2130	Value *[]Operation `json:"value,omitempty"`
2131}
2132
2133// PaginatedComputeResourcesList paginated list of Machine Learning compute objects wrapped in ARM resource
2134// envelope.
2135type PaginatedComputeResourcesList struct {
2136	autorest.Response `json:"-"`
2137	// Value - An array of Machine Learning compute objects wrapped in ARM resource envelope.
2138	Value *[]ComputeResource `json:"value,omitempty"`
2139	// NextLink - A continuation link (absolute URI) to the next page of results in the list.
2140	NextLink *string `json:"nextLink,omitempty"`
2141}
2142
2143// PaginatedComputeResourcesListIterator provides access to a complete listing of ComputeResource values.
2144type PaginatedComputeResourcesListIterator struct {
2145	i    int
2146	page PaginatedComputeResourcesListPage
2147}
2148
2149// NextWithContext advances to the next value.  If there was an error making
2150// the request the iterator does not advance and the error is returned.
2151func (iter *PaginatedComputeResourcesListIterator) NextWithContext(ctx context.Context) (err error) {
2152	if tracing.IsEnabled() {
2153		ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedComputeResourcesListIterator.NextWithContext")
2154		defer func() {
2155			sc := -1
2156			if iter.Response().Response.Response != nil {
2157				sc = iter.Response().Response.Response.StatusCode
2158			}
2159			tracing.EndSpan(ctx, sc, err)
2160		}()
2161	}
2162	iter.i++
2163	if iter.i < len(iter.page.Values()) {
2164		return nil
2165	}
2166	err = iter.page.NextWithContext(ctx)
2167	if err != nil {
2168		iter.i--
2169		return err
2170	}
2171	iter.i = 0
2172	return nil
2173}
2174
2175// Next advances to the next value.  If there was an error making
2176// the request the iterator does not advance and the error is returned.
2177// Deprecated: Use NextWithContext() instead.
2178func (iter *PaginatedComputeResourcesListIterator) Next() error {
2179	return iter.NextWithContext(context.Background())
2180}
2181
2182// NotDone returns true if the enumeration should be started or is not yet complete.
2183func (iter PaginatedComputeResourcesListIterator) NotDone() bool {
2184	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2185}
2186
2187// Response returns the raw server response from the last page request.
2188func (iter PaginatedComputeResourcesListIterator) Response() PaginatedComputeResourcesList {
2189	return iter.page.Response()
2190}
2191
2192// Value returns the current value or a zero-initialized value if the
2193// iterator has advanced beyond the end of the collection.
2194func (iter PaginatedComputeResourcesListIterator) Value() ComputeResource {
2195	if !iter.page.NotDone() {
2196		return ComputeResource{}
2197	}
2198	return iter.page.Values()[iter.i]
2199}
2200
2201// Creates a new instance of the PaginatedComputeResourcesListIterator type.
2202func NewPaginatedComputeResourcesListIterator(page PaginatedComputeResourcesListPage) PaginatedComputeResourcesListIterator {
2203	return PaginatedComputeResourcesListIterator{page: page}
2204}
2205
2206// IsEmpty returns true if the ListResult contains no values.
2207func (pcrl PaginatedComputeResourcesList) IsEmpty() bool {
2208	return pcrl.Value == nil || len(*pcrl.Value) == 0
2209}
2210
2211// hasNextLink returns true if the NextLink is not empty.
2212func (pcrl PaginatedComputeResourcesList) hasNextLink() bool {
2213	return pcrl.NextLink != nil && len(*pcrl.NextLink) != 0
2214}
2215
2216// paginatedComputeResourcesListPreparer prepares a request to retrieve the next set of results.
2217// It returns nil if no more results exist.
2218func (pcrl PaginatedComputeResourcesList) paginatedComputeResourcesListPreparer(ctx context.Context) (*http.Request, error) {
2219	if !pcrl.hasNextLink() {
2220		return nil, nil
2221	}
2222	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2223		autorest.AsJSON(),
2224		autorest.AsGet(),
2225		autorest.WithBaseURL(to.String(pcrl.NextLink)))
2226}
2227
2228// PaginatedComputeResourcesListPage contains a page of ComputeResource values.
2229type PaginatedComputeResourcesListPage struct {
2230	fn   func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error)
2231	pcrl PaginatedComputeResourcesList
2232}
2233
2234// NextWithContext advances to the next page of values.  If there was an error making
2235// the request the page does not advance and the error is returned.
2236func (page *PaginatedComputeResourcesListPage) NextWithContext(ctx context.Context) (err error) {
2237	if tracing.IsEnabled() {
2238		ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedComputeResourcesListPage.NextWithContext")
2239		defer func() {
2240			sc := -1
2241			if page.Response().Response.Response != nil {
2242				sc = page.Response().Response.Response.StatusCode
2243			}
2244			tracing.EndSpan(ctx, sc, err)
2245		}()
2246	}
2247	for {
2248		next, err := page.fn(ctx, page.pcrl)
2249		if err != nil {
2250			return err
2251		}
2252		page.pcrl = next
2253		if !next.hasNextLink() || !next.IsEmpty() {
2254			break
2255		}
2256	}
2257	return nil
2258}
2259
2260// Next advances to the next page of values.  If there was an error making
2261// the request the page does not advance and the error is returned.
2262// Deprecated: Use NextWithContext() instead.
2263func (page *PaginatedComputeResourcesListPage) Next() error {
2264	return page.NextWithContext(context.Background())
2265}
2266
2267// NotDone returns true if the page enumeration should be started or is not yet complete.
2268func (page PaginatedComputeResourcesListPage) NotDone() bool {
2269	return !page.pcrl.IsEmpty()
2270}
2271
2272// Response returns the raw server response from the last page request.
2273func (page PaginatedComputeResourcesListPage) Response() PaginatedComputeResourcesList {
2274	return page.pcrl
2275}
2276
2277// Values returns the slice of values for the current page or nil if there are no values.
2278func (page PaginatedComputeResourcesListPage) Values() []ComputeResource {
2279	if page.pcrl.IsEmpty() {
2280		return nil
2281	}
2282	return *page.pcrl.Value
2283}
2284
2285// Creates a new instance of the PaginatedComputeResourcesListPage type.
2286func NewPaginatedComputeResourcesListPage(cur PaginatedComputeResourcesList, getNextPage func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error)) PaginatedComputeResourcesListPage {
2287	return PaginatedComputeResourcesListPage{
2288		fn:   getNextPage,
2289		pcrl: cur,
2290	}
2291}
2292
2293// Password ...
2294type Password struct {
2295	// Name - READ-ONLY
2296	Name *string `json:"name,omitempty"`
2297	// Value - READ-ONLY
2298	Value *string `json:"value,omitempty"`
2299}
2300
2301// MarshalJSON is the custom marshaler for Password.
2302func (p Password) MarshalJSON() ([]byte, error) {
2303	objectMap := make(map[string]interface{})
2304	return json.Marshal(objectMap)
2305}
2306
2307// PrivateEndpoint the Private Endpoint resource.
2308type PrivateEndpoint struct {
2309	// ID - READ-ONLY; The ARM identifier for Private Endpoint
2310	ID *string `json:"id,omitempty"`
2311}
2312
2313// MarshalJSON is the custom marshaler for PrivateEndpoint.
2314func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) {
2315	objectMap := make(map[string]interface{})
2316	return json.Marshal(objectMap)
2317}
2318
2319// PrivateEndpointConnection the Private Endpoint Connection resource.
2320type PrivateEndpointConnection struct {
2321	autorest.Response `json:"-"`
2322	// PrivateEndpointConnectionProperties - Resource properties.
2323	*PrivateEndpointConnectionProperties `json:"properties,omitempty"`
2324	// ID - READ-ONLY; Specifies the resource ID.
2325	ID *string `json:"id,omitempty"`
2326	// Name - READ-ONLY; Specifies the name of the resource.
2327	Name *string `json:"name,omitempty"`
2328	// Identity - The identity of the resource.
2329	Identity *Identity `json:"identity,omitempty"`
2330	// Location - Specifies the location of the resource.
2331	Location *string `json:"location,omitempty"`
2332	// Type - READ-ONLY; Specifies the type of the resource.
2333	Type *string `json:"type,omitempty"`
2334	// Tags - Contains resource tags defined as key/value pairs.
2335	Tags map[string]*string `json:"tags"`
2336	// Sku - The sku of the workspace.
2337	Sku *Sku `json:"sku,omitempty"`
2338}
2339
2340// MarshalJSON is the custom marshaler for PrivateEndpointConnection.
2341func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) {
2342	objectMap := make(map[string]interface{})
2343	if pec.PrivateEndpointConnectionProperties != nil {
2344		objectMap["properties"] = pec.PrivateEndpointConnectionProperties
2345	}
2346	if pec.Identity != nil {
2347		objectMap["identity"] = pec.Identity
2348	}
2349	if pec.Location != nil {
2350		objectMap["location"] = pec.Location
2351	}
2352	if pec.Tags != nil {
2353		objectMap["tags"] = pec.Tags
2354	}
2355	if pec.Sku != nil {
2356		objectMap["sku"] = pec.Sku
2357	}
2358	return json.Marshal(objectMap)
2359}
2360
2361// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct.
2362func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error {
2363	var m map[string]*json.RawMessage
2364	err := json.Unmarshal(body, &m)
2365	if err != nil {
2366		return err
2367	}
2368	for k, v := range m {
2369		switch k {
2370		case "properties":
2371			if v != nil {
2372				var privateEndpointConnectionProperties PrivateEndpointConnectionProperties
2373				err = json.Unmarshal(*v, &privateEndpointConnectionProperties)
2374				if err != nil {
2375					return err
2376				}
2377				pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties
2378			}
2379		case "id":
2380			if v != nil {
2381				var ID string
2382				err = json.Unmarshal(*v, &ID)
2383				if err != nil {
2384					return err
2385				}
2386				pec.ID = &ID
2387			}
2388		case "name":
2389			if v != nil {
2390				var name string
2391				err = json.Unmarshal(*v, &name)
2392				if err != nil {
2393					return err
2394				}
2395				pec.Name = &name
2396			}
2397		case "identity":
2398			if v != nil {
2399				var identity Identity
2400				err = json.Unmarshal(*v, &identity)
2401				if err != nil {
2402					return err
2403				}
2404				pec.Identity = &identity
2405			}
2406		case "location":
2407			if v != nil {
2408				var location string
2409				err = json.Unmarshal(*v, &location)
2410				if err != nil {
2411					return err
2412				}
2413				pec.Location = &location
2414			}
2415		case "type":
2416			if v != nil {
2417				var typeVar string
2418				err = json.Unmarshal(*v, &typeVar)
2419				if err != nil {
2420					return err
2421				}
2422				pec.Type = &typeVar
2423			}
2424		case "tags":
2425			if v != nil {
2426				var tags map[string]*string
2427				err = json.Unmarshal(*v, &tags)
2428				if err != nil {
2429					return err
2430				}
2431				pec.Tags = tags
2432			}
2433		case "sku":
2434			if v != nil {
2435				var sku Sku
2436				err = json.Unmarshal(*v, &sku)
2437				if err != nil {
2438					return err
2439				}
2440				pec.Sku = &sku
2441			}
2442		}
2443	}
2444
2445	return nil
2446}
2447
2448// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties.
2449type PrivateEndpointConnectionProperties struct {
2450	// PrivateEndpoint - The resource of private end point.
2451	PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"`
2452	// PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider.
2453	PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"`
2454	// ProvisioningState - The provisioning state of the private endpoint connection resource. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed'
2455	ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"`
2456}
2457
2458// PrivateLinkResource a private link resource
2459type PrivateLinkResource struct {
2460	// PrivateLinkResourceProperties - Resource properties.
2461	*PrivateLinkResourceProperties `json:"properties,omitempty"`
2462	// ID - READ-ONLY; Specifies the resource ID.
2463	ID *string `json:"id,omitempty"`
2464	// Name - READ-ONLY; Specifies the name of the resource.
2465	Name *string `json:"name,omitempty"`
2466	// Identity - The identity of the resource.
2467	Identity *Identity `json:"identity,omitempty"`
2468	// Location - Specifies the location of the resource.
2469	Location *string `json:"location,omitempty"`
2470	// Type - READ-ONLY; Specifies the type of the resource.
2471	Type *string `json:"type,omitempty"`
2472	// Tags - Contains resource tags defined as key/value pairs.
2473	Tags map[string]*string `json:"tags"`
2474	// Sku - The sku of the workspace.
2475	Sku *Sku `json:"sku,omitempty"`
2476}
2477
2478// MarshalJSON is the custom marshaler for PrivateLinkResource.
2479func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) {
2480	objectMap := make(map[string]interface{})
2481	if plr.PrivateLinkResourceProperties != nil {
2482		objectMap["properties"] = plr.PrivateLinkResourceProperties
2483	}
2484	if plr.Identity != nil {
2485		objectMap["identity"] = plr.Identity
2486	}
2487	if plr.Location != nil {
2488		objectMap["location"] = plr.Location
2489	}
2490	if plr.Tags != nil {
2491		objectMap["tags"] = plr.Tags
2492	}
2493	if plr.Sku != nil {
2494		objectMap["sku"] = plr.Sku
2495	}
2496	return json.Marshal(objectMap)
2497}
2498
2499// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct.
2500func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error {
2501	var m map[string]*json.RawMessage
2502	err := json.Unmarshal(body, &m)
2503	if err != nil {
2504		return err
2505	}
2506	for k, v := range m {
2507		switch k {
2508		case "properties":
2509			if v != nil {
2510				var privateLinkResourceProperties PrivateLinkResourceProperties
2511				err = json.Unmarshal(*v, &privateLinkResourceProperties)
2512				if err != nil {
2513					return err
2514				}
2515				plr.PrivateLinkResourceProperties = &privateLinkResourceProperties
2516			}
2517		case "id":
2518			if v != nil {
2519				var ID string
2520				err = json.Unmarshal(*v, &ID)
2521				if err != nil {
2522					return err
2523				}
2524				plr.ID = &ID
2525			}
2526		case "name":
2527			if v != nil {
2528				var name string
2529				err = json.Unmarshal(*v, &name)
2530				if err != nil {
2531					return err
2532				}
2533				plr.Name = &name
2534			}
2535		case "identity":
2536			if v != nil {
2537				var identity Identity
2538				err = json.Unmarshal(*v, &identity)
2539				if err != nil {
2540					return err
2541				}
2542				plr.Identity = &identity
2543			}
2544		case "location":
2545			if v != nil {
2546				var location string
2547				err = json.Unmarshal(*v, &location)
2548				if err != nil {
2549					return err
2550				}
2551				plr.Location = &location
2552			}
2553		case "type":
2554			if v != nil {
2555				var typeVar string
2556				err = json.Unmarshal(*v, &typeVar)
2557				if err != nil {
2558					return err
2559				}
2560				plr.Type = &typeVar
2561			}
2562		case "tags":
2563			if v != nil {
2564				var tags map[string]*string
2565				err = json.Unmarshal(*v, &tags)
2566				if err != nil {
2567					return err
2568				}
2569				plr.Tags = tags
2570			}
2571		case "sku":
2572			if v != nil {
2573				var sku Sku
2574				err = json.Unmarshal(*v, &sku)
2575				if err != nil {
2576					return err
2577				}
2578				plr.Sku = &sku
2579			}
2580		}
2581	}
2582
2583	return nil
2584}
2585
2586// PrivateLinkResourceListResult a list of private link resources
2587type PrivateLinkResourceListResult struct {
2588	autorest.Response `json:"-"`
2589	// Value - Array of private link resources
2590	Value *[]PrivateLinkResource `json:"value,omitempty"`
2591}
2592
2593// PrivateLinkResourceProperties properties of a private link resource.
2594type PrivateLinkResourceProperties struct {
2595	// GroupID - READ-ONLY; The private link resource group id.
2596	GroupID *string `json:"groupId,omitempty"`
2597	// RequiredMembers - READ-ONLY; The private link resource required member names.
2598	RequiredMembers *[]string `json:"requiredMembers,omitempty"`
2599	// RequiredZoneNames - The private link resource Private link DNS zone name.
2600	RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"`
2601}
2602
2603// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties.
2604func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) {
2605	objectMap := make(map[string]interface{})
2606	if plrp.RequiredZoneNames != nil {
2607		objectMap["requiredZoneNames"] = plrp.RequiredZoneNames
2608	}
2609	return json.Marshal(objectMap)
2610}
2611
2612// PrivateLinkServiceConnectionState a collection of information about the state of the connection between
2613// service consumer and provider.
2614type PrivateLinkServiceConnectionState struct {
2615	// Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected'
2616	Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"`
2617	// Description - The reason for approval/rejection of the connection.
2618	Description *string `json:"description,omitempty"`
2619	// ActionRequired - A message indicating if changes on the service provider require any updates on the consumer.
2620	ActionRequired *string `json:"actionRequired,omitempty"`
2621}
2622
2623// QuotaBaseProperties the properties for Quota update or retrieval.
2624type QuotaBaseProperties struct {
2625	// ID - Specifies the resource ID.
2626	ID *string `json:"id,omitempty"`
2627	// Type - Specifies the resource type.
2628	Type *string `json:"type,omitempty"`
2629	// Limit - The maximum permitted quota of the resource.
2630	Limit *int64 `json:"limit,omitempty"`
2631	// Unit - An enum describing the unit of quota measurement. Possible values include: 'Count'
2632	Unit QuotaUnit `json:"unit,omitempty"`
2633}
2634
2635// QuotaUpdateParameters quota update parameters.
2636type QuotaUpdateParameters struct {
2637	// Value - The list for update quota.
2638	Value *[]QuotaBaseProperties `json:"value,omitempty"`
2639}
2640
2641// RegistryListCredentialsResult ...
2642type RegistryListCredentialsResult struct {
2643	// Location - READ-ONLY
2644	Location *string `json:"location,omitempty"`
2645	// Username - READ-ONLY
2646	Username  *string     `json:"username,omitempty"`
2647	Passwords *[]Password `json:"passwords,omitempty"`
2648}
2649
2650// MarshalJSON is the custom marshaler for RegistryListCredentialsResult.
2651func (rlcr RegistryListCredentialsResult) MarshalJSON() ([]byte, error) {
2652	objectMap := make(map[string]interface{})
2653	if rlcr.Passwords != nil {
2654		objectMap["passwords"] = rlcr.Passwords
2655	}
2656	return json.Marshal(objectMap)
2657}
2658
2659// Resource azure Resource Manager resource envelope.
2660type Resource struct {
2661	// ID - READ-ONLY; Specifies the resource ID.
2662	ID *string `json:"id,omitempty"`
2663	// Name - READ-ONLY; Specifies the name of the resource.
2664	Name *string `json:"name,omitempty"`
2665	// Identity - The identity of the resource.
2666	Identity *Identity `json:"identity,omitempty"`
2667	// Location - Specifies the location of the resource.
2668	Location *string `json:"location,omitempty"`
2669	// Type - READ-ONLY; Specifies the type of the resource.
2670	Type *string `json:"type,omitempty"`
2671	// Tags - Contains resource tags defined as key/value pairs.
2672	Tags map[string]*string `json:"tags"`
2673	// Sku - The sku of the workspace.
2674	Sku *Sku `json:"sku,omitempty"`
2675}
2676
2677// MarshalJSON is the custom marshaler for Resource.
2678func (r Resource) MarshalJSON() ([]byte, error) {
2679	objectMap := make(map[string]interface{})
2680	if r.Identity != nil {
2681		objectMap["identity"] = r.Identity
2682	}
2683	if r.Location != nil {
2684		objectMap["location"] = r.Location
2685	}
2686	if r.Tags != nil {
2687		objectMap["tags"] = r.Tags
2688	}
2689	if r.Sku != nil {
2690		objectMap["sku"] = r.Sku
2691	}
2692	return json.Marshal(objectMap)
2693}
2694
2695// ResourceID represents a resource ID. For example, for a subnet, it is the resource URL for the subnet.
2696type ResourceID struct {
2697	// ID - The ID of the resource
2698	ID *string `json:"id,omitempty"`
2699}
2700
2701// ResourceName the Resource Name.
2702type ResourceName struct {
2703	// Value - READ-ONLY; The name of the resource.
2704	Value *string `json:"value,omitempty"`
2705	// LocalizedValue - READ-ONLY; The localized name of the resource.
2706	LocalizedValue *string `json:"localizedValue,omitempty"`
2707}
2708
2709// MarshalJSON is the custom marshaler for ResourceName.
2710func (rn ResourceName) MarshalJSON() ([]byte, error) {
2711	objectMap := make(map[string]interface{})
2712	return json.Marshal(objectMap)
2713}
2714
2715// ResourceQuota the quota assigned to a resource.
2716type ResourceQuota struct {
2717	// ID - READ-ONLY; Specifies the resource ID.
2718	ID *string `json:"id,omitempty"`
2719	// Type - READ-ONLY; Specifies the resource type.
2720	Type *string `json:"type,omitempty"`
2721	// Name - READ-ONLY; Name of the resource.
2722	Name *ResourceName `json:"name,omitempty"`
2723	// Limit - READ-ONLY; The maximum permitted quota of the resource.
2724	Limit *int64 `json:"limit,omitempty"`
2725	// Unit - READ-ONLY; An enum describing the unit of quota measurement. Possible values include: 'Count'
2726	Unit QuotaUnit `json:"unit,omitempty"`
2727}
2728
2729// MarshalJSON is the custom marshaler for ResourceQuota.
2730func (rq ResourceQuota) MarshalJSON() ([]byte, error) {
2731	objectMap := make(map[string]interface{})
2732	return json.Marshal(objectMap)
2733}
2734
2735// ResourceSkuLocationInfo ...
2736type ResourceSkuLocationInfo struct {
2737	// Location - READ-ONLY; Location of the SKU
2738	Location *string `json:"location,omitempty"`
2739	// Zones - READ-ONLY; List of availability zones where the SKU is supported.
2740	Zones *[]string `json:"zones,omitempty"`
2741	// ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones.
2742	ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"`
2743}
2744
2745// MarshalJSON is the custom marshaler for ResourceSkuLocationInfo.
2746func (rsli ResourceSkuLocationInfo) MarshalJSON() ([]byte, error) {
2747	objectMap := make(map[string]interface{})
2748	return json.Marshal(objectMap)
2749}
2750
2751// ResourceSkuZoneDetails describes The zonal capabilities of a SKU.
2752type ResourceSkuZoneDetails struct {
2753	// Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities.
2754	Name *[]string `json:"name,omitempty"`
2755	// Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones.
2756	Capabilities *[]SKUCapability `json:"capabilities,omitempty"`
2757}
2758
2759// MarshalJSON is the custom marshaler for ResourceSkuZoneDetails.
2760func (rszd ResourceSkuZoneDetails) MarshalJSON() ([]byte, error) {
2761	objectMap := make(map[string]interface{})
2762	return json.Marshal(objectMap)
2763}
2764
2765// Restriction the restriction because of which SKU cannot be used.
2766type Restriction struct {
2767	// Type - READ-ONLY; The type of restrictions. As of now only possible value for this is location.
2768	Type *string `json:"type,omitempty"`
2769	// Values - READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted.
2770	Values *[]string `json:"values,omitempty"`
2771	// ReasonCode - The reason for the restriction. Possible values include: 'NotSpecified', 'NotAvailableForRegion', 'NotAvailableForSubscription'
2772	ReasonCode ReasonCode `json:"reasonCode,omitempty"`
2773}
2774
2775// MarshalJSON is the custom marshaler for Restriction.
2776func (r Restriction) MarshalJSON() ([]byte, error) {
2777	objectMap := make(map[string]interface{})
2778	if r.ReasonCode != "" {
2779		objectMap["reasonCode"] = r.ReasonCode
2780	}
2781	return json.Marshal(objectMap)
2782}
2783
2784// ScaleSettings scale settings for AML Compute
2785type ScaleSettings struct {
2786	// MaxNodeCount - Max number of nodes to use
2787	MaxNodeCount *int32 `json:"maxNodeCount,omitempty"`
2788	// MinNodeCount - Min number of nodes to use
2789	MinNodeCount *int32 `json:"minNodeCount,omitempty"`
2790	// NodeIdleTimeBeforeScaleDown - Node Idle Time before scaling down amlCompute
2791	NodeIdleTimeBeforeScaleDown *string `json:"nodeIdleTimeBeforeScaleDown,omitempty"`
2792}
2793
2794// ServicePrincipalCredentials service principal credentials.
2795type ServicePrincipalCredentials struct {
2796	// ClientID - Client Id
2797	ClientID *string `json:"clientId,omitempty"`
2798	// ClientSecret - Client secret
2799	ClientSecret *string `json:"clientSecret,omitempty"`
2800}
2801
2802// Sku sku of the resource
2803type Sku struct {
2804	// Name - Name of the sku
2805	Name *string `json:"name,omitempty"`
2806	// Tier - Tier of the sku like Basic or Enterprise
2807	Tier *string `json:"tier,omitempty"`
2808}
2809
2810// SKUCapability features/user capabilities associated with the sku
2811type SKUCapability struct {
2812	// Name - Capability/Feature ID
2813	Name *string `json:"name,omitempty"`
2814	// Value - Details about the feature/capability
2815	Value *string `json:"value,omitempty"`
2816}
2817
2818// SkuListResult list of skus with features
2819type SkuListResult struct {
2820	autorest.Response `json:"-"`
2821	Value             *[]WorkspaceSku `json:"value,omitempty"`
2822	// NextLink - The URI to fetch the next page of Workspace Skus. Call ListNext() with this URI to fetch the next page of Workspace Skus
2823	NextLink *string `json:"nextLink,omitempty"`
2824}
2825
2826// SkuListResultIterator provides access to a complete listing of WorkspaceSku values.
2827type SkuListResultIterator struct {
2828	i    int
2829	page SkuListResultPage
2830}
2831
2832// NextWithContext advances to the next value.  If there was an error making
2833// the request the iterator does not advance and the error is returned.
2834func (iter *SkuListResultIterator) NextWithContext(ctx context.Context) (err error) {
2835	if tracing.IsEnabled() {
2836		ctx = tracing.StartSpan(ctx, fqdn+"/SkuListResultIterator.NextWithContext")
2837		defer func() {
2838			sc := -1
2839			if iter.Response().Response.Response != nil {
2840				sc = iter.Response().Response.Response.StatusCode
2841			}
2842			tracing.EndSpan(ctx, sc, err)
2843		}()
2844	}
2845	iter.i++
2846	if iter.i < len(iter.page.Values()) {
2847		return nil
2848	}
2849	err = iter.page.NextWithContext(ctx)
2850	if err != nil {
2851		iter.i--
2852		return err
2853	}
2854	iter.i = 0
2855	return nil
2856}
2857
2858// Next advances to the next value.  If there was an error making
2859// the request the iterator does not advance and the error is returned.
2860// Deprecated: Use NextWithContext() instead.
2861func (iter *SkuListResultIterator) Next() error {
2862	return iter.NextWithContext(context.Background())
2863}
2864
2865// NotDone returns true if the enumeration should be started or is not yet complete.
2866func (iter SkuListResultIterator) NotDone() bool {
2867	return iter.page.NotDone() && iter.i < len(iter.page.Values())
2868}
2869
2870// Response returns the raw server response from the last page request.
2871func (iter SkuListResultIterator) Response() SkuListResult {
2872	return iter.page.Response()
2873}
2874
2875// Value returns the current value or a zero-initialized value if the
2876// iterator has advanced beyond the end of the collection.
2877func (iter SkuListResultIterator) Value() WorkspaceSku {
2878	if !iter.page.NotDone() {
2879		return WorkspaceSku{}
2880	}
2881	return iter.page.Values()[iter.i]
2882}
2883
2884// Creates a new instance of the SkuListResultIterator type.
2885func NewSkuListResultIterator(page SkuListResultPage) SkuListResultIterator {
2886	return SkuListResultIterator{page: page}
2887}
2888
2889// IsEmpty returns true if the ListResult contains no values.
2890func (slr SkuListResult) IsEmpty() bool {
2891	return slr.Value == nil || len(*slr.Value) == 0
2892}
2893
2894// hasNextLink returns true if the NextLink is not empty.
2895func (slr SkuListResult) hasNextLink() bool {
2896	return slr.NextLink != nil && len(*slr.NextLink) != 0
2897}
2898
2899// skuListResultPreparer prepares a request to retrieve the next set of results.
2900// It returns nil if no more results exist.
2901func (slr SkuListResult) skuListResultPreparer(ctx context.Context) (*http.Request, error) {
2902	if !slr.hasNextLink() {
2903		return nil, nil
2904	}
2905	return autorest.Prepare((&http.Request{}).WithContext(ctx),
2906		autorest.AsJSON(),
2907		autorest.AsGet(),
2908		autorest.WithBaseURL(to.String(slr.NextLink)))
2909}
2910
2911// SkuListResultPage contains a page of WorkspaceSku values.
2912type SkuListResultPage struct {
2913	fn  func(context.Context, SkuListResult) (SkuListResult, error)
2914	slr SkuListResult
2915}
2916
2917// NextWithContext advances to the next page of values.  If there was an error making
2918// the request the page does not advance and the error is returned.
2919func (page *SkuListResultPage) NextWithContext(ctx context.Context) (err error) {
2920	if tracing.IsEnabled() {
2921		ctx = tracing.StartSpan(ctx, fqdn+"/SkuListResultPage.NextWithContext")
2922		defer func() {
2923			sc := -1
2924			if page.Response().Response.Response != nil {
2925				sc = page.Response().Response.Response.StatusCode
2926			}
2927			tracing.EndSpan(ctx, sc, err)
2928		}()
2929	}
2930	for {
2931		next, err := page.fn(ctx, page.slr)
2932		if err != nil {
2933			return err
2934		}
2935		page.slr = next
2936		if !next.hasNextLink() || !next.IsEmpty() {
2937			break
2938		}
2939	}
2940	return nil
2941}
2942
2943// Next advances to the next page of values.  If there was an error making
2944// the request the page does not advance and the error is returned.
2945// Deprecated: Use NextWithContext() instead.
2946func (page *SkuListResultPage) Next() error {
2947	return page.NextWithContext(context.Background())
2948}
2949
2950// NotDone returns true if the page enumeration should be started or is not yet complete.
2951func (page SkuListResultPage) NotDone() bool {
2952	return !page.slr.IsEmpty()
2953}
2954
2955// Response returns the raw server response from the last page request.
2956func (page SkuListResultPage) Response() SkuListResult {
2957	return page.slr
2958}
2959
2960// Values returns the slice of values for the current page or nil if there are no values.
2961func (page SkuListResultPage) Values() []WorkspaceSku {
2962	if page.slr.IsEmpty() {
2963		return nil
2964	}
2965	return *page.slr.Value
2966}
2967
2968// Creates a new instance of the SkuListResultPage type.
2969func NewSkuListResultPage(cur SkuListResult, getNextPage func(context.Context, SkuListResult) (SkuListResult, error)) SkuListResultPage {
2970	return SkuListResultPage{
2971		fn:  getNextPage,
2972		slr: cur,
2973	}
2974}
2975
2976// SslConfiguration the ssl configuration for scoring
2977type SslConfiguration struct {
2978	// Status - Enable or disable ssl for scoring. Possible values include: 'Status1Disabled', 'Status1Enabled'
2979	Status Status1 `json:"status,omitempty"`
2980	// Cert - Cert data
2981	Cert *string `json:"cert,omitempty"`
2982	// Key - Key data
2983	Key *string `json:"key,omitempty"`
2984	// Cname - CNAME of the cert
2985	Cname *string `json:"cname,omitempty"`
2986}
2987
2988// SystemService a system service running on a compute.
2989type SystemService struct {
2990	// SystemServiceType - READ-ONLY; The type of this system service.
2991	SystemServiceType *string `json:"systemServiceType,omitempty"`
2992	// PublicIPAddress - READ-ONLY; Public IP address
2993	PublicIPAddress *string `json:"publicIpAddress,omitempty"`
2994	// Version - READ-ONLY; The version for this type.
2995	Version *string `json:"version,omitempty"`
2996}
2997
2998// MarshalJSON is the custom marshaler for SystemService.
2999func (ss SystemService) MarshalJSON() ([]byte, error) {
3000	objectMap := make(map[string]interface{})
3001	return json.Marshal(objectMap)
3002}
3003
3004// UpdateWorkspaceQuotas the properties for update Quota response.
3005type UpdateWorkspaceQuotas struct {
3006	// ID - READ-ONLY; Specifies the resource ID.
3007	ID *string `json:"id,omitempty"`
3008	// Type - READ-ONLY; Specifies the resource type.
3009	Type *string `json:"type,omitempty"`
3010	// Limit - The maximum permitted quota of the resource.
3011	Limit *int64 `json:"limit,omitempty"`
3012	// Unit - READ-ONLY; An enum describing the unit of quota measurement. Possible values include: 'Count'
3013	Unit QuotaUnit `json:"unit,omitempty"`
3014	// Status - Status of update workspace quota. Possible values include: 'Undefined', 'Success', 'Failure', 'InvalidQuotaBelowClusterMinimum', 'InvalidQuotaExceedsSubscriptionLimit', 'InvalidVMFamilyName', 'OperationNotSupportedForSku', 'OperationNotEnabledForRegion'
3015	Status Status `json:"status,omitempty"`
3016}
3017
3018// MarshalJSON is the custom marshaler for UpdateWorkspaceQuotas.
3019func (uwq UpdateWorkspaceQuotas) MarshalJSON() ([]byte, error) {
3020	objectMap := make(map[string]interface{})
3021	if uwq.Limit != nil {
3022		objectMap["limit"] = uwq.Limit
3023	}
3024	if uwq.Status != "" {
3025		objectMap["status"] = uwq.Status
3026	}
3027	return json.Marshal(objectMap)
3028}
3029
3030// UpdateWorkspaceQuotasResult the result of update workspace quota.
3031type UpdateWorkspaceQuotasResult struct {
3032	autorest.Response `json:"-"`
3033	// Value - READ-ONLY; The list of workspace quota update result.
3034	Value *[]UpdateWorkspaceQuotas `json:"value,omitempty"`
3035	// NextLink - READ-ONLY; The URI to fetch the next page of workspace quota update result. Call ListNext() with this to fetch the next page of Workspace Quota update result.
3036	NextLink *string `json:"nextLink,omitempty"`
3037}
3038
3039// MarshalJSON is the custom marshaler for UpdateWorkspaceQuotasResult.
3040func (uwqr UpdateWorkspaceQuotasResult) MarshalJSON() ([]byte, error) {
3041	objectMap := make(map[string]interface{})
3042	return json.Marshal(objectMap)
3043}
3044
3045// Usage describes AML Resource Usage.
3046type Usage struct {
3047	// ID - READ-ONLY; Specifies the resource ID.
3048	ID *string `json:"id,omitempty"`
3049	// Type - READ-ONLY; Specifies the resource type.
3050	Type *string `json:"type,omitempty"`
3051	// Unit - READ-ONLY; An enum describing the unit of usage measurement. Possible values include: 'UsageUnitCount'
3052	Unit UsageUnit `json:"unit,omitempty"`
3053	// CurrentValue - READ-ONLY; The current usage of the resource.
3054	CurrentValue *int64 `json:"currentValue,omitempty"`
3055	// Limit - READ-ONLY; The maximum permitted usage of the resource.
3056	Limit *int64 `json:"limit,omitempty"`
3057	// Name - READ-ONLY; The name of the type of usage.
3058	Name *UsageName `json:"name,omitempty"`
3059}
3060
3061// MarshalJSON is the custom marshaler for Usage.
3062func (u Usage) MarshalJSON() ([]byte, error) {
3063	objectMap := make(map[string]interface{})
3064	return json.Marshal(objectMap)
3065}
3066
3067// UsageName the Usage Names.
3068type UsageName struct {
3069	// Value - READ-ONLY; The name of the resource.
3070	Value *string `json:"value,omitempty"`
3071	// LocalizedValue - READ-ONLY; The localized name of the resource.
3072	LocalizedValue *string `json:"localizedValue,omitempty"`
3073}
3074
3075// MarshalJSON is the custom marshaler for UsageName.
3076func (un UsageName) MarshalJSON() ([]byte, error) {
3077	objectMap := make(map[string]interface{})
3078	return json.Marshal(objectMap)
3079}
3080
3081// UserAccountCredentials settings for user account that gets created on each on the nodes of a compute.
3082type UserAccountCredentials struct {
3083	// AdminUserName - Name of the administrator user account which can be used to SSH to nodes.
3084	AdminUserName *string `json:"adminUserName,omitempty"`
3085	// AdminUserSSHPublicKey - SSH public key of the administrator user account.
3086	AdminUserSSHPublicKey *string `json:"adminUserSshPublicKey,omitempty"`
3087	// AdminUserPassword - Password of the administrator user account.
3088	AdminUserPassword *string `json:"adminUserPassword,omitempty"`
3089}
3090
3091// VirtualMachine a Machine Learning compute based on Azure Virtual Machines.
3092type VirtualMachine struct {
3093	Properties *VirtualMachineProperties `json:"properties,omitempty"`
3094	// ComputeLocation - Location for the underlying compute
3095	ComputeLocation *string `json:"computeLocation,omitempty"`
3096	// ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled'
3097	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
3098	// Description - The description of the Machine Learning compute.
3099	Description *string `json:"description,omitempty"`
3100	// CreatedOn - READ-ONLY; The date and time when the compute was created.
3101	CreatedOn *date.Time `json:"createdOn,omitempty"`
3102	// ModifiedOn - READ-ONLY; The date and time when the compute was last modified.
3103	ModifiedOn *date.Time `json:"modifiedOn,omitempty"`
3104	// ResourceID - ARM resource id of the underlying compute
3105	ResourceID *string `json:"resourceId,omitempty"`
3106	// ProvisioningErrors - READ-ONLY; Errors during provisioning
3107	ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"`
3108	// 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.
3109	IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"`
3110	// ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1'
3111	ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"`
3112}
3113
3114// MarshalJSON is the custom marshaler for VirtualMachine.
3115func (VM VirtualMachine) MarshalJSON() ([]byte, error) {
3116	VM.ComputeType = ComputeTypeVirtualMachine1
3117	objectMap := make(map[string]interface{})
3118	if VM.Properties != nil {
3119		objectMap["properties"] = VM.Properties
3120	}
3121	if VM.ComputeLocation != nil {
3122		objectMap["computeLocation"] = VM.ComputeLocation
3123	}
3124	if VM.Description != nil {
3125		objectMap["description"] = VM.Description
3126	}
3127	if VM.ResourceID != nil {
3128		objectMap["resourceId"] = VM.ResourceID
3129	}
3130	if VM.ComputeType != "" {
3131		objectMap["computeType"] = VM.ComputeType
3132	}
3133	return json.Marshal(objectMap)
3134}
3135
3136// AsAKS is the BasicCompute implementation for VirtualMachine.
3137func (VM VirtualMachine) AsAKS() (*AKS, bool) {
3138	return nil, false
3139}
3140
3141// AsAmlCompute is the BasicCompute implementation for VirtualMachine.
3142func (VM VirtualMachine) AsAmlCompute() (*AmlCompute, bool) {
3143	return nil, false
3144}
3145
3146// AsVirtualMachine is the BasicCompute implementation for VirtualMachine.
3147func (VM VirtualMachine) AsVirtualMachine() (*VirtualMachine, bool) {
3148	return &VM, true
3149}
3150
3151// AsHDInsight is the BasicCompute implementation for VirtualMachine.
3152func (VM VirtualMachine) AsHDInsight() (*HDInsight, bool) {
3153	return nil, false
3154}
3155
3156// AsDataFactory is the BasicCompute implementation for VirtualMachine.
3157func (VM VirtualMachine) AsDataFactory() (*DataFactory, bool) {
3158	return nil, false
3159}
3160
3161// AsDatabricks is the BasicCompute implementation for VirtualMachine.
3162func (VM VirtualMachine) AsDatabricks() (*Databricks, bool) {
3163	return nil, false
3164}
3165
3166// AsDataLakeAnalytics is the BasicCompute implementation for VirtualMachine.
3167func (VM VirtualMachine) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) {
3168	return nil, false
3169}
3170
3171// AsCompute is the BasicCompute implementation for VirtualMachine.
3172func (VM VirtualMachine) AsCompute() (*Compute, bool) {
3173	return nil, false
3174}
3175
3176// AsBasicCompute is the BasicCompute implementation for VirtualMachine.
3177func (VM VirtualMachine) AsBasicCompute() (BasicCompute, bool) {
3178	return &VM, true
3179}
3180
3181// VirtualMachineProperties ...
3182type VirtualMachineProperties struct {
3183	// VirtualMachineSize - Virtual Machine size
3184	VirtualMachineSize *string `json:"virtualMachineSize,omitempty"`
3185	// SSHPort - Port open for ssh connections.
3186	SSHPort *int32 `json:"sshPort,omitempty"`
3187	// Address - Public IP address of the virtual machine.
3188	Address *string `json:"address,omitempty"`
3189	// AdministratorAccount - Admin credentials for virtual machine
3190	AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"`
3191}
3192
3193// VirtualMachineSecrets secrets related to a Machine Learning compute based on AKS.
3194type VirtualMachineSecrets struct {
3195	// AdministratorAccount - Admin credentials for virtual machine.
3196	AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"`
3197	// ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine', 'ComputeTypeBasicComputeSecretsComputeTypeDatabricks'
3198	ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"`
3199}
3200
3201// MarshalJSON is the custom marshaler for VirtualMachineSecrets.
3202func (vms VirtualMachineSecrets) MarshalJSON() ([]byte, error) {
3203	vms.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine
3204	objectMap := make(map[string]interface{})
3205	if vms.AdministratorAccount != nil {
3206		objectMap["administratorAccount"] = vms.AdministratorAccount
3207	}
3208	if vms.ComputeType != "" {
3209		objectMap["computeType"] = vms.ComputeType
3210	}
3211	return json.Marshal(objectMap)
3212}
3213
3214// AsAksComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets.
3215func (vms VirtualMachineSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) {
3216	return nil, false
3217}
3218
3219// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets.
3220func (vms VirtualMachineSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) {
3221	return &vms, true
3222}
3223
3224// AsDatabricksComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets.
3225func (vms VirtualMachineSecrets) AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) {
3226	return nil, false
3227}
3228
3229// AsComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets.
3230func (vms VirtualMachineSecrets) AsComputeSecrets() (*ComputeSecrets, bool) {
3231	return nil, false
3232}
3233
3234// AsBasicComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets.
3235func (vms VirtualMachineSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) {
3236	return &vms, true
3237}
3238
3239// VirtualMachineSize describes the properties of a VM size.
3240type VirtualMachineSize struct {
3241	// Name - READ-ONLY; The name of the virtual machine size.
3242	Name *string `json:"name,omitempty"`
3243	// Family - READ-ONLY; The family name of the virtual machine size.
3244	Family *string `json:"family,omitempty"`
3245	// VCPUs - READ-ONLY; The number of vCPUs supported by the virtual machine size.
3246	VCPUs *int32 `json:"vCPUs,omitempty"`
3247	// Gpus - READ-ONLY; The number of gPUs supported by the virtual machine size.
3248	Gpus *int32 `json:"gpus,omitempty"`
3249	// OsVhdSizeMB - READ-ONLY; The OS VHD disk size, in MB, allowed by the virtual machine size.
3250	OsVhdSizeMB *int32 `json:"osVhdSizeMB,omitempty"`
3251	// MaxResourceVolumeMB - READ-ONLY; The resource volume size, in MB, allowed by the virtual machine size.
3252	MaxResourceVolumeMB *int32 `json:"maxResourceVolumeMB,omitempty"`
3253	// MemoryGB - READ-ONLY; The amount of memory, in GB, supported by the virtual machine size.
3254	MemoryGB *float64 `json:"memoryGB,omitempty"`
3255	// LowPriorityCapable - READ-ONLY; Specifies if the virtual machine size supports low priority VMs.
3256	LowPriorityCapable *bool `json:"lowPriorityCapable,omitempty"`
3257	// PremiumIO - READ-ONLY; Specifies if the virtual machine size supports premium IO.
3258	PremiumIO *bool `json:"premiumIO,omitempty"`
3259}
3260
3261// MarshalJSON is the custom marshaler for VirtualMachineSize.
3262func (vms VirtualMachineSize) MarshalJSON() ([]byte, error) {
3263	objectMap := make(map[string]interface{})
3264	return json.Marshal(objectMap)
3265}
3266
3267// VirtualMachineSizeListResult the List Virtual Machine size operation response.
3268type VirtualMachineSizeListResult struct {
3269	autorest.Response `json:"-"`
3270	// AmlCompute - The list of virtual machine sizes supported by AmlCompute.
3271	AmlCompute *[]VirtualMachineSize `json:"amlCompute,omitempty"`
3272}
3273
3274// VirtualMachineSSHCredentials admin credentials for virtual machine
3275type VirtualMachineSSHCredentials struct {
3276	// Username - Username of admin account
3277	Username *string `json:"username,omitempty"`
3278	// Password - Password of admin account
3279	Password *string `json:"password,omitempty"`
3280	// PublicKeyData - Public key data
3281	PublicKeyData *string `json:"publicKeyData,omitempty"`
3282	// PrivateKeyData - Private key data
3283	PrivateKeyData *string `json:"privateKeyData,omitempty"`
3284}
3285
3286// Workspace an object that represents a machine learning workspace.
3287type Workspace struct {
3288	autorest.Response `json:"-"`
3289	// WorkspaceProperties - The properties of the machine learning workspace.
3290	*WorkspaceProperties `json:"properties,omitempty"`
3291	// ID - READ-ONLY; Specifies the resource ID.
3292	ID *string `json:"id,omitempty"`
3293	// Name - READ-ONLY; Specifies the name of the resource.
3294	Name *string `json:"name,omitempty"`
3295	// Identity - The identity of the resource.
3296	Identity *Identity `json:"identity,omitempty"`
3297	// Location - Specifies the location of the resource.
3298	Location *string `json:"location,omitempty"`
3299	// Type - READ-ONLY; Specifies the type of the resource.
3300	Type *string `json:"type,omitempty"`
3301	// Tags - Contains resource tags defined as key/value pairs.
3302	Tags map[string]*string `json:"tags"`
3303	// Sku - The sku of the workspace.
3304	Sku *Sku `json:"sku,omitempty"`
3305}
3306
3307// MarshalJSON is the custom marshaler for Workspace.
3308func (w Workspace) MarshalJSON() ([]byte, error) {
3309	objectMap := make(map[string]interface{})
3310	if w.WorkspaceProperties != nil {
3311		objectMap["properties"] = w.WorkspaceProperties
3312	}
3313	if w.Identity != nil {
3314		objectMap["identity"] = w.Identity
3315	}
3316	if w.Location != nil {
3317		objectMap["location"] = w.Location
3318	}
3319	if w.Tags != nil {
3320		objectMap["tags"] = w.Tags
3321	}
3322	if w.Sku != nil {
3323		objectMap["sku"] = w.Sku
3324	}
3325	return json.Marshal(objectMap)
3326}
3327
3328// UnmarshalJSON is the custom unmarshaler for Workspace struct.
3329func (w *Workspace) UnmarshalJSON(body []byte) error {
3330	var m map[string]*json.RawMessage
3331	err := json.Unmarshal(body, &m)
3332	if err != nil {
3333		return err
3334	}
3335	for k, v := range m {
3336		switch k {
3337		case "properties":
3338			if v != nil {
3339				var workspaceProperties WorkspaceProperties
3340				err = json.Unmarshal(*v, &workspaceProperties)
3341				if err != nil {
3342					return err
3343				}
3344				w.WorkspaceProperties = &workspaceProperties
3345			}
3346		case "id":
3347			if v != nil {
3348				var ID string
3349				err = json.Unmarshal(*v, &ID)
3350				if err != nil {
3351					return err
3352				}
3353				w.ID = &ID
3354			}
3355		case "name":
3356			if v != nil {
3357				var name string
3358				err = json.Unmarshal(*v, &name)
3359				if err != nil {
3360					return err
3361				}
3362				w.Name = &name
3363			}
3364		case "identity":
3365			if v != nil {
3366				var identity Identity
3367				err = json.Unmarshal(*v, &identity)
3368				if err != nil {
3369					return err
3370				}
3371				w.Identity = &identity
3372			}
3373		case "location":
3374			if v != nil {
3375				var location string
3376				err = json.Unmarshal(*v, &location)
3377				if err != nil {
3378					return err
3379				}
3380				w.Location = &location
3381			}
3382		case "type":
3383			if v != nil {
3384				var typeVar string
3385				err = json.Unmarshal(*v, &typeVar)
3386				if err != nil {
3387					return err
3388				}
3389				w.Type = &typeVar
3390			}
3391		case "tags":
3392			if v != nil {
3393				var tags map[string]*string
3394				err = json.Unmarshal(*v, &tags)
3395				if err != nil {
3396					return err
3397				}
3398				w.Tags = tags
3399			}
3400		case "sku":
3401			if v != nil {
3402				var sku Sku
3403				err = json.Unmarshal(*v, &sku)
3404				if err != nil {
3405					return err
3406				}
3407				w.Sku = &sku
3408			}
3409		}
3410	}
3411
3412	return nil
3413}
3414
3415// WorkspaceListResult the result of a request to list machine learning workspaces.
3416type WorkspaceListResult struct {
3417	autorest.Response `json:"-"`
3418	// 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.
3419	Value *[]Workspace `json:"value,omitempty"`
3420	// NextLink - The URI that can be used to request the next list of machine learning workspaces.
3421	NextLink *string `json:"nextLink,omitempty"`
3422}
3423
3424// WorkspaceListResultIterator provides access to a complete listing of Workspace values.
3425type WorkspaceListResultIterator struct {
3426	i    int
3427	page WorkspaceListResultPage
3428}
3429
3430// NextWithContext advances to the next value.  If there was an error making
3431// the request the iterator does not advance and the error is returned.
3432func (iter *WorkspaceListResultIterator) NextWithContext(ctx context.Context) (err error) {
3433	if tracing.IsEnabled() {
3434		ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListResultIterator.NextWithContext")
3435		defer func() {
3436			sc := -1
3437			if iter.Response().Response.Response != nil {
3438				sc = iter.Response().Response.Response.StatusCode
3439			}
3440			tracing.EndSpan(ctx, sc, err)
3441		}()
3442	}
3443	iter.i++
3444	if iter.i < len(iter.page.Values()) {
3445		return nil
3446	}
3447	err = iter.page.NextWithContext(ctx)
3448	if err != nil {
3449		iter.i--
3450		return err
3451	}
3452	iter.i = 0
3453	return nil
3454}
3455
3456// Next advances to the next value.  If there was an error making
3457// the request the iterator does not advance and the error is returned.
3458// Deprecated: Use NextWithContext() instead.
3459func (iter *WorkspaceListResultIterator) Next() error {
3460	return iter.NextWithContext(context.Background())
3461}
3462
3463// NotDone returns true if the enumeration should be started or is not yet complete.
3464func (iter WorkspaceListResultIterator) NotDone() bool {
3465	return iter.page.NotDone() && iter.i < len(iter.page.Values())
3466}
3467
3468// Response returns the raw server response from the last page request.
3469func (iter WorkspaceListResultIterator) Response() WorkspaceListResult {
3470	return iter.page.Response()
3471}
3472
3473// Value returns the current value or a zero-initialized value if the
3474// iterator has advanced beyond the end of the collection.
3475func (iter WorkspaceListResultIterator) Value() Workspace {
3476	if !iter.page.NotDone() {
3477		return Workspace{}
3478	}
3479	return iter.page.Values()[iter.i]
3480}
3481
3482// Creates a new instance of the WorkspaceListResultIterator type.
3483func NewWorkspaceListResultIterator(page WorkspaceListResultPage) WorkspaceListResultIterator {
3484	return WorkspaceListResultIterator{page: page}
3485}
3486
3487// IsEmpty returns true if the ListResult contains no values.
3488func (wlr WorkspaceListResult) IsEmpty() bool {
3489	return wlr.Value == nil || len(*wlr.Value) == 0
3490}
3491
3492// hasNextLink returns true if the NextLink is not empty.
3493func (wlr WorkspaceListResult) hasNextLink() bool {
3494	return wlr.NextLink != nil && len(*wlr.NextLink) != 0
3495}
3496
3497// workspaceListResultPreparer prepares a request to retrieve the next set of results.
3498// It returns nil if no more results exist.
3499func (wlr WorkspaceListResult) workspaceListResultPreparer(ctx context.Context) (*http.Request, error) {
3500	if !wlr.hasNextLink() {
3501		return nil, nil
3502	}
3503	return autorest.Prepare((&http.Request{}).WithContext(ctx),
3504		autorest.AsJSON(),
3505		autorest.AsGet(),
3506		autorest.WithBaseURL(to.String(wlr.NextLink)))
3507}
3508
3509// WorkspaceListResultPage contains a page of Workspace values.
3510type WorkspaceListResultPage struct {
3511	fn  func(context.Context, WorkspaceListResult) (WorkspaceListResult, error)
3512	wlr WorkspaceListResult
3513}
3514
3515// NextWithContext advances to the next page of values.  If there was an error making
3516// the request the page does not advance and the error is returned.
3517func (page *WorkspaceListResultPage) NextWithContext(ctx context.Context) (err error) {
3518	if tracing.IsEnabled() {
3519		ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListResultPage.NextWithContext")
3520		defer func() {
3521			sc := -1
3522			if page.Response().Response.Response != nil {
3523				sc = page.Response().Response.Response.StatusCode
3524			}
3525			tracing.EndSpan(ctx, sc, err)
3526		}()
3527	}
3528	for {
3529		next, err := page.fn(ctx, page.wlr)
3530		if err != nil {
3531			return err
3532		}
3533		page.wlr = next
3534		if !next.hasNextLink() || !next.IsEmpty() {
3535			break
3536		}
3537	}
3538	return nil
3539}
3540
3541// Next advances to the next page of values.  If there was an error making
3542// the request the page does not advance and the error is returned.
3543// Deprecated: Use NextWithContext() instead.
3544func (page *WorkspaceListResultPage) Next() error {
3545	return page.NextWithContext(context.Background())
3546}
3547
3548// NotDone returns true if the page enumeration should be started or is not yet complete.
3549func (page WorkspaceListResultPage) NotDone() bool {
3550	return !page.wlr.IsEmpty()
3551}
3552
3553// Response returns the raw server response from the last page request.
3554func (page WorkspaceListResultPage) Response() WorkspaceListResult {
3555	return page.wlr
3556}
3557
3558// Values returns the slice of values for the current page or nil if there are no values.
3559func (page WorkspaceListResultPage) Values() []Workspace {
3560	if page.wlr.IsEmpty() {
3561		return nil
3562	}
3563	return *page.wlr.Value
3564}
3565
3566// Creates a new instance of the WorkspaceListResultPage type.
3567func NewWorkspaceListResultPage(cur WorkspaceListResult, getNextPage func(context.Context, WorkspaceListResult) (WorkspaceListResult, error)) WorkspaceListResultPage {
3568	return WorkspaceListResultPage{
3569		fn:  getNextPage,
3570		wlr: cur,
3571	}
3572}
3573
3574// WorkspaceProperties the properties of a machine learning workspace.
3575type WorkspaceProperties struct {
3576	// WorkspaceID - READ-ONLY; The immutable id associated with this workspace.
3577	WorkspaceID *string `json:"workspaceId,omitempty"`
3578	// Description - The description of this workspace.
3579	Description *string `json:"description,omitempty"`
3580	// FriendlyName - The friendly name for this workspace. This name in mutable
3581	FriendlyName *string `json:"friendlyName,omitempty"`
3582	// CreationTime - READ-ONLY; The creation time of the machine learning workspace in ISO8601 format.
3583	CreationTime *date.Time `json:"creationTime,omitempty"`
3584	// KeyVault - ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created
3585	KeyVault *string `json:"keyVault,omitempty"`
3586	// ApplicationInsights - ARM id of the application insights associated with this workspace. This cannot be changed once the workspace has been created
3587	ApplicationInsights *string `json:"applicationInsights,omitempty"`
3588	// ContainerRegistry - ARM id of the container registry associated with this workspace. This cannot be changed once the workspace has been created
3589	ContainerRegistry *string `json:"containerRegistry,omitempty"`
3590	// StorageAccount - ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been created
3591	StorageAccount *string `json:"storageAccount,omitempty"`
3592	// DiscoveryURL - Url for the discovery service to identify regional endpoints for machine learning experimentation services
3593	DiscoveryURL *string `json:"discoveryUrl,omitempty"`
3594	// ProvisioningState - READ-ONLY; The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled'
3595	ProvisioningState ProvisioningState `json:"provisioningState,omitempty"`
3596	// Encryption - The encryption settings of Azure ML workspace.
3597	Encryption *EncryptionProperty `json:"encryption,omitempty"`
3598	// HbiWorkspace - The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service
3599	HbiWorkspace *bool `json:"hbiWorkspace,omitempty"`
3600	// ServiceProvisionedResourceGroup - READ-ONLY; The name of the managed resource group created by workspace RP in customer subscription if the workspace is CMK workspace
3601	ServiceProvisionedResourceGroup *string `json:"serviceProvisionedResourceGroup,omitempty"`
3602}
3603
3604// MarshalJSON is the custom marshaler for WorkspaceProperties.
3605func (wp WorkspaceProperties) MarshalJSON() ([]byte, error) {
3606	objectMap := make(map[string]interface{})
3607	if wp.Description != nil {
3608		objectMap["description"] = wp.Description
3609	}
3610	if wp.FriendlyName != nil {
3611		objectMap["friendlyName"] = wp.FriendlyName
3612	}
3613	if wp.KeyVault != nil {
3614		objectMap["keyVault"] = wp.KeyVault
3615	}
3616	if wp.ApplicationInsights != nil {
3617		objectMap["applicationInsights"] = wp.ApplicationInsights
3618	}
3619	if wp.ContainerRegistry != nil {
3620		objectMap["containerRegistry"] = wp.ContainerRegistry
3621	}
3622	if wp.StorageAccount != nil {
3623		objectMap["storageAccount"] = wp.StorageAccount
3624	}
3625	if wp.DiscoveryURL != nil {
3626		objectMap["discoveryUrl"] = wp.DiscoveryURL
3627	}
3628	if wp.Encryption != nil {
3629		objectMap["encryption"] = wp.Encryption
3630	}
3631	if wp.HbiWorkspace != nil {
3632		objectMap["hbiWorkspace"] = wp.HbiWorkspace
3633	}
3634	return json.Marshal(objectMap)
3635}
3636
3637// WorkspacePropertiesUpdateParameters the parameters for updating the properties of a machine learning
3638// workspace.
3639type WorkspacePropertiesUpdateParameters struct {
3640	// Description - The description of this workspace.
3641	Description *string `json:"description,omitempty"`
3642	// FriendlyName - The friendly name for this workspace.
3643	FriendlyName *string `json:"friendlyName,omitempty"`
3644}
3645
3646// WorkspacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
3647// long-running operation.
3648type WorkspacesCreateOrUpdateFuture struct {
3649	azure.FutureAPI
3650	// Result returns the result of the asynchronous operation.
3651	// If the operation has not completed it will return an error.
3652	Result func(WorkspacesClient) (Workspace, error)
3653}
3654
3655// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3656func (future *WorkspacesCreateOrUpdateFuture) UnmarshalJSON(body []byte) error {
3657	var azFuture azure.Future
3658	if err := json.Unmarshal(body, &azFuture); err != nil {
3659		return err
3660	}
3661	future.FutureAPI = &azFuture
3662	future.Result = future.result
3663	return nil
3664}
3665
3666// result is the default implementation for WorkspacesCreateOrUpdateFuture.Result.
3667func (future *WorkspacesCreateOrUpdateFuture) result(client WorkspacesClient) (w Workspace, err error) {
3668	var done bool
3669	done, err = future.DoneWithContext(context.Background(), client)
3670	if err != nil {
3671		err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
3672		return
3673	}
3674	if !done {
3675		w.Response.Response = future.Response()
3676		err = azure.NewAsyncOpIncompleteError("machinelearningservices.WorkspacesCreateOrUpdateFuture")
3677		return
3678	}
3679	sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
3680	if w.Response.Response, err = future.GetResult(sender); err == nil && w.Response.Response.StatusCode != http.StatusNoContent {
3681		w, err = client.CreateOrUpdateResponder(w.Response.Response)
3682		if err != nil {
3683			err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesCreateOrUpdateFuture", "Result", w.Response.Response, "Failure responding to request")
3684		}
3685	}
3686	return
3687}
3688
3689// WorkspacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
3690// operation.
3691type WorkspacesDeleteFuture struct {
3692	azure.FutureAPI
3693	// Result returns the result of the asynchronous operation.
3694	// If the operation has not completed it will return an error.
3695	Result func(WorkspacesClient) (autorest.Response, error)
3696}
3697
3698// UnmarshalJSON is the custom unmarshaller for CreateFuture.
3699func (future *WorkspacesDeleteFuture) UnmarshalJSON(body []byte) error {
3700	var azFuture azure.Future
3701	if err := json.Unmarshal(body, &azFuture); err != nil {
3702		return err
3703	}
3704	future.FutureAPI = &azFuture
3705	future.Result = future.result
3706	return nil
3707}
3708
3709// result is the default implementation for WorkspacesDeleteFuture.Result.
3710func (future *WorkspacesDeleteFuture) result(client WorkspacesClient) (ar autorest.Response, err error) {
3711	var done bool
3712	done, err = future.DoneWithContext(context.Background(), client)
3713	if err != nil {
3714		err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesDeleteFuture", "Result", future.Response(), "Polling failure")
3715		return
3716	}
3717	if !done {
3718		ar.Response = future.Response()
3719		err = azure.NewAsyncOpIncompleteError("machinelearningservices.WorkspacesDeleteFuture")
3720		return
3721	}
3722	ar.Response = future.Response()
3723	return
3724}
3725
3726// WorkspaceSku describes Workspace Sku details and features
3727type WorkspaceSku struct {
3728	// Locations - READ-ONLY; The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.).
3729	Locations *[]string `json:"locations,omitempty"`
3730	// LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available.
3731	LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"`
3732	// Tier - READ-ONLY; Sku Tier like Basic or Enterprise
3733	Tier *string `json:"tier,omitempty"`
3734	// ResourceType - READ-ONLY
3735	ResourceType *string `json:"resourceType,omitempty"`
3736	// Name - READ-ONLY
3737	Name *string `json:"name,omitempty"`
3738	// Capabilities - READ-ONLY; List of features/user capabilities associated with the sku
3739	Capabilities *[]SKUCapability `json:"capabilities,omitempty"`
3740	// Restrictions - The restrictions because of which SKU cannot be used. This is empty if there are no restrictions.
3741	Restrictions *[]Restriction `json:"restrictions,omitempty"`
3742}
3743
3744// MarshalJSON is the custom marshaler for WorkspaceSku.
3745func (ws WorkspaceSku) MarshalJSON() ([]byte, error) {
3746	objectMap := make(map[string]interface{})
3747	if ws.Restrictions != nil {
3748		objectMap["restrictions"] = ws.Restrictions
3749	}
3750	return json.Marshal(objectMap)
3751}
3752
3753// WorkspaceUpdateParameters the parameters for updating a machine learning workspace.
3754type WorkspaceUpdateParameters struct {
3755	// Tags - The resource tags for the machine learning workspace.
3756	Tags map[string]*string `json:"tags"`
3757	// Sku - The sku of the workspace.
3758	Sku *Sku `json:"sku,omitempty"`
3759	// WorkspacePropertiesUpdateParameters - The properties that the machine learning workspace will be updated with.
3760	*WorkspacePropertiesUpdateParameters `json:"properties,omitempty"`
3761}
3762
3763// MarshalJSON is the custom marshaler for WorkspaceUpdateParameters.
3764func (wup WorkspaceUpdateParameters) MarshalJSON() ([]byte, error) {
3765	objectMap := make(map[string]interface{})
3766	if wup.Tags != nil {
3767		objectMap["tags"] = wup.Tags
3768	}
3769	if wup.Sku != nil {
3770		objectMap["sku"] = wup.Sku
3771	}
3772	if wup.WorkspacePropertiesUpdateParameters != nil {
3773		objectMap["properties"] = wup.WorkspacePropertiesUpdateParameters
3774	}
3775	return json.Marshal(objectMap)
3776}
3777
3778// UnmarshalJSON is the custom unmarshaler for WorkspaceUpdateParameters struct.
3779func (wup *WorkspaceUpdateParameters) UnmarshalJSON(body []byte) error {
3780	var m map[string]*json.RawMessage
3781	err := json.Unmarshal(body, &m)
3782	if err != nil {
3783		return err
3784	}
3785	for k, v := range m {
3786		switch k {
3787		case "tags":
3788			if v != nil {
3789				var tags map[string]*string
3790				err = json.Unmarshal(*v, &tags)
3791				if err != nil {
3792					return err
3793				}
3794				wup.Tags = tags
3795			}
3796		case "sku":
3797			if v != nil {
3798				var sku Sku
3799				err = json.Unmarshal(*v, &sku)
3800				if err != nil {
3801					return err
3802				}
3803				wup.Sku = &sku
3804			}
3805		case "properties":
3806			if v != nil {
3807				var workspacePropertiesUpdateParameters WorkspacePropertiesUpdateParameters
3808				err = json.Unmarshal(*v, &workspacePropertiesUpdateParameters)
3809				if err != nil {
3810					return err
3811				}
3812				wup.WorkspacePropertiesUpdateParameters = &workspacePropertiesUpdateParameters
3813			}
3814		}
3815	}
3816
3817	return nil
3818}
3819