/
virtual_machine_scale_set_types_gen.go
8089 lines (6975 loc) · 334 KB
/
virtual_machine_scale_set_types_gen.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
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1alpha1api20201201storage
import (
alpha20210701s "github.com/Azure/azure-service-operator/v2/api/compute/v1alpha1api20210701storage"
v20200930s "github.com/Azure/azure-service-operator/v2/api/compute/v1beta20200930storage"
v20201201s "github.com/Azure/azure-service-operator/v2/api/compute/v1beta20201201storage"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions"
"github.com/pkg/errors"
"k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/controller-runtime/pkg/conversion"
)
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Ready",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].status"
// +kubebuilder:printcolumn:name="Severity",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].severity"
// +kubebuilder:printcolumn:name="Reason",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].reason"
// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[?(@.type=='Ready')].message"
// Storage version of v1alpha1api20201201.VirtualMachineScaleSet
// Deprecated version of VirtualMachineScaleSet. Use v1beta20201201.VirtualMachineScaleSet instead
type VirtualMachineScaleSet struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec VirtualMachineScaleSet_Spec `json:"spec,omitempty"`
Status VirtualMachineScaleSet_STATUS `json:"status,omitempty"`
}
var _ conditions.Conditioner = &VirtualMachineScaleSet{}
// GetConditions returns the conditions of the resource
func (scaleSet *VirtualMachineScaleSet) GetConditions() conditions.Conditions {
return scaleSet.Status.Conditions
}
// SetConditions sets the conditions on the resource status
func (scaleSet *VirtualMachineScaleSet) SetConditions(conditions conditions.Conditions) {
scaleSet.Status.Conditions = conditions
}
var _ conversion.Convertible = &VirtualMachineScaleSet{}
// ConvertFrom populates our VirtualMachineScaleSet from the provided hub VirtualMachineScaleSet
func (scaleSet *VirtualMachineScaleSet) ConvertFrom(hub conversion.Hub) error {
// intermediate variable for conversion
var source v20201201s.VirtualMachineScaleSet
err := source.ConvertFrom(hub)
if err != nil {
return errors.Wrap(err, "converting from hub to source")
}
err = scaleSet.AssignProperties_From_VirtualMachineScaleSet(&source)
if err != nil {
return errors.Wrap(err, "converting from source to scaleSet")
}
return nil
}
// ConvertTo populates the provided hub VirtualMachineScaleSet from our VirtualMachineScaleSet
func (scaleSet *VirtualMachineScaleSet) ConvertTo(hub conversion.Hub) error {
// intermediate variable for conversion
var destination v20201201s.VirtualMachineScaleSet
err := scaleSet.AssignProperties_To_VirtualMachineScaleSet(&destination)
if err != nil {
return errors.Wrap(err, "converting to destination from scaleSet")
}
err = destination.ConvertTo(hub)
if err != nil {
return errors.Wrap(err, "converting from destination to hub")
}
return nil
}
var _ genruntime.KubernetesResource = &VirtualMachineScaleSet{}
// AzureName returns the Azure name of the resource
func (scaleSet *VirtualMachineScaleSet) AzureName() string {
return scaleSet.Spec.AzureName
}
// GetAPIVersion returns the ARM API version of the resource. This is always "2020-12-01"
func (scaleSet VirtualMachineScaleSet) GetAPIVersion() string {
return string(APIVersion_Value)
}
// GetResourceScope returns the scope of the resource
func (scaleSet *VirtualMachineScaleSet) GetResourceScope() genruntime.ResourceScope {
return genruntime.ResourceScopeResourceGroup
}
// GetSpec returns the specification of this resource
func (scaleSet *VirtualMachineScaleSet) GetSpec() genruntime.ConvertibleSpec {
return &scaleSet.Spec
}
// GetStatus returns the status of this resource
func (scaleSet *VirtualMachineScaleSet) GetStatus() genruntime.ConvertibleStatus {
return &scaleSet.Status
}
// GetType returns the ARM Type of the resource. This is always "Microsoft.Compute/virtualMachineScaleSets"
func (scaleSet *VirtualMachineScaleSet) GetType() string {
return "Microsoft.Compute/virtualMachineScaleSets"
}
// NewEmptyStatus returns a new empty (blank) status
func (scaleSet *VirtualMachineScaleSet) NewEmptyStatus() genruntime.ConvertibleStatus {
return &VirtualMachineScaleSet_STATUS{}
}
// Owner returns the ResourceReference of the owner
func (scaleSet *VirtualMachineScaleSet) Owner() *genruntime.ResourceReference {
group, kind := genruntime.LookupOwnerGroupKind(scaleSet.Spec)
return &genruntime.ResourceReference{
Group: group,
Kind: kind,
Name: scaleSet.Spec.Owner.Name,
}
}
// SetStatus sets the status of this resource
func (scaleSet *VirtualMachineScaleSet) SetStatus(status genruntime.ConvertibleStatus) error {
// If we have exactly the right type of status, assign it
if st, ok := status.(*VirtualMachineScaleSet_STATUS); ok {
scaleSet.Status = *st
return nil
}
// Convert status to required version
var st VirtualMachineScaleSet_STATUS
err := status.ConvertStatusTo(&st)
if err != nil {
return errors.Wrap(err, "failed to convert status")
}
scaleSet.Status = st
return nil
}
// AssignProperties_From_VirtualMachineScaleSet populates our VirtualMachineScaleSet from the provided source VirtualMachineScaleSet
func (scaleSet *VirtualMachineScaleSet) AssignProperties_From_VirtualMachineScaleSet(source *v20201201s.VirtualMachineScaleSet) error {
// ObjectMeta
scaleSet.ObjectMeta = *source.ObjectMeta.DeepCopy()
// Spec
var spec VirtualMachineScaleSet_Spec
err := spec.AssignProperties_From_VirtualMachineScaleSet_Spec(&source.Spec)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_VirtualMachineScaleSet_Spec() to populate field Spec")
}
scaleSet.Spec = spec
// Status
var status VirtualMachineScaleSet_STATUS
err = status.AssignProperties_From_VirtualMachineScaleSet_STATUS(&source.Status)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_VirtualMachineScaleSet_STATUS() to populate field Status")
}
scaleSet.Status = status
// Invoke the augmentConversionForVirtualMachineScaleSet interface (if implemented) to customize the conversion
var scaleSetAsAny any = scaleSet
if augmentedScaleSet, ok := scaleSetAsAny.(augmentConversionForVirtualMachineScaleSet); ok {
err := augmentedScaleSet.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_VirtualMachineScaleSet populates the provided destination VirtualMachineScaleSet from our VirtualMachineScaleSet
func (scaleSet *VirtualMachineScaleSet) AssignProperties_To_VirtualMachineScaleSet(destination *v20201201s.VirtualMachineScaleSet) error {
// ObjectMeta
destination.ObjectMeta = *scaleSet.ObjectMeta.DeepCopy()
// Spec
var spec v20201201s.VirtualMachineScaleSet_Spec
err := scaleSet.Spec.AssignProperties_To_VirtualMachineScaleSet_Spec(&spec)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_VirtualMachineScaleSet_Spec() to populate field Spec")
}
destination.Spec = spec
// Status
var status v20201201s.VirtualMachineScaleSet_STATUS
err = scaleSet.Status.AssignProperties_To_VirtualMachineScaleSet_STATUS(&status)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_VirtualMachineScaleSet_STATUS() to populate field Status")
}
destination.Status = status
// Invoke the augmentConversionForVirtualMachineScaleSet interface (if implemented) to customize the conversion
var scaleSetAsAny any = scaleSet
if augmentedScaleSet, ok := scaleSetAsAny.(augmentConversionForVirtualMachineScaleSet); ok {
err := augmentedScaleSet.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
// OriginalGVK returns a GroupValueKind for the original API version used to create the resource
func (scaleSet *VirtualMachineScaleSet) OriginalGVK() *schema.GroupVersionKind {
return &schema.GroupVersionKind{
Group: GroupVersion.Group,
Version: scaleSet.Spec.OriginalVersion,
Kind: "VirtualMachineScaleSet",
}
}
// +kubebuilder:object:root=true
// Storage version of v1alpha1api20201201.VirtualMachineScaleSet
// Deprecated version of VirtualMachineScaleSet. Use v1beta20201201.VirtualMachineScaleSet instead
type VirtualMachineScaleSetList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []VirtualMachineScaleSet `json:"items"`
}
type augmentConversionForVirtualMachineScaleSet interface {
AssignPropertiesFrom(src *v20201201s.VirtualMachineScaleSet) error
AssignPropertiesTo(dst *v20201201s.VirtualMachineScaleSet) error
}
// Storage version of v1alpha1api20201201.VirtualMachineScaleSet_Spec
type VirtualMachineScaleSet_Spec struct {
AdditionalCapabilities *AdditionalCapabilities `json:"additionalCapabilities,omitempty"`
AutomaticRepairsPolicy *AutomaticRepairsPolicy `json:"automaticRepairsPolicy,omitempty"`
// AzureName: The name of the resource in Azure. This is often the same as the name of the resource in Kubernetes but it
// doesn't have to be.
AzureName string `json:"azureName,omitempty"`
DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"`
ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"`
HostGroup *SubResource `json:"hostGroup,omitempty"`
Identity *VirtualMachineScaleSetIdentity `json:"identity,omitempty"`
Location *string `json:"location,omitempty"`
OrchestrationMode *string `json:"orchestrationMode,omitempty"`
OriginalVersion string `json:"originalVersion,omitempty"`
Overprovision *bool `json:"overprovision,omitempty"`
// +kubebuilder:validation:Required
// Owner: The owner of the resource. The owner controls where the resource goes when it is deployed. The owner also
// controls the resources lifecycle. When the owner is deleted the resource will also be deleted. Owner is expected to be a
// reference to a resources.azure.com/ResourceGroup resource
Owner *genruntime.KnownResourceReference `group:"resources.azure.com" json:"owner,omitempty" kind:"ResourceGroup"`
Plan *Plan `json:"plan,omitempty"`
PlatformFaultDomainCount *int `json:"platformFaultDomainCount,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
ProximityPlacementGroup *SubResource `json:"proximityPlacementGroup,omitempty"`
ScaleInPolicy *ScaleInPolicy `json:"scaleInPolicy,omitempty"`
SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"`
Sku *Sku `json:"sku,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
UpgradePolicy *UpgradePolicy `json:"upgradePolicy,omitempty"`
VirtualMachineProfile *VirtualMachineScaleSetVMProfile `json:"virtualMachineProfile,omitempty"`
ZoneBalance *bool `json:"zoneBalance,omitempty"`
Zones []string `json:"zones,omitempty"`
}
var _ genruntime.ConvertibleSpec = &VirtualMachineScaleSet_Spec{}
// ConvertSpecFrom populates our VirtualMachineScaleSet_Spec from the provided source
func (scaleSet *VirtualMachineScaleSet_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
src, ok := source.(*v20201201s.VirtualMachineScaleSet_Spec)
if ok {
// Populate our instance from source
return scaleSet.AssignProperties_From_VirtualMachineScaleSet_Spec(src)
}
// Convert to an intermediate form
src = &v20201201s.VirtualMachineScaleSet_Spec{}
err := src.ConvertSpecFrom(source)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()")
}
// Update our instance from src
err = scaleSet.AssignProperties_From_VirtualMachineScaleSet_Spec(src)
if err != nil {
return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()")
}
return nil
}
// ConvertSpecTo populates the provided destination from our VirtualMachineScaleSet_Spec
func (scaleSet *VirtualMachineScaleSet_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
dst, ok := destination.(*v20201201s.VirtualMachineScaleSet_Spec)
if ok {
// Populate destination from our instance
return scaleSet.AssignProperties_To_VirtualMachineScaleSet_Spec(dst)
}
// Convert to an intermediate form
dst = &v20201201s.VirtualMachineScaleSet_Spec{}
err := scaleSet.AssignProperties_To_VirtualMachineScaleSet_Spec(dst)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertSpecTo()")
}
// Update dst from our instance
err = dst.ConvertSpecTo(destination)
if err != nil {
return errors.Wrap(err, "final step of conversion in ConvertSpecTo()")
}
return nil
}
// AssignProperties_From_VirtualMachineScaleSet_Spec populates our VirtualMachineScaleSet_Spec from the provided source VirtualMachineScaleSet_Spec
func (scaleSet *VirtualMachineScaleSet_Spec) AssignProperties_From_VirtualMachineScaleSet_Spec(source *v20201201s.VirtualMachineScaleSet_Spec) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// AdditionalCapabilities
if source.AdditionalCapabilities != nil {
var additionalCapability AdditionalCapabilities
err := additionalCapability.AssignProperties_From_AdditionalCapabilities(source.AdditionalCapabilities)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_AdditionalCapabilities() to populate field AdditionalCapabilities")
}
scaleSet.AdditionalCapabilities = &additionalCapability
} else {
scaleSet.AdditionalCapabilities = nil
}
// AutomaticRepairsPolicy
if source.AutomaticRepairsPolicy != nil {
var automaticRepairsPolicy AutomaticRepairsPolicy
err := automaticRepairsPolicy.AssignProperties_From_AutomaticRepairsPolicy(source.AutomaticRepairsPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_AutomaticRepairsPolicy() to populate field AutomaticRepairsPolicy")
}
scaleSet.AutomaticRepairsPolicy = &automaticRepairsPolicy
} else {
scaleSet.AutomaticRepairsPolicy = nil
}
// AzureName
scaleSet.AzureName = source.AzureName
// DoNotRunExtensionsOnOverprovisionedVMs
if source.DoNotRunExtensionsOnOverprovisionedVMs != nil {
doNotRunExtensionsOnOverprovisionedVM := *source.DoNotRunExtensionsOnOverprovisionedVMs
scaleSet.DoNotRunExtensionsOnOverprovisionedVMs = &doNotRunExtensionsOnOverprovisionedVM
} else {
scaleSet.DoNotRunExtensionsOnOverprovisionedVMs = nil
}
// ExtendedLocation
if source.ExtendedLocation != nil {
var extendedLocationStash v20200930s.ExtendedLocation
err := extendedLocationStash.AssignProperties_From_ExtendedLocation(source.ExtendedLocation)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_ExtendedLocation() to populate field ExtendedLocationStash from ExtendedLocation")
}
var extendedLocationStashLocal alpha20210701s.ExtendedLocation
err = extendedLocationStashLocal.AssignProperties_From_ExtendedLocation(&extendedLocationStash)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_ExtendedLocation() to populate field ExtendedLocationStash")
}
var extendedLocation ExtendedLocation
err = extendedLocation.AssignProperties_From_ExtendedLocation(&extendedLocationStashLocal)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_ExtendedLocation() to populate field ExtendedLocation from ExtendedLocationStash")
}
scaleSet.ExtendedLocation = &extendedLocation
} else {
scaleSet.ExtendedLocation = nil
}
// HostGroup
if source.HostGroup != nil {
var subResourceStash alpha20210701s.SubResource
err := subResourceStash.AssignProperties_From_SubResource(source.HostGroup)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_SubResource() to populate field SubResourceStash from HostGroup")
}
var hostGroup SubResource
err = hostGroup.AssignProperties_From_SubResource(&subResourceStash)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_SubResource() to populate field HostGroup from SubResourceStash")
}
scaleSet.HostGroup = &hostGroup
} else {
scaleSet.HostGroup = nil
}
// Identity
if source.Identity != nil {
var identity VirtualMachineScaleSetIdentity
err := identity.AssignProperties_From_VirtualMachineScaleSetIdentity(source.Identity)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_VirtualMachineScaleSetIdentity() to populate field Identity")
}
scaleSet.Identity = &identity
} else {
scaleSet.Identity = nil
}
// Location
scaleSet.Location = genruntime.ClonePointerToString(source.Location)
// OrchestrationMode
scaleSet.OrchestrationMode = genruntime.ClonePointerToString(source.OrchestrationMode)
// OriginalVersion
scaleSet.OriginalVersion = source.OriginalVersion
// Overprovision
if source.Overprovision != nil {
overprovision := *source.Overprovision
scaleSet.Overprovision = &overprovision
} else {
scaleSet.Overprovision = nil
}
// Owner
if source.Owner != nil {
owner := source.Owner.Copy()
scaleSet.Owner = &owner
} else {
scaleSet.Owner = nil
}
// Plan
if source.Plan != nil {
var plan Plan
err := plan.AssignProperties_From_Plan(source.Plan)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_Plan() to populate field Plan")
}
scaleSet.Plan = &plan
} else {
scaleSet.Plan = nil
}
// PlatformFaultDomainCount
scaleSet.PlatformFaultDomainCount = genruntime.ClonePointerToInt(source.PlatformFaultDomainCount)
// ProximityPlacementGroup
if source.ProximityPlacementGroup != nil {
var subResourceStash alpha20210701s.SubResource
err := subResourceStash.AssignProperties_From_SubResource(source.ProximityPlacementGroup)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_SubResource() to populate field SubResourceStash from ProximityPlacementGroup")
}
var proximityPlacementGroup SubResource
err = proximityPlacementGroup.AssignProperties_From_SubResource(&subResourceStash)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_SubResource() to populate field ProximityPlacementGroup from SubResourceStash")
}
scaleSet.ProximityPlacementGroup = &proximityPlacementGroup
} else {
scaleSet.ProximityPlacementGroup = nil
}
// ScaleInPolicy
if source.ScaleInPolicy != nil {
var scaleInPolicy ScaleInPolicy
err := scaleInPolicy.AssignProperties_From_ScaleInPolicy(source.ScaleInPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_ScaleInPolicy() to populate field ScaleInPolicy")
}
scaleSet.ScaleInPolicy = &scaleInPolicy
} else {
scaleSet.ScaleInPolicy = nil
}
// SinglePlacementGroup
if source.SinglePlacementGroup != nil {
singlePlacementGroup := *source.SinglePlacementGroup
scaleSet.SinglePlacementGroup = &singlePlacementGroup
} else {
scaleSet.SinglePlacementGroup = nil
}
// Sku
if source.Sku != nil {
var sku Sku
err := sku.AssignProperties_From_Sku(source.Sku)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_Sku() to populate field Sku")
}
scaleSet.Sku = &sku
} else {
scaleSet.Sku = nil
}
// Tags
scaleSet.Tags = genruntime.CloneMapOfStringToString(source.Tags)
// UpgradePolicy
if source.UpgradePolicy != nil {
var upgradePolicy UpgradePolicy
err := upgradePolicy.AssignProperties_From_UpgradePolicy(source.UpgradePolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_UpgradePolicy() to populate field UpgradePolicy")
}
scaleSet.UpgradePolicy = &upgradePolicy
} else {
scaleSet.UpgradePolicy = nil
}
// VirtualMachineProfile
if source.VirtualMachineProfile != nil {
var virtualMachineProfile VirtualMachineScaleSetVMProfile
err := virtualMachineProfile.AssignProperties_From_VirtualMachineScaleSetVMProfile(source.VirtualMachineProfile)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_VirtualMachineScaleSetVMProfile() to populate field VirtualMachineProfile")
}
scaleSet.VirtualMachineProfile = &virtualMachineProfile
} else {
scaleSet.VirtualMachineProfile = nil
}
// ZoneBalance
if source.ZoneBalance != nil {
zoneBalance := *source.ZoneBalance
scaleSet.ZoneBalance = &zoneBalance
} else {
scaleSet.ZoneBalance = nil
}
// Zones
scaleSet.Zones = genruntime.CloneSliceOfString(source.Zones)
// Update the property bag
if len(propertyBag) > 0 {
scaleSet.PropertyBag = propertyBag
} else {
scaleSet.PropertyBag = nil
}
// Invoke the augmentConversionForVirtualMachineScaleSet_Spec interface (if implemented) to customize the conversion
var scaleSetAsAny any = scaleSet
if augmentedScaleSet, ok := scaleSetAsAny.(augmentConversionForVirtualMachineScaleSet_Spec); ok {
err := augmentedScaleSet.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_VirtualMachineScaleSet_Spec populates the provided destination VirtualMachineScaleSet_Spec from our VirtualMachineScaleSet_Spec
func (scaleSet *VirtualMachineScaleSet_Spec) AssignProperties_To_VirtualMachineScaleSet_Spec(destination *v20201201s.VirtualMachineScaleSet_Spec) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(scaleSet.PropertyBag)
// AdditionalCapabilities
if scaleSet.AdditionalCapabilities != nil {
var additionalCapability v20201201s.AdditionalCapabilities
err := scaleSet.AdditionalCapabilities.AssignProperties_To_AdditionalCapabilities(&additionalCapability)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_AdditionalCapabilities() to populate field AdditionalCapabilities")
}
destination.AdditionalCapabilities = &additionalCapability
} else {
destination.AdditionalCapabilities = nil
}
// AutomaticRepairsPolicy
if scaleSet.AutomaticRepairsPolicy != nil {
var automaticRepairsPolicy v20201201s.AutomaticRepairsPolicy
err := scaleSet.AutomaticRepairsPolicy.AssignProperties_To_AutomaticRepairsPolicy(&automaticRepairsPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_AutomaticRepairsPolicy() to populate field AutomaticRepairsPolicy")
}
destination.AutomaticRepairsPolicy = &automaticRepairsPolicy
} else {
destination.AutomaticRepairsPolicy = nil
}
// AzureName
destination.AzureName = scaleSet.AzureName
// DoNotRunExtensionsOnOverprovisionedVMs
if scaleSet.DoNotRunExtensionsOnOverprovisionedVMs != nil {
doNotRunExtensionsOnOverprovisionedVM := *scaleSet.DoNotRunExtensionsOnOverprovisionedVMs
destination.DoNotRunExtensionsOnOverprovisionedVMs = &doNotRunExtensionsOnOverprovisionedVM
} else {
destination.DoNotRunExtensionsOnOverprovisionedVMs = nil
}
// ExtendedLocation
if scaleSet.ExtendedLocation != nil {
var extendedLocationStash alpha20210701s.ExtendedLocation
err := scaleSet.ExtendedLocation.AssignProperties_To_ExtendedLocation(&extendedLocationStash)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_ExtendedLocation() to populate field ExtendedLocationStash from ExtendedLocation")
}
var extendedLocationStashLocal v20200930s.ExtendedLocation
err = extendedLocationStash.AssignProperties_To_ExtendedLocation(&extendedLocationStashLocal)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_ExtendedLocation() to populate field ExtendedLocationStash")
}
var extendedLocation v20201201s.ExtendedLocation
err = extendedLocationStashLocal.AssignProperties_To_ExtendedLocation(&extendedLocation)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_ExtendedLocation() to populate field ExtendedLocation from ExtendedLocationStash")
}
destination.ExtendedLocation = &extendedLocation
} else {
destination.ExtendedLocation = nil
}
// HostGroup
if scaleSet.HostGroup != nil {
var subResourceStash alpha20210701s.SubResource
err := scaleSet.HostGroup.AssignProperties_To_SubResource(&subResourceStash)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_SubResource() to populate field SubResourceStash from HostGroup")
}
var hostGroup v20201201s.SubResource
err = subResourceStash.AssignProperties_To_SubResource(&hostGroup)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_SubResource() to populate field HostGroup from SubResourceStash")
}
destination.HostGroup = &hostGroup
} else {
destination.HostGroup = nil
}
// Identity
if scaleSet.Identity != nil {
var identity v20201201s.VirtualMachineScaleSetIdentity
err := scaleSet.Identity.AssignProperties_To_VirtualMachineScaleSetIdentity(&identity)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_VirtualMachineScaleSetIdentity() to populate field Identity")
}
destination.Identity = &identity
} else {
destination.Identity = nil
}
// Location
destination.Location = genruntime.ClonePointerToString(scaleSet.Location)
// OrchestrationMode
destination.OrchestrationMode = genruntime.ClonePointerToString(scaleSet.OrchestrationMode)
// OriginalVersion
destination.OriginalVersion = scaleSet.OriginalVersion
// Overprovision
if scaleSet.Overprovision != nil {
overprovision := *scaleSet.Overprovision
destination.Overprovision = &overprovision
} else {
destination.Overprovision = nil
}
// Owner
if scaleSet.Owner != nil {
owner := scaleSet.Owner.Copy()
destination.Owner = &owner
} else {
destination.Owner = nil
}
// Plan
if scaleSet.Plan != nil {
var plan v20201201s.Plan
err := scaleSet.Plan.AssignProperties_To_Plan(&plan)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_Plan() to populate field Plan")
}
destination.Plan = &plan
} else {
destination.Plan = nil
}
// PlatformFaultDomainCount
destination.PlatformFaultDomainCount = genruntime.ClonePointerToInt(scaleSet.PlatformFaultDomainCount)
// ProximityPlacementGroup
if scaleSet.ProximityPlacementGroup != nil {
var subResourceStash alpha20210701s.SubResource
err := scaleSet.ProximityPlacementGroup.AssignProperties_To_SubResource(&subResourceStash)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_SubResource() to populate field SubResourceStash from ProximityPlacementGroup")
}
var proximityPlacementGroup v20201201s.SubResource
err = subResourceStash.AssignProperties_To_SubResource(&proximityPlacementGroup)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_SubResource() to populate field ProximityPlacementGroup from SubResourceStash")
}
destination.ProximityPlacementGroup = &proximityPlacementGroup
} else {
destination.ProximityPlacementGroup = nil
}
// ScaleInPolicy
if scaleSet.ScaleInPolicy != nil {
var scaleInPolicy v20201201s.ScaleInPolicy
err := scaleSet.ScaleInPolicy.AssignProperties_To_ScaleInPolicy(&scaleInPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_ScaleInPolicy() to populate field ScaleInPolicy")
}
destination.ScaleInPolicy = &scaleInPolicy
} else {
destination.ScaleInPolicy = nil
}
// SinglePlacementGroup
if scaleSet.SinglePlacementGroup != nil {
singlePlacementGroup := *scaleSet.SinglePlacementGroup
destination.SinglePlacementGroup = &singlePlacementGroup
} else {
destination.SinglePlacementGroup = nil
}
// Sku
if scaleSet.Sku != nil {
var sku v20201201s.Sku
err := scaleSet.Sku.AssignProperties_To_Sku(&sku)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_Sku() to populate field Sku")
}
destination.Sku = &sku
} else {
destination.Sku = nil
}
// Tags
destination.Tags = genruntime.CloneMapOfStringToString(scaleSet.Tags)
// UpgradePolicy
if scaleSet.UpgradePolicy != nil {
var upgradePolicy v20201201s.UpgradePolicy
err := scaleSet.UpgradePolicy.AssignProperties_To_UpgradePolicy(&upgradePolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_UpgradePolicy() to populate field UpgradePolicy")
}
destination.UpgradePolicy = &upgradePolicy
} else {
destination.UpgradePolicy = nil
}
// VirtualMachineProfile
if scaleSet.VirtualMachineProfile != nil {
var virtualMachineProfile v20201201s.VirtualMachineScaleSetVMProfile
err := scaleSet.VirtualMachineProfile.AssignProperties_To_VirtualMachineScaleSetVMProfile(&virtualMachineProfile)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_VirtualMachineScaleSetVMProfile() to populate field VirtualMachineProfile")
}
destination.VirtualMachineProfile = &virtualMachineProfile
} else {
destination.VirtualMachineProfile = nil
}
// ZoneBalance
if scaleSet.ZoneBalance != nil {
zoneBalance := *scaleSet.ZoneBalance
destination.ZoneBalance = &zoneBalance
} else {
destination.ZoneBalance = nil
}
// Zones
destination.Zones = genruntime.CloneSliceOfString(scaleSet.Zones)
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// Invoke the augmentConversionForVirtualMachineScaleSet_Spec interface (if implemented) to customize the conversion
var scaleSetAsAny any = scaleSet
if augmentedScaleSet, ok := scaleSetAsAny.(augmentConversionForVirtualMachineScaleSet_Spec); ok {
err := augmentedScaleSet.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
// Storage version of v1alpha1api20201201.VirtualMachineScaleSet_STATUS
// Deprecated version of VirtualMachineScaleSet_STATUS. Use v1beta20201201.VirtualMachineScaleSet_STATUS instead
type VirtualMachineScaleSet_STATUS struct {
AdditionalCapabilities *AdditionalCapabilities_STATUS `json:"additionalCapabilities,omitempty"`
AutomaticRepairsPolicy *AutomaticRepairsPolicy_STATUS `json:"automaticRepairsPolicy,omitempty"`
Conditions []conditions.Condition `json:"conditions,omitempty"`
DoNotRunExtensionsOnOverprovisionedVMs *bool `json:"doNotRunExtensionsOnOverprovisionedVMs,omitempty"`
ExtendedLocation *ExtendedLocation_STATUS `json:"extendedLocation,omitempty"`
HostGroup *SubResource_STATUS `json:"hostGroup,omitempty"`
Id *string `json:"id,omitempty"`
Identity *VirtualMachineScaleSetIdentity_STATUS `json:"identity,omitempty"`
Location *string `json:"location,omitempty"`
Name *string `json:"name,omitempty"`
OrchestrationMode *string `json:"orchestrationMode,omitempty"`
Overprovision *bool `json:"overprovision,omitempty"`
Plan *Plan_STATUS `json:"plan,omitempty"`
PlatformFaultDomainCount *int `json:"platformFaultDomainCount,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
ProximityPlacementGroup *SubResource_STATUS `json:"proximityPlacementGroup,omitempty"`
ScaleInPolicy *ScaleInPolicy_STATUS `json:"scaleInPolicy,omitempty"`
SinglePlacementGroup *bool `json:"singlePlacementGroup,omitempty"`
Sku *Sku_STATUS `json:"sku,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
Type *string `json:"type,omitempty"`
UniqueId *string `json:"uniqueId,omitempty"`
UpgradePolicy *UpgradePolicy_STATUS `json:"upgradePolicy,omitempty"`
VirtualMachineProfile *VirtualMachineScaleSetVMProfile_STATUS `json:"virtualMachineProfile,omitempty"`
ZoneBalance *bool `json:"zoneBalance,omitempty"`
Zones []string `json:"zones,omitempty"`
}
var _ genruntime.ConvertibleStatus = &VirtualMachineScaleSet_STATUS{}
// ConvertStatusFrom populates our VirtualMachineScaleSet_STATUS from the provided source
func (scaleSet *VirtualMachineScaleSet_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
src, ok := source.(*v20201201s.VirtualMachineScaleSet_STATUS)
if ok {
// Populate our instance from source
return scaleSet.AssignProperties_From_VirtualMachineScaleSet_STATUS(src)
}
// Convert to an intermediate form
src = &v20201201s.VirtualMachineScaleSet_STATUS{}
err := src.ConvertStatusFrom(source)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()")
}
// Update our instance from src
err = scaleSet.AssignProperties_From_VirtualMachineScaleSet_STATUS(src)
if err != nil {
return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()")
}
return nil
}
// ConvertStatusTo populates the provided destination from our VirtualMachineScaleSet_STATUS
func (scaleSet *VirtualMachineScaleSet_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
dst, ok := destination.(*v20201201s.VirtualMachineScaleSet_STATUS)
if ok {
// Populate destination from our instance
return scaleSet.AssignProperties_To_VirtualMachineScaleSet_STATUS(dst)
}
// Convert to an intermediate form
dst = &v20201201s.VirtualMachineScaleSet_STATUS{}
err := scaleSet.AssignProperties_To_VirtualMachineScaleSet_STATUS(dst)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertStatusTo()")
}
// Update dst from our instance
err = dst.ConvertStatusTo(destination)
if err != nil {
return errors.Wrap(err, "final step of conversion in ConvertStatusTo()")
}
return nil
}
// AssignProperties_From_VirtualMachineScaleSet_STATUS populates our VirtualMachineScaleSet_STATUS from the provided source VirtualMachineScaleSet_STATUS
func (scaleSet *VirtualMachineScaleSet_STATUS) AssignProperties_From_VirtualMachineScaleSet_STATUS(source *v20201201s.VirtualMachineScaleSet_STATUS) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// AdditionalCapabilities
if source.AdditionalCapabilities != nil {
var additionalCapability AdditionalCapabilities_STATUS
err := additionalCapability.AssignProperties_From_AdditionalCapabilities_STATUS(source.AdditionalCapabilities)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_AdditionalCapabilities_STATUS() to populate field AdditionalCapabilities")
}
scaleSet.AdditionalCapabilities = &additionalCapability
} else {
scaleSet.AdditionalCapabilities = nil
}
// AutomaticRepairsPolicy
if source.AutomaticRepairsPolicy != nil {
var automaticRepairsPolicy AutomaticRepairsPolicy_STATUS
err := automaticRepairsPolicy.AssignProperties_From_AutomaticRepairsPolicy_STATUS(source.AutomaticRepairsPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_AutomaticRepairsPolicy_STATUS() to populate field AutomaticRepairsPolicy")
}
scaleSet.AutomaticRepairsPolicy = &automaticRepairsPolicy
} else {
scaleSet.AutomaticRepairsPolicy = nil
}
// Conditions
scaleSet.Conditions = genruntime.CloneSliceOfCondition(source.Conditions)
// DoNotRunExtensionsOnOverprovisionedVMs
if source.DoNotRunExtensionsOnOverprovisionedVMs != nil {
doNotRunExtensionsOnOverprovisionedVM := *source.DoNotRunExtensionsOnOverprovisionedVMs
scaleSet.DoNotRunExtensionsOnOverprovisionedVMs = &doNotRunExtensionsOnOverprovisionedVM
} else {
scaleSet.DoNotRunExtensionsOnOverprovisionedVMs = nil
}
// ExtendedLocation
if source.ExtendedLocation != nil {
var extendedLocationSTATUSStash v20200930s.ExtendedLocation_STATUS
err := extendedLocationSTATUSStash.AssignProperties_From_ExtendedLocation_STATUS(source.ExtendedLocation)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_ExtendedLocation_STATUS() to populate field ExtendedLocation_STATUSStash from ExtendedLocation")
}
var extendedLocationSTATUSStashLocal alpha20210701s.ExtendedLocation_STATUS
err = extendedLocationSTATUSStashLocal.AssignProperties_From_ExtendedLocation_STATUS(&extendedLocationSTATUSStash)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_ExtendedLocation_STATUS() to populate field ExtendedLocation_STATUSStash")
}
var extendedLocation ExtendedLocation_STATUS
err = extendedLocation.AssignProperties_From_ExtendedLocation_STATUS(&extendedLocationSTATUSStashLocal)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_ExtendedLocation_STATUS() to populate field ExtendedLocation from ExtendedLocation_STATUSStash")
}
scaleSet.ExtendedLocation = &extendedLocation
} else {
scaleSet.ExtendedLocation = nil
}
// HostGroup
if source.HostGroup != nil {
var subResourceSTATUSStash alpha20210701s.SubResource_STATUS
err := subResourceSTATUSStash.AssignProperties_From_SubResource_STATUS(source.HostGroup)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_SubResource_STATUS() to populate field SubResource_STATUSStash from HostGroup")
}
var hostGroup SubResource_STATUS
err = hostGroup.AssignProperties_From_SubResource_STATUS(&subResourceSTATUSStash)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_SubResource_STATUS() to populate field HostGroup from SubResource_STATUSStash")
}
scaleSet.HostGroup = &hostGroup
} else {
scaleSet.HostGroup = nil
}
// Id
scaleSet.Id = genruntime.ClonePointerToString(source.Id)
// Identity
if source.Identity != nil {
var identity VirtualMachineScaleSetIdentity_STATUS
err := identity.AssignProperties_From_VirtualMachineScaleSetIdentity_STATUS(source.Identity)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_VirtualMachineScaleSetIdentity_STATUS() to populate field Identity")
}
scaleSet.Identity = &identity
} else {
scaleSet.Identity = nil
}
// Location
scaleSet.Location = genruntime.ClonePointerToString(source.Location)
// Name
scaleSet.Name = genruntime.ClonePointerToString(source.Name)
// OrchestrationMode
scaleSet.OrchestrationMode = genruntime.ClonePointerToString(source.OrchestrationMode)
// Overprovision
if source.Overprovision != nil {
overprovision := *source.Overprovision
scaleSet.Overprovision = &overprovision
} else {
scaleSet.Overprovision = nil
}
// Plan
if source.Plan != nil {
var plan Plan_STATUS
err := plan.AssignProperties_From_Plan_STATUS(source.Plan)
if err != nil {