/
disk_types_gen.go
742 lines (629 loc) · 32.1 KB
/
disk_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
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package storage
import (
v20201201s "github.com/Azure/azure-service-operator/v2/api/compute/v1api20201201/storage"
v20220702s "github.com/Azure/azure-service-operator/v2/api/compute/v1api20220702/storage"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime/conditions"
"github.com/pkg/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// +kubebuilder:rbac:groups=compute.azure.com,resources=disks,verbs=get;list;watch;create;update;patch;delete
// +kubebuilder:rbac:groups=compute.azure.com,resources={disks/status,disks/finalizers},verbs=get;update;patch
// +kubebuilder:object:root=true
// +kubebuilder:subresource:status
// +kubebuilder:storageversion
// +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 v1api20200930.Disk
// Generator information:
// - Generated from: /compute/resource-manager/Microsoft.Compute/DiskRP/stable/2020-09-30/disk.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}
type Disk struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec Disk_Spec `json:"spec,omitempty"`
Status Disk_STATUS `json:"status,omitempty"`
}
var _ conditions.Conditioner = &Disk{}
// GetConditions returns the conditions of the resource
func (disk *Disk) GetConditions() conditions.Conditions {
return disk.Status.Conditions
}
// SetConditions sets the conditions on the resource status
func (disk *Disk) SetConditions(conditions conditions.Conditions) {
disk.Status.Conditions = conditions
}
var _ genruntime.KubernetesResource = &Disk{}
// AzureName returns the Azure name of the resource
func (disk *Disk) AzureName() string {
return disk.Spec.AzureName
}
// GetAPIVersion returns the ARM API version of the resource. This is always "2020-09-30"
func (disk Disk) GetAPIVersion() string {
return string(APIVersion_Value)
}
// GetResourceScope returns the scope of the resource
func (disk *Disk) GetResourceScope() genruntime.ResourceScope {
return genruntime.ResourceScopeResourceGroup
}
// GetSpec returns the specification of this resource
func (disk *Disk) GetSpec() genruntime.ConvertibleSpec {
return &disk.Spec
}
// GetStatus returns the status of this resource
func (disk *Disk) GetStatus() genruntime.ConvertibleStatus {
return &disk.Status
}
// GetSupportedOperations returns the operations supported by the resource
func (disk *Disk) GetSupportedOperations() []genruntime.ResourceOperation {
return []genruntime.ResourceOperation{
genruntime.ResourceOperationDelete,
genruntime.ResourceOperationGet,
genruntime.ResourceOperationPut,
}
}
// GetType returns the ARM Type of the resource. This is always "Microsoft.Compute/disks"
func (disk *Disk) GetType() string {
return "Microsoft.Compute/disks"
}
// NewEmptyStatus returns a new empty (blank) status
func (disk *Disk) NewEmptyStatus() genruntime.ConvertibleStatus {
return &Disk_STATUS{}
}
// Owner returns the ResourceReference of the owner
func (disk *Disk) Owner() *genruntime.ResourceReference {
group, kind := genruntime.LookupOwnerGroupKind(disk.Spec)
return disk.Spec.Owner.AsResourceReference(group, kind)
}
// SetStatus sets the status of this resource
func (disk *Disk) SetStatus(status genruntime.ConvertibleStatus) error {
// If we have exactly the right type of status, assign it
if st, ok := status.(*Disk_STATUS); ok {
disk.Status = *st
return nil
}
// Convert status to required version
var st Disk_STATUS
err := status.ConvertStatusTo(&st)
if err != nil {
return errors.Wrap(err, "failed to convert status")
}
disk.Status = st
return nil
}
// Hub marks that this Disk is the hub type for conversion
func (disk *Disk) Hub() {}
// OriginalGVK returns a GroupValueKind for the original API version used to create the resource
func (disk *Disk) OriginalGVK() *schema.GroupVersionKind {
return &schema.GroupVersionKind{
Group: GroupVersion.Group,
Version: disk.Spec.OriginalVersion,
Kind: "Disk",
}
}
// +kubebuilder:object:root=true
// Storage version of v1api20200930.Disk
// Generator information:
// - Generated from: /compute/resource-manager/Microsoft.Compute/DiskRP/stable/2020-09-30/disk.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/disks/{diskName}
type DiskList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []Disk `json:"items"`
}
// Storage version of v1api20200930.APIVersion
// +kubebuilder:validation:Enum={"2020-09-30"}
type APIVersion string
const APIVersion_Value = APIVersion("2020-09-30")
// Storage version of v1api20200930.Disk_Spec
type Disk_Spec struct {
// 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"`
BurstingEnabled *bool `json:"burstingEnabled,omitempty"`
CreationData *CreationData `json:"creationData,omitempty"`
// DiskAccessReference: ARM id of the DiskAccess resource for using private endpoints on disks.
DiskAccessReference *genruntime.ResourceReference `armReference:"DiskAccessId" json:"diskAccessReference,omitempty"`
DiskIOPSReadOnly *int `json:"diskIOPSReadOnly,omitempty"`
DiskIOPSReadWrite *int `json:"diskIOPSReadWrite,omitempty"`
DiskMBpsReadOnly *int `json:"diskMBpsReadOnly,omitempty"`
DiskMBpsReadWrite *int `json:"diskMBpsReadWrite,omitempty"`
DiskSizeGB *int `json:"diskSizeGB,omitempty"`
Encryption *Encryption `json:"encryption,omitempty"`
EncryptionSettingsCollection *EncryptionSettingsCollection `json:"encryptionSettingsCollection,omitempty"`
ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"`
HyperVGeneration *string `json:"hyperVGeneration,omitempty"`
Location *string `json:"location,omitempty"`
MaxShares *int `json:"maxShares,omitempty"`
NetworkAccessPolicy *string `json:"networkAccessPolicy,omitempty"`
OriginalVersion string `json:"originalVersion,omitempty"`
OsType *string `json:"osType,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"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
PurchasePlan *PurchasePlan `json:"purchasePlan,omitempty"`
Sku *DiskSku `json:"sku,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
Tier *string `json:"tier,omitempty"`
Zones []string `json:"zones,omitempty"`
}
var _ genruntime.ConvertibleSpec = &Disk_Spec{}
// ConvertSpecFrom populates our Disk_Spec from the provided source
func (disk *Disk_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
if source == disk {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec")
}
return source.ConvertSpecTo(disk)
}
// ConvertSpecTo populates the provided destination from our Disk_Spec
func (disk *Disk_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
if destination == disk {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleSpec")
}
return destination.ConvertSpecFrom(disk)
}
// Storage version of v1api20200930.Disk_STATUS
// Disk resource.
type Disk_STATUS struct {
BurstingEnabled *bool `json:"burstingEnabled,omitempty"`
Conditions []conditions.Condition `json:"conditions,omitempty"`
CreationData *CreationData_STATUS `json:"creationData,omitempty"`
DiskAccessId *string `json:"diskAccessId,omitempty"`
DiskIOPSReadOnly *int `json:"diskIOPSReadOnly,omitempty"`
DiskIOPSReadWrite *int `json:"diskIOPSReadWrite,omitempty"`
DiskMBpsReadOnly *int `json:"diskMBpsReadOnly,omitempty"`
DiskMBpsReadWrite *int `json:"diskMBpsReadWrite,omitempty"`
DiskSizeBytes *int `json:"diskSizeBytes,omitempty"`
DiskSizeGB *int `json:"diskSizeGB,omitempty"`
DiskState *string `json:"diskState,omitempty"`
Encryption *Encryption_STATUS `json:"encryption,omitempty"`
EncryptionSettingsCollection *EncryptionSettingsCollection_STATUS `json:"encryptionSettingsCollection,omitempty"`
ExtendedLocation *ExtendedLocation_STATUS `json:"extendedLocation,omitempty"`
HyperVGeneration *string `json:"hyperVGeneration,omitempty"`
Id *string `json:"id,omitempty"`
Location *string `json:"location,omitempty"`
ManagedBy *string `json:"managedBy,omitempty"`
ManagedByExtended []string `json:"managedByExtended,omitempty"`
MaxShares *int `json:"maxShares,omitempty"`
Name *string `json:"name,omitempty"`
NetworkAccessPolicy *string `json:"networkAccessPolicy,omitempty"`
OsType *string `json:"osType,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
ProvisioningState *string `json:"provisioningState,omitempty"`
PurchasePlan *PurchasePlan_STATUS `json:"purchasePlan,omitempty"`
ShareInfo []ShareInfoElement_STATUS `json:"shareInfo,omitempty"`
Sku *DiskSku_STATUS `json:"sku,omitempty"`
Tags map[string]string `json:"tags,omitempty"`
Tier *string `json:"tier,omitempty"`
TimeCreated *string `json:"timeCreated,omitempty"`
Type *string `json:"type,omitempty"`
UniqueId *string `json:"uniqueId,omitempty"`
Zones []string `json:"zones,omitempty"`
}
var _ genruntime.ConvertibleStatus = &Disk_STATUS{}
// ConvertStatusFrom populates our Disk_STATUS from the provided source
func (disk *Disk_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
if source == disk {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus")
}
return source.ConvertStatusTo(disk)
}
// ConvertStatusTo populates the provided destination from our Disk_STATUS
func (disk *Disk_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
if destination == disk {
return errors.New("attempted conversion between unrelated implementations of github.com/Azure/azure-service-operator/v2/pkg/genruntime/ConvertibleStatus")
}
return destination.ConvertStatusFrom(disk)
}
// Storage version of v1api20200930.CreationData
// Data used when creating a disk.
type CreationData struct {
CreateOption *string `json:"createOption,omitempty"`
GalleryImageReference *ImageDiskReference `json:"galleryImageReference,omitempty"`
ImageReference *ImageDiskReference `json:"imageReference,omitempty"`
LogicalSectorSize *int `json:"logicalSectorSize,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
// SourceResourceReference: If createOption is Copy, this is the ARM id of the source snapshot or disk.
SourceResourceReference *genruntime.ResourceReference `armReference:"SourceResourceId" json:"sourceResourceReference,omitempty"`
SourceUri *string `json:"sourceUri,omitempty"`
StorageAccountId *string `json:"storageAccountId,omitempty"`
UploadSizeBytes *int `json:"uploadSizeBytes,omitempty"`
}
// Storage version of v1api20200930.CreationData_STATUS
// Data used when creating a disk.
type CreationData_STATUS struct {
CreateOption *string `json:"createOption,omitempty"`
GalleryImageReference *ImageDiskReference_STATUS `json:"galleryImageReference,omitempty"`
ImageReference *ImageDiskReference_STATUS `json:"imageReference,omitempty"`
LogicalSectorSize *int `json:"logicalSectorSize,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
SourceResourceId *string `json:"sourceResourceId,omitempty"`
SourceUniqueId *string `json:"sourceUniqueId,omitempty"`
SourceUri *string `json:"sourceUri,omitempty"`
StorageAccountId *string `json:"storageAccountId,omitempty"`
UploadSizeBytes *int `json:"uploadSizeBytes,omitempty"`
}
// Storage version of v1api20200930.DiskSku
// The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS.
type DiskSku struct {
Name *string `json:"name,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1api20200930.DiskSku_STATUS
// The disks sku name. Can be Standard_LRS, Premium_LRS, StandardSSD_LRS, or UltraSSD_LRS.
type DiskSku_STATUS struct {
Name *string `json:"name,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Tier *string `json:"tier,omitempty"`
}
// Storage version of v1api20200930.Encryption
// Encryption at rest settings for disk or snapshot
type Encryption struct {
// DiskEncryptionSetReference: ResourceId of the disk encryption set to use for enabling encryption at rest.
DiskEncryptionSetReference *genruntime.ResourceReference `armReference:"DiskEncryptionSetId" json:"diskEncryptionSetReference,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Type *string `json:"type,omitempty"`
}
// Storage version of v1api20200930.Encryption_STATUS
// Encryption at rest settings for disk or snapshot
type Encryption_STATUS struct {
DiskEncryptionSetId *string `json:"diskEncryptionSetId,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Type *string `json:"type,omitempty"`
}
// Storage version of v1api20200930.EncryptionSettingsCollection
// Encryption settings for disk or snapshot
type EncryptionSettingsCollection struct {
Enabled *bool `json:"enabled,omitempty"`
EncryptionSettings []EncryptionSettingsElement `json:"encryptionSettings,omitempty"`
EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1api20200930.EncryptionSettingsCollection_STATUS
// Encryption settings for disk or snapshot
type EncryptionSettingsCollection_STATUS struct {
Enabled *bool `json:"enabled,omitempty"`
EncryptionSettings []EncryptionSettingsElement_STATUS `json:"encryptionSettings,omitempty"`
EncryptionSettingsVersion *string `json:"encryptionSettingsVersion,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1api20200930.ExtendedLocation
// The complex type of the extended location.
type ExtendedLocation struct {
Name *string `json:"name,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Type *string `json:"type,omitempty"`
}
// AssignProperties_From_ExtendedLocation populates our ExtendedLocation from the provided source ExtendedLocation
func (location *ExtendedLocation) AssignProperties_From_ExtendedLocation(source *v20201201s.ExtendedLocation) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// Name
location.Name = genruntime.ClonePointerToString(source.Name)
// Type
location.Type = genruntime.ClonePointerToString(source.Type)
// Update the property bag
if len(propertyBag) > 0 {
location.PropertyBag = propertyBag
} else {
location.PropertyBag = nil
}
// Invoke the augmentConversionForExtendedLocation interface (if implemented) to customize the conversion
var locationAsAny any = location
if augmentedLocation, ok := locationAsAny.(augmentConversionForExtendedLocation); ok {
err := augmentedLocation.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_ExtendedLocation populates the provided destination ExtendedLocation from our ExtendedLocation
func (location *ExtendedLocation) AssignProperties_To_ExtendedLocation(destination *v20201201s.ExtendedLocation) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(location.PropertyBag)
// Name
destination.Name = genruntime.ClonePointerToString(location.Name)
// Type
destination.Type = genruntime.ClonePointerToString(location.Type)
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// Invoke the augmentConversionForExtendedLocation interface (if implemented) to customize the conversion
var locationAsAny any = location
if augmentedLocation, ok := locationAsAny.(augmentConversionForExtendedLocation); ok {
err := augmentedLocation.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
// Storage version of v1api20200930.ExtendedLocation_STATUS
// The complex type of the extended location.
type ExtendedLocation_STATUS struct {
Name *string `json:"name,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Type *string `json:"type,omitempty"`
}
// AssignProperties_From_ExtendedLocation_STATUS populates our ExtendedLocation_STATUS from the provided source ExtendedLocation_STATUS
func (location *ExtendedLocation_STATUS) AssignProperties_From_ExtendedLocation_STATUS(source *v20201201s.ExtendedLocation_STATUS) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// Name
location.Name = genruntime.ClonePointerToString(source.Name)
// Type
location.Type = genruntime.ClonePointerToString(source.Type)
// Update the property bag
if len(propertyBag) > 0 {
location.PropertyBag = propertyBag
} else {
location.PropertyBag = nil
}
// Invoke the augmentConversionForExtendedLocation_STATUS interface (if implemented) to customize the conversion
var locationAsAny any = location
if augmentedLocation, ok := locationAsAny.(augmentConversionForExtendedLocation_STATUS); ok {
err := augmentedLocation.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_ExtendedLocation_STATUS populates the provided destination ExtendedLocation_STATUS from our ExtendedLocation_STATUS
func (location *ExtendedLocation_STATUS) AssignProperties_To_ExtendedLocation_STATUS(destination *v20201201s.ExtendedLocation_STATUS) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(location.PropertyBag)
// Name
destination.Name = genruntime.ClonePointerToString(location.Name)
// Type
destination.Type = genruntime.ClonePointerToString(location.Type)
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// Invoke the augmentConversionForExtendedLocation_STATUS interface (if implemented) to customize the conversion
var locationAsAny any = location
if augmentedLocation, ok := locationAsAny.(augmentConversionForExtendedLocation_STATUS); ok {
err := augmentedLocation.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
// Storage version of v1api20200930.PurchasePlan
// Used for establishing the purchase context of any 3rd Party artifact through MarketPlace.
type PurchasePlan struct {
Name *string `json:"name,omitempty"`
Product *string `json:"product,omitempty"`
PromotionCode *string `json:"promotionCode,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Publisher *string `json:"publisher,omitempty"`
}
// Storage version of v1api20200930.PurchasePlan_STATUS
// Used for establishing the purchase context of any 3rd Party artifact through MarketPlace.
type PurchasePlan_STATUS struct {
Name *string `json:"name,omitempty"`
Product *string `json:"product,omitempty"`
PromotionCode *string `json:"promotionCode,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Publisher *string `json:"publisher,omitempty"`
}
// Storage version of v1api20200930.ShareInfoElement_STATUS
type ShareInfoElement_STATUS struct {
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
VmUri *string `json:"vmUri,omitempty"`
}
type augmentConversionForExtendedLocation interface {
AssignPropertiesFrom(src *v20201201s.ExtendedLocation) error
AssignPropertiesTo(dst *v20201201s.ExtendedLocation) error
}
type augmentConversionForExtendedLocation_STATUS interface {
AssignPropertiesFrom(src *v20201201s.ExtendedLocation_STATUS) error
AssignPropertiesTo(dst *v20201201s.ExtendedLocation_STATUS) error
}
// Storage version of v1api20200930.EncryptionSettingsElement
// Encryption settings for one disk volume.
type EncryptionSettingsElement struct {
DiskEncryptionKey *KeyVaultAndSecretReference `json:"diskEncryptionKey,omitempty"`
KeyEncryptionKey *KeyVaultAndKeyReference `json:"keyEncryptionKey,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1api20200930.EncryptionSettingsElement_STATUS
// Encryption settings for one disk volume.
type EncryptionSettingsElement_STATUS struct {
DiskEncryptionKey *KeyVaultAndSecretReference_STATUS `json:"diskEncryptionKey,omitempty"`
KeyEncryptionKey *KeyVaultAndKeyReference_STATUS `json:"keyEncryptionKey,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1api20200930.ImageDiskReference
// The source image used for creating the disk.
type ImageDiskReference struct {
Lun *int `json:"lun,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
// +kubebuilder:validation:Required
// Reference: A relative uri containing either a Platform Image Repository or user image reference.
Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"`
}
// Storage version of v1api20200930.ImageDiskReference_STATUS
// The source image used for creating the disk.
type ImageDiskReference_STATUS struct {
Id *string `json:"id,omitempty"`
Lun *int `json:"lun,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// Storage version of v1api20200930.KeyVaultAndKeyReference
// Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to unwrap the encryptionKey
type KeyVaultAndKeyReference struct {
KeyUrl *string `json:"keyUrl,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
SourceVault *SourceVault `json:"sourceVault,omitempty"`
}
// Storage version of v1api20200930.KeyVaultAndKeyReference_STATUS
// Key Vault Key Url and vault id of KeK, KeK is optional and when provided is used to unwrap the encryptionKey
type KeyVaultAndKeyReference_STATUS struct {
KeyUrl *string `json:"keyUrl,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
SourceVault *SourceVault_STATUS `json:"sourceVault,omitempty"`
}
// Storage version of v1api20200930.KeyVaultAndSecretReference
// Key Vault Secret Url and vault id of the encryption key
type KeyVaultAndSecretReference struct {
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
SecretUrl *string `json:"secretUrl,omitempty"`
SourceVault *SourceVault `json:"sourceVault,omitempty"`
}
// Storage version of v1api20200930.KeyVaultAndSecretReference_STATUS
// Key Vault Secret Url and vault id of the encryption key
type KeyVaultAndSecretReference_STATUS struct {
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
SecretUrl *string `json:"secretUrl,omitempty"`
SourceVault *SourceVault_STATUS `json:"sourceVault,omitempty"`
}
// Storage version of v1api20200930.SourceVault
// The vault id is an Azure Resource Manager Resource id in the form
// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}
type SourceVault struct {
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
// Reference: Resource Id
Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"`
}
// AssignProperties_From_SourceVault populates our SourceVault from the provided source SourceVault
func (vault *SourceVault) AssignProperties_From_SourceVault(source *v20220702s.SourceVault) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// Reference
if source.Reference != nil {
reference := source.Reference.Copy()
vault.Reference = &reference
} else {
vault.Reference = nil
}
// Update the property bag
if len(propertyBag) > 0 {
vault.PropertyBag = propertyBag
} else {
vault.PropertyBag = nil
}
// Invoke the augmentConversionForSourceVault interface (if implemented) to customize the conversion
var vaultAsAny any = vault
if augmentedVault, ok := vaultAsAny.(augmentConversionForSourceVault); ok {
err := augmentedVault.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_SourceVault populates the provided destination SourceVault from our SourceVault
func (vault *SourceVault) AssignProperties_To_SourceVault(destination *v20220702s.SourceVault) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(vault.PropertyBag)
// Reference
if vault.Reference != nil {
reference := vault.Reference.Copy()
destination.Reference = &reference
} else {
destination.Reference = nil
}
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// Invoke the augmentConversionForSourceVault interface (if implemented) to customize the conversion
var vaultAsAny any = vault
if augmentedVault, ok := vaultAsAny.(augmentConversionForSourceVault); ok {
err := augmentedVault.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
// Storage version of v1api20200930.SourceVault_STATUS
// The vault id is an Azure Resource Manager Resource id in the form
// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.KeyVault/vaults/{vaultName}
type SourceVault_STATUS struct {
Id *string `json:"id,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// AssignProperties_From_SourceVault_STATUS populates our SourceVault_STATUS from the provided source SourceVault_STATUS
func (vault *SourceVault_STATUS) AssignProperties_From_SourceVault_STATUS(source *v20220702s.SourceVault_STATUS) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// Id
vault.Id = genruntime.ClonePointerToString(source.Id)
// Update the property bag
if len(propertyBag) > 0 {
vault.PropertyBag = propertyBag
} else {
vault.PropertyBag = nil
}
// Invoke the augmentConversionForSourceVault_STATUS interface (if implemented) to customize the conversion
var vaultAsAny any = vault
if augmentedVault, ok := vaultAsAny.(augmentConversionForSourceVault_STATUS); ok {
err := augmentedVault.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_SourceVault_STATUS populates the provided destination SourceVault_STATUS from our SourceVault_STATUS
func (vault *SourceVault_STATUS) AssignProperties_To_SourceVault_STATUS(destination *v20220702s.SourceVault_STATUS) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(vault.PropertyBag)
// Id
destination.Id = genruntime.ClonePointerToString(vault.Id)
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// Invoke the augmentConversionForSourceVault_STATUS interface (if implemented) to customize the conversion
var vaultAsAny any = vault
if augmentedVault, ok := vaultAsAny.(augmentConversionForSourceVault_STATUS); ok {
err := augmentedVault.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
type augmentConversionForSourceVault interface {
AssignPropertiesFrom(src *v20220702s.SourceVault) error
AssignPropertiesTo(dst *v20220702s.SourceVault) error
}
type augmentConversionForSourceVault_STATUS interface {
AssignPropertiesFrom(src *v20220702s.SourceVault_STATUS) error
AssignPropertiesTo(dst *v20220702s.SourceVault_STATUS) error
}
func init() {
SchemeBuilder.Register(&Disk{}, &DiskList{})
}