-
Notifications
You must be signed in to change notification settings - Fork 821
/
models.go
3411 lines (3133 loc) · 118 KB
/
models.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package labservices
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
import (
"context"
"encoding/json"
"github.com/Azure/go-autorest/autorest"
"github.com/Azure/go-autorest/autorest/azure"
"github.com/Azure/go-autorest/autorest/date"
"github.com/Azure/go-autorest/autorest/to"
"github.com/Azure/go-autorest/tracing"
"github.com/shopspring/decimal"
"net/http"
)
// The package's fully qualified name.
const fqdn = "github.com/Azure/azure-sdk-for-go/services/labservices/mgmt/2018-10-15/labservices"
// AddRemove enumerates the values for add remove.
type AddRemove string
const (
// Add Indicates that a user is adding a favorite lab
Add AddRemove = "Add"
// Remove Indicates that a user is removing a favorite lab
Remove AddRemove = "Remove"
)
// PossibleAddRemoveValues returns an array of possible values for the AddRemove const type.
func PossibleAddRemoveValues() []AddRemove {
return []AddRemove{Add, Remove}
}
// ConfigurationState enumerates the values for configuration state.
type ConfigurationState string
const (
// Completed User is finished modifying the template.
Completed ConfigurationState = "Completed"
// NotApplicable User either hasn't started configuring their template
// or they haven't started the configuration process.
NotApplicable ConfigurationState = "NotApplicable"
)
// PossibleConfigurationStateValues returns an array of possible values for the ConfigurationState const type.
func PossibleConfigurationStateValues() []ConfigurationState {
return []ConfigurationState{Completed, NotApplicable}
}
// LabUserAccessMode enumerates the values for lab user access mode.
type LabUserAccessMode string
const (
// Open Any user can register with the lab and access its VMs.
Open LabUserAccessMode = "Open"
// Restricted Only users registered with the lab can access VMs.
Restricted LabUserAccessMode = "Restricted"
)
// PossibleLabUserAccessModeValues returns an array of possible values for the LabUserAccessMode const type.
func PossibleLabUserAccessModeValues() []LabUserAccessMode {
return []LabUserAccessMode{Open, Restricted}
}
// ManagedLabVMSize enumerates the values for managed lab vm size.
type ManagedLabVMSize string
const (
// Basic The base VM size
Basic ManagedLabVMSize = "Basic"
// Performance The most performant VM size
Performance ManagedLabVMSize = "Performance"
// Standard The standard or default VM size
Standard ManagedLabVMSize = "Standard"
)
// PossibleManagedLabVMSizeValues returns an array of possible values for the ManagedLabVMSize const type.
func PossibleManagedLabVMSizeValues() []ManagedLabVMSize {
return []ManagedLabVMSize{Basic, Performance, Standard}
}
// PublishingState enumerates the values for publishing state.
type PublishingState string
const (
// Draft Initial state of an environment setting.
Draft PublishingState = "Draft"
// Published All resources are currently provisioned.
Published PublishingState = "Published"
// PublishFailed Failed to provision all the necessary resources.
PublishFailed PublishingState = "PublishFailed"
// Publishing Currently provisioning resources.
Publishing PublishingState = "Publishing"
// Scaling Currently provisioning resources without recreating VM image.
Scaling PublishingState = "Scaling"
)
// PossiblePublishingStateValues returns an array of possible values for the PublishingState const type.
func PossiblePublishingStateValues() []PublishingState {
return []PublishingState{Draft, Published, PublishFailed, Publishing, Scaling}
}
// AddUsersPayload payload for Add Users operation on a Lab.
type AddUsersPayload struct {
// EmailAddresses - List of user emails addresses to add to the lab.
EmailAddresses *[]string `json:"emailAddresses,omitempty"`
}
// CloudError error from a REST request.
type CloudError struct {
Error *CloudErrorBody `json:"error,omitempty"`
}
// CloudErrorBody body of an error from a REST request.
type CloudErrorBody struct {
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
Target *string `json:"target,omitempty"`
// Details - Inner errors.
Details *[]CloudErrorBody `json:"details,omitempty"`
}
// CreateLabProperties properties for creating a managed lab and a default environment setting
type CreateLabProperties struct {
// EnvironmentSettingCreationParameters - Settings related to creating an environment setting
EnvironmentSettingCreationParameters *EnvironmentSettingCreationParameters `json:"environmentSettingCreationParameters,omitempty"`
// LabCreationParameters - Settings related to creating a lab
LabCreationParameters *LabCreationParameters `json:"labCreationParameters,omitempty"`
// Name - The name of the resource
Name *string `json:"name,omitempty"`
// Location - The location of the resource
Location *string `json:"location,omitempty"`
// Tags - The tags of the resource.
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for CreateLabProperties.
func (clp CreateLabProperties) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if clp.EnvironmentSettingCreationParameters != nil {
objectMap["environmentSettingCreationParameters"] = clp.EnvironmentSettingCreationParameters
}
if clp.LabCreationParameters != nil {
objectMap["labCreationParameters"] = clp.LabCreationParameters
}
if clp.Name != nil {
objectMap["name"] = clp.Name
}
if clp.Location != nil {
objectMap["location"] = clp.Location
}
if clp.Tags != nil {
objectMap["tags"] = clp.Tags
}
return json.Marshal(objectMap)
}
// Environment represents an environment instance
type Environment struct {
autorest.Response `json:"-"`
// EnvironmentProperties - The properties of the Environment resource
*EnvironmentProperties `json:"properties,omitempty"`
// ID - READ-ONLY; The identifier of the resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
// Location - The location of the resource.
Location *string `json:"location,omitempty"`
// Tags - The tags of the resource.
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for Environment.
func (e Environment) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if e.EnvironmentProperties != nil {
objectMap["properties"] = e.EnvironmentProperties
}
if e.Location != nil {
objectMap["location"] = e.Location
}
if e.Tags != nil {
objectMap["tags"] = e.Tags
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for Environment struct.
func (e *Environment) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var environmentProperties EnvironmentProperties
err = json.Unmarshal(*v, &environmentProperties)
if err != nil {
return err
}
e.EnvironmentProperties = &environmentProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
e.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
e.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
e.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
e.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
e.Tags = tags
}
}
}
return nil
}
// EnvironmentDetails this represents the details about a User's environment and its state.
type EnvironmentDetails struct {
// Name - READ-ONLY; Name of the Environment
Name *string `json:"name,omitempty"`
// Description - READ-ONLY; Description of the Environment
Description *string `json:"description,omitempty"`
// ID - READ-ONLY; Resource Id of the environment
ID *string `json:"id,omitempty"`
// ProvisioningState - READ-ONLY; The provisioning state of the environment. This also includes LabIsFull and NotYetProvisioned status.
ProvisioningState *string `json:"provisioningState,omitempty"`
// VirtualMachineDetails - READ-ONLY; Details of backing DTL virtual machine with compute and network details.
VirtualMachineDetails *VirtualMachineDetails `json:"virtualMachineDetails,omitempty"`
// LatestOperationResult - READ-ONLY; The details of the latest operation. ex: status, error
LatestOperationResult *LatestOperationResult `json:"latestOperationResult,omitempty"`
// EnvironmentState - READ-ONLY; Publishing state of the environment setting Possible values are Creating, Created, Failed
EnvironmentState *string `json:"environmentState,omitempty"`
// TotalUsage - READ-ONLY; How long the environment has been used by a lab user
TotalUsage *string `json:"totalUsage,omitempty"`
// PasswordLastReset - READ-ONLY; When the password was last reset on the environment.
PasswordLastReset *date.Time `json:"passwordLastReset,omitempty"`
}
// EnvironmentFragment represents an environment instance
type EnvironmentFragment struct {
// EnvironmentPropertiesFragment - The properties of the Environment resource
*EnvironmentPropertiesFragment `json:"properties,omitempty"`
// ID - READ-ONLY; The identifier of the resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
// Location - The location of the resource.
Location *string `json:"location,omitempty"`
// Tags - The tags of the resource.
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for EnvironmentFragment.
func (ef EnvironmentFragment) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if ef.EnvironmentPropertiesFragment != nil {
objectMap["properties"] = ef.EnvironmentPropertiesFragment
}
if ef.Location != nil {
objectMap["location"] = ef.Location
}
if ef.Tags != nil {
objectMap["tags"] = ef.Tags
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for EnvironmentFragment struct.
func (ef *EnvironmentFragment) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var environmentPropertiesFragment EnvironmentPropertiesFragment
err = json.Unmarshal(*v, &environmentPropertiesFragment)
if err != nil {
return err
}
ef.EnvironmentPropertiesFragment = &environmentPropertiesFragment
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
ef.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
ef.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
ef.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
ef.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
ef.Tags = tags
}
}
}
return nil
}
// EnvironmentOperationsPayload represents payload for any Environment operations like get, start, stop,
// connect
type EnvironmentOperationsPayload struct {
// EnvironmentID - The resourceId of the environment
EnvironmentID *string `json:"environmentId,omitempty"`
}
// EnvironmentProperties properties of an environment
type EnvironmentProperties struct {
// ResourceSets - The set of a VM and the setting id it was created for
ResourceSets *ResourceSet `json:"resourceSets,omitempty"`
// ClaimedByUserObjectID - READ-ONLY; The AAD object Id of the user who has claimed the environment
ClaimedByUserObjectID *string `json:"claimedByUserObjectId,omitempty"`
// ClaimedByUserPrincipalID - READ-ONLY; The user principal Id of the user who has claimed the environment
ClaimedByUserPrincipalID *string `json:"claimedByUserPrincipalId,omitempty"`
// ClaimedByUserName - READ-ONLY; The name or email address of the user who has claimed the environment
ClaimedByUserName *string `json:"claimedByUserName,omitempty"`
// IsClaimed - READ-ONLY; Is the environment claimed or not
IsClaimed *bool `json:"isClaimed,omitempty"`
// LastKnownPowerState - READ-ONLY; Last known power state of the environment
LastKnownPowerState *string `json:"lastKnownPowerState,omitempty"`
// NetworkInterface - READ-ONLY; Network details of the environment
NetworkInterface *NetworkInterface `json:"networkInterface,omitempty"`
// TotalUsage - READ-ONLY; How long the environment has been used by a lab user
TotalUsage *string `json:"totalUsage,omitempty"`
// PasswordLastReset - READ-ONLY; When the password was last reset on the environment.
PasswordLastReset *date.Time `json:"passwordLastReset,omitempty"`
// ProvisioningState - The provisioning status of the resource.
ProvisioningState *string `json:"provisioningState,omitempty"`
// UniqueIdentifier - The unique immutable identifier of a resource (Guid).
UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
// LatestOperationResult - READ-ONLY; The details of the latest operation. ex: status, error
LatestOperationResult *LatestOperationResult `json:"latestOperationResult,omitempty"`
}
// EnvironmentPropertiesFragment properties of an environment
type EnvironmentPropertiesFragment struct {
// ResourceSets - The set of a VM and the setting id it was created for
ResourceSets *ResourceSetFragment `json:"resourceSets,omitempty"`
// ProvisioningState - The provisioning status of the resource.
ProvisioningState *string `json:"provisioningState,omitempty"`
// UniqueIdentifier - The unique immutable identifier of a resource (Guid).
UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
}
// EnvironmentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type EnvironmentsDeleteFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *EnvironmentsDeleteFuture) Result(client EnvironmentsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "labservices.EnvironmentsDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("labservices.EnvironmentsDeleteFuture")
return
}
ar.Response = future.Response()
return
}
// EnvironmentSetting represents settings of an environment, from which environment instances would be
// created
type EnvironmentSetting struct {
autorest.Response `json:"-"`
// EnvironmentSettingProperties - The properties of the Environment Setting resource
*EnvironmentSettingProperties `json:"properties,omitempty"`
// ID - READ-ONLY; The identifier of the resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
// Location - The location of the resource.
Location *string `json:"location,omitempty"`
// Tags - The tags of the resource.
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for EnvironmentSetting.
func (es EnvironmentSetting) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if es.EnvironmentSettingProperties != nil {
objectMap["properties"] = es.EnvironmentSettingProperties
}
if es.Location != nil {
objectMap["location"] = es.Location
}
if es.Tags != nil {
objectMap["tags"] = es.Tags
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for EnvironmentSetting struct.
func (es *EnvironmentSetting) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var environmentSettingProperties EnvironmentSettingProperties
err = json.Unmarshal(*v, &environmentSettingProperties)
if err != nil {
return err
}
es.EnvironmentSettingProperties = &environmentSettingProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
es.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
es.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
es.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
es.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
es.Tags = tags
}
}
}
return nil
}
// EnvironmentSettingCreationParameters settings related to creating an environment setting
type EnvironmentSettingCreationParameters struct {
// ResourceSettingCreationParameters - The resource specific settings
ResourceSettingCreationParameters *ResourceSettingCreationParameters `json:"resourceSettingCreationParameters,omitempty"`
}
// EnvironmentSettingFragment represents settings of an environment, from which environment instances would
// be created
type EnvironmentSettingFragment struct {
// EnvironmentSettingPropertiesFragment - The properties of the Environment Setting resource
*EnvironmentSettingPropertiesFragment `json:"properties,omitempty"`
// ID - READ-ONLY; The identifier of the resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
// Location - The location of the resource.
Location *string `json:"location,omitempty"`
// Tags - The tags of the resource.
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for EnvironmentSettingFragment.
func (esf EnvironmentSettingFragment) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if esf.EnvironmentSettingPropertiesFragment != nil {
objectMap["properties"] = esf.EnvironmentSettingPropertiesFragment
}
if esf.Location != nil {
objectMap["location"] = esf.Location
}
if esf.Tags != nil {
objectMap["tags"] = esf.Tags
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for EnvironmentSettingFragment struct.
func (esf *EnvironmentSettingFragment) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var environmentSettingPropertiesFragment EnvironmentSettingPropertiesFragment
err = json.Unmarshal(*v, &environmentSettingPropertiesFragment)
if err != nil {
return err
}
esf.EnvironmentSettingPropertiesFragment = &environmentSettingPropertiesFragment
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
esf.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
esf.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
esf.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
esf.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
esf.Tags = tags
}
}
}
return nil
}
// EnvironmentSettingProperties properties of an environment setting
type EnvironmentSettingProperties struct {
// PublishingState - READ-ONLY; Describes the readiness of this environment setting. Possible values include: 'Draft', 'Publishing', 'Published', 'PublishFailed', 'Scaling'
PublishingState PublishingState `json:"publishingState,omitempty"`
// ConfigurationState - Describes the user's progress in configuring their environment setting. Possible values include: 'NotApplicable', 'Completed'
ConfigurationState ConfigurationState `json:"configurationState,omitempty"`
// Description - Describes the environment and its resource settings
Description *string `json:"description,omitempty"`
// Title - Brief title describing the environment and its resource settings
Title *string `json:"title,omitempty"`
// ResourceSettings - The resource specific settings
ResourceSettings *ResourceSettings `json:"resourceSettings,omitempty"`
// LastChanged - READ-ONLY; Time when the template VM was last changed.
LastChanged *date.Time `json:"lastChanged,omitempty"`
// LastPublished - READ-ONLY; Time when the template VM was last sent for publishing.
LastPublished *date.Time `json:"lastPublished,omitempty"`
// ProvisioningState - The provisioning status of the resource.
ProvisioningState *string `json:"provisioningState,omitempty"`
// UniqueIdentifier - The unique immutable identifier of a resource (Guid).
UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
// LatestOperationResult - READ-ONLY; The details of the latest operation. ex: status, error
LatestOperationResult *LatestOperationResult `json:"latestOperationResult,omitempty"`
}
// EnvironmentSettingPropertiesFragment properties of an environment setting
type EnvironmentSettingPropertiesFragment struct {
// ConfigurationState - Describes the user's progress in configuring their environment setting. Possible values include: 'NotApplicable', 'Completed'
ConfigurationState ConfigurationState `json:"configurationState,omitempty"`
// Description - Describes the environment and its resource settings
Description *string `json:"description,omitempty"`
// Title - Brief title describing the environment and its resource settings
Title *string `json:"title,omitempty"`
// ResourceSettings - The resource specific settings
ResourceSettings *ResourceSettingsFragment `json:"resourceSettings,omitempty"`
// ProvisioningState - The provisioning status of the resource.
ProvisioningState *string `json:"provisioningState,omitempty"`
// UniqueIdentifier - The unique immutable identifier of a resource (Guid).
UniqueIdentifier *string `json:"uniqueIdentifier,omitempty"`
}
// EnvironmentSettingsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type EnvironmentSettingsCreateOrUpdateFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *EnvironmentSettingsCreateOrUpdateFuture) Result(client EnvironmentSettingsClient) (es EnvironmentSetting, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "labservices.EnvironmentSettingsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("labservices.EnvironmentSettingsCreateOrUpdateFuture")
return
}
sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...))
if es.Response.Response, err = future.GetResult(sender); err == nil && es.Response.Response.StatusCode != http.StatusNoContent {
es, err = client.CreateOrUpdateResponder(es.Response.Response)
if err != nil {
err = autorest.NewErrorWithError(err, "labservices.EnvironmentSettingsCreateOrUpdateFuture", "Result", es.Response.Response, "Failure responding to request")
}
}
return
}
// EnvironmentSettingsDeleteFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type EnvironmentSettingsDeleteFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *EnvironmentSettingsDeleteFuture) Result(client EnvironmentSettingsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "labservices.EnvironmentSettingsDeleteFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("labservices.EnvironmentSettingsDeleteFuture")
return
}
ar.Response = future.Response()
return
}
// EnvironmentSettingsStartFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type EnvironmentSettingsStartFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *EnvironmentSettingsStartFuture) Result(client EnvironmentSettingsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "labservices.EnvironmentSettingsStartFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("labservices.EnvironmentSettingsStartFuture")
return
}
ar.Response = future.Response()
return
}
// EnvironmentSettingsStopFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type EnvironmentSettingsStopFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *EnvironmentSettingsStopFuture) Result(client EnvironmentSettingsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "labservices.EnvironmentSettingsStopFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("labservices.EnvironmentSettingsStopFuture")
return
}
ar.Response = future.Response()
return
}
// EnvironmentSize represents a size category supported by this Lab Account (small, medium or large)
type EnvironmentSize struct {
// Name - The size category. Possible values include: 'Basic', 'Standard', 'Performance'
Name ManagedLabVMSize `json:"name,omitempty"`
// VMSizes - Represents a set of compute sizes that can serve this given size type
VMSizes *[]SizeInfo `json:"vmSizes,omitempty"`
// MaxPrice - READ-ONLY; The pay-as-you-go dollar price per hour this size will cost. It does not include discounts and may not reflect the actual price the size will cost. This is the maximum price of all prices within this tier.
MaxPrice *decimal.Decimal `json:"maxPrice,omitempty"`
// MinNumberOfCores - READ-ONLY; The number of cores a VM of this size has. This is the minimum number of cores within this tier.
MinNumberOfCores *int32 `json:"minNumberOfCores,omitempty"`
// MinMemory - READ-ONLY; The amount of memory available (in GB). This is the minimum amount of memory within this tier.
MinMemory *float64 `json:"minMemory,omitempty"`
}
// EnvironmentSizeFragment represents a size category supported by this Lab Account (small, medium or
// large)
type EnvironmentSizeFragment struct {
// Name - The size category. Possible values include: 'Basic', 'Standard', 'Performance'
Name ManagedLabVMSize `json:"name,omitempty"`
// VMSizes - Represents a set of compute sizes that can serve this given size type
VMSizes *[]SizeInfoFragment `json:"vmSizes,omitempty"`
}
// EnvironmentsResetPasswordFuture an abstraction for monitoring and retrieving the results of a
// long-running operation.
type EnvironmentsResetPasswordFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *EnvironmentsResetPasswordFuture) Result(client EnvironmentsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "labservices.EnvironmentsResetPasswordFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("labservices.EnvironmentsResetPasswordFuture")
return
}
ar.Response = future.Response()
return
}
// EnvironmentsStartFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type EnvironmentsStartFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *EnvironmentsStartFuture) Result(client EnvironmentsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "labservices.EnvironmentsStartFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("labservices.EnvironmentsStartFuture")
return
}
ar.Response = future.Response()
return
}
// EnvironmentsStopFuture an abstraction for monitoring and retrieving the results of a long-running
// operation.
type EnvironmentsStopFuture struct {
azure.Future
}
// Result returns the result of the asynchronous operation.
// If the operation has not completed it will return an error.
func (future *EnvironmentsStopFuture) Result(client EnvironmentsClient) (ar autorest.Response, err error) {
var done bool
done, err = future.DoneWithContext(context.Background(), client)
if err != nil {
err = autorest.NewErrorWithError(err, "labservices.EnvironmentsStopFuture", "Result", future.Response(), "Polling failure")
return
}
if !done {
err = azure.NewAsyncOpIncompleteError("labservices.EnvironmentsStopFuture")
return
}
ar.Response = future.Response()
return
}
// GalleryImage represents an image from the Azure Marketplace
type GalleryImage struct {
autorest.Response `json:"-"`
// GalleryImageProperties - The gallery image properties
*GalleryImageProperties `json:"properties,omitempty"`
// ID - READ-ONLY; The identifier of the resource.
ID *string `json:"id,omitempty"`
// Name - READ-ONLY; The name of the resource.
Name *string `json:"name,omitempty"`
// Type - READ-ONLY; The type of the resource.
Type *string `json:"type,omitempty"`
// Location - The location of the resource.
Location *string `json:"location,omitempty"`
// Tags - The tags of the resource.
Tags map[string]*string `json:"tags"`
}
// MarshalJSON is the custom marshaler for GalleryImage.
func (gi GalleryImage) MarshalJSON() ([]byte, error) {
objectMap := make(map[string]interface{})
if gi.GalleryImageProperties != nil {
objectMap["properties"] = gi.GalleryImageProperties
}
if gi.Location != nil {
objectMap["location"] = gi.Location
}
if gi.Tags != nil {
objectMap["tags"] = gi.Tags
}
return json.Marshal(objectMap)
}
// UnmarshalJSON is the custom unmarshaler for GalleryImage struct.
func (gi *GalleryImage) UnmarshalJSON(body []byte) error {
var m map[string]*json.RawMessage
err := json.Unmarshal(body, &m)
if err != nil {
return err
}
for k, v := range m {
switch k {
case "properties":
if v != nil {
var galleryImageProperties GalleryImageProperties
err = json.Unmarshal(*v, &galleryImageProperties)
if err != nil {
return err
}
gi.GalleryImageProperties = &galleryImageProperties
}
case "id":
if v != nil {
var ID string
err = json.Unmarshal(*v, &ID)
if err != nil {
return err
}
gi.ID = &ID
}
case "name":
if v != nil {
var name string
err = json.Unmarshal(*v, &name)
if err != nil {
return err
}
gi.Name = &name
}
case "type":
if v != nil {
var typeVar string
err = json.Unmarshal(*v, &typeVar)
if err != nil {
return err
}
gi.Type = &typeVar
}
case "location":
if v != nil {
var location string
err = json.Unmarshal(*v, &location)
if err != nil {
return err
}
gi.Location = &location
}
case "tags":
if v != nil {
var tags map[string]*string
err = json.Unmarshal(*v, &tags)
if err != nil {
return err
}
gi.Tags = tags
}
}
}