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/preview/machinelearningservices/mgmt/2018-03-01-preview/machinelearningservices" 22 23// AKS a Machine Learning compute based on AKS. 24type AKS struct { 25 // Properties - AKS properties 26 Properties *AKSProperties `json:"properties,omitempty"` 27 // ComputeLocation - Location for the underlying compute 28 ComputeLocation *string `json:"computeLocation,omitempty"` 29 // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' 30 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 31 // Description - The description of the Machine Learning compute. 32 Description *string `json:"description,omitempty"` 33 // CreatedOn - READ-ONLY; The date and time when the compute was created. 34 CreatedOn *date.Time `json:"createdOn,omitempty"` 35 // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. 36 ModifiedOn *date.Time `json:"modifiedOn,omitempty"` 37 // ResourceID - ARM resource id of the compute 38 ResourceID *string `json:"resourceId,omitempty"` 39 // ProvisioningErrors - READ-ONLY; Errors during provisioning 40 ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` 41 // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeBatchAI1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1' 42 ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` 43} 44 45// MarshalJSON is the custom marshaler for AKS. 46func (a AKS) MarshalJSON() ([]byte, error) { 47 a.ComputeType = ComputeTypeAKS1 48 objectMap := make(map[string]interface{}) 49 if a.Properties != nil { 50 objectMap["properties"] = a.Properties 51 } 52 if a.ComputeLocation != nil { 53 objectMap["computeLocation"] = a.ComputeLocation 54 } 55 if a.Description != nil { 56 objectMap["description"] = a.Description 57 } 58 if a.ResourceID != nil { 59 objectMap["resourceId"] = a.ResourceID 60 } 61 if a.ComputeType != "" { 62 objectMap["computeType"] = a.ComputeType 63 } 64 return json.Marshal(objectMap) 65} 66 67// AsAKS is the BasicCompute implementation for AKS. 68func (a AKS) AsAKS() (*AKS, bool) { 69 return &a, true 70} 71 72// AsBatchAI is the BasicCompute implementation for AKS. 73func (a AKS) AsBatchAI() (*BatchAI, bool) { 74 return nil, false 75} 76 77// AsVirtualMachine is the BasicCompute implementation for AKS. 78func (a AKS) AsVirtualMachine() (*VirtualMachine, bool) { 79 return nil, false 80} 81 82// AsHDInsight is the BasicCompute implementation for AKS. 83func (a AKS) AsHDInsight() (*HDInsight, bool) { 84 return nil, false 85} 86 87// AsDataFactory is the BasicCompute implementation for AKS. 88func (a AKS) AsDataFactory() (*DataFactory, bool) { 89 return nil, false 90} 91 92// AsCompute is the BasicCompute implementation for AKS. 93func (a AKS) AsCompute() (*Compute, bool) { 94 return nil, false 95} 96 97// AsBasicCompute is the BasicCompute implementation for AKS. 98func (a AKS) AsBasicCompute() (BasicCompute, bool) { 99 return &a, true 100} 101 102// AksComputeSecrets secrets related to a Machine Learning compute based on AKS. 103type AksComputeSecrets struct { 104 // UserKubeConfig - Content of kubeconfig file that can be used to connect to the Kubernetes cluster. 105 UserKubeConfig *string `json:"userKubeConfig,omitempty"` 106 // AdminKubeConfig - Content of kubeconfig file that can be used to connect to the Kubernetes cluster. 107 AdminKubeConfig *string `json:"adminKubeConfig,omitempty"` 108 // ImagePullSecretName - Image registry pull secret. 109 ImagePullSecretName *string `json:"imagePullSecretName,omitempty"` 110 // ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine' 111 ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"` 112} 113 114// MarshalJSON is the custom marshaler for AksComputeSecrets. 115func (acs AksComputeSecrets) MarshalJSON() ([]byte, error) { 116 acs.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeAKS 117 objectMap := make(map[string]interface{}) 118 if acs.UserKubeConfig != nil { 119 objectMap["userKubeConfig"] = acs.UserKubeConfig 120 } 121 if acs.AdminKubeConfig != nil { 122 objectMap["adminKubeConfig"] = acs.AdminKubeConfig 123 } 124 if acs.ImagePullSecretName != nil { 125 objectMap["imagePullSecretName"] = acs.ImagePullSecretName 126 } 127 if acs.ComputeType != "" { 128 objectMap["computeType"] = acs.ComputeType 129 } 130 return json.Marshal(objectMap) 131} 132 133// AsAksComputeSecrets is the BasicComputeSecrets implementation for AksComputeSecrets. 134func (acs AksComputeSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) { 135 return &acs, true 136} 137 138// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for AksComputeSecrets. 139func (acs AksComputeSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) { 140 return nil, false 141} 142 143// AsComputeSecrets is the BasicComputeSecrets implementation for AksComputeSecrets. 144func (acs AksComputeSecrets) AsComputeSecrets() (*ComputeSecrets, bool) { 145 return nil, false 146} 147 148// AsBasicComputeSecrets is the BasicComputeSecrets implementation for AksComputeSecrets. 149func (acs AksComputeSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) { 150 return &acs, true 151} 152 153// AKSProperties AKS properties 154type AKSProperties struct { 155 // ClusterFqdn - Cluster full qualified domain name 156 ClusterFqdn *string `json:"clusterFqdn,omitempty"` 157 // SystemServices - System services 158 SystemServices *[]SystemService `json:"systemServices,omitempty"` 159 // AgentCount - Number of agents 160 AgentCount *int32 `json:"agentCount,omitempty"` 161 // AgentVMSize - Agent virtual machine size 162 AgentVMSize *string `json:"agentVMSize,omitempty"` 163 // SslConfiguration - SSL configuration 164 SslConfiguration *SslConfiguration `json:"sslConfiguration,omitempty"` 165} 166 167// BatchAI a Machine Learning compute based on Azure BatchAI. 168type BatchAI struct { 169 // Properties - BatchAI properties 170 Properties *BatchAIProperties `json:"properties,omitempty"` 171 // ComputeLocation - Location for the underlying compute 172 ComputeLocation *string `json:"computeLocation,omitempty"` 173 // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' 174 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 175 // Description - The description of the Machine Learning compute. 176 Description *string `json:"description,omitempty"` 177 // CreatedOn - READ-ONLY; The date and time when the compute was created. 178 CreatedOn *date.Time `json:"createdOn,omitempty"` 179 // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. 180 ModifiedOn *date.Time `json:"modifiedOn,omitempty"` 181 // ResourceID - ARM resource id of the compute 182 ResourceID *string `json:"resourceId,omitempty"` 183 // ProvisioningErrors - READ-ONLY; Errors during provisioning 184 ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` 185 // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeBatchAI1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1' 186 ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` 187} 188 189// MarshalJSON is the custom marshaler for BatchAI. 190func (ba BatchAI) MarshalJSON() ([]byte, error) { 191 ba.ComputeType = ComputeTypeBatchAI1 192 objectMap := make(map[string]interface{}) 193 if ba.Properties != nil { 194 objectMap["properties"] = ba.Properties 195 } 196 if ba.ComputeLocation != nil { 197 objectMap["computeLocation"] = ba.ComputeLocation 198 } 199 if ba.Description != nil { 200 objectMap["description"] = ba.Description 201 } 202 if ba.ResourceID != nil { 203 objectMap["resourceId"] = ba.ResourceID 204 } 205 if ba.ComputeType != "" { 206 objectMap["computeType"] = ba.ComputeType 207 } 208 return json.Marshal(objectMap) 209} 210 211// AsAKS is the BasicCompute implementation for BatchAI. 212func (ba BatchAI) AsAKS() (*AKS, bool) { 213 return nil, false 214} 215 216// AsBatchAI is the BasicCompute implementation for BatchAI. 217func (ba BatchAI) AsBatchAI() (*BatchAI, bool) { 218 return &ba, true 219} 220 221// AsVirtualMachine is the BasicCompute implementation for BatchAI. 222func (ba BatchAI) AsVirtualMachine() (*VirtualMachine, bool) { 223 return nil, false 224} 225 226// AsHDInsight is the BasicCompute implementation for BatchAI. 227func (ba BatchAI) AsHDInsight() (*HDInsight, bool) { 228 return nil, false 229} 230 231// AsDataFactory is the BasicCompute implementation for BatchAI. 232func (ba BatchAI) AsDataFactory() (*DataFactory, bool) { 233 return nil, false 234} 235 236// AsCompute is the BasicCompute implementation for BatchAI. 237func (ba BatchAI) AsCompute() (*Compute, bool) { 238 return nil, false 239} 240 241// AsBasicCompute is the BasicCompute implementation for BatchAI. 242func (ba BatchAI) AsBasicCompute() (BasicCompute, bool) { 243 return &ba, true 244} 245 246// BatchAIProperties batchAI properties 247type BatchAIProperties struct { 248 // VMSize - Virtual Machine Size 249 VMSize *string `json:"vmSize,omitempty"` 250 // VMPriority - Virtual Machine priority 251 VMPriority *string `json:"vmPriority,omitempty"` 252 // ScaleSettings - Scale settings for BatchAI 253 ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` 254} 255 256// BasicCompute machine Learning compute object. 257type BasicCompute interface { 258 AsAKS() (*AKS, bool) 259 AsBatchAI() (*BatchAI, bool) 260 AsVirtualMachine() (*VirtualMachine, bool) 261 AsHDInsight() (*HDInsight, bool) 262 AsDataFactory() (*DataFactory, bool) 263 AsCompute() (*Compute, bool) 264} 265 266// Compute machine Learning compute object. 267type Compute struct { 268 // ComputeLocation - Location for the underlying compute 269 ComputeLocation *string `json:"computeLocation,omitempty"` 270 // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' 271 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 272 // Description - The description of the Machine Learning compute. 273 Description *string `json:"description,omitempty"` 274 // CreatedOn - READ-ONLY; The date and time when the compute was created. 275 CreatedOn *date.Time `json:"createdOn,omitempty"` 276 // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. 277 ModifiedOn *date.Time `json:"modifiedOn,omitempty"` 278 // ResourceID - ARM resource id of the compute 279 ResourceID *string `json:"resourceId,omitempty"` 280 // ProvisioningErrors - READ-ONLY; Errors during provisioning 281 ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` 282 // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeBatchAI1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1' 283 ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` 284} 285 286func unmarshalBasicCompute(body []byte) (BasicCompute, error) { 287 var m map[string]interface{} 288 err := json.Unmarshal(body, &m) 289 if err != nil { 290 return nil, err 291 } 292 293 switch m["computeType"] { 294 case string(ComputeTypeAKS1): 295 var a AKS 296 err := json.Unmarshal(body, &a) 297 return a, err 298 case string(ComputeTypeBatchAI1): 299 var ba BatchAI 300 err := json.Unmarshal(body, &ba) 301 return ba, err 302 case string(ComputeTypeVirtualMachine1): 303 var VM VirtualMachine 304 err := json.Unmarshal(body, &VM) 305 return VM, err 306 case string(ComputeTypeHDInsight1): 307 var hi HDInsight 308 err := json.Unmarshal(body, &hi) 309 return hi, err 310 case string(ComputeTypeDataFactory1): 311 var df DataFactory 312 err := json.Unmarshal(body, &df) 313 return df, err 314 default: 315 var c Compute 316 err := json.Unmarshal(body, &c) 317 return c, err 318 } 319} 320func unmarshalBasicComputeArray(body []byte) ([]BasicCompute, error) { 321 var rawMessages []*json.RawMessage 322 err := json.Unmarshal(body, &rawMessages) 323 if err != nil { 324 return nil, err 325 } 326 327 cArray := make([]BasicCompute, len(rawMessages)) 328 329 for index, rawMessage := range rawMessages { 330 c, err := unmarshalBasicCompute(*rawMessage) 331 if err != nil { 332 return nil, err 333 } 334 cArray[index] = c 335 } 336 return cArray, nil 337} 338 339// MarshalJSON is the custom marshaler for Compute. 340func (c Compute) MarshalJSON() ([]byte, error) { 341 c.ComputeType = ComputeTypeCompute 342 objectMap := make(map[string]interface{}) 343 if c.ComputeLocation != nil { 344 objectMap["computeLocation"] = c.ComputeLocation 345 } 346 if c.Description != nil { 347 objectMap["description"] = c.Description 348 } 349 if c.ResourceID != nil { 350 objectMap["resourceId"] = c.ResourceID 351 } 352 if c.ComputeType != "" { 353 objectMap["computeType"] = c.ComputeType 354 } 355 return json.Marshal(objectMap) 356} 357 358// AsAKS is the BasicCompute implementation for Compute. 359func (c Compute) AsAKS() (*AKS, bool) { 360 return nil, false 361} 362 363// AsBatchAI is the BasicCompute implementation for Compute. 364func (c Compute) AsBatchAI() (*BatchAI, bool) { 365 return nil, false 366} 367 368// AsVirtualMachine is the BasicCompute implementation for Compute. 369func (c Compute) AsVirtualMachine() (*VirtualMachine, bool) { 370 return nil, false 371} 372 373// AsHDInsight is the BasicCompute implementation for Compute. 374func (c Compute) AsHDInsight() (*HDInsight, bool) { 375 return nil, false 376} 377 378// AsDataFactory is the BasicCompute implementation for Compute. 379func (c Compute) AsDataFactory() (*DataFactory, bool) { 380 return nil, false 381} 382 383// AsCompute is the BasicCompute implementation for Compute. 384func (c Compute) AsCompute() (*Compute, bool) { 385 return &c, true 386} 387 388// AsBasicCompute is the BasicCompute implementation for Compute. 389func (c Compute) AsBasicCompute() (BasicCompute, bool) { 390 return &c, true 391} 392 393// ComputeResource machine Learning compute object wrapped into ARM resource envelope. 394type ComputeResource struct { 395 autorest.Response `json:"-"` 396 // Properties - Compute properties 397 Properties BasicCompute `json:"properties,omitempty"` 398 // ID - READ-ONLY; Specifies the resource ID. 399 ID *string `json:"id,omitempty"` 400 // Name - READ-ONLY; Specifies the name of the resource. 401 Name *string `json:"name,omitempty"` 402 // Identity - The identity of the resource. 403 Identity *Identity `json:"identity,omitempty"` 404 // Location - Specifies the location of the resource. 405 Location *string `json:"location,omitempty"` 406 // Type - READ-ONLY; Specifies the type of the resource. 407 Type *string `json:"type,omitempty"` 408 // Tags - Contains resource tags defined as key/value pairs. 409 Tags map[string]*string `json:"tags"` 410} 411 412// MarshalJSON is the custom marshaler for ComputeResource. 413func (cr ComputeResource) MarshalJSON() ([]byte, error) { 414 objectMap := make(map[string]interface{}) 415 objectMap["properties"] = cr.Properties 416 if cr.Identity != nil { 417 objectMap["identity"] = cr.Identity 418 } 419 if cr.Location != nil { 420 objectMap["location"] = cr.Location 421 } 422 if cr.Tags != nil { 423 objectMap["tags"] = cr.Tags 424 } 425 return json.Marshal(objectMap) 426} 427 428// UnmarshalJSON is the custom unmarshaler for ComputeResource struct. 429func (cr *ComputeResource) UnmarshalJSON(body []byte) error { 430 var m map[string]*json.RawMessage 431 err := json.Unmarshal(body, &m) 432 if err != nil { 433 return err 434 } 435 for k, v := range m { 436 switch k { 437 case "properties": 438 if v != nil { 439 properties, err := unmarshalBasicCompute(*v) 440 if err != nil { 441 return err 442 } 443 cr.Properties = properties 444 } 445 case "id": 446 if v != nil { 447 var ID string 448 err = json.Unmarshal(*v, &ID) 449 if err != nil { 450 return err 451 } 452 cr.ID = &ID 453 } 454 case "name": 455 if v != nil { 456 var name string 457 err = json.Unmarshal(*v, &name) 458 if err != nil { 459 return err 460 } 461 cr.Name = &name 462 } 463 case "identity": 464 if v != nil { 465 var identity Identity 466 err = json.Unmarshal(*v, &identity) 467 if err != nil { 468 return err 469 } 470 cr.Identity = &identity 471 } 472 case "location": 473 if v != nil { 474 var location string 475 err = json.Unmarshal(*v, &location) 476 if err != nil { 477 return err 478 } 479 cr.Location = &location 480 } 481 case "type": 482 if v != nil { 483 var typeVar string 484 err = json.Unmarshal(*v, &typeVar) 485 if err != nil { 486 return err 487 } 488 cr.Type = &typeVar 489 } 490 case "tags": 491 if v != nil { 492 var tags map[string]*string 493 err = json.Unmarshal(*v, &tags) 494 if err != nil { 495 return err 496 } 497 cr.Tags = tags 498 } 499 } 500 } 501 502 return nil 503} 504 505// BasicComputeSecrets secrets related to a Machine Learning compute. Might differ for every type of compute. 506type BasicComputeSecrets interface { 507 AsAksComputeSecrets() (*AksComputeSecrets, bool) 508 AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) 509 AsComputeSecrets() (*ComputeSecrets, bool) 510} 511 512// ComputeSecrets secrets related to a Machine Learning compute. Might differ for every type of compute. 513type ComputeSecrets struct { 514 autorest.Response `json:"-"` 515 // ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine' 516 ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"` 517} 518 519func unmarshalBasicComputeSecrets(body []byte) (BasicComputeSecrets, error) { 520 var m map[string]interface{} 521 err := json.Unmarshal(body, &m) 522 if err != nil { 523 return nil, err 524 } 525 526 switch m["computeType"] { 527 case string(ComputeTypeBasicComputeSecretsComputeTypeAKS): 528 var acs AksComputeSecrets 529 err := json.Unmarshal(body, &acs) 530 return acs, err 531 case string(ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine): 532 var vms VirtualMachineSecrets 533 err := json.Unmarshal(body, &vms) 534 return vms, err 535 default: 536 var cs ComputeSecrets 537 err := json.Unmarshal(body, &cs) 538 return cs, err 539 } 540} 541func unmarshalBasicComputeSecretsArray(body []byte) ([]BasicComputeSecrets, error) { 542 var rawMessages []*json.RawMessage 543 err := json.Unmarshal(body, &rawMessages) 544 if err != nil { 545 return nil, err 546 } 547 548 csArray := make([]BasicComputeSecrets, len(rawMessages)) 549 550 for index, rawMessage := range rawMessages { 551 cs, err := unmarshalBasicComputeSecrets(*rawMessage) 552 if err != nil { 553 return nil, err 554 } 555 csArray[index] = cs 556 } 557 return csArray, nil 558} 559 560// MarshalJSON is the custom marshaler for ComputeSecrets. 561func (cs ComputeSecrets) MarshalJSON() ([]byte, error) { 562 cs.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets 563 objectMap := make(map[string]interface{}) 564 if cs.ComputeType != "" { 565 objectMap["computeType"] = cs.ComputeType 566 } 567 return json.Marshal(objectMap) 568} 569 570// AsAksComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets. 571func (cs ComputeSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) { 572 return nil, false 573} 574 575// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for ComputeSecrets. 576func (cs ComputeSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) { 577 return nil, false 578} 579 580// AsComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets. 581func (cs ComputeSecrets) AsComputeSecrets() (*ComputeSecrets, bool) { 582 return &cs, true 583} 584 585// AsBasicComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets. 586func (cs ComputeSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) { 587 return &cs, true 588} 589 590// ComputeSecretsModel ... 591type ComputeSecretsModel struct { 592 autorest.Response `json:"-"` 593 Value BasicComputeSecrets `json:"value,omitempty"` 594} 595 596// UnmarshalJSON is the custom unmarshaler for ComputeSecretsModel struct. 597func (csm *ComputeSecretsModel) UnmarshalJSON(body []byte) error { 598 cs, err := unmarshalBasicComputeSecrets(body) 599 if err != nil { 600 return err 601 } 602 csm.Value = cs 603 604 return nil 605} 606 607// DataFactory a DataFactory compute. 608type DataFactory struct { 609 // ComputeLocation - Location for the underlying compute 610 ComputeLocation *string `json:"computeLocation,omitempty"` 611 // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' 612 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 613 // Description - The description of the Machine Learning compute. 614 Description *string `json:"description,omitempty"` 615 // CreatedOn - READ-ONLY; The date and time when the compute was created. 616 CreatedOn *date.Time `json:"createdOn,omitempty"` 617 // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. 618 ModifiedOn *date.Time `json:"modifiedOn,omitempty"` 619 // ResourceID - ARM resource id of the compute 620 ResourceID *string `json:"resourceId,omitempty"` 621 // ProvisioningErrors - READ-ONLY; Errors during provisioning 622 ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` 623 // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeBatchAI1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1' 624 ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` 625} 626 627// MarshalJSON is the custom marshaler for DataFactory. 628func (df DataFactory) MarshalJSON() ([]byte, error) { 629 df.ComputeType = ComputeTypeDataFactory1 630 objectMap := make(map[string]interface{}) 631 if df.ComputeLocation != nil { 632 objectMap["computeLocation"] = df.ComputeLocation 633 } 634 if df.Description != nil { 635 objectMap["description"] = df.Description 636 } 637 if df.ResourceID != nil { 638 objectMap["resourceId"] = df.ResourceID 639 } 640 if df.ComputeType != "" { 641 objectMap["computeType"] = df.ComputeType 642 } 643 return json.Marshal(objectMap) 644} 645 646// AsAKS is the BasicCompute implementation for DataFactory. 647func (df DataFactory) AsAKS() (*AKS, bool) { 648 return nil, false 649} 650 651// AsBatchAI is the BasicCompute implementation for DataFactory. 652func (df DataFactory) AsBatchAI() (*BatchAI, bool) { 653 return nil, false 654} 655 656// AsVirtualMachine is the BasicCompute implementation for DataFactory. 657func (df DataFactory) AsVirtualMachine() (*VirtualMachine, bool) { 658 return nil, false 659} 660 661// AsHDInsight is the BasicCompute implementation for DataFactory. 662func (df DataFactory) AsHDInsight() (*HDInsight, bool) { 663 return nil, false 664} 665 666// AsDataFactory is the BasicCompute implementation for DataFactory. 667func (df DataFactory) AsDataFactory() (*DataFactory, bool) { 668 return &df, true 669} 670 671// AsCompute is the BasicCompute implementation for DataFactory. 672func (df DataFactory) AsCompute() (*Compute, bool) { 673 return nil, false 674} 675 676// AsBasicCompute is the BasicCompute implementation for DataFactory. 677func (df DataFactory) AsBasicCompute() (BasicCompute, bool) { 678 return &df, true 679} 680 681// Error wrapper for error response to follow ARM guidelines. 682type Error struct { 683 // Error - The error response. 684 Error *ErrorResponse `json:"error,omitempty"` 685} 686 687// ErrorDetail error detail information. 688type ErrorDetail struct { 689 // Code - Error code. 690 Code *string `json:"code,omitempty"` 691 // Message - Error message. 692 Message *string `json:"message,omitempty"` 693} 694 695// ErrorResponse error response information. 696type ErrorResponse struct { 697 // Code - Error code. 698 Code *string `json:"code,omitempty"` 699 // Message - Error message. 700 Message *string `json:"message,omitempty"` 701 // Details - An array of error detail objects. 702 Details *[]ErrorDetail `json:"details,omitempty"` 703} 704 705// HDInsight a HDInsight compute. 706type HDInsight struct { 707 Properties *HDInsightProperties `json:"properties,omitempty"` 708 // ComputeLocation - Location for the underlying compute 709 ComputeLocation *string `json:"computeLocation,omitempty"` 710 // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' 711 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 712 // Description - The description of the Machine Learning compute. 713 Description *string `json:"description,omitempty"` 714 // CreatedOn - READ-ONLY; The date and time when the compute was created. 715 CreatedOn *date.Time `json:"createdOn,omitempty"` 716 // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. 717 ModifiedOn *date.Time `json:"modifiedOn,omitempty"` 718 // ResourceID - ARM resource id of the compute 719 ResourceID *string `json:"resourceId,omitempty"` 720 // ProvisioningErrors - READ-ONLY; Errors during provisioning 721 ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` 722 // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeBatchAI1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1' 723 ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` 724} 725 726// MarshalJSON is the custom marshaler for HDInsight. 727func (hi HDInsight) MarshalJSON() ([]byte, error) { 728 hi.ComputeType = ComputeTypeHDInsight1 729 objectMap := make(map[string]interface{}) 730 if hi.Properties != nil { 731 objectMap["properties"] = hi.Properties 732 } 733 if hi.ComputeLocation != nil { 734 objectMap["computeLocation"] = hi.ComputeLocation 735 } 736 if hi.Description != nil { 737 objectMap["description"] = hi.Description 738 } 739 if hi.ResourceID != nil { 740 objectMap["resourceId"] = hi.ResourceID 741 } 742 if hi.ComputeType != "" { 743 objectMap["computeType"] = hi.ComputeType 744 } 745 return json.Marshal(objectMap) 746} 747 748// AsAKS is the BasicCompute implementation for HDInsight. 749func (hi HDInsight) AsAKS() (*AKS, bool) { 750 return nil, false 751} 752 753// AsBatchAI is the BasicCompute implementation for HDInsight. 754func (hi HDInsight) AsBatchAI() (*BatchAI, bool) { 755 return nil, false 756} 757 758// AsVirtualMachine is the BasicCompute implementation for HDInsight. 759func (hi HDInsight) AsVirtualMachine() (*VirtualMachine, bool) { 760 return nil, false 761} 762 763// AsHDInsight is the BasicCompute implementation for HDInsight. 764func (hi HDInsight) AsHDInsight() (*HDInsight, bool) { 765 return &hi, true 766} 767 768// AsDataFactory is the BasicCompute implementation for HDInsight. 769func (hi HDInsight) AsDataFactory() (*DataFactory, bool) { 770 return nil, false 771} 772 773// AsCompute is the BasicCompute implementation for HDInsight. 774func (hi HDInsight) AsCompute() (*Compute, bool) { 775 return nil, false 776} 777 778// AsBasicCompute is the BasicCompute implementation for HDInsight. 779func (hi HDInsight) AsBasicCompute() (BasicCompute, bool) { 780 return &hi, true 781} 782 783// HDInsightProperties ... 784type HDInsightProperties struct { 785 // SSHPort - Port open for ssh connections on the master node of the cluster. 786 SSHPort *int32 `json:"sshPort,omitempty"` 787 // Address - Public IP address of the master node of the cluster. 788 Address *string `json:"address,omitempty"` 789 // AdministratorAccount - Admin credentials for master node of the cluster 790 AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"` 791} 792 793// Identity identity for the resource. 794type Identity struct { 795 // PrincipalID - READ-ONLY; The principal ID of resource identity. 796 PrincipalID *string `json:"principalId,omitempty"` 797 // TenantID - READ-ONLY; The tenant ID of resource. 798 TenantID *string `json:"tenantId,omitempty"` 799 // Type - The identity type. Possible values include: 'SystemAssigned' 800 Type ResourceIdentityType `json:"type,omitempty"` 801} 802 803// MarshalJSON is the custom marshaler for Identity. 804func (i Identity) MarshalJSON() ([]byte, error) { 805 objectMap := make(map[string]interface{}) 806 if i.Type != "" { 807 objectMap["type"] = i.Type 808 } 809 return json.Marshal(objectMap) 810} 811 812// ListWorkspaceKeysResult ... 813type ListWorkspaceKeysResult struct { 814 autorest.Response `json:"-"` 815 // UserStorageKey - READ-ONLY 816 UserStorageKey *string `json:"userStorageKey,omitempty"` 817 // UserStorageResourceID - READ-ONLY 818 UserStorageResourceID *string `json:"userStorageResourceId,omitempty"` 819 // AppInsightsInstrumentationKey - READ-ONLY 820 AppInsightsInstrumentationKey *string `json:"appInsightsInstrumentationKey,omitempty"` 821 // ContainerRegistryCredentials - READ-ONLY 822 ContainerRegistryCredentials *RegistryListCredentialsResult `json:"containerRegistryCredentials,omitempty"` 823} 824 825// MarshalJSON is the custom marshaler for ListWorkspaceKeysResult. 826func (lwkr ListWorkspaceKeysResult) MarshalJSON() ([]byte, error) { 827 objectMap := make(map[string]interface{}) 828 return json.Marshal(objectMap) 829} 830 831// MachineLearningComputeCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a 832// long-running operation. 833type MachineLearningComputeCreateOrUpdateFuture struct { 834 azure.FutureAPI 835 // Result returns the result of the asynchronous operation. 836 // If the operation has not completed it will return an error. 837 Result func(MachineLearningComputeClient) (ComputeResource, error) 838} 839 840// UnmarshalJSON is the custom unmarshaller for CreateFuture. 841func (future *MachineLearningComputeCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { 842 var azFuture azure.Future 843 if err := json.Unmarshal(body, &azFuture); err != nil { 844 return err 845 } 846 future.FutureAPI = &azFuture 847 future.Result = future.result 848 return nil 849} 850 851// result is the default implementation for MachineLearningComputeCreateOrUpdateFuture.Result. 852func (future *MachineLearningComputeCreateOrUpdateFuture) result(client MachineLearningComputeClient) (cr ComputeResource, err error) { 853 var done bool 854 done, err = future.DoneWithContext(context.Background(), client) 855 if err != nil { 856 err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") 857 return 858 } 859 if !done { 860 cr.Response.Response = future.Response() 861 err = azure.NewAsyncOpIncompleteError("machinelearningservices.MachineLearningComputeCreateOrUpdateFuture") 862 return 863 } 864 sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) 865 if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { 866 cr, err = client.CreateOrUpdateResponder(cr.Response.Response) 867 if err != nil { 868 err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeCreateOrUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") 869 } 870 } 871 return 872} 873 874// MachineLearningComputeDeleteFuture an abstraction for monitoring and retrieving the results of a 875// long-running operation. 876type MachineLearningComputeDeleteFuture struct { 877 azure.FutureAPI 878 // Result returns the result of the asynchronous operation. 879 // If the operation has not completed it will return an error. 880 Result func(MachineLearningComputeClient) (autorest.Response, error) 881} 882 883// UnmarshalJSON is the custom unmarshaller for CreateFuture. 884func (future *MachineLearningComputeDeleteFuture) UnmarshalJSON(body []byte) error { 885 var azFuture azure.Future 886 if err := json.Unmarshal(body, &azFuture); err != nil { 887 return err 888 } 889 future.FutureAPI = &azFuture 890 future.Result = future.result 891 return nil 892} 893 894// result is the default implementation for MachineLearningComputeDeleteFuture.Result. 895func (future *MachineLearningComputeDeleteFuture) result(client MachineLearningComputeClient) (ar autorest.Response, err error) { 896 var done bool 897 done, err = future.DoneWithContext(context.Background(), client) 898 if err != nil { 899 err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeDeleteFuture", "Result", future.Response(), "Polling failure") 900 return 901 } 902 if !done { 903 ar.Response = future.Response() 904 err = azure.NewAsyncOpIncompleteError("machinelearningservices.MachineLearningComputeDeleteFuture") 905 return 906 } 907 ar.Response = future.Response() 908 return 909} 910 911// MachineLearningComputeSystemUpdateFuture an abstraction for monitoring and retrieving the results of a 912// long-running operation. 913type MachineLearningComputeSystemUpdateFuture struct { 914 azure.FutureAPI 915 // Result returns the result of the asynchronous operation. 916 // If the operation has not completed it will return an error. 917 Result func(MachineLearningComputeClient) (autorest.Response, error) 918} 919 920// UnmarshalJSON is the custom unmarshaller for CreateFuture. 921func (future *MachineLearningComputeSystemUpdateFuture) UnmarshalJSON(body []byte) error { 922 var azFuture azure.Future 923 if err := json.Unmarshal(body, &azFuture); err != nil { 924 return err 925 } 926 future.FutureAPI = &azFuture 927 future.Result = future.result 928 return nil 929} 930 931// result is the default implementation for MachineLearningComputeSystemUpdateFuture.Result. 932func (future *MachineLearningComputeSystemUpdateFuture) result(client MachineLearningComputeClient) (ar autorest.Response, err error) { 933 var done bool 934 done, err = future.DoneWithContext(context.Background(), client) 935 if err != nil { 936 err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeSystemUpdateFuture", "Result", future.Response(), "Polling failure") 937 return 938 } 939 if !done { 940 ar.Response = future.Response() 941 err = azure.NewAsyncOpIncompleteError("machinelearningservices.MachineLearningComputeSystemUpdateFuture") 942 return 943 } 944 ar.Response = future.Response() 945 return 946} 947 948// Operation azure Machine Learning workspace REST API operation 949type Operation struct { 950 // Name - Operation name: {provider}/{resource}/{operation} 951 Name *string `json:"name,omitempty"` 952 // Display - Display name of operation 953 Display *OperationDisplay `json:"display,omitempty"` 954} 955 956// OperationDisplay display name of operation 957type OperationDisplay struct { 958 // Provider - The resource provider name: Microsoft.MachineLearningExperimentation 959 Provider *string `json:"provider,omitempty"` 960 // Resource - The resource on which the operation is performed. 961 Resource *string `json:"resource,omitempty"` 962 // Operation - The operation that users can perform. 963 Operation *string `json:"operation,omitempty"` 964 // Description - The description for the operation. 965 Description *string `json:"description,omitempty"` 966} 967 968// OperationListResult an array of operations supported by the resource provider. 969type OperationListResult struct { 970 autorest.Response `json:"-"` 971 // Value - List of AML workspace operations supported by the AML workspace resource provider. 972 Value *[]Operation `json:"value,omitempty"` 973} 974 975// PaginatedComputeResourcesList paginated list of Machine Learning compute objects wrapped in ARM resource 976// envelope. 977type PaginatedComputeResourcesList struct { 978 autorest.Response `json:"-"` 979 // Value - An array of Machine Learning compute objects wrapped in ARM resource envelope. 980 Value *[]ComputeResource `json:"value,omitempty"` 981 // NextLink - A continuation link (absolute URI) to the next page of results in the list. 982 NextLink *string `json:"nextLink,omitempty"` 983} 984 985// PaginatedComputeResourcesListIterator provides access to a complete listing of ComputeResource values. 986type PaginatedComputeResourcesListIterator struct { 987 i int 988 page PaginatedComputeResourcesListPage 989} 990 991// NextWithContext advances to the next value. If there was an error making 992// the request the iterator does not advance and the error is returned. 993func (iter *PaginatedComputeResourcesListIterator) NextWithContext(ctx context.Context) (err error) { 994 if tracing.IsEnabled() { 995 ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedComputeResourcesListIterator.NextWithContext") 996 defer func() { 997 sc := -1 998 if iter.Response().Response.Response != nil { 999 sc = iter.Response().Response.Response.StatusCode 1000 } 1001 tracing.EndSpan(ctx, sc, err) 1002 }() 1003 } 1004 iter.i++ 1005 if iter.i < len(iter.page.Values()) { 1006 return nil 1007 } 1008 err = iter.page.NextWithContext(ctx) 1009 if err != nil { 1010 iter.i-- 1011 return err 1012 } 1013 iter.i = 0 1014 return nil 1015} 1016 1017// Next advances to the next value. If there was an error making 1018// the request the iterator does not advance and the error is returned. 1019// Deprecated: Use NextWithContext() instead. 1020func (iter *PaginatedComputeResourcesListIterator) Next() error { 1021 return iter.NextWithContext(context.Background()) 1022} 1023 1024// NotDone returns true if the enumeration should be started or is not yet complete. 1025func (iter PaginatedComputeResourcesListIterator) NotDone() bool { 1026 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1027} 1028 1029// Response returns the raw server response from the last page request. 1030func (iter PaginatedComputeResourcesListIterator) Response() PaginatedComputeResourcesList { 1031 return iter.page.Response() 1032} 1033 1034// Value returns the current value or a zero-initialized value if the 1035// iterator has advanced beyond the end of the collection. 1036func (iter PaginatedComputeResourcesListIterator) Value() ComputeResource { 1037 if !iter.page.NotDone() { 1038 return ComputeResource{} 1039 } 1040 return iter.page.Values()[iter.i] 1041} 1042 1043// Creates a new instance of the PaginatedComputeResourcesListIterator type. 1044func NewPaginatedComputeResourcesListIterator(page PaginatedComputeResourcesListPage) PaginatedComputeResourcesListIterator { 1045 return PaginatedComputeResourcesListIterator{page: page} 1046} 1047 1048// IsEmpty returns true if the ListResult contains no values. 1049func (pcrl PaginatedComputeResourcesList) IsEmpty() bool { 1050 return pcrl.Value == nil || len(*pcrl.Value) == 0 1051} 1052 1053// hasNextLink returns true if the NextLink is not empty. 1054func (pcrl PaginatedComputeResourcesList) hasNextLink() bool { 1055 return pcrl.NextLink != nil && len(*pcrl.NextLink) != 0 1056} 1057 1058// paginatedComputeResourcesListPreparer prepares a request to retrieve the next set of results. 1059// It returns nil if no more results exist. 1060func (pcrl PaginatedComputeResourcesList) paginatedComputeResourcesListPreparer(ctx context.Context) (*http.Request, error) { 1061 if !pcrl.hasNextLink() { 1062 return nil, nil 1063 } 1064 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1065 autorest.AsJSON(), 1066 autorest.AsGet(), 1067 autorest.WithBaseURL(to.String(pcrl.NextLink))) 1068} 1069 1070// PaginatedComputeResourcesListPage contains a page of ComputeResource values. 1071type PaginatedComputeResourcesListPage struct { 1072 fn func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error) 1073 pcrl PaginatedComputeResourcesList 1074} 1075 1076// NextWithContext advances to the next page of values. If there was an error making 1077// the request the page does not advance and the error is returned. 1078func (page *PaginatedComputeResourcesListPage) NextWithContext(ctx context.Context) (err error) { 1079 if tracing.IsEnabled() { 1080 ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedComputeResourcesListPage.NextWithContext") 1081 defer func() { 1082 sc := -1 1083 if page.Response().Response.Response != nil { 1084 sc = page.Response().Response.Response.StatusCode 1085 } 1086 tracing.EndSpan(ctx, sc, err) 1087 }() 1088 } 1089 for { 1090 next, err := page.fn(ctx, page.pcrl) 1091 if err != nil { 1092 return err 1093 } 1094 page.pcrl = next 1095 if !next.hasNextLink() || !next.IsEmpty() { 1096 break 1097 } 1098 } 1099 return nil 1100} 1101 1102// Next advances to the next page of values. If there was an error making 1103// the request the page does not advance and the error is returned. 1104// Deprecated: Use NextWithContext() instead. 1105func (page *PaginatedComputeResourcesListPage) Next() error { 1106 return page.NextWithContext(context.Background()) 1107} 1108 1109// NotDone returns true if the page enumeration should be started or is not yet complete. 1110func (page PaginatedComputeResourcesListPage) NotDone() bool { 1111 return !page.pcrl.IsEmpty() 1112} 1113 1114// Response returns the raw server response from the last page request. 1115func (page PaginatedComputeResourcesListPage) Response() PaginatedComputeResourcesList { 1116 return page.pcrl 1117} 1118 1119// Values returns the slice of values for the current page or nil if there are no values. 1120func (page PaginatedComputeResourcesListPage) Values() []ComputeResource { 1121 if page.pcrl.IsEmpty() { 1122 return nil 1123 } 1124 return *page.pcrl.Value 1125} 1126 1127// Creates a new instance of the PaginatedComputeResourcesListPage type. 1128func NewPaginatedComputeResourcesListPage(cur PaginatedComputeResourcesList, getNextPage func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error)) PaginatedComputeResourcesListPage { 1129 return PaginatedComputeResourcesListPage{ 1130 fn: getNextPage, 1131 pcrl: cur, 1132 } 1133} 1134 1135// Password ... 1136type Password struct { 1137 // Name - READ-ONLY 1138 Name *string `json:"name,omitempty"` 1139 // Value - READ-ONLY 1140 Value *string `json:"value,omitempty"` 1141} 1142 1143// MarshalJSON is the custom marshaler for Password. 1144func (p Password) MarshalJSON() ([]byte, error) { 1145 objectMap := make(map[string]interface{}) 1146 return json.Marshal(objectMap) 1147} 1148 1149// RegistryListCredentialsResult ... 1150type RegistryListCredentialsResult struct { 1151 // Location - READ-ONLY 1152 Location *string `json:"location,omitempty"` 1153 // Username - READ-ONLY 1154 Username *string `json:"username,omitempty"` 1155 Passwords *[]Password `json:"passwords,omitempty"` 1156} 1157 1158// MarshalJSON is the custom marshaler for RegistryListCredentialsResult. 1159func (rlcr RegistryListCredentialsResult) MarshalJSON() ([]byte, error) { 1160 objectMap := make(map[string]interface{}) 1161 if rlcr.Passwords != nil { 1162 objectMap["passwords"] = rlcr.Passwords 1163 } 1164 return json.Marshal(objectMap) 1165} 1166 1167// Resource azure Resource Manager resource envelope. 1168type Resource struct { 1169 // ID - READ-ONLY; Specifies the resource ID. 1170 ID *string `json:"id,omitempty"` 1171 // Name - READ-ONLY; Specifies the name of the resource. 1172 Name *string `json:"name,omitempty"` 1173 // Identity - The identity of the resource. 1174 Identity *Identity `json:"identity,omitempty"` 1175 // Location - Specifies the location of the resource. 1176 Location *string `json:"location,omitempty"` 1177 // Type - READ-ONLY; Specifies the type of the resource. 1178 Type *string `json:"type,omitempty"` 1179 // Tags - Contains resource tags defined as key/value pairs. 1180 Tags map[string]*string `json:"tags"` 1181} 1182 1183// MarshalJSON is the custom marshaler for Resource. 1184func (r Resource) MarshalJSON() ([]byte, error) { 1185 objectMap := make(map[string]interface{}) 1186 if r.Identity != nil { 1187 objectMap["identity"] = r.Identity 1188 } 1189 if r.Location != nil { 1190 objectMap["location"] = r.Location 1191 } 1192 if r.Tags != nil { 1193 objectMap["tags"] = r.Tags 1194 } 1195 return json.Marshal(objectMap) 1196} 1197 1198// ScaleSettings scale settings for BatchAI Compute 1199type ScaleSettings struct { 1200 // MaxNodeCount - Max number of nodes to use 1201 MaxNodeCount *int32 `json:"maxNodeCount,omitempty"` 1202 // MinNodeCount - Min number of nodes to use 1203 MinNodeCount *int32 `json:"minNodeCount,omitempty"` 1204 // AutoScaleEnabled - Enable or disable auto scale 1205 AutoScaleEnabled *bool `json:"autoScaleEnabled,omitempty"` 1206} 1207 1208// ServicePrincipalCredentials service principal credentials. 1209type ServicePrincipalCredentials struct { 1210 // ClientID - Client Id 1211 ClientID *string `json:"clientId,omitempty"` 1212 // ClientSecret - Client secret 1213 ClientSecret *string `json:"clientSecret,omitempty"` 1214} 1215 1216// SslConfiguration the SSL configuration for scoring 1217type SslConfiguration struct { 1218 // Status - Enable or disable SSL for scoring. Possible values include: 'Disabled', 'Enabled' 1219 Status Status `json:"status,omitempty"` 1220 // Cert - Cert data 1221 Cert *string `json:"cert,omitempty"` 1222 // Key - Key data 1223 Key *string `json:"key,omitempty"` 1224 // Cname - CNAME of the cert 1225 Cname *string `json:"cname,omitempty"` 1226} 1227 1228// SystemService a system service running on a compute. 1229type SystemService struct { 1230 // SystemServiceType - READ-ONLY; The type of this system service. 1231 SystemServiceType *string `json:"systemServiceType,omitempty"` 1232 // PublicIPAddress - READ-ONLY; Public IP address 1233 PublicIPAddress *string `json:"publicIpAddress,omitempty"` 1234 // Version - READ-ONLY; The version for this type. 1235 Version *string `json:"version,omitempty"` 1236} 1237 1238// MarshalJSON is the custom marshaler for SystemService. 1239func (ss SystemService) MarshalJSON() ([]byte, error) { 1240 objectMap := make(map[string]interface{}) 1241 return json.Marshal(objectMap) 1242} 1243 1244// VirtualMachine a Machine Learning compute based on Azure Virtual Machines. 1245type VirtualMachine struct { 1246 Properties *VirtualMachineProperties `json:"properties,omitempty"` 1247 // ComputeLocation - Location for the underlying compute 1248 ComputeLocation *string `json:"computeLocation,omitempty"` 1249 // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' 1250 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 1251 // Description - The description of the Machine Learning compute. 1252 Description *string `json:"description,omitempty"` 1253 // CreatedOn - READ-ONLY; The date and time when the compute was created. 1254 CreatedOn *date.Time `json:"createdOn,omitempty"` 1255 // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. 1256 ModifiedOn *date.Time `json:"modifiedOn,omitempty"` 1257 // ResourceID - ARM resource id of the compute 1258 ResourceID *string `json:"resourceId,omitempty"` 1259 // ProvisioningErrors - READ-ONLY; Errors during provisioning 1260 ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` 1261 // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeBatchAI1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1' 1262 ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` 1263} 1264 1265// MarshalJSON is the custom marshaler for VirtualMachine. 1266func (VM VirtualMachine) MarshalJSON() ([]byte, error) { 1267 VM.ComputeType = ComputeTypeVirtualMachine1 1268 objectMap := make(map[string]interface{}) 1269 if VM.Properties != nil { 1270 objectMap["properties"] = VM.Properties 1271 } 1272 if VM.ComputeLocation != nil { 1273 objectMap["computeLocation"] = VM.ComputeLocation 1274 } 1275 if VM.Description != nil { 1276 objectMap["description"] = VM.Description 1277 } 1278 if VM.ResourceID != nil { 1279 objectMap["resourceId"] = VM.ResourceID 1280 } 1281 if VM.ComputeType != "" { 1282 objectMap["computeType"] = VM.ComputeType 1283 } 1284 return json.Marshal(objectMap) 1285} 1286 1287// AsAKS is the BasicCompute implementation for VirtualMachine. 1288func (VM VirtualMachine) AsAKS() (*AKS, bool) { 1289 return nil, false 1290} 1291 1292// AsBatchAI is the BasicCompute implementation for VirtualMachine. 1293func (VM VirtualMachine) AsBatchAI() (*BatchAI, bool) { 1294 return nil, false 1295} 1296 1297// AsVirtualMachine is the BasicCompute implementation for VirtualMachine. 1298func (VM VirtualMachine) AsVirtualMachine() (*VirtualMachine, bool) { 1299 return &VM, true 1300} 1301 1302// AsHDInsight is the BasicCompute implementation for VirtualMachine. 1303func (VM VirtualMachine) AsHDInsight() (*HDInsight, bool) { 1304 return nil, false 1305} 1306 1307// AsDataFactory is the BasicCompute implementation for VirtualMachine. 1308func (VM VirtualMachine) AsDataFactory() (*DataFactory, bool) { 1309 return nil, false 1310} 1311 1312// AsCompute is the BasicCompute implementation for VirtualMachine. 1313func (VM VirtualMachine) AsCompute() (*Compute, bool) { 1314 return nil, false 1315} 1316 1317// AsBasicCompute is the BasicCompute implementation for VirtualMachine. 1318func (VM VirtualMachine) AsBasicCompute() (BasicCompute, bool) { 1319 return &VM, true 1320} 1321 1322// VirtualMachineProperties ... 1323type VirtualMachineProperties struct { 1324 // VirtualMachineSize - Virtual Machine size 1325 VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` 1326 // SSHPort - Port open for ssh connections. 1327 SSHPort *int32 `json:"sshPort,omitempty"` 1328 // Address - Public IP address of the virtual machine. 1329 Address *string `json:"address,omitempty"` 1330 // AdministratorAccount - Admin credentials for virtual machine 1331 AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"` 1332} 1333 1334// VirtualMachineSecrets secrets related to a Machine Learning compute based on AKS. 1335type VirtualMachineSecrets struct { 1336 // AdministratorAccount - Admin credentials for virtual machine. 1337 AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"` 1338 // ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine' 1339 ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"` 1340} 1341 1342// MarshalJSON is the custom marshaler for VirtualMachineSecrets. 1343func (vms VirtualMachineSecrets) MarshalJSON() ([]byte, error) { 1344 vms.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine 1345 objectMap := make(map[string]interface{}) 1346 if vms.AdministratorAccount != nil { 1347 objectMap["administratorAccount"] = vms.AdministratorAccount 1348 } 1349 if vms.ComputeType != "" { 1350 objectMap["computeType"] = vms.ComputeType 1351 } 1352 return json.Marshal(objectMap) 1353} 1354 1355// AsAksComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. 1356func (vms VirtualMachineSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) { 1357 return nil, false 1358} 1359 1360// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. 1361func (vms VirtualMachineSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) { 1362 return &vms, true 1363} 1364 1365// AsComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. 1366func (vms VirtualMachineSecrets) AsComputeSecrets() (*ComputeSecrets, bool) { 1367 return nil, false 1368} 1369 1370// AsBasicComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. 1371func (vms VirtualMachineSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) { 1372 return &vms, true 1373} 1374 1375// VirtualMachineSSHCredentials admin credentials for virtual machine 1376type VirtualMachineSSHCredentials struct { 1377 // Username - Username of admin account 1378 Username *string `json:"username,omitempty"` 1379 // Password - Password of admin account 1380 Password *string `json:"password,omitempty"` 1381 // PublicKeyData - Public key data 1382 PublicKeyData *string `json:"publicKeyData,omitempty"` 1383 // PrivateKeyData - Private key data 1384 PrivateKeyData *string `json:"privateKeyData,omitempty"` 1385} 1386 1387// Workspace an object that represents a machine learning workspace. 1388type Workspace struct { 1389 autorest.Response `json:"-"` 1390 // WorkspaceProperties - The properties of the machine learning workspace. 1391 *WorkspaceProperties `json:"properties,omitempty"` 1392 // ID - READ-ONLY; Specifies the resource ID. 1393 ID *string `json:"id,omitempty"` 1394 // Name - READ-ONLY; Specifies the name of the resource. 1395 Name *string `json:"name,omitempty"` 1396 // Identity - The identity of the resource. 1397 Identity *Identity `json:"identity,omitempty"` 1398 // Location - Specifies the location of the resource. 1399 Location *string `json:"location,omitempty"` 1400 // Type - READ-ONLY; Specifies the type of the resource. 1401 Type *string `json:"type,omitempty"` 1402 // Tags - Contains resource tags defined as key/value pairs. 1403 Tags map[string]*string `json:"tags"` 1404} 1405 1406// MarshalJSON is the custom marshaler for Workspace. 1407func (w Workspace) MarshalJSON() ([]byte, error) { 1408 objectMap := make(map[string]interface{}) 1409 if w.WorkspaceProperties != nil { 1410 objectMap["properties"] = w.WorkspaceProperties 1411 } 1412 if w.Identity != nil { 1413 objectMap["identity"] = w.Identity 1414 } 1415 if w.Location != nil { 1416 objectMap["location"] = w.Location 1417 } 1418 if w.Tags != nil { 1419 objectMap["tags"] = w.Tags 1420 } 1421 return json.Marshal(objectMap) 1422} 1423 1424// UnmarshalJSON is the custom unmarshaler for Workspace struct. 1425func (w *Workspace) UnmarshalJSON(body []byte) error { 1426 var m map[string]*json.RawMessage 1427 err := json.Unmarshal(body, &m) 1428 if err != nil { 1429 return err 1430 } 1431 for k, v := range m { 1432 switch k { 1433 case "properties": 1434 if v != nil { 1435 var workspaceProperties WorkspaceProperties 1436 err = json.Unmarshal(*v, &workspaceProperties) 1437 if err != nil { 1438 return err 1439 } 1440 w.WorkspaceProperties = &workspaceProperties 1441 } 1442 case "id": 1443 if v != nil { 1444 var ID string 1445 err = json.Unmarshal(*v, &ID) 1446 if err != nil { 1447 return err 1448 } 1449 w.ID = &ID 1450 } 1451 case "name": 1452 if v != nil { 1453 var name string 1454 err = json.Unmarshal(*v, &name) 1455 if err != nil { 1456 return err 1457 } 1458 w.Name = &name 1459 } 1460 case "identity": 1461 if v != nil { 1462 var identity Identity 1463 err = json.Unmarshal(*v, &identity) 1464 if err != nil { 1465 return err 1466 } 1467 w.Identity = &identity 1468 } 1469 case "location": 1470 if v != nil { 1471 var location string 1472 err = json.Unmarshal(*v, &location) 1473 if err != nil { 1474 return err 1475 } 1476 w.Location = &location 1477 } 1478 case "type": 1479 if v != nil { 1480 var typeVar string 1481 err = json.Unmarshal(*v, &typeVar) 1482 if err != nil { 1483 return err 1484 } 1485 w.Type = &typeVar 1486 } 1487 case "tags": 1488 if v != nil { 1489 var tags map[string]*string 1490 err = json.Unmarshal(*v, &tags) 1491 if err != nil { 1492 return err 1493 } 1494 w.Tags = tags 1495 } 1496 } 1497 } 1498 1499 return nil 1500} 1501 1502// WorkspaceListResult the result of a request to list machine learning workspaces. 1503type WorkspaceListResult struct { 1504 autorest.Response `json:"-"` 1505 // 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. 1506 Value *[]Workspace `json:"value,omitempty"` 1507 // NextLink - The URI that can be used to request the next list of machine learning workspaces. 1508 NextLink *string `json:"nextLink,omitempty"` 1509} 1510 1511// WorkspaceListResultIterator provides access to a complete listing of Workspace values. 1512type WorkspaceListResultIterator struct { 1513 i int 1514 page WorkspaceListResultPage 1515} 1516 1517// NextWithContext advances to the next value. If there was an error making 1518// the request the iterator does not advance and the error is returned. 1519func (iter *WorkspaceListResultIterator) NextWithContext(ctx context.Context) (err error) { 1520 if tracing.IsEnabled() { 1521 ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListResultIterator.NextWithContext") 1522 defer func() { 1523 sc := -1 1524 if iter.Response().Response.Response != nil { 1525 sc = iter.Response().Response.Response.StatusCode 1526 } 1527 tracing.EndSpan(ctx, sc, err) 1528 }() 1529 } 1530 iter.i++ 1531 if iter.i < len(iter.page.Values()) { 1532 return nil 1533 } 1534 err = iter.page.NextWithContext(ctx) 1535 if err != nil { 1536 iter.i-- 1537 return err 1538 } 1539 iter.i = 0 1540 return nil 1541} 1542 1543// Next advances to the next value. If there was an error making 1544// the request the iterator does not advance and the error is returned. 1545// Deprecated: Use NextWithContext() instead. 1546func (iter *WorkspaceListResultIterator) Next() error { 1547 return iter.NextWithContext(context.Background()) 1548} 1549 1550// NotDone returns true if the enumeration should be started or is not yet complete. 1551func (iter WorkspaceListResultIterator) NotDone() bool { 1552 return iter.page.NotDone() && iter.i < len(iter.page.Values()) 1553} 1554 1555// Response returns the raw server response from the last page request. 1556func (iter WorkspaceListResultIterator) Response() WorkspaceListResult { 1557 return iter.page.Response() 1558} 1559 1560// Value returns the current value or a zero-initialized value if the 1561// iterator has advanced beyond the end of the collection. 1562func (iter WorkspaceListResultIterator) Value() Workspace { 1563 if !iter.page.NotDone() { 1564 return Workspace{} 1565 } 1566 return iter.page.Values()[iter.i] 1567} 1568 1569// Creates a new instance of the WorkspaceListResultIterator type. 1570func NewWorkspaceListResultIterator(page WorkspaceListResultPage) WorkspaceListResultIterator { 1571 return WorkspaceListResultIterator{page: page} 1572} 1573 1574// IsEmpty returns true if the ListResult contains no values. 1575func (wlr WorkspaceListResult) IsEmpty() bool { 1576 return wlr.Value == nil || len(*wlr.Value) == 0 1577} 1578 1579// hasNextLink returns true if the NextLink is not empty. 1580func (wlr WorkspaceListResult) hasNextLink() bool { 1581 return wlr.NextLink != nil && len(*wlr.NextLink) != 0 1582} 1583 1584// workspaceListResultPreparer prepares a request to retrieve the next set of results. 1585// It returns nil if no more results exist. 1586func (wlr WorkspaceListResult) workspaceListResultPreparer(ctx context.Context) (*http.Request, error) { 1587 if !wlr.hasNextLink() { 1588 return nil, nil 1589 } 1590 return autorest.Prepare((&http.Request{}).WithContext(ctx), 1591 autorest.AsJSON(), 1592 autorest.AsGet(), 1593 autorest.WithBaseURL(to.String(wlr.NextLink))) 1594} 1595 1596// WorkspaceListResultPage contains a page of Workspace values. 1597type WorkspaceListResultPage struct { 1598 fn func(context.Context, WorkspaceListResult) (WorkspaceListResult, error) 1599 wlr WorkspaceListResult 1600} 1601 1602// NextWithContext advances to the next page of values. If there was an error making 1603// the request the page does not advance and the error is returned. 1604func (page *WorkspaceListResultPage) NextWithContext(ctx context.Context) (err error) { 1605 if tracing.IsEnabled() { 1606 ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListResultPage.NextWithContext") 1607 defer func() { 1608 sc := -1 1609 if page.Response().Response.Response != nil { 1610 sc = page.Response().Response.Response.StatusCode 1611 } 1612 tracing.EndSpan(ctx, sc, err) 1613 }() 1614 } 1615 for { 1616 next, err := page.fn(ctx, page.wlr) 1617 if err != nil { 1618 return err 1619 } 1620 page.wlr = next 1621 if !next.hasNextLink() || !next.IsEmpty() { 1622 break 1623 } 1624 } 1625 return nil 1626} 1627 1628// Next advances to the next page of values. If there was an error making 1629// the request the page does not advance and the error is returned. 1630// Deprecated: Use NextWithContext() instead. 1631func (page *WorkspaceListResultPage) Next() error { 1632 return page.NextWithContext(context.Background()) 1633} 1634 1635// NotDone returns true if the page enumeration should be started or is not yet complete. 1636func (page WorkspaceListResultPage) NotDone() bool { 1637 return !page.wlr.IsEmpty() 1638} 1639 1640// Response returns the raw server response from the last page request. 1641func (page WorkspaceListResultPage) Response() WorkspaceListResult { 1642 return page.wlr 1643} 1644 1645// Values returns the slice of values for the current page or nil if there are no values. 1646func (page WorkspaceListResultPage) Values() []Workspace { 1647 if page.wlr.IsEmpty() { 1648 return nil 1649 } 1650 return *page.wlr.Value 1651} 1652 1653// Creates a new instance of the WorkspaceListResultPage type. 1654func NewWorkspaceListResultPage(cur WorkspaceListResult, getNextPage func(context.Context, WorkspaceListResult) (WorkspaceListResult, error)) WorkspaceListResultPage { 1655 return WorkspaceListResultPage{ 1656 fn: getNextPage, 1657 wlr: cur, 1658 } 1659} 1660 1661// WorkspaceProperties the properties of a machine learning workspace. 1662type WorkspaceProperties struct { 1663 // WorkspaceID - READ-ONLY; The immutable id associated with this workspace. 1664 WorkspaceID *string `json:"workspaceId,omitempty"` 1665 // Description - The description of this workspace. 1666 Description *string `json:"description,omitempty"` 1667 // FriendlyName - The friendly name for this workspace. This name in mutable 1668 FriendlyName *string `json:"friendlyName,omitempty"` 1669 // CreationTime - READ-ONLY; The creation time of the machine learning workspace in ISO8601 format. 1670 CreationTime *date.Time `json:"creationTime,omitempty"` 1671 // BatchaiWorkspace - ARM id of the Batch AI workspace associated with this workspace. This cannot be changed once the workspace has been created 1672 BatchaiWorkspace *string `json:"batchaiWorkspace,omitempty"` 1673 // KeyVault - ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created 1674 KeyVault *string `json:"keyVault,omitempty"` 1675 // ApplicationInsights - ARM id of the application insights associated with this workspace. This cannot be changed once the workspace has been created 1676 ApplicationInsights *string `json:"applicationInsights,omitempty"` 1677 // ContainerRegistry - ARM id of the container registry associated with this workspace. This cannot be changed once the workspace has been created 1678 ContainerRegistry *string `json:"containerRegistry,omitempty"` 1679 // StorageAccount - ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been created 1680 StorageAccount *string `json:"storageAccount,omitempty"` 1681 // DiscoveryURL - Url for the discovery service to identify regional endpoints for machine learning experimentation services 1682 DiscoveryURL *string `json:"discoveryUrl,omitempty"` 1683 // ProvisioningState - READ-ONLY; The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. Possible values include: 'Unknown', 'Updating', 'Creating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' 1684 ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` 1685} 1686 1687// MarshalJSON is the custom marshaler for WorkspaceProperties. 1688func (wp WorkspaceProperties) MarshalJSON() ([]byte, error) { 1689 objectMap := make(map[string]interface{}) 1690 if wp.Description != nil { 1691 objectMap["description"] = wp.Description 1692 } 1693 if wp.FriendlyName != nil { 1694 objectMap["friendlyName"] = wp.FriendlyName 1695 } 1696 if wp.BatchaiWorkspace != nil { 1697 objectMap["batchaiWorkspace"] = wp.BatchaiWorkspace 1698 } 1699 if wp.KeyVault != nil { 1700 objectMap["keyVault"] = wp.KeyVault 1701 } 1702 if wp.ApplicationInsights != nil { 1703 objectMap["applicationInsights"] = wp.ApplicationInsights 1704 } 1705 if wp.ContainerRegistry != nil { 1706 objectMap["containerRegistry"] = wp.ContainerRegistry 1707 } 1708 if wp.StorageAccount != nil { 1709 objectMap["storageAccount"] = wp.StorageAccount 1710 } 1711 if wp.DiscoveryURL != nil { 1712 objectMap["discoveryUrl"] = wp.DiscoveryURL 1713 } 1714 return json.Marshal(objectMap) 1715} 1716 1717// WorkspacePropertiesUpdateParameters the parameters for updating the properties of a machine learning 1718// workspace. 1719type WorkspacePropertiesUpdateParameters struct { 1720 // Description - The description of this workspace. 1721 Description *string `json:"description,omitempty"` 1722 // FriendlyName - The friendly name for this workspace. 1723 FriendlyName *string `json:"friendlyName,omitempty"` 1724} 1725 1726// WorkspacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running 1727// operation. 1728type WorkspacesDeleteFuture struct { 1729 azure.FutureAPI 1730 // Result returns the result of the asynchronous operation. 1731 // If the operation has not completed it will return an error. 1732 Result func(WorkspacesClient) (autorest.Response, error) 1733} 1734 1735// UnmarshalJSON is the custom unmarshaller for CreateFuture. 1736func (future *WorkspacesDeleteFuture) UnmarshalJSON(body []byte) error { 1737 var azFuture azure.Future 1738 if err := json.Unmarshal(body, &azFuture); err != nil { 1739 return err 1740 } 1741 future.FutureAPI = &azFuture 1742 future.Result = future.result 1743 return nil 1744} 1745 1746// result is the default implementation for WorkspacesDeleteFuture.Result. 1747func (future *WorkspacesDeleteFuture) result(client WorkspacesClient) (ar autorest.Response, err error) { 1748 var done bool 1749 done, err = future.DoneWithContext(context.Background(), client) 1750 if err != nil { 1751 err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesDeleteFuture", "Result", future.Response(), "Polling failure") 1752 return 1753 } 1754 if !done { 1755 ar.Response = future.Response() 1756 err = azure.NewAsyncOpIncompleteError("machinelearningservices.WorkspacesDeleteFuture") 1757 return 1758 } 1759 ar.Response = future.Response() 1760 return 1761} 1762 1763// WorkspaceUpdateParameters the parameters for updating a machine learning workspace. 1764type WorkspaceUpdateParameters struct { 1765 // Tags - The resource tags for the machine learning workspace. 1766 Tags map[string]*string `json:"tags"` 1767 // WorkspacePropertiesUpdateParameters - The properties that the machine learning workspace will be updated with. 1768 *WorkspacePropertiesUpdateParameters `json:"properties,omitempty"` 1769} 1770 1771// MarshalJSON is the custom marshaler for WorkspaceUpdateParameters. 1772func (wup WorkspaceUpdateParameters) MarshalJSON() ([]byte, error) { 1773 objectMap := make(map[string]interface{}) 1774 if wup.Tags != nil { 1775 objectMap["tags"] = wup.Tags 1776 } 1777 if wup.WorkspacePropertiesUpdateParameters != nil { 1778 objectMap["properties"] = wup.WorkspacePropertiesUpdateParameters 1779 } 1780 return json.Marshal(objectMap) 1781} 1782 1783// UnmarshalJSON is the custom unmarshaler for WorkspaceUpdateParameters struct. 1784func (wup *WorkspaceUpdateParameters) UnmarshalJSON(body []byte) error { 1785 var m map[string]*json.RawMessage 1786 err := json.Unmarshal(body, &m) 1787 if err != nil { 1788 return err 1789 } 1790 for k, v := range m { 1791 switch k { 1792 case "tags": 1793 if v != nil { 1794 var tags map[string]*string 1795 err = json.Unmarshal(*v, &tags) 1796 if err != nil { 1797 return err 1798 } 1799 wup.Tags = tags 1800 } 1801 case "properties": 1802 if v != nil { 1803 var workspacePropertiesUpdateParameters WorkspacePropertiesUpdateParameters 1804 err = json.Unmarshal(*v, &workspacePropertiesUpdateParameters) 1805 if err != nil { 1806 return err 1807 } 1808 wup.WorkspacePropertiesUpdateParameters = &workspacePropertiesUpdateParameters 1809 } 1810 } 1811 } 1812 1813 return nil 1814} 1815