-
Notifications
You must be signed in to change notification settings - Fork 188
/
namespaces_authorization_rule_types_gen.go
820 lines (687 loc) · 30.8 KB
/
namespaces_authorization_rule_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
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package storage
import (
"fmt"
v20211101s "github.com/Azure/azure-service-operator/v2/api/servicebus/v1api20211101/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 v1api20210101preview.NamespacesAuthorizationRule
// Generator information:
// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2021-01-01-preview/AuthorizationRules.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}
type NamespacesAuthorizationRule struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec Namespaces_AuthorizationRule_Spec `json:"spec,omitempty"`
Status Namespaces_AuthorizationRule_STATUS `json:"status,omitempty"`
}
var _ conditions.Conditioner = &NamespacesAuthorizationRule{}
// GetConditions returns the conditions of the resource
func (rule *NamespacesAuthorizationRule) GetConditions() conditions.Conditions {
return rule.Status.Conditions
}
// SetConditions sets the conditions on the resource status
func (rule *NamespacesAuthorizationRule) SetConditions(conditions conditions.Conditions) {
rule.Status.Conditions = conditions
}
var _ conversion.Convertible = &NamespacesAuthorizationRule{}
// ConvertFrom populates our NamespacesAuthorizationRule from the provided hub NamespacesAuthorizationRule
func (rule *NamespacesAuthorizationRule) ConvertFrom(hub conversion.Hub) error {
source, ok := hub.(*v20211101s.NamespacesAuthorizationRule)
if !ok {
return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesAuthorizationRule but received %T instead", hub)
}
return rule.AssignProperties_From_NamespacesAuthorizationRule(source)
}
// ConvertTo populates the provided hub NamespacesAuthorizationRule from our NamespacesAuthorizationRule
func (rule *NamespacesAuthorizationRule) ConvertTo(hub conversion.Hub) error {
destination, ok := hub.(*v20211101s.NamespacesAuthorizationRule)
if !ok {
return fmt.Errorf("expected servicebus/v1api20211101/storage/NamespacesAuthorizationRule but received %T instead", hub)
}
return rule.AssignProperties_To_NamespacesAuthorizationRule(destination)
}
var _ genruntime.KubernetesResource = &NamespacesAuthorizationRule{}
// AzureName returns the Azure name of the resource
func (rule *NamespacesAuthorizationRule) AzureName() string {
return rule.Spec.AzureName
}
// GetAPIVersion returns the ARM API version of the resource. This is always "2021-01-01-preview"
func (rule NamespacesAuthorizationRule) GetAPIVersion() string {
return string(APIVersion_Value)
}
// GetResourceScope returns the scope of the resource
func (rule *NamespacesAuthorizationRule) GetResourceScope() genruntime.ResourceScope {
return genruntime.ResourceScopeResourceGroup
}
// GetSpec returns the specification of this resource
func (rule *NamespacesAuthorizationRule) GetSpec() genruntime.ConvertibleSpec {
return &rule.Spec
}
// GetStatus returns the status of this resource
func (rule *NamespacesAuthorizationRule) GetStatus() genruntime.ConvertibleStatus {
return &rule.Status
}
// GetSupportedOperations returns the operations supported by the resource
func (rule *NamespacesAuthorizationRule) GetSupportedOperations() []genruntime.ResourceOperation {
return []genruntime.ResourceOperation{
genruntime.ResourceOperationDelete,
genruntime.ResourceOperationGet,
genruntime.ResourceOperationPut,
}
}
// GetType returns the ARM Type of the resource. This is always "Microsoft.ServiceBus/namespaces/AuthorizationRules"
func (rule *NamespacesAuthorizationRule) GetType() string {
return "Microsoft.ServiceBus/namespaces/AuthorizationRules"
}
// NewEmptyStatus returns a new empty (blank) status
func (rule *NamespacesAuthorizationRule) NewEmptyStatus() genruntime.ConvertibleStatus {
return &Namespaces_AuthorizationRule_STATUS{}
}
// Owner returns the ResourceReference of the owner
func (rule *NamespacesAuthorizationRule) Owner() *genruntime.ResourceReference {
group, kind := genruntime.LookupOwnerGroupKind(rule.Spec)
return rule.Spec.Owner.AsResourceReference(group, kind)
}
// SetStatus sets the status of this resource
func (rule *NamespacesAuthorizationRule) SetStatus(status genruntime.ConvertibleStatus) error {
// If we have exactly the right type of status, assign it
if st, ok := status.(*Namespaces_AuthorizationRule_STATUS); ok {
rule.Status = *st
return nil
}
// Convert status to required version
var st Namespaces_AuthorizationRule_STATUS
err := status.ConvertStatusTo(&st)
if err != nil {
return errors.Wrap(err, "failed to convert status")
}
rule.Status = st
return nil
}
// AssignProperties_From_NamespacesAuthorizationRule populates our NamespacesAuthorizationRule from the provided source NamespacesAuthorizationRule
func (rule *NamespacesAuthorizationRule) AssignProperties_From_NamespacesAuthorizationRule(source *v20211101s.NamespacesAuthorizationRule) error {
// ObjectMeta
rule.ObjectMeta = *source.ObjectMeta.DeepCopy()
// Spec
var spec Namespaces_AuthorizationRule_Spec
err := spec.AssignProperties_From_Namespaces_AuthorizationRule_Spec(&source.Spec)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_Namespaces_AuthorizationRule_Spec() to populate field Spec")
}
rule.Spec = spec
// Status
var status Namespaces_AuthorizationRule_STATUS
err = status.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(&source.Status)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_Namespaces_AuthorizationRule_STATUS() to populate field Status")
}
rule.Status = status
// Invoke the augmentConversionForNamespacesAuthorizationRule interface (if implemented) to customize the conversion
var ruleAsAny any = rule
if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesAuthorizationRule); ok {
err := augmentedRule.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_NamespacesAuthorizationRule populates the provided destination NamespacesAuthorizationRule from our NamespacesAuthorizationRule
func (rule *NamespacesAuthorizationRule) AssignProperties_To_NamespacesAuthorizationRule(destination *v20211101s.NamespacesAuthorizationRule) error {
// ObjectMeta
destination.ObjectMeta = *rule.ObjectMeta.DeepCopy()
// Spec
var spec v20211101s.Namespaces_AuthorizationRule_Spec
err := rule.Spec.AssignProperties_To_Namespaces_AuthorizationRule_Spec(&spec)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_Namespaces_AuthorizationRule_Spec() to populate field Spec")
}
destination.Spec = spec
// Status
var status v20211101s.Namespaces_AuthorizationRule_STATUS
err = rule.Status.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(&status)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_Namespaces_AuthorizationRule_STATUS() to populate field Status")
}
destination.Status = status
// Invoke the augmentConversionForNamespacesAuthorizationRule interface (if implemented) to customize the conversion
var ruleAsAny any = rule
if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespacesAuthorizationRule); ok {
err := augmentedRule.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 (rule *NamespacesAuthorizationRule) OriginalGVK() *schema.GroupVersionKind {
return &schema.GroupVersionKind{
Group: GroupVersion.Group,
Version: rule.Spec.OriginalVersion,
Kind: "NamespacesAuthorizationRule",
}
}
// +kubebuilder:object:root=true
// Storage version of v1api20210101preview.NamespacesAuthorizationRule
// Generator information:
// - Generated from: /servicebus/resource-manager/Microsoft.ServiceBus/preview/2021-01-01-preview/AuthorizationRules.json
// - ARM URI: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceBus/namespaces/{namespaceName}/AuthorizationRules/{authorizationRuleName}
type NamespacesAuthorizationRuleList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []NamespacesAuthorizationRule `json:"items"`
}
type augmentConversionForNamespacesAuthorizationRule interface {
AssignPropertiesFrom(src *v20211101s.NamespacesAuthorizationRule) error
AssignPropertiesTo(dst *v20211101s.NamespacesAuthorizationRule) error
}
// Storage version of v1api20210101preview.Namespaces_AuthorizationRule_Spec
type Namespaces_AuthorizationRule_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"`
OperatorSpec *NamespacesAuthorizationRuleOperatorSpec `json:"operatorSpec,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 servicebus.azure.com/Namespace resource
Owner *genruntime.KnownResourceReference `group:"servicebus.azure.com" json:"owner,omitempty" kind:"Namespace"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Rights []string `json:"rights,omitempty"`
}
var _ genruntime.ConvertibleSpec = &Namespaces_AuthorizationRule_Spec{}
// ConvertSpecFrom populates our Namespaces_AuthorizationRule_Spec from the provided source
func (rule *Namespaces_AuthorizationRule_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
src, ok := source.(*v20211101s.Namespaces_AuthorizationRule_Spec)
if ok {
// Populate our instance from source
return rule.AssignProperties_From_Namespaces_AuthorizationRule_Spec(src)
}
// Convert to an intermediate form
src = &v20211101s.Namespaces_AuthorizationRule_Spec{}
err := src.ConvertSpecFrom(source)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()")
}
// Update our instance from src
err = rule.AssignProperties_From_Namespaces_AuthorizationRule_Spec(src)
if err != nil {
return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()")
}
return nil
}
// ConvertSpecTo populates the provided destination from our Namespaces_AuthorizationRule_Spec
func (rule *Namespaces_AuthorizationRule_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
dst, ok := destination.(*v20211101s.Namespaces_AuthorizationRule_Spec)
if ok {
// Populate destination from our instance
return rule.AssignProperties_To_Namespaces_AuthorizationRule_Spec(dst)
}
// Convert to an intermediate form
dst = &v20211101s.Namespaces_AuthorizationRule_Spec{}
err := rule.AssignProperties_To_Namespaces_AuthorizationRule_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_Namespaces_AuthorizationRule_Spec populates our Namespaces_AuthorizationRule_Spec from the provided source Namespaces_AuthorizationRule_Spec
func (rule *Namespaces_AuthorizationRule_Spec) AssignProperties_From_Namespaces_AuthorizationRule_Spec(source *v20211101s.Namespaces_AuthorizationRule_Spec) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// AzureName
rule.AzureName = source.AzureName
// OperatorSpec
if source.OperatorSpec != nil {
var operatorSpec NamespacesAuthorizationRuleOperatorSpec
err := operatorSpec.AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec(source.OperatorSpec)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec() to populate field OperatorSpec")
}
rule.OperatorSpec = &operatorSpec
} else {
rule.OperatorSpec = nil
}
// OriginalVersion
rule.OriginalVersion = source.OriginalVersion
// Owner
if source.Owner != nil {
owner := source.Owner.Copy()
rule.Owner = &owner
} else {
rule.Owner = nil
}
// Rights
rule.Rights = genruntime.CloneSliceOfString(source.Rights)
// Update the property bag
if len(propertyBag) > 0 {
rule.PropertyBag = propertyBag
} else {
rule.PropertyBag = nil
}
// Invoke the augmentConversionForNamespaces_AuthorizationRule_Spec interface (if implemented) to customize the conversion
var ruleAsAny any = rule
if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_AuthorizationRule_Spec); ok {
err := augmentedRule.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_Namespaces_AuthorizationRule_Spec populates the provided destination Namespaces_AuthorizationRule_Spec from our Namespaces_AuthorizationRule_Spec
func (rule *Namespaces_AuthorizationRule_Spec) AssignProperties_To_Namespaces_AuthorizationRule_Spec(destination *v20211101s.Namespaces_AuthorizationRule_Spec) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(rule.PropertyBag)
// AzureName
destination.AzureName = rule.AzureName
// OperatorSpec
if rule.OperatorSpec != nil {
var operatorSpec v20211101s.NamespacesAuthorizationRuleOperatorSpec
err := rule.OperatorSpec.AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(&operatorSpec)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec() to populate field OperatorSpec")
}
destination.OperatorSpec = &operatorSpec
} else {
destination.OperatorSpec = nil
}
// OriginalVersion
destination.OriginalVersion = rule.OriginalVersion
// Owner
if rule.Owner != nil {
owner := rule.Owner.Copy()
destination.Owner = &owner
} else {
destination.Owner = nil
}
// Rights
destination.Rights = genruntime.CloneSliceOfString(rule.Rights)
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// Invoke the augmentConversionForNamespaces_AuthorizationRule_Spec interface (if implemented) to customize the conversion
var ruleAsAny any = rule
if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_AuthorizationRule_Spec); ok {
err := augmentedRule.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
// Storage version of v1api20210101preview.Namespaces_AuthorizationRule_STATUS
type Namespaces_AuthorizationRule_STATUS struct {
Conditions []conditions.Condition `json:"conditions,omitempty"`
Id *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Rights []string `json:"rights,omitempty"`
SystemData *SystemData_STATUS `json:"systemData,omitempty"`
Type *string `json:"type,omitempty"`
}
var _ genruntime.ConvertibleStatus = &Namespaces_AuthorizationRule_STATUS{}
// ConvertStatusFrom populates our Namespaces_AuthorizationRule_STATUS from the provided source
func (rule *Namespaces_AuthorizationRule_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
src, ok := source.(*v20211101s.Namespaces_AuthorizationRule_STATUS)
if ok {
// Populate our instance from source
return rule.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(src)
}
// Convert to an intermediate form
src = &v20211101s.Namespaces_AuthorizationRule_STATUS{}
err := src.ConvertStatusFrom(source)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()")
}
// Update our instance from src
err = rule.AssignProperties_From_Namespaces_AuthorizationRule_STATUS(src)
if err != nil {
return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()")
}
return nil
}
// ConvertStatusTo populates the provided destination from our Namespaces_AuthorizationRule_STATUS
func (rule *Namespaces_AuthorizationRule_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
dst, ok := destination.(*v20211101s.Namespaces_AuthorizationRule_STATUS)
if ok {
// Populate destination from our instance
return rule.AssignProperties_To_Namespaces_AuthorizationRule_STATUS(dst)
}
// Convert to an intermediate form
dst = &v20211101s.Namespaces_AuthorizationRule_STATUS{}
err := rule.AssignProperties_To_Namespaces_AuthorizationRule_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_Namespaces_AuthorizationRule_STATUS populates our Namespaces_AuthorizationRule_STATUS from the provided source Namespaces_AuthorizationRule_STATUS
func (rule *Namespaces_AuthorizationRule_STATUS) AssignProperties_From_Namespaces_AuthorizationRule_STATUS(source *v20211101s.Namespaces_AuthorizationRule_STATUS) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// Conditions
rule.Conditions = genruntime.CloneSliceOfCondition(source.Conditions)
// Id
rule.Id = genruntime.ClonePointerToString(source.Id)
// Location
if source.Location != nil {
propertyBag.Add("Location", *source.Location)
} else {
propertyBag.Remove("Location")
}
// Name
rule.Name = genruntime.ClonePointerToString(source.Name)
// Rights
rule.Rights = genruntime.CloneSliceOfString(source.Rights)
// SystemData
if source.SystemData != nil {
var systemDatum SystemData_STATUS
err := systemDatum.AssignProperties_From_SystemData_STATUS(source.SystemData)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_SystemData_STATUS() to populate field SystemData")
}
rule.SystemData = &systemDatum
} else {
rule.SystemData = nil
}
// Type
rule.Type = genruntime.ClonePointerToString(source.Type)
// Update the property bag
if len(propertyBag) > 0 {
rule.PropertyBag = propertyBag
} else {
rule.PropertyBag = nil
}
// Invoke the augmentConversionForNamespaces_AuthorizationRule_STATUS interface (if implemented) to customize the conversion
var ruleAsAny any = rule
if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_AuthorizationRule_STATUS); ok {
err := augmentedRule.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_Namespaces_AuthorizationRule_STATUS populates the provided destination Namespaces_AuthorizationRule_STATUS from our Namespaces_AuthorizationRule_STATUS
func (rule *Namespaces_AuthorizationRule_STATUS) AssignProperties_To_Namespaces_AuthorizationRule_STATUS(destination *v20211101s.Namespaces_AuthorizationRule_STATUS) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(rule.PropertyBag)
// Conditions
destination.Conditions = genruntime.CloneSliceOfCondition(rule.Conditions)
// Id
destination.Id = genruntime.ClonePointerToString(rule.Id)
// Location
if propertyBag.Contains("Location") {
var location string
err := propertyBag.Pull("Location", &location)
if err != nil {
return errors.Wrap(err, "pulling 'Location' from propertyBag")
}
destination.Location = &location
} else {
destination.Location = nil
}
// Name
destination.Name = genruntime.ClonePointerToString(rule.Name)
// Rights
destination.Rights = genruntime.CloneSliceOfString(rule.Rights)
// SystemData
if rule.SystemData != nil {
var systemDatum v20211101s.SystemData_STATUS
err := rule.SystemData.AssignProperties_To_SystemData_STATUS(&systemDatum)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_SystemData_STATUS() to populate field SystemData")
}
destination.SystemData = &systemDatum
} else {
destination.SystemData = nil
}
// Type
destination.Type = genruntime.ClonePointerToString(rule.Type)
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// Invoke the augmentConversionForNamespaces_AuthorizationRule_STATUS interface (if implemented) to customize the conversion
var ruleAsAny any = rule
if augmentedRule, ok := ruleAsAny.(augmentConversionForNamespaces_AuthorizationRule_STATUS); ok {
err := augmentedRule.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
type augmentConversionForNamespaces_AuthorizationRule_Spec interface {
AssignPropertiesFrom(src *v20211101s.Namespaces_AuthorizationRule_Spec) error
AssignPropertiesTo(dst *v20211101s.Namespaces_AuthorizationRule_Spec) error
}
type augmentConversionForNamespaces_AuthorizationRule_STATUS interface {
AssignPropertiesFrom(src *v20211101s.Namespaces_AuthorizationRule_STATUS) error
AssignPropertiesTo(dst *v20211101s.Namespaces_AuthorizationRule_STATUS) error
}
// Storage version of v1api20210101preview.NamespacesAuthorizationRuleOperatorSpec
// Details for configuring operator behavior. Fields in this struct are interpreted by the operator directly rather than being passed to Azure
type NamespacesAuthorizationRuleOperatorSpec struct {
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
Secrets *NamespacesAuthorizationRuleOperatorSecrets `json:"secrets,omitempty"`
}
// AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec populates our NamespacesAuthorizationRuleOperatorSpec from the provided source NamespacesAuthorizationRuleOperatorSpec
func (operator *NamespacesAuthorizationRuleOperatorSpec) AssignProperties_From_NamespacesAuthorizationRuleOperatorSpec(source *v20211101s.NamespacesAuthorizationRuleOperatorSpec) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// Secrets
if source.Secrets != nil {
var secret NamespacesAuthorizationRuleOperatorSecrets
err := secret.AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets(source.Secrets)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets() to populate field Secrets")
}
operator.Secrets = &secret
} else {
operator.Secrets = nil
}
// Update the property bag
if len(propertyBag) > 0 {
operator.PropertyBag = propertyBag
} else {
operator.PropertyBag = nil
}
// Invoke the augmentConversionForNamespacesAuthorizationRuleOperatorSpec interface (if implemented) to customize the conversion
var operatorAsAny any = operator
if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespacesAuthorizationRuleOperatorSpec); ok {
err := augmentedOperator.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec populates the provided destination NamespacesAuthorizationRuleOperatorSpec from our NamespacesAuthorizationRuleOperatorSpec
func (operator *NamespacesAuthorizationRuleOperatorSpec) AssignProperties_To_NamespacesAuthorizationRuleOperatorSpec(destination *v20211101s.NamespacesAuthorizationRuleOperatorSpec) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(operator.PropertyBag)
// Secrets
if operator.Secrets != nil {
var secret v20211101s.NamespacesAuthorizationRuleOperatorSecrets
err := operator.Secrets.AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(&secret)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets() to populate field Secrets")
}
destination.Secrets = &secret
} else {
destination.Secrets = nil
}
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// Invoke the augmentConversionForNamespacesAuthorizationRuleOperatorSpec interface (if implemented) to customize the conversion
var operatorAsAny any = operator
if augmentedOperator, ok := operatorAsAny.(augmentConversionForNamespacesAuthorizationRuleOperatorSpec); ok {
err := augmentedOperator.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
type augmentConversionForNamespacesAuthorizationRuleOperatorSpec interface {
AssignPropertiesFrom(src *v20211101s.NamespacesAuthorizationRuleOperatorSpec) error
AssignPropertiesTo(dst *v20211101s.NamespacesAuthorizationRuleOperatorSpec) error
}
// Storage version of v1api20210101preview.NamespacesAuthorizationRuleOperatorSecrets
type NamespacesAuthorizationRuleOperatorSecrets struct {
PrimaryConnectionString *genruntime.SecretDestination `json:"primaryConnectionString,omitempty"`
PrimaryKey *genruntime.SecretDestination `json:"primaryKey,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
SecondaryConnectionString *genruntime.SecretDestination `json:"secondaryConnectionString,omitempty"`
SecondaryKey *genruntime.SecretDestination `json:"secondaryKey,omitempty"`
}
// AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets populates our NamespacesAuthorizationRuleOperatorSecrets from the provided source NamespacesAuthorizationRuleOperatorSecrets
func (secrets *NamespacesAuthorizationRuleOperatorSecrets) AssignProperties_From_NamespacesAuthorizationRuleOperatorSecrets(source *v20211101s.NamespacesAuthorizationRuleOperatorSecrets) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// PrimaryConnectionString
if source.PrimaryConnectionString != nil {
primaryConnectionString := source.PrimaryConnectionString.Copy()
secrets.PrimaryConnectionString = &primaryConnectionString
} else {
secrets.PrimaryConnectionString = nil
}
// PrimaryKey
if source.PrimaryKey != nil {
primaryKey := source.PrimaryKey.Copy()
secrets.PrimaryKey = &primaryKey
} else {
secrets.PrimaryKey = nil
}
// SecondaryConnectionString
if source.SecondaryConnectionString != nil {
secondaryConnectionString := source.SecondaryConnectionString.Copy()
secrets.SecondaryConnectionString = &secondaryConnectionString
} else {
secrets.SecondaryConnectionString = nil
}
// SecondaryKey
if source.SecondaryKey != nil {
secondaryKey := source.SecondaryKey.Copy()
secrets.SecondaryKey = &secondaryKey
} else {
secrets.SecondaryKey = nil
}
// Update the property bag
if len(propertyBag) > 0 {
secrets.PropertyBag = propertyBag
} else {
secrets.PropertyBag = nil
}
// Invoke the augmentConversionForNamespacesAuthorizationRuleOperatorSecrets interface (if implemented) to customize the conversion
var secretsAsAny any = secrets
if augmentedSecrets, ok := secretsAsAny.(augmentConversionForNamespacesAuthorizationRuleOperatorSecrets); ok {
err := augmentedSecrets.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets populates the provided destination NamespacesAuthorizationRuleOperatorSecrets from our NamespacesAuthorizationRuleOperatorSecrets
func (secrets *NamespacesAuthorizationRuleOperatorSecrets) AssignProperties_To_NamespacesAuthorizationRuleOperatorSecrets(destination *v20211101s.NamespacesAuthorizationRuleOperatorSecrets) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(secrets.PropertyBag)
// PrimaryConnectionString
if secrets.PrimaryConnectionString != nil {
primaryConnectionString := secrets.PrimaryConnectionString.Copy()
destination.PrimaryConnectionString = &primaryConnectionString
} else {
destination.PrimaryConnectionString = nil
}
// PrimaryKey
if secrets.PrimaryKey != nil {
primaryKey := secrets.PrimaryKey.Copy()
destination.PrimaryKey = &primaryKey
} else {
destination.PrimaryKey = nil
}
// SecondaryConnectionString
if secrets.SecondaryConnectionString != nil {
secondaryConnectionString := secrets.SecondaryConnectionString.Copy()
destination.SecondaryConnectionString = &secondaryConnectionString
} else {
destination.SecondaryConnectionString = nil
}
// SecondaryKey
if secrets.SecondaryKey != nil {
secondaryKey := secrets.SecondaryKey.Copy()
destination.SecondaryKey = &secondaryKey
} else {
destination.SecondaryKey = nil
}
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// Invoke the augmentConversionForNamespacesAuthorizationRuleOperatorSecrets interface (if implemented) to customize the conversion
var secretsAsAny any = secrets
if augmentedSecrets, ok := secretsAsAny.(augmentConversionForNamespacesAuthorizationRuleOperatorSecrets); ok {
err := augmentedSecrets.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
type augmentConversionForNamespacesAuthorizationRuleOperatorSecrets interface {
AssignPropertiesFrom(src *v20211101s.NamespacesAuthorizationRuleOperatorSecrets) error
AssignPropertiesTo(dst *v20211101s.NamespacesAuthorizationRuleOperatorSecrets) error
}
func init() {
SchemeBuilder.Register(&NamespacesAuthorizationRule{}, &NamespacesAuthorizationRuleList{})
}