-
Notifications
You must be signed in to change notification settings - Fork 188
/
storage_accounts_file_services_share_types_gen.go
1126 lines (922 loc) · 42.4 KB
/
storage_accounts_file_services_share_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 storage
import (
"fmt"
v20230101s "github.com/Azure/azure-service-operator/v2/api/storage/v1api20230101/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"
"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 v1api20220901.StorageAccountsFileServicesShare
// Generator information:
// - Generated from: /storage/resource-manager/Microsoft.Storage/stable/2022-09-01/file.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}
type StorageAccountsFileServicesShare struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec StorageAccounts_FileServices_Share_Spec `json:"spec,omitempty"`
Status StorageAccounts_FileServices_Share_STATUS `json:"status,omitempty"`
}
var _ conditions.Conditioner = &StorageAccountsFileServicesShare{}
// GetConditions returns the conditions of the resource
func (share *StorageAccountsFileServicesShare) GetConditions() conditions.Conditions {
return share.Status.Conditions
}
// SetConditions sets the conditions on the resource status
func (share *StorageAccountsFileServicesShare) SetConditions(conditions conditions.Conditions) {
share.Status.Conditions = conditions
}
var _ conversion.Convertible = &StorageAccountsFileServicesShare{}
// ConvertFrom populates our StorageAccountsFileServicesShare from the provided hub StorageAccountsFileServicesShare
func (share *StorageAccountsFileServicesShare) ConvertFrom(hub conversion.Hub) error {
source, ok := hub.(*v20230101s.StorageAccountsFileServicesShare)
if !ok {
return fmt.Errorf("expected storage/v1api20230101/storage/StorageAccountsFileServicesShare but received %T instead", hub)
}
return share.AssignProperties_From_StorageAccountsFileServicesShare(source)
}
// ConvertTo populates the provided hub StorageAccountsFileServicesShare from our StorageAccountsFileServicesShare
func (share *StorageAccountsFileServicesShare) ConvertTo(hub conversion.Hub) error {
destination, ok := hub.(*v20230101s.StorageAccountsFileServicesShare)
if !ok {
return fmt.Errorf("expected storage/v1api20230101/storage/StorageAccountsFileServicesShare but received %T instead", hub)
}
return share.AssignProperties_To_StorageAccountsFileServicesShare(destination)
}
var _ genruntime.KubernetesResource = &StorageAccountsFileServicesShare{}
// AzureName returns the Azure name of the resource
func (share *StorageAccountsFileServicesShare) AzureName() string {
return share.Spec.AzureName
}
// GetAPIVersion returns the ARM API version of the resource. This is always "2022-09-01"
func (share StorageAccountsFileServicesShare) GetAPIVersion() string {
return string(APIVersion_Value)
}
// GetResourceScope returns the scope of the resource
func (share *StorageAccountsFileServicesShare) GetResourceScope() genruntime.ResourceScope {
return genruntime.ResourceScopeResourceGroup
}
// GetSpec returns the specification of this resource
func (share *StorageAccountsFileServicesShare) GetSpec() genruntime.ConvertibleSpec {
return &share.Spec
}
// GetStatus returns the status of this resource
func (share *StorageAccountsFileServicesShare) GetStatus() genruntime.ConvertibleStatus {
return &share.Status
}
// GetSupportedOperations returns the operations supported by the resource
func (share *StorageAccountsFileServicesShare) GetSupportedOperations() []genruntime.ResourceOperation {
return []genruntime.ResourceOperation{
genruntime.ResourceOperationDelete,
genruntime.ResourceOperationGet,
genruntime.ResourceOperationPut,
}
}
// GetType returns the ARM Type of the resource. This is always "Microsoft.Storage/storageAccounts/fileServices/shares"
func (share *StorageAccountsFileServicesShare) GetType() string {
return "Microsoft.Storage/storageAccounts/fileServices/shares"
}
// NewEmptyStatus returns a new empty (blank) status
func (share *StorageAccountsFileServicesShare) NewEmptyStatus() genruntime.ConvertibleStatus {
return &StorageAccounts_FileServices_Share_STATUS{}
}
// Owner returns the ResourceReference of the owner
func (share *StorageAccountsFileServicesShare) Owner() *genruntime.ResourceReference {
group, kind := genruntime.LookupOwnerGroupKind(share.Spec)
return share.Spec.Owner.AsResourceReference(group, kind)
}
// SetStatus sets the status of this resource
func (share *StorageAccountsFileServicesShare) SetStatus(status genruntime.ConvertibleStatus) error {
// If we have exactly the right type of status, assign it
if st, ok := status.(*StorageAccounts_FileServices_Share_STATUS); ok {
share.Status = *st
return nil
}
// Convert status to required version
var st StorageAccounts_FileServices_Share_STATUS
err := status.ConvertStatusTo(&st)
if err != nil {
return errors.Wrap(err, "failed to convert status")
}
share.Status = st
return nil
}
// AssignProperties_From_StorageAccountsFileServicesShare populates our StorageAccountsFileServicesShare from the provided source StorageAccountsFileServicesShare
func (share *StorageAccountsFileServicesShare) AssignProperties_From_StorageAccountsFileServicesShare(source *v20230101s.StorageAccountsFileServicesShare) error {
// ObjectMeta
share.ObjectMeta = *source.ObjectMeta.DeepCopy()
// Spec
var spec StorageAccounts_FileServices_Share_Spec
err := spec.AssignProperties_From_StorageAccounts_FileServices_Share_Spec(&source.Spec)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_StorageAccounts_FileServices_Share_Spec() to populate field Spec")
}
share.Spec = spec
// Status
var status StorageAccounts_FileServices_Share_STATUS
err = status.AssignProperties_From_StorageAccounts_FileServices_Share_STATUS(&source.Status)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_StorageAccounts_FileServices_Share_STATUS() to populate field Status")
}
share.Status = status
// Invoke the augmentConversionForStorageAccountsFileServicesShare interface (if implemented) to customize the conversion
var shareAsAny any = share
if augmentedShare, ok := shareAsAny.(augmentConversionForStorageAccountsFileServicesShare); ok {
err := augmentedShare.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_StorageAccountsFileServicesShare populates the provided destination StorageAccountsFileServicesShare from our StorageAccountsFileServicesShare
func (share *StorageAccountsFileServicesShare) AssignProperties_To_StorageAccountsFileServicesShare(destination *v20230101s.StorageAccountsFileServicesShare) error {
// ObjectMeta
destination.ObjectMeta = *share.ObjectMeta.DeepCopy()
// Spec
var spec v20230101s.StorageAccounts_FileServices_Share_Spec
err := share.Spec.AssignProperties_To_StorageAccounts_FileServices_Share_Spec(&spec)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_StorageAccounts_FileServices_Share_Spec() to populate field Spec")
}
destination.Spec = spec
// Status
var status v20230101s.StorageAccounts_FileServices_Share_STATUS
err = share.Status.AssignProperties_To_StorageAccounts_FileServices_Share_STATUS(&status)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_StorageAccounts_FileServices_Share_STATUS() to populate field Status")
}
destination.Status = status
// Invoke the augmentConversionForStorageAccountsFileServicesShare interface (if implemented) to customize the conversion
var shareAsAny any = share
if augmentedShare, ok := shareAsAny.(augmentConversionForStorageAccountsFileServicesShare); ok {
err := augmentedShare.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 (share *StorageAccountsFileServicesShare) OriginalGVK() *schema.GroupVersionKind {
return &schema.GroupVersionKind{
Group: GroupVersion.Group,
Version: share.Spec.OriginalVersion,
Kind: "StorageAccountsFileServicesShare",
}
}
// +kubebuilder:object:root=true
// Storage version of v1api20220901.StorageAccountsFileServicesShare
// Generator information:
// - Generated from: /storage/resource-manager/Microsoft.Storage/stable/2022-09-01/file.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}
type StorageAccountsFileServicesShareList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []StorageAccountsFileServicesShare `json:"items"`
}
type augmentConversionForStorageAccountsFileServicesShare interface {
AssignPropertiesFrom(src *v20230101s.StorageAccountsFileServicesShare) error
AssignPropertiesTo(dst *v20230101s.StorageAccountsFileServicesShare) error
}
// Storage version of v1api20220901.StorageAccounts_FileServices_Share_Spec
type StorageAccounts_FileServices_Share_Spec struct {
AccessTier *string `json:"accessTier,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"`
EnabledProtocols *string `json:"enabledProtocols,omitempty"`
Metadata map[string]string `json:"metadata,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/StorageAccountsFileService resource
Owner *genruntime.KnownResourceReference `group:"storage.azure.com" json:"owner,omitempty" kind:"StorageAccountsFileService"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
RootSquash *string `json:"rootSquash,omitempty"`
ShareQuota *int `json:"shareQuota,omitempty"`
SignedIdentifiers []SignedIdentifier `json:"signedIdentifiers,omitempty"`
}
var _ genruntime.ConvertibleSpec = &StorageAccounts_FileServices_Share_Spec{}
// ConvertSpecFrom populates our StorageAccounts_FileServices_Share_Spec from the provided source
func (share *StorageAccounts_FileServices_Share_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
src, ok := source.(*v20230101s.StorageAccounts_FileServices_Share_Spec)
if ok {
// Populate our instance from source
return share.AssignProperties_From_StorageAccounts_FileServices_Share_Spec(src)
}
// Convert to an intermediate form
src = &v20230101s.StorageAccounts_FileServices_Share_Spec{}
err := src.ConvertSpecFrom(source)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()")
}
// Update our instance from src
err = share.AssignProperties_From_StorageAccounts_FileServices_Share_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_FileServices_Share_Spec
func (share *StorageAccounts_FileServices_Share_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
dst, ok := destination.(*v20230101s.StorageAccounts_FileServices_Share_Spec)
if ok {
// Populate destination from our instance
return share.AssignProperties_To_StorageAccounts_FileServices_Share_Spec(dst)
}
// Convert to an intermediate form
dst = &v20230101s.StorageAccounts_FileServices_Share_Spec{}
err := share.AssignProperties_To_StorageAccounts_FileServices_Share_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_FileServices_Share_Spec populates our StorageAccounts_FileServices_Share_Spec from the provided source StorageAccounts_FileServices_Share_Spec
func (share *StorageAccounts_FileServices_Share_Spec) AssignProperties_From_StorageAccounts_FileServices_Share_Spec(source *v20230101s.StorageAccounts_FileServices_Share_Spec) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// AccessTier
share.AccessTier = genruntime.ClonePointerToString(source.AccessTier)
// AzureName
share.AzureName = source.AzureName
// EnabledProtocols
share.EnabledProtocols = genruntime.ClonePointerToString(source.EnabledProtocols)
// Metadata
share.Metadata = genruntime.CloneMapOfStringToString(source.Metadata)
// OriginalVersion
share.OriginalVersion = source.OriginalVersion
// Owner
if source.Owner != nil {
owner := source.Owner.Copy()
share.Owner = &owner
} else {
share.Owner = nil
}
// RootSquash
share.RootSquash = genruntime.ClonePointerToString(source.RootSquash)
// ShareQuota
share.ShareQuota = genruntime.ClonePointerToInt(source.ShareQuota)
// SignedIdentifiers
if source.SignedIdentifiers != nil {
signedIdentifierList := make([]SignedIdentifier, len(source.SignedIdentifiers))
for signedIdentifierIndex, signedIdentifierItem := range source.SignedIdentifiers {
// Shadow the loop variable to avoid aliasing
signedIdentifierItem := signedIdentifierItem
var signedIdentifier SignedIdentifier
err := signedIdentifier.AssignProperties_From_SignedIdentifier(&signedIdentifierItem)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_SignedIdentifier() to populate field SignedIdentifiers")
}
signedIdentifierList[signedIdentifierIndex] = signedIdentifier
}
share.SignedIdentifiers = signedIdentifierList
} else {
share.SignedIdentifiers = nil
}
// Update the property bag
if len(propertyBag) > 0 {
share.PropertyBag = propertyBag
} else {
share.PropertyBag = nil
}
// Invoke the augmentConversionForStorageAccounts_FileServices_Share_Spec interface (if implemented) to customize the conversion
var shareAsAny any = share
if augmentedShare, ok := shareAsAny.(augmentConversionForStorageAccounts_FileServices_Share_Spec); ok {
err := augmentedShare.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_StorageAccounts_FileServices_Share_Spec populates the provided destination StorageAccounts_FileServices_Share_Spec from our StorageAccounts_FileServices_Share_Spec
func (share *StorageAccounts_FileServices_Share_Spec) AssignProperties_To_StorageAccounts_FileServices_Share_Spec(destination *v20230101s.StorageAccounts_FileServices_Share_Spec) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(share.PropertyBag)
// AccessTier
destination.AccessTier = genruntime.ClonePointerToString(share.AccessTier)
// AzureName
destination.AzureName = share.AzureName
// EnabledProtocols
destination.EnabledProtocols = genruntime.ClonePointerToString(share.EnabledProtocols)
// Metadata
destination.Metadata = genruntime.CloneMapOfStringToString(share.Metadata)
// OriginalVersion
destination.OriginalVersion = share.OriginalVersion
// Owner
if share.Owner != nil {
owner := share.Owner.Copy()
destination.Owner = &owner
} else {
destination.Owner = nil
}
// RootSquash
destination.RootSquash = genruntime.ClonePointerToString(share.RootSquash)
// ShareQuota
destination.ShareQuota = genruntime.ClonePointerToInt(share.ShareQuota)
// SignedIdentifiers
if share.SignedIdentifiers != nil {
signedIdentifierList := make([]v20230101s.SignedIdentifier, len(share.SignedIdentifiers))
for signedIdentifierIndex, signedIdentifierItem := range share.SignedIdentifiers {
// Shadow the loop variable to avoid aliasing
signedIdentifierItem := signedIdentifierItem
var signedIdentifier v20230101s.SignedIdentifier
err := signedIdentifierItem.AssignProperties_To_SignedIdentifier(&signedIdentifier)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_SignedIdentifier() to populate field SignedIdentifiers")
}
signedIdentifierList[signedIdentifierIndex] = signedIdentifier
}
destination.SignedIdentifiers = signedIdentifierList
} else {
destination.SignedIdentifiers = nil
}
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// Invoke the augmentConversionForStorageAccounts_FileServices_Share_Spec interface (if implemented) to customize the conversion
var shareAsAny any = share
if augmentedShare, ok := shareAsAny.(augmentConversionForStorageAccounts_FileServices_Share_Spec); ok {
err := augmentedShare.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
// Storage version of v1api20220901.StorageAccounts_FileServices_Share_STATUS
type StorageAccounts_FileServices_Share_STATUS struct {
AccessTier *string `json:"accessTier,omitempty"`
AccessTierChangeTime *string `json:"accessTierChangeTime,omitempty"`
AccessTierStatus *string `json:"accessTierStatus,omitempty"`
Conditions []conditions.Condition `json:"conditions,omitempty"`
Deleted *bool `json:"deleted,omitempty"`
DeletedTime *string `json:"deletedTime,omitempty"`
EnabledProtocols *string `json:"enabledProtocols,omitempty"`
Etag *string `json:"etag,omitempty"`
Id *string `json:"id,omitempty"`
LastModifiedTime *string `json:"lastModifiedTime,omitempty"`
LeaseDuration *string `json:"leaseDuration,omitempty"`
LeaseState *string `json:"leaseState,omitempty"`
LeaseStatus *string `json:"leaseStatus,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
Name *string `json:"name,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
RemainingRetentionDays *int `json:"remainingRetentionDays,omitempty"`
RootSquash *string `json:"rootSquash,omitempty"`
ShareQuota *int `json:"shareQuota,omitempty"`
ShareUsageBytes *int `json:"shareUsageBytes,omitempty"`
SignedIdentifiers []SignedIdentifier_STATUS `json:"signedIdentifiers,omitempty"`
SnapshotTime *string `json:"snapshotTime,omitempty"`
Type *string `json:"type,omitempty"`
Version *string `json:"version,omitempty"`
}
var _ genruntime.ConvertibleStatus = &StorageAccounts_FileServices_Share_STATUS{}
// ConvertStatusFrom populates our StorageAccounts_FileServices_Share_STATUS from the provided source
func (share *StorageAccounts_FileServices_Share_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
src, ok := source.(*v20230101s.StorageAccounts_FileServices_Share_STATUS)
if ok {
// Populate our instance from source
return share.AssignProperties_From_StorageAccounts_FileServices_Share_STATUS(src)
}
// Convert to an intermediate form
src = &v20230101s.StorageAccounts_FileServices_Share_STATUS{}
err := src.ConvertStatusFrom(source)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()")
}
// Update our instance from src
err = share.AssignProperties_From_StorageAccounts_FileServices_Share_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_FileServices_Share_STATUS
func (share *StorageAccounts_FileServices_Share_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
dst, ok := destination.(*v20230101s.StorageAccounts_FileServices_Share_STATUS)
if ok {
// Populate destination from our instance
return share.AssignProperties_To_StorageAccounts_FileServices_Share_STATUS(dst)
}
// Convert to an intermediate form
dst = &v20230101s.StorageAccounts_FileServices_Share_STATUS{}
err := share.AssignProperties_To_StorageAccounts_FileServices_Share_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_FileServices_Share_STATUS populates our StorageAccounts_FileServices_Share_STATUS from the provided source StorageAccounts_FileServices_Share_STATUS
func (share *StorageAccounts_FileServices_Share_STATUS) AssignProperties_From_StorageAccounts_FileServices_Share_STATUS(source *v20230101s.StorageAccounts_FileServices_Share_STATUS) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// AccessTier
share.AccessTier = genruntime.ClonePointerToString(source.AccessTier)
// AccessTierChangeTime
share.AccessTierChangeTime = genruntime.ClonePointerToString(source.AccessTierChangeTime)
// AccessTierStatus
share.AccessTierStatus = genruntime.ClonePointerToString(source.AccessTierStatus)
// Conditions
share.Conditions = genruntime.CloneSliceOfCondition(source.Conditions)
// Deleted
if source.Deleted != nil {
deleted := *source.Deleted
share.Deleted = &deleted
} else {
share.Deleted = nil
}
// DeletedTime
share.DeletedTime = genruntime.ClonePointerToString(source.DeletedTime)
// EnabledProtocols
share.EnabledProtocols = genruntime.ClonePointerToString(source.EnabledProtocols)
// Etag
share.Etag = genruntime.ClonePointerToString(source.Etag)
// Id
share.Id = genruntime.ClonePointerToString(source.Id)
// LastModifiedTime
share.LastModifiedTime = genruntime.ClonePointerToString(source.LastModifiedTime)
// LeaseDuration
share.LeaseDuration = genruntime.ClonePointerToString(source.LeaseDuration)
// LeaseState
share.LeaseState = genruntime.ClonePointerToString(source.LeaseState)
// LeaseStatus
share.LeaseStatus = genruntime.ClonePointerToString(source.LeaseStatus)
// Metadata
share.Metadata = genruntime.CloneMapOfStringToString(source.Metadata)
// Name
share.Name = genruntime.ClonePointerToString(source.Name)
// RemainingRetentionDays
share.RemainingRetentionDays = genruntime.ClonePointerToInt(source.RemainingRetentionDays)
// RootSquash
share.RootSquash = genruntime.ClonePointerToString(source.RootSquash)
// ShareQuota
share.ShareQuota = genruntime.ClonePointerToInt(source.ShareQuota)
// ShareUsageBytes
share.ShareUsageBytes = genruntime.ClonePointerToInt(source.ShareUsageBytes)
// SignedIdentifiers
if source.SignedIdentifiers != nil {
signedIdentifierList := make([]SignedIdentifier_STATUS, len(source.SignedIdentifiers))
for signedIdentifierIndex, signedIdentifierItem := range source.SignedIdentifiers {
// Shadow the loop variable to avoid aliasing
signedIdentifierItem := signedIdentifierItem
var signedIdentifier SignedIdentifier_STATUS
err := signedIdentifier.AssignProperties_From_SignedIdentifier_STATUS(&signedIdentifierItem)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_SignedIdentifier_STATUS() to populate field SignedIdentifiers")
}
signedIdentifierList[signedIdentifierIndex] = signedIdentifier
}
share.SignedIdentifiers = signedIdentifierList
} else {
share.SignedIdentifiers = nil
}
// SnapshotTime
share.SnapshotTime = genruntime.ClonePointerToString(source.SnapshotTime)
// Type
share.Type = genruntime.ClonePointerToString(source.Type)
// Version
share.Version = genruntime.ClonePointerToString(source.Version)
// Update the property bag
if len(propertyBag) > 0 {
share.PropertyBag = propertyBag
} else {
share.PropertyBag = nil
}
// Invoke the augmentConversionForStorageAccounts_FileServices_Share_STATUS interface (if implemented) to customize the conversion
var shareAsAny any = share
if augmentedShare, ok := shareAsAny.(augmentConversionForStorageAccounts_FileServices_Share_STATUS); ok {
err := augmentedShare.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_StorageAccounts_FileServices_Share_STATUS populates the provided destination StorageAccounts_FileServices_Share_STATUS from our StorageAccounts_FileServices_Share_STATUS
func (share *StorageAccounts_FileServices_Share_STATUS) AssignProperties_To_StorageAccounts_FileServices_Share_STATUS(destination *v20230101s.StorageAccounts_FileServices_Share_STATUS) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(share.PropertyBag)
// AccessTier
destination.AccessTier = genruntime.ClonePointerToString(share.AccessTier)
// AccessTierChangeTime
destination.AccessTierChangeTime = genruntime.ClonePointerToString(share.AccessTierChangeTime)
// AccessTierStatus
destination.AccessTierStatus = genruntime.ClonePointerToString(share.AccessTierStatus)
// Conditions
destination.Conditions = genruntime.CloneSliceOfCondition(share.Conditions)
// Deleted
if share.Deleted != nil {
deleted := *share.Deleted
destination.Deleted = &deleted
} else {
destination.Deleted = nil
}
// DeletedTime
destination.DeletedTime = genruntime.ClonePointerToString(share.DeletedTime)
// EnabledProtocols
destination.EnabledProtocols = genruntime.ClonePointerToString(share.EnabledProtocols)
// Etag
destination.Etag = genruntime.ClonePointerToString(share.Etag)
// Id
destination.Id = genruntime.ClonePointerToString(share.Id)
// LastModifiedTime
destination.LastModifiedTime = genruntime.ClonePointerToString(share.LastModifiedTime)
// LeaseDuration
destination.LeaseDuration = genruntime.ClonePointerToString(share.LeaseDuration)
// LeaseState
destination.LeaseState = genruntime.ClonePointerToString(share.LeaseState)
// LeaseStatus
destination.LeaseStatus = genruntime.ClonePointerToString(share.LeaseStatus)
// Metadata
destination.Metadata = genruntime.CloneMapOfStringToString(share.Metadata)
// Name
destination.Name = genruntime.ClonePointerToString(share.Name)
// RemainingRetentionDays
destination.RemainingRetentionDays = genruntime.ClonePointerToInt(share.RemainingRetentionDays)
// RootSquash
destination.RootSquash = genruntime.ClonePointerToString(share.RootSquash)
// ShareQuota
destination.ShareQuota = genruntime.ClonePointerToInt(share.ShareQuota)
// ShareUsageBytes
destination.ShareUsageBytes = genruntime.ClonePointerToInt(share.ShareUsageBytes)
// SignedIdentifiers
if share.SignedIdentifiers != nil {
signedIdentifierList := make([]v20230101s.SignedIdentifier_STATUS, len(share.SignedIdentifiers))
for signedIdentifierIndex, signedIdentifierItem := range share.SignedIdentifiers {
// Shadow the loop variable to avoid aliasing
signedIdentifierItem := signedIdentifierItem
var signedIdentifier v20230101s.SignedIdentifier_STATUS
err := signedIdentifierItem.AssignProperties_To_SignedIdentifier_STATUS(&signedIdentifier)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_SignedIdentifier_STATUS() to populate field SignedIdentifiers")
}
signedIdentifierList[signedIdentifierIndex] = signedIdentifier
}
destination.SignedIdentifiers = signedIdentifierList
} else {
destination.SignedIdentifiers = nil
}
// SnapshotTime
destination.SnapshotTime = genruntime.ClonePointerToString(share.SnapshotTime)
// Type
destination.Type = genruntime.ClonePointerToString(share.Type)
// Version
destination.Version = genruntime.ClonePointerToString(share.Version)
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// Invoke the augmentConversionForStorageAccounts_FileServices_Share_STATUS interface (if implemented) to customize the conversion
var shareAsAny any = share
if augmentedShare, ok := shareAsAny.(augmentConversionForStorageAccounts_FileServices_Share_STATUS); ok {
err := augmentedShare.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
type augmentConversionForStorageAccounts_FileServices_Share_Spec interface {
AssignPropertiesFrom(src *v20230101s.StorageAccounts_FileServices_Share_Spec) error
AssignPropertiesTo(dst *v20230101s.StorageAccounts_FileServices_Share_Spec) error
}
type augmentConversionForStorageAccounts_FileServices_Share_STATUS interface {
AssignPropertiesFrom(src *v20230101s.StorageAccounts_FileServices_Share_STATUS) error
AssignPropertiesTo(dst *v20230101s.StorageAccounts_FileServices_Share_STATUS) error
}
// Storage version of v1api20220901.SignedIdentifier
type SignedIdentifier struct {
AccessPolicy *AccessPolicy `json:"accessPolicy,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
// Reference: An unique identifier of the stored access policy.
Reference *genruntime.ResourceReference `armReference:"Id" json:"reference,omitempty"`
}
// AssignProperties_From_SignedIdentifier populates our SignedIdentifier from the provided source SignedIdentifier
func (identifier *SignedIdentifier) AssignProperties_From_SignedIdentifier(source *v20230101s.SignedIdentifier) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// AccessPolicy
if source.AccessPolicy != nil {
var accessPolicy AccessPolicy
err := accessPolicy.AssignProperties_From_AccessPolicy(source.AccessPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_AccessPolicy() to populate field AccessPolicy")
}
identifier.AccessPolicy = &accessPolicy
} else {
identifier.AccessPolicy = nil
}
// Reference
if source.Reference != nil {
reference := source.Reference.Copy()
identifier.Reference = &reference
} else {
identifier.Reference = nil
}
// Update the property bag
if len(propertyBag) > 0 {
identifier.PropertyBag = propertyBag
} else {
identifier.PropertyBag = nil
}
// Invoke the augmentConversionForSignedIdentifier interface (if implemented) to customize the conversion
var identifierAsAny any = identifier
if augmentedIdentifier, ok := identifierAsAny.(augmentConversionForSignedIdentifier); ok {
err := augmentedIdentifier.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_SignedIdentifier populates the provided destination SignedIdentifier from our SignedIdentifier
func (identifier *SignedIdentifier) AssignProperties_To_SignedIdentifier(destination *v20230101s.SignedIdentifier) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(identifier.PropertyBag)
// AccessPolicy
if identifier.AccessPolicy != nil {
var accessPolicy v20230101s.AccessPolicy
err := identifier.AccessPolicy.AssignProperties_To_AccessPolicy(&accessPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_AccessPolicy() to populate field AccessPolicy")
}
destination.AccessPolicy = &accessPolicy
} else {
destination.AccessPolicy = nil
}
// Reference
if identifier.Reference != nil {
reference := identifier.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 augmentConversionForSignedIdentifier interface (if implemented) to customize the conversion
var identifierAsAny any = identifier
if augmentedIdentifier, ok := identifierAsAny.(augmentConversionForSignedIdentifier); ok {
err := augmentedIdentifier.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
// Storage version of v1api20220901.SignedIdentifier_STATUS
type SignedIdentifier_STATUS struct {
AccessPolicy *AccessPolicy_STATUS `json:"accessPolicy,omitempty"`
Id *string `json:"id,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
}
// AssignProperties_From_SignedIdentifier_STATUS populates our SignedIdentifier_STATUS from the provided source SignedIdentifier_STATUS
func (identifier *SignedIdentifier_STATUS) AssignProperties_From_SignedIdentifier_STATUS(source *v20230101s.SignedIdentifier_STATUS) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// AccessPolicy
if source.AccessPolicy != nil {
var accessPolicy AccessPolicy_STATUS
err := accessPolicy.AssignProperties_From_AccessPolicy_STATUS(source.AccessPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_AccessPolicy_STATUS() to populate field AccessPolicy")
}
identifier.AccessPolicy = &accessPolicy
} else {
identifier.AccessPolicy = nil
}
// Id
identifier.Id = genruntime.ClonePointerToString(source.Id)
// Update the property bag
if len(propertyBag) > 0 {
identifier.PropertyBag = propertyBag
} else {
identifier.PropertyBag = nil
}
// Invoke the augmentConversionForSignedIdentifier_STATUS interface (if implemented) to customize the conversion
var identifierAsAny any = identifier
if augmentedIdentifier, ok := identifierAsAny.(augmentConversionForSignedIdentifier_STATUS); ok {
err := augmentedIdentifier.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_SignedIdentifier_STATUS populates the provided destination SignedIdentifier_STATUS from our SignedIdentifier_STATUS
func (identifier *SignedIdentifier_STATUS) AssignProperties_To_SignedIdentifier_STATUS(destination *v20230101s.SignedIdentifier_STATUS) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(identifier.PropertyBag)
// AccessPolicy
if identifier.AccessPolicy != nil {
var accessPolicy v20230101s.AccessPolicy_STATUS
err := identifier.AccessPolicy.AssignProperties_To_AccessPolicy_STATUS(&accessPolicy)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_AccessPolicy_STATUS() to populate field AccessPolicy")
}
destination.AccessPolicy = &accessPolicy
} else {
destination.AccessPolicy = nil
}
// Id
destination.Id = genruntime.ClonePointerToString(identifier.Id)
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// Invoke the augmentConversionForSignedIdentifier_STATUS interface (if implemented) to customize the conversion
var identifierAsAny any = identifier
if augmentedIdentifier, ok := identifierAsAny.(augmentConversionForSignedIdentifier_STATUS); ok {
err := augmentedIdentifier.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
// Storage version of v1api20220901.AccessPolicy
type AccessPolicy struct {
ExpiryTime *string `json:"expiryTime,omitempty"`
Permission *string `json:"permission,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
StartTime *string `json:"startTime,omitempty"`
}
// AssignProperties_From_AccessPolicy populates our AccessPolicy from the provided source AccessPolicy
func (policy *AccessPolicy) AssignProperties_From_AccessPolicy(source *v20230101s.AccessPolicy) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// ExpiryTime
policy.ExpiryTime = genruntime.ClonePointerToString(source.ExpiryTime)
// Permission
policy.Permission = genruntime.ClonePointerToString(source.Permission)
// StartTime
policy.StartTime = genruntime.ClonePointerToString(source.StartTime)
// Update the property bag
if len(propertyBag) > 0 {
policy.PropertyBag = propertyBag
} else {
policy.PropertyBag = nil
}
// Invoke the augmentConversionForAccessPolicy interface (if implemented) to customize the conversion
var policyAsAny any = policy
if augmentedPolicy, ok := policyAsAny.(augmentConversionForAccessPolicy); ok {
err := augmentedPolicy.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_AccessPolicy populates the provided destination AccessPolicy from our AccessPolicy
func (policy *AccessPolicy) AssignProperties_To_AccessPolicy(destination *v20230101s.AccessPolicy) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(policy.PropertyBag)
// ExpiryTime
destination.ExpiryTime = genruntime.ClonePointerToString(policy.ExpiryTime)