/
storage_accounts_blob_service_types_gen.go
2022 lines (1707 loc) · 73.3 KB
/
storage_accounts_blob_service_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 v1alpha1api20210401storage
import (
"fmt"
v20210401s "github.com/Azure/azure-service-operator/v2/api/storage/v1beta20210401storage"
"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"
"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 v1alpha1api20210401.StorageAccountsBlobService
// Deprecated version of StorageAccountsBlobService. Use v1beta20210401.StorageAccountsBlobService instead
type StorageAccountsBlobService struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec StorageAccounts_BlobService_Spec `json:"spec,omitempty"`
Status StorageAccounts_BlobService_STATUS `json:"status,omitempty"`
}
var _ conditions.Conditioner = &StorageAccountsBlobService{}
// GetConditions returns the conditions of the resource
func (service *StorageAccountsBlobService) GetConditions() conditions.Conditions {
return service.Status.Conditions
}
// SetConditions sets the conditions on the resource status
func (service *StorageAccountsBlobService) SetConditions(conditions conditions.Conditions) {
service.Status.Conditions = conditions
}
var _ conversion.Convertible = &StorageAccountsBlobService{}
// ConvertFrom populates our StorageAccountsBlobService from the provided hub StorageAccountsBlobService
func (service *StorageAccountsBlobService) ConvertFrom(hub conversion.Hub) error {
source, ok := hub.(*v20210401s.StorageAccountsBlobService)
if !ok {
return fmt.Errorf("expected storage/v1beta20210401storage/StorageAccountsBlobService but received %T instead", hub)
}
return service.AssignProperties_From_StorageAccountsBlobService(source)
}
// ConvertTo populates the provided hub StorageAccountsBlobService from our StorageAccountsBlobService
func (service *StorageAccountsBlobService) ConvertTo(hub conversion.Hub) error {
destination, ok := hub.(*v20210401s.StorageAccountsBlobService)
if !ok {
return fmt.Errorf("expected storage/v1beta20210401storage/StorageAccountsBlobService but received %T instead", hub)
}
return service.AssignProperties_To_StorageAccountsBlobService(destination)
}
var _ genruntime.KubernetesResource = &StorageAccountsBlobService{}
// AzureName returns the Azure name of the resource (always "default")
func (service *StorageAccountsBlobService) AzureName() string {
return "default"
}
// GetAPIVersion returns the ARM API version of the resource. This is always "2021-04-01"
func (service StorageAccountsBlobService) GetAPIVersion() string {
return string(APIVersion_Value)
}
// GetResourceScope returns the scope of the resource
func (service *StorageAccountsBlobService) GetResourceScope() genruntime.ResourceScope {
return genruntime.ResourceScopeResourceGroup
}
// GetSpec returns the specification of this resource
func (service *StorageAccountsBlobService) GetSpec() genruntime.ConvertibleSpec {
return &service.Spec
}
// GetStatus returns the status of this resource
func (service *StorageAccountsBlobService) GetStatus() genruntime.ConvertibleStatus {
return &service.Status
}
// GetType returns the ARM Type of the resource. This is always "Microsoft.Storage/storageAccounts/blobServices"
func (service *StorageAccountsBlobService) GetType() string {
return "Microsoft.Storage/storageAccounts/blobServices"
}
// NewEmptyStatus returns a new empty (blank) status
func (service *StorageAccountsBlobService) NewEmptyStatus() genruntime.ConvertibleStatus {
return &StorageAccounts_BlobService_STATUS{}
}
// Owner returns the ResourceReference of the owner
func (service *StorageAccountsBlobService) Owner() *genruntime.ResourceReference {
group, kind := genruntime.LookupOwnerGroupKind(service.Spec)
return &genruntime.ResourceReference{
Group: group,
Kind: kind,
Name: service.Spec.Owner.Name,
}
}
// SetStatus sets the status of this resource
func (service *StorageAccountsBlobService) SetStatus(status genruntime.ConvertibleStatus) error {
// If we have exactly the right type of status, assign it
if st, ok := status.(*StorageAccounts_BlobService_STATUS); ok {
service.Status = *st
return nil
}
// Convert status to required version
var st StorageAccounts_BlobService_STATUS
err := status.ConvertStatusTo(&st)
if err != nil {
return errors.Wrap(err, "failed to convert status")
}
service.Status = st
return nil
}
// AssignProperties_From_StorageAccountsBlobService populates our StorageAccountsBlobService from the provided source StorageAccountsBlobService
func (service *StorageAccountsBlobService) AssignProperties_From_StorageAccountsBlobService(source *v20210401s.StorageAccountsBlobService) error {
// ObjectMeta
service.ObjectMeta = *source.ObjectMeta.DeepCopy()
// Spec
var spec StorageAccounts_BlobService_Spec
err := spec.AssignProperties_From_StorageAccounts_BlobService_Spec(&source.Spec)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_StorageAccounts_BlobService_Spec() to populate field Spec")
}
service.Spec = spec
// Status
var status StorageAccounts_BlobService_STATUS
err = status.AssignProperties_From_StorageAccounts_BlobService_STATUS(&source.Status)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_StorageAccounts_BlobService_STATUS() to populate field Status")
}
service.Status = status
// Invoke the augmentConversionForStorageAccountsBlobService interface (if implemented) to customize the conversion
var serviceAsAny any = service
if augmentedService, ok := serviceAsAny.(augmentConversionForStorageAccountsBlobService); ok {
err := augmentedService.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_StorageAccountsBlobService populates the provided destination StorageAccountsBlobService from our StorageAccountsBlobService
func (service *StorageAccountsBlobService) AssignProperties_To_StorageAccountsBlobService(destination *v20210401s.StorageAccountsBlobService) error {
// ObjectMeta
destination.ObjectMeta = *service.ObjectMeta.DeepCopy()
// Spec
var spec v20210401s.StorageAccounts_BlobService_Spec
err := service.Spec.AssignProperties_To_StorageAccounts_BlobService_Spec(&spec)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_StorageAccounts_BlobService_Spec() to populate field Spec")
}
destination.Spec = spec
// Status
var status v20210401s.StorageAccounts_BlobService_STATUS
err = service.Status.AssignProperties_To_StorageAccounts_BlobService_STATUS(&status)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_StorageAccounts_BlobService_STATUS() to populate field Status")
}
destination.Status = status
// Invoke the augmentConversionForStorageAccountsBlobService interface (if implemented) to customize the conversion
var serviceAsAny any = service
if augmentedService, ok := serviceAsAny.(augmentConversionForStorageAccountsBlobService); ok {
err := augmentedService.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 (service *StorageAccountsBlobService) OriginalGVK() *schema.GroupVersionKind {
return &schema.GroupVersionKind{
Group: GroupVersion.Group,
Version: service.Spec.OriginalVersion,
Kind: "StorageAccountsBlobService",
}
}
// +kubebuilder:object:root=true
// Storage version of v1alpha1api20210401.StorageAccountsBlobService
// Deprecated version of StorageAccountsBlobService. Use v1beta20210401.StorageAccountsBlobService instead
type StorageAccountsBlobServiceList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []StorageAccountsBlobService `json:"items"`
}
type augmentConversionForStorageAccountsBlobService interface {
AssignPropertiesFrom(src *v20210401s.StorageAccountsBlobService) error
AssignPropertiesTo(dst *v20210401s.StorageAccountsBlobService) error
}
// Storage version of v1alpha1api20210401.StorageAccounts_BlobService_Spec
type StorageAccounts_BlobService_Spec struct {
AutomaticSnapshotPolicyEnabled *bool `json:"automaticSnapshotPolicyEnabled,omitempty"`
ChangeFeed *ChangeFeed `json:"changeFeed,omitempty"`
ContainerDeleteRetentionPolicy *DeleteRetentionPolicy `json:"containerDeleteRetentionPolicy,omitempty"`
Cors *CorsRules `json:"cors,omitempty"`
DefaultServiceVersion *string `json:"defaultServiceVersion,omitempty"`
DeleteRetentionPolicy *DeleteRetentionPolicy `json:"deleteRetentionPolicy,omitempty"`
IsVersioningEnabled *bool `json:"isVersioningEnabled,omitempty"`
LastAccessTimeTrackingPolicy *LastAccessTimeTrackingPolicy `json:"lastAccessTimeTrackingPolicy,omitempty"`
OriginalVersion string `json:"originalVersion,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 storage.azure.com/StorageAccount resource
Owner *genruntime.KnownResourceReference `group:"storage.azure.com" json:"owner,omitempty" kind:"StorageAccount"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
RestorePolicy *RestorePolicyProperties `json:"restorePolicy,omitempty"`
}
var _ genruntime.ConvertibleSpec = &StorageAccounts_BlobService_Spec{}
// ConvertSpecFrom populates our StorageAccounts_BlobService_Spec from the provided source
func (service *StorageAccounts_BlobService_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
src, ok := source.(*v20210401s.StorageAccounts_BlobService_Spec)
if ok {
// Populate our instance from source
return service.AssignProperties_From_StorageAccounts_BlobService_Spec(src)
}
// Convert to an intermediate form
src = &v20210401s.StorageAccounts_BlobService_Spec{}
err := src.ConvertSpecFrom(source)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()")
}
// Update our instance from src
err = service.AssignProperties_From_StorageAccounts_BlobService_Spec(src)
if err != nil {
return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()")
}
return nil
}
// ConvertSpecTo populates the provided destination from our StorageAccounts_BlobService_Spec
func (service *StorageAccounts_BlobService_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
dst, ok := destination.(*v20210401s.StorageAccounts_BlobService_Spec)
if ok {
// Populate destination from our instance
return service.AssignProperties_To_StorageAccounts_BlobService_Spec(dst)
}
// Convert to an intermediate form
dst = &v20210401s.StorageAccounts_BlobService_Spec{}
err := service.AssignProperties_To_StorageAccounts_BlobService_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_StorageAccounts_BlobService_Spec populates our StorageAccounts_BlobService_Spec from the provided source StorageAccounts_BlobService_Spec
func (service *StorageAccounts_BlobService_Spec) AssignProperties_From_StorageAccounts_BlobService_Spec(source *v20210401s.StorageAccounts_BlobService_Spec) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// AutomaticSnapshotPolicyEnabled
if source.AutomaticSnapshotPolicyEnabled != nil {
automaticSnapshotPolicyEnabled := *source.AutomaticSnapshotPolicyEnabled
service.AutomaticSnapshotPolicyEnabled = &automaticSnapshotPolicyEnabled
} else {
service.AutomaticSnapshotPolicyEnabled = nil
}
// ChangeFeed
if source.ChangeFeed != nil {
var changeFeed ChangeFeed
err := changeFeed.AssignProperties_From_ChangeFeed(source.ChangeFeed)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_ChangeFeed() to populate field ChangeFeed")
}
service.ChangeFeed = &changeFeed
} else {
service.ChangeFeed = nil
}
// ContainerDeleteRetentionPolicy
if source.ContainerDeleteRetentionPolicy != nil {
var containerDeleteRetentionPolicy DeleteRetentionPolicy
err := containerDeleteRetentionPolicy.AssignProperties_From_DeleteRetentionPolicy(source.ContainerDeleteRetentionPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_DeleteRetentionPolicy() to populate field ContainerDeleteRetentionPolicy")
}
service.ContainerDeleteRetentionPolicy = &containerDeleteRetentionPolicy
} else {
service.ContainerDeleteRetentionPolicy = nil
}
// Cors
if source.Cors != nil {
var cor CorsRules
err := cor.AssignProperties_From_CorsRules(source.Cors)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_CorsRules() to populate field Cors")
}
service.Cors = &cor
} else {
service.Cors = nil
}
// DefaultServiceVersion
service.DefaultServiceVersion = genruntime.ClonePointerToString(source.DefaultServiceVersion)
// DeleteRetentionPolicy
if source.DeleteRetentionPolicy != nil {
var deleteRetentionPolicy DeleteRetentionPolicy
err := deleteRetentionPolicy.AssignProperties_From_DeleteRetentionPolicy(source.DeleteRetentionPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_DeleteRetentionPolicy() to populate field DeleteRetentionPolicy")
}
service.DeleteRetentionPolicy = &deleteRetentionPolicy
} else {
service.DeleteRetentionPolicy = nil
}
// IsVersioningEnabled
if source.IsVersioningEnabled != nil {
isVersioningEnabled := *source.IsVersioningEnabled
service.IsVersioningEnabled = &isVersioningEnabled
} else {
service.IsVersioningEnabled = nil
}
// LastAccessTimeTrackingPolicy
if source.LastAccessTimeTrackingPolicy != nil {
var lastAccessTimeTrackingPolicy LastAccessTimeTrackingPolicy
err := lastAccessTimeTrackingPolicy.AssignProperties_From_LastAccessTimeTrackingPolicy(source.LastAccessTimeTrackingPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_LastAccessTimeTrackingPolicy() to populate field LastAccessTimeTrackingPolicy")
}
service.LastAccessTimeTrackingPolicy = &lastAccessTimeTrackingPolicy
} else {
service.LastAccessTimeTrackingPolicy = nil
}
// OriginalVersion
service.OriginalVersion = source.OriginalVersion
// Owner
if source.Owner != nil {
owner := source.Owner.Copy()
service.Owner = &owner
} else {
service.Owner = nil
}
// RestorePolicy
if source.RestorePolicy != nil {
var restorePolicy RestorePolicyProperties
err := restorePolicy.AssignProperties_From_RestorePolicyProperties(source.RestorePolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_RestorePolicyProperties() to populate field RestorePolicy")
}
service.RestorePolicy = &restorePolicy
} else {
service.RestorePolicy = nil
}
// Update the property bag
if len(propertyBag) > 0 {
service.PropertyBag = propertyBag
} else {
service.PropertyBag = nil
}
// Invoke the augmentConversionForStorageAccounts_BlobService_Spec interface (if implemented) to customize the conversion
var serviceAsAny any = service
if augmentedService, ok := serviceAsAny.(augmentConversionForStorageAccounts_BlobService_Spec); ok {
err := augmentedService.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_StorageAccounts_BlobService_Spec populates the provided destination StorageAccounts_BlobService_Spec from our StorageAccounts_BlobService_Spec
func (service *StorageAccounts_BlobService_Spec) AssignProperties_To_StorageAccounts_BlobService_Spec(destination *v20210401s.StorageAccounts_BlobService_Spec) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(service.PropertyBag)
// AutomaticSnapshotPolicyEnabled
if service.AutomaticSnapshotPolicyEnabled != nil {
automaticSnapshotPolicyEnabled := *service.AutomaticSnapshotPolicyEnabled
destination.AutomaticSnapshotPolicyEnabled = &automaticSnapshotPolicyEnabled
} else {
destination.AutomaticSnapshotPolicyEnabled = nil
}
// ChangeFeed
if service.ChangeFeed != nil {
var changeFeed v20210401s.ChangeFeed
err := service.ChangeFeed.AssignProperties_To_ChangeFeed(&changeFeed)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_ChangeFeed() to populate field ChangeFeed")
}
destination.ChangeFeed = &changeFeed
} else {
destination.ChangeFeed = nil
}
// ContainerDeleteRetentionPolicy
if service.ContainerDeleteRetentionPolicy != nil {
var containerDeleteRetentionPolicy v20210401s.DeleteRetentionPolicy
err := service.ContainerDeleteRetentionPolicy.AssignProperties_To_DeleteRetentionPolicy(&containerDeleteRetentionPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_DeleteRetentionPolicy() to populate field ContainerDeleteRetentionPolicy")
}
destination.ContainerDeleteRetentionPolicy = &containerDeleteRetentionPolicy
} else {
destination.ContainerDeleteRetentionPolicy = nil
}
// Cors
if service.Cors != nil {
var cor v20210401s.CorsRules
err := service.Cors.AssignProperties_To_CorsRules(&cor)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_CorsRules() to populate field Cors")
}
destination.Cors = &cor
} else {
destination.Cors = nil
}
// DefaultServiceVersion
destination.DefaultServiceVersion = genruntime.ClonePointerToString(service.DefaultServiceVersion)
// DeleteRetentionPolicy
if service.DeleteRetentionPolicy != nil {
var deleteRetentionPolicy v20210401s.DeleteRetentionPolicy
err := service.DeleteRetentionPolicy.AssignProperties_To_DeleteRetentionPolicy(&deleteRetentionPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_DeleteRetentionPolicy() to populate field DeleteRetentionPolicy")
}
destination.DeleteRetentionPolicy = &deleteRetentionPolicy
} else {
destination.DeleteRetentionPolicy = nil
}
// IsVersioningEnabled
if service.IsVersioningEnabled != nil {
isVersioningEnabled := *service.IsVersioningEnabled
destination.IsVersioningEnabled = &isVersioningEnabled
} else {
destination.IsVersioningEnabled = nil
}
// LastAccessTimeTrackingPolicy
if service.LastAccessTimeTrackingPolicy != nil {
var lastAccessTimeTrackingPolicy v20210401s.LastAccessTimeTrackingPolicy
err := service.LastAccessTimeTrackingPolicy.AssignProperties_To_LastAccessTimeTrackingPolicy(&lastAccessTimeTrackingPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_LastAccessTimeTrackingPolicy() to populate field LastAccessTimeTrackingPolicy")
}
destination.LastAccessTimeTrackingPolicy = &lastAccessTimeTrackingPolicy
} else {
destination.LastAccessTimeTrackingPolicy = nil
}
// OriginalVersion
destination.OriginalVersion = service.OriginalVersion
// Owner
if service.Owner != nil {
owner := service.Owner.Copy()
destination.Owner = &owner
} else {
destination.Owner = nil
}
// RestorePolicy
if service.RestorePolicy != nil {
var restorePolicy v20210401s.RestorePolicyProperties
err := service.RestorePolicy.AssignProperties_To_RestorePolicyProperties(&restorePolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_RestorePolicyProperties() to populate field RestorePolicy")
}
destination.RestorePolicy = &restorePolicy
} else {
destination.RestorePolicy = nil
}
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// Invoke the augmentConversionForStorageAccounts_BlobService_Spec interface (if implemented) to customize the conversion
var serviceAsAny any = service
if augmentedService, ok := serviceAsAny.(augmentConversionForStorageAccounts_BlobService_Spec); ok {
err := augmentedService.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
// Storage version of v1alpha1api20210401.StorageAccounts_BlobService_STATUS
// Deprecated version of StorageAccounts_BlobService_STATUS. Use v1beta20210401.StorageAccounts_BlobService_STATUS instead
type StorageAccounts_BlobService_STATUS struct {
AutomaticSnapshotPolicyEnabled *bool `json:"automaticSnapshotPolicyEnabled,omitempty"`
ChangeFeed *ChangeFeed_STATUS `json:"changeFeed,omitempty"`
Conditions []conditions.Condition `json:"conditions,omitempty"`
ContainerDeleteRetentionPolicy *DeleteRetentionPolicy_STATUS `json:"containerDeleteRetentionPolicy,omitempty"`
Cors *CorsRules_STATUS `json:"cors,omitempty"`
DefaultServiceVersion *string `json:"defaultServiceVersion,omitempty"`
DeleteRetentionPolicy *DeleteRetentionPolicy_STATUS `json:"deleteRetentionPolicy,omitempty"`
Id *string `json:"id,omitempty"`
IsVersioningEnabled *bool `json:"isVersioningEnabled,omitempty"`
LastAccessTimeTrackingPolicy *LastAccessTimeTrackingPolicy_STATUS `json:"lastAccessTimeTrackingPolicy,omitempty"`
Name *string `json:"name,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
RestorePolicy *RestorePolicyProperties_STATUS `json:"restorePolicy,omitempty"`
Sku *Sku_STATUS `json:"sku,omitempty"`
Type *string `json:"type,omitempty"`
}
var _ genruntime.ConvertibleStatus = &StorageAccounts_BlobService_STATUS{}
// ConvertStatusFrom populates our StorageAccounts_BlobService_STATUS from the provided source
func (service *StorageAccounts_BlobService_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
src, ok := source.(*v20210401s.StorageAccounts_BlobService_STATUS)
if ok {
// Populate our instance from source
return service.AssignProperties_From_StorageAccounts_BlobService_STATUS(src)
}
// Convert to an intermediate form
src = &v20210401s.StorageAccounts_BlobService_STATUS{}
err := src.ConvertStatusFrom(source)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()")
}
// Update our instance from src
err = service.AssignProperties_From_StorageAccounts_BlobService_STATUS(src)
if err != nil {
return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()")
}
return nil
}
// ConvertStatusTo populates the provided destination from our StorageAccounts_BlobService_STATUS
func (service *StorageAccounts_BlobService_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
dst, ok := destination.(*v20210401s.StorageAccounts_BlobService_STATUS)
if ok {
// Populate destination from our instance
return service.AssignProperties_To_StorageAccounts_BlobService_STATUS(dst)
}
// Convert to an intermediate form
dst = &v20210401s.StorageAccounts_BlobService_STATUS{}
err := service.AssignProperties_To_StorageAccounts_BlobService_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_StorageAccounts_BlobService_STATUS populates our StorageAccounts_BlobService_STATUS from the provided source StorageAccounts_BlobService_STATUS
func (service *StorageAccounts_BlobService_STATUS) AssignProperties_From_StorageAccounts_BlobService_STATUS(source *v20210401s.StorageAccounts_BlobService_STATUS) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// AutomaticSnapshotPolicyEnabled
if source.AutomaticSnapshotPolicyEnabled != nil {
automaticSnapshotPolicyEnabled := *source.AutomaticSnapshotPolicyEnabled
service.AutomaticSnapshotPolicyEnabled = &automaticSnapshotPolicyEnabled
} else {
service.AutomaticSnapshotPolicyEnabled = nil
}
// ChangeFeed
if source.ChangeFeed != nil {
var changeFeed ChangeFeed_STATUS
err := changeFeed.AssignProperties_From_ChangeFeed_STATUS(source.ChangeFeed)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_ChangeFeed_STATUS() to populate field ChangeFeed")
}
service.ChangeFeed = &changeFeed
} else {
service.ChangeFeed = nil
}
// Conditions
service.Conditions = genruntime.CloneSliceOfCondition(source.Conditions)
// ContainerDeleteRetentionPolicy
if source.ContainerDeleteRetentionPolicy != nil {
var containerDeleteRetentionPolicy DeleteRetentionPolicy_STATUS
err := containerDeleteRetentionPolicy.AssignProperties_From_DeleteRetentionPolicy_STATUS(source.ContainerDeleteRetentionPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_DeleteRetentionPolicy_STATUS() to populate field ContainerDeleteRetentionPolicy")
}
service.ContainerDeleteRetentionPolicy = &containerDeleteRetentionPolicy
} else {
service.ContainerDeleteRetentionPolicy = nil
}
// Cors
if source.Cors != nil {
var cor CorsRules_STATUS
err := cor.AssignProperties_From_CorsRules_STATUS(source.Cors)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_CorsRules_STATUS() to populate field Cors")
}
service.Cors = &cor
} else {
service.Cors = nil
}
// DefaultServiceVersion
service.DefaultServiceVersion = genruntime.ClonePointerToString(source.DefaultServiceVersion)
// DeleteRetentionPolicy
if source.DeleteRetentionPolicy != nil {
var deleteRetentionPolicy DeleteRetentionPolicy_STATUS
err := deleteRetentionPolicy.AssignProperties_From_DeleteRetentionPolicy_STATUS(source.DeleteRetentionPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_DeleteRetentionPolicy_STATUS() to populate field DeleteRetentionPolicy")
}
service.DeleteRetentionPolicy = &deleteRetentionPolicy
} else {
service.DeleteRetentionPolicy = nil
}
// Id
service.Id = genruntime.ClonePointerToString(source.Id)
// IsVersioningEnabled
if source.IsVersioningEnabled != nil {
isVersioningEnabled := *source.IsVersioningEnabled
service.IsVersioningEnabled = &isVersioningEnabled
} else {
service.IsVersioningEnabled = nil
}
// LastAccessTimeTrackingPolicy
if source.LastAccessTimeTrackingPolicy != nil {
var lastAccessTimeTrackingPolicy LastAccessTimeTrackingPolicy_STATUS
err := lastAccessTimeTrackingPolicy.AssignProperties_From_LastAccessTimeTrackingPolicy_STATUS(source.LastAccessTimeTrackingPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_LastAccessTimeTrackingPolicy_STATUS() to populate field LastAccessTimeTrackingPolicy")
}
service.LastAccessTimeTrackingPolicy = &lastAccessTimeTrackingPolicy
} else {
service.LastAccessTimeTrackingPolicy = nil
}
// Name
service.Name = genruntime.ClonePointerToString(source.Name)
// RestorePolicy
if source.RestorePolicy != nil {
var restorePolicy RestorePolicyProperties_STATUS
err := restorePolicy.AssignProperties_From_RestorePolicyProperties_STATUS(source.RestorePolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_RestorePolicyProperties_STATUS() to populate field RestorePolicy")
}
service.RestorePolicy = &restorePolicy
} else {
service.RestorePolicy = nil
}
// Sku
if source.Sku != nil {
var sku Sku_STATUS
err := sku.AssignProperties_From_Sku_STATUS(source.Sku)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_Sku_STATUS() to populate field Sku")
}
service.Sku = &sku
} else {
service.Sku = nil
}
// Type
service.Type = genruntime.ClonePointerToString(source.Type)
// Update the property bag
if len(propertyBag) > 0 {
service.PropertyBag = propertyBag
} else {
service.PropertyBag = nil
}
// Invoke the augmentConversionForStorageAccounts_BlobService_STATUS interface (if implemented) to customize the conversion
var serviceAsAny any = service
if augmentedService, ok := serviceAsAny.(augmentConversionForStorageAccounts_BlobService_STATUS); ok {
err := augmentedService.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_StorageAccounts_BlobService_STATUS populates the provided destination StorageAccounts_BlobService_STATUS from our StorageAccounts_BlobService_STATUS
func (service *StorageAccounts_BlobService_STATUS) AssignProperties_To_StorageAccounts_BlobService_STATUS(destination *v20210401s.StorageAccounts_BlobService_STATUS) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(service.PropertyBag)
// AutomaticSnapshotPolicyEnabled
if service.AutomaticSnapshotPolicyEnabled != nil {
automaticSnapshotPolicyEnabled := *service.AutomaticSnapshotPolicyEnabled
destination.AutomaticSnapshotPolicyEnabled = &automaticSnapshotPolicyEnabled
} else {
destination.AutomaticSnapshotPolicyEnabled = nil
}
// ChangeFeed
if service.ChangeFeed != nil {
var changeFeed v20210401s.ChangeFeed_STATUS
err := service.ChangeFeed.AssignProperties_To_ChangeFeed_STATUS(&changeFeed)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_ChangeFeed_STATUS() to populate field ChangeFeed")
}
destination.ChangeFeed = &changeFeed
} else {
destination.ChangeFeed = nil
}
// Conditions
destination.Conditions = genruntime.CloneSliceOfCondition(service.Conditions)
// ContainerDeleteRetentionPolicy
if service.ContainerDeleteRetentionPolicy != nil {
var containerDeleteRetentionPolicy v20210401s.DeleteRetentionPolicy_STATUS
err := service.ContainerDeleteRetentionPolicy.AssignProperties_To_DeleteRetentionPolicy_STATUS(&containerDeleteRetentionPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_DeleteRetentionPolicy_STATUS() to populate field ContainerDeleteRetentionPolicy")
}
destination.ContainerDeleteRetentionPolicy = &containerDeleteRetentionPolicy
} else {
destination.ContainerDeleteRetentionPolicy = nil
}
// Cors
if service.Cors != nil {
var cor v20210401s.CorsRules_STATUS
err := service.Cors.AssignProperties_To_CorsRules_STATUS(&cor)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_CorsRules_STATUS() to populate field Cors")
}
destination.Cors = &cor
} else {
destination.Cors = nil
}
// DefaultServiceVersion
destination.DefaultServiceVersion = genruntime.ClonePointerToString(service.DefaultServiceVersion)
// DeleteRetentionPolicy
if service.DeleteRetentionPolicy != nil {
var deleteRetentionPolicy v20210401s.DeleteRetentionPolicy_STATUS
err := service.DeleteRetentionPolicy.AssignProperties_To_DeleteRetentionPolicy_STATUS(&deleteRetentionPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_DeleteRetentionPolicy_STATUS() to populate field DeleteRetentionPolicy")
}
destination.DeleteRetentionPolicy = &deleteRetentionPolicy
} else {
destination.DeleteRetentionPolicy = nil
}
// Id
destination.Id = genruntime.ClonePointerToString(service.Id)
// IsVersioningEnabled
if service.IsVersioningEnabled != nil {
isVersioningEnabled := *service.IsVersioningEnabled
destination.IsVersioningEnabled = &isVersioningEnabled
} else {
destination.IsVersioningEnabled = nil
}
// LastAccessTimeTrackingPolicy
if service.LastAccessTimeTrackingPolicy != nil {
var lastAccessTimeTrackingPolicy v20210401s.LastAccessTimeTrackingPolicy_STATUS
err := service.LastAccessTimeTrackingPolicy.AssignProperties_To_LastAccessTimeTrackingPolicy_STATUS(&lastAccessTimeTrackingPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_LastAccessTimeTrackingPolicy_STATUS() to populate field LastAccessTimeTrackingPolicy")
}
destination.LastAccessTimeTrackingPolicy = &lastAccessTimeTrackingPolicy
} else {
destination.LastAccessTimeTrackingPolicy = nil
}
// Name
destination.Name = genruntime.ClonePointerToString(service.Name)
// RestorePolicy
if service.RestorePolicy != nil {
var restorePolicy v20210401s.RestorePolicyProperties_STATUS
err := service.RestorePolicy.AssignProperties_To_RestorePolicyProperties_STATUS(&restorePolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_RestorePolicyProperties_STATUS() to populate field RestorePolicy")
}
destination.RestorePolicy = &restorePolicy
} else {
destination.RestorePolicy = nil
}
// Sku
if service.Sku != nil {
var sku v20210401s.Sku_STATUS
err := service.Sku.AssignProperties_To_Sku_STATUS(&sku)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_Sku_STATUS() to populate field Sku")
}
destination.Sku = &sku
} else {
destination.Sku = nil
}
// Type
destination.Type = genruntime.ClonePointerToString(service.Type)
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// Invoke the augmentConversionForStorageAccounts_BlobService_STATUS interface (if implemented) to customize the conversion
var serviceAsAny any = service
if augmentedService, ok := serviceAsAny.(augmentConversionForStorageAccounts_BlobService_STATUS); ok {
err := augmentedService.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
type augmentConversionForStorageAccounts_BlobService_Spec interface {
AssignPropertiesFrom(src *v20210401s.StorageAccounts_BlobService_Spec) error
AssignPropertiesTo(dst *v20210401s.StorageAccounts_BlobService_Spec) error
}
type augmentConversionForStorageAccounts_BlobService_STATUS interface {
AssignPropertiesFrom(src *v20210401s.StorageAccounts_BlobService_STATUS) error
AssignPropertiesTo(dst *v20210401s.StorageAccounts_BlobService_STATUS) error
}
// Storage version of v1alpha1api20210401.ChangeFeed
// Deprecated version of ChangeFeed. Use v1beta20210401.ChangeFeed instead
type ChangeFeed struct {
Enabled *bool `json:"enabled,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
RetentionInDays *int `json:"retentionInDays,omitempty"`
}
// AssignProperties_From_ChangeFeed populates our ChangeFeed from the provided source ChangeFeed
func (feed *ChangeFeed) AssignProperties_From_ChangeFeed(source *v20210401s.ChangeFeed) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// Enabled
if source.Enabled != nil {
enabled := *source.Enabled
feed.Enabled = &enabled
} else {
feed.Enabled = nil
}
// RetentionInDays
feed.RetentionInDays = genruntime.ClonePointerToInt(source.RetentionInDays)
// Update the property bag
if len(propertyBag) > 0 {
feed.PropertyBag = propertyBag
} else {
feed.PropertyBag = nil
}
// Invoke the augmentConversionForChangeFeed interface (if implemented) to customize the conversion
var feedAsAny any = feed
if augmentedFeed, ok := feedAsAny.(augmentConversionForChangeFeed); ok {
err := augmentedFeed.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_ChangeFeed populates the provided destination ChangeFeed from our ChangeFeed
func (feed *ChangeFeed) AssignProperties_To_ChangeFeed(destination *v20210401s.ChangeFeed) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(feed.PropertyBag)
// Enabled
if feed.Enabled != nil {
enabled := *feed.Enabled
destination.Enabled = &enabled
} else {
destination.Enabled = nil
}
// RetentionInDays
destination.RetentionInDays = genruntime.ClonePointerToInt(feed.RetentionInDays)
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// Invoke the augmentConversionForChangeFeed interface (if implemented) to customize the conversion
var feedAsAny any = feed
if augmentedFeed, ok := feedAsAny.(augmentConversionForChangeFeed); ok {
err := augmentedFeed.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
// Storage version of v1alpha1api20210401.ChangeFeed_STATUS
// Deprecated version of ChangeFeed_STATUS. Use v1beta20210401.ChangeFeed_STATUS instead
type ChangeFeed_STATUS struct {
Enabled *bool `json:"enabled,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
RetentionInDays *int `json:"retentionInDays,omitempty"`
}
// AssignProperties_From_ChangeFeed_STATUS populates our ChangeFeed_STATUS from the provided source ChangeFeed_STATUS
func (feed *ChangeFeed_STATUS) AssignProperties_From_ChangeFeed_STATUS(source *v20210401s.ChangeFeed_STATUS) error {
// Clone the existing property bag