/
role_assignment_types_gen.go
678 lines (544 loc) · 24.9 KB
/
role_assignment_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
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20200801previewstorage
import (
"fmt"
v20200801ps "github.com/Azure/azure-service-operator/v2/api/authorization/v1api20200801previewstorage"
"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 v1beta20200801preview.RoleAssignment
// Deprecated version of RoleAssignment. Use v1api20200801preview.RoleAssignment instead
type RoleAssignment struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec RoleAssignment_Spec `json:"spec,omitempty"`
Status RoleAssignment_STATUS `json:"status,omitempty"`
}
var _ conditions.Conditioner = &RoleAssignment{}
// GetConditions returns the conditions of the resource
func (assignment *RoleAssignment) GetConditions() conditions.Conditions {
return assignment.Status.Conditions
}
// SetConditions sets the conditions on the resource status
func (assignment *RoleAssignment) SetConditions(conditions conditions.Conditions) {
assignment.Status.Conditions = conditions
}
var _ conversion.Convertible = &RoleAssignment{}
// ConvertFrom populates our RoleAssignment from the provided hub RoleAssignment
func (assignment *RoleAssignment) ConvertFrom(hub conversion.Hub) error {
source, ok := hub.(*v20200801ps.RoleAssignment)
if !ok {
return fmt.Errorf("expected authorization/v1api20200801previewstorage/RoleAssignment but received %T instead", hub)
}
return assignment.AssignProperties_From_RoleAssignment(source)
}
// ConvertTo populates the provided hub RoleAssignment from our RoleAssignment
func (assignment *RoleAssignment) ConvertTo(hub conversion.Hub) error {
destination, ok := hub.(*v20200801ps.RoleAssignment)
if !ok {
return fmt.Errorf("expected authorization/v1api20200801previewstorage/RoleAssignment but received %T instead", hub)
}
return assignment.AssignProperties_To_RoleAssignment(destination)
}
var _ genruntime.KubernetesResource = &RoleAssignment{}
// AzureName returns the Azure name of the resource
func (assignment *RoleAssignment) AzureName() string {
return assignment.Spec.AzureName
}
// GetAPIVersion returns the ARM API version of the resource. This is always "2020-08-01-preview"
func (assignment RoleAssignment) GetAPIVersion() string {
return string(APIVersion_Value)
}
// GetResourceScope returns the scope of the resource
func (assignment *RoleAssignment) GetResourceScope() genruntime.ResourceScope {
return genruntime.ResourceScopeExtension
}
// GetSpec returns the specification of this resource
func (assignment *RoleAssignment) GetSpec() genruntime.ConvertibleSpec {
return &assignment.Spec
}
// GetStatus returns the status of this resource
func (assignment *RoleAssignment) GetStatus() genruntime.ConvertibleStatus {
return &assignment.Status
}
// GetType returns the ARM Type of the resource. This is always "Microsoft.Authorization/roleAssignments"
func (assignment *RoleAssignment) GetType() string {
return "Microsoft.Authorization/roleAssignments"
}
// NewEmptyStatus returns a new empty (blank) status
func (assignment *RoleAssignment) NewEmptyStatus() genruntime.ConvertibleStatus {
return &RoleAssignment_STATUS{}
}
// Owner returns the ResourceReference of the owner
func (assignment *RoleAssignment) Owner() *genruntime.ResourceReference {
return assignment.Spec.Owner.AsResourceReference()
}
// SetStatus sets the status of this resource
func (assignment *RoleAssignment) SetStatus(status genruntime.ConvertibleStatus) error {
// If we have exactly the right type of status, assign it
if st, ok := status.(*RoleAssignment_STATUS); ok {
assignment.Status = *st
return nil
}
// Convert status to required version
var st RoleAssignment_STATUS
err := status.ConvertStatusTo(&st)
if err != nil {
return errors.Wrap(err, "failed to convert status")
}
assignment.Status = st
return nil
}
// AssignProperties_From_RoleAssignment populates our RoleAssignment from the provided source RoleAssignment
func (assignment *RoleAssignment) AssignProperties_From_RoleAssignment(source *v20200801ps.RoleAssignment) error {
// ObjectMeta
assignment.ObjectMeta = *source.ObjectMeta.DeepCopy()
// Spec
var spec RoleAssignment_Spec
err := spec.AssignProperties_From_RoleAssignment_Spec(&source.Spec)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_RoleAssignment_Spec() to populate field Spec")
}
assignment.Spec = spec
// Status
var status RoleAssignment_STATUS
err = status.AssignProperties_From_RoleAssignment_STATUS(&source.Status)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_From_RoleAssignment_STATUS() to populate field Status")
}
assignment.Status = status
// Invoke the augmentConversionForRoleAssignment interface (if implemented) to customize the conversion
var assignmentAsAny any = assignment
if augmentedAssignment, ok := assignmentAsAny.(augmentConversionForRoleAssignment); ok {
err := augmentedAssignment.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_RoleAssignment populates the provided destination RoleAssignment from our RoleAssignment
func (assignment *RoleAssignment) AssignProperties_To_RoleAssignment(destination *v20200801ps.RoleAssignment) error {
// ObjectMeta
destination.ObjectMeta = *assignment.ObjectMeta.DeepCopy()
// Spec
var spec v20200801ps.RoleAssignment_Spec
err := assignment.Spec.AssignProperties_To_RoleAssignment_Spec(&spec)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_RoleAssignment_Spec() to populate field Spec")
}
destination.Spec = spec
// Status
var status v20200801ps.RoleAssignment_STATUS
err = assignment.Status.AssignProperties_To_RoleAssignment_STATUS(&status)
if err != nil {
return errors.Wrap(err, "calling AssignProperties_To_RoleAssignment_STATUS() to populate field Status")
}
destination.Status = status
// Invoke the augmentConversionForRoleAssignment interface (if implemented) to customize the conversion
var assignmentAsAny any = assignment
if augmentedAssignment, ok := assignmentAsAny.(augmentConversionForRoleAssignment); ok {
err := augmentedAssignment.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 (assignment *RoleAssignment) OriginalGVK() *schema.GroupVersionKind {
return &schema.GroupVersionKind{
Group: GroupVersion.Group,
Version: assignment.Spec.OriginalVersion,
Kind: "RoleAssignment",
}
}
// +kubebuilder:object:root=true
// Storage version of v1beta20200801preview.RoleAssignment
// Deprecated version of RoleAssignment. Use v1api20200801preview.RoleAssignment instead
type RoleAssignmentList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []RoleAssignment `json:"items"`
}
// Storage version of v1beta20200801preview.APIVersion
// Deprecated version of APIVersion. Use v1api20200801preview.APIVersion instead
// +kubebuilder:validation:Enum={"2020-08-01-preview"}
type APIVersion string
const APIVersion_Value = APIVersion("2020-08-01-preview")
type augmentConversionForRoleAssignment interface {
AssignPropertiesFrom(src *v20200801ps.RoleAssignment) error
AssignPropertiesTo(dst *v20200801ps.RoleAssignment) error
}
// Storage version of v1beta20200801preview.RoleAssignment_Spec
type RoleAssignment_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"`
Condition *string `json:"condition,omitempty"`
ConditionVersion *string `json:"conditionVersion,omitempty"`
DelegatedManagedIdentityResourceId *string `json:"delegatedManagedIdentityResourceId,omitempty"`
Description *string `json:"description,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. This resource is an
// extension resource, which means that any other Azure resource can be its owner.
Owner *genruntime.ArbitraryOwnerReference `json:"owner,omitempty"`
PrincipalId *string `json:"principalId,omitempty" optionalConfigMapPair:"PrincipalId"`
PrincipalIdFromConfig *genruntime.ConfigMapReference `json:"principalIdFromConfig,omitempty" optionalConfigMapPair:"PrincipalId"`
PrincipalType *string `json:"principalType,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
// +kubebuilder:validation:Required
RoleDefinitionReference *genruntime.ResourceReference `armReference:"RoleDefinitionId" json:"roleDefinitionReference,omitempty"`
}
var _ genruntime.ConvertibleSpec = &RoleAssignment_Spec{}
// ConvertSpecFrom populates our RoleAssignment_Spec from the provided source
func (assignment *RoleAssignment_Spec) ConvertSpecFrom(source genruntime.ConvertibleSpec) error {
src, ok := source.(*v20200801ps.RoleAssignment_Spec)
if ok {
// Populate our instance from source
return assignment.AssignProperties_From_RoleAssignment_Spec(src)
}
// Convert to an intermediate form
src = &v20200801ps.RoleAssignment_Spec{}
err := src.ConvertSpecFrom(source)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertSpecFrom()")
}
// Update our instance from src
err = assignment.AssignProperties_From_RoleAssignment_Spec(src)
if err != nil {
return errors.Wrap(err, "final step of conversion in ConvertSpecFrom()")
}
return nil
}
// ConvertSpecTo populates the provided destination from our RoleAssignment_Spec
func (assignment *RoleAssignment_Spec) ConvertSpecTo(destination genruntime.ConvertibleSpec) error {
dst, ok := destination.(*v20200801ps.RoleAssignment_Spec)
if ok {
// Populate destination from our instance
return assignment.AssignProperties_To_RoleAssignment_Spec(dst)
}
// Convert to an intermediate form
dst = &v20200801ps.RoleAssignment_Spec{}
err := assignment.AssignProperties_To_RoleAssignment_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_RoleAssignment_Spec populates our RoleAssignment_Spec from the provided source RoleAssignment_Spec
func (assignment *RoleAssignment_Spec) AssignProperties_From_RoleAssignment_Spec(source *v20200801ps.RoleAssignment_Spec) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// AzureName
assignment.AzureName = source.AzureName
// Condition
assignment.Condition = genruntime.ClonePointerToString(source.Condition)
// ConditionVersion
assignment.ConditionVersion = genruntime.ClonePointerToString(source.ConditionVersion)
// DelegatedManagedIdentityResourceId
assignment.DelegatedManagedIdentityResourceId = genruntime.ClonePointerToString(source.DelegatedManagedIdentityResourceId)
// Description
assignment.Description = genruntime.ClonePointerToString(source.Description)
// OriginalVersion
assignment.OriginalVersion = source.OriginalVersion
// Owner
if source.Owner != nil {
owner := source.Owner.Copy()
assignment.Owner = &owner
} else {
assignment.Owner = nil
}
// PrincipalId
assignment.PrincipalId = genruntime.ClonePointerToString(source.PrincipalId)
// PrincipalIdFromConfig
if source.PrincipalIdFromConfig != nil {
principalIdFromConfig := source.PrincipalIdFromConfig.Copy()
assignment.PrincipalIdFromConfig = &principalIdFromConfig
} else {
assignment.PrincipalIdFromConfig = nil
}
// PrincipalType
assignment.PrincipalType = genruntime.ClonePointerToString(source.PrincipalType)
// RoleDefinitionReference
if source.RoleDefinitionReference != nil {
roleDefinitionReference := source.RoleDefinitionReference.Copy()
assignment.RoleDefinitionReference = &roleDefinitionReference
} else {
assignment.RoleDefinitionReference = nil
}
// Update the property bag
if len(propertyBag) > 0 {
assignment.PropertyBag = propertyBag
} else {
assignment.PropertyBag = nil
}
// Invoke the augmentConversionForRoleAssignment_Spec interface (if implemented) to customize the conversion
var assignmentAsAny any = assignment
if augmentedAssignment, ok := assignmentAsAny.(augmentConversionForRoleAssignment_Spec); ok {
err := augmentedAssignment.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_RoleAssignment_Spec populates the provided destination RoleAssignment_Spec from our RoleAssignment_Spec
func (assignment *RoleAssignment_Spec) AssignProperties_To_RoleAssignment_Spec(destination *v20200801ps.RoleAssignment_Spec) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(assignment.PropertyBag)
// AzureName
destination.AzureName = assignment.AzureName
// Condition
destination.Condition = genruntime.ClonePointerToString(assignment.Condition)
// ConditionVersion
destination.ConditionVersion = genruntime.ClonePointerToString(assignment.ConditionVersion)
// DelegatedManagedIdentityResourceId
destination.DelegatedManagedIdentityResourceId = genruntime.ClonePointerToString(assignment.DelegatedManagedIdentityResourceId)
// Description
destination.Description = genruntime.ClonePointerToString(assignment.Description)
// OriginalVersion
destination.OriginalVersion = assignment.OriginalVersion
// Owner
if assignment.Owner != nil {
owner := assignment.Owner.Copy()
destination.Owner = &owner
} else {
destination.Owner = nil
}
// PrincipalId
destination.PrincipalId = genruntime.ClonePointerToString(assignment.PrincipalId)
// PrincipalIdFromConfig
if assignment.PrincipalIdFromConfig != nil {
principalIdFromConfig := assignment.PrincipalIdFromConfig.Copy()
destination.PrincipalIdFromConfig = &principalIdFromConfig
} else {
destination.PrincipalIdFromConfig = nil
}
// PrincipalType
destination.PrincipalType = genruntime.ClonePointerToString(assignment.PrincipalType)
// RoleDefinitionReference
if assignment.RoleDefinitionReference != nil {
roleDefinitionReference := assignment.RoleDefinitionReference.Copy()
destination.RoleDefinitionReference = &roleDefinitionReference
} else {
destination.RoleDefinitionReference = nil
}
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// Invoke the augmentConversionForRoleAssignment_Spec interface (if implemented) to customize the conversion
var assignmentAsAny any = assignment
if augmentedAssignment, ok := assignmentAsAny.(augmentConversionForRoleAssignment_Spec); ok {
err := augmentedAssignment.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
// Storage version of v1beta20200801preview.RoleAssignment_STATUS
// Deprecated version of RoleAssignment_STATUS. Use v1api20200801preview.RoleAssignment_STATUS instead
type RoleAssignment_STATUS struct {
Condition *string `json:"condition,omitempty"`
ConditionVersion *string `json:"conditionVersion,omitempty"`
Conditions []conditions.Condition `json:"conditions,omitempty"`
CreatedBy *string `json:"createdBy,omitempty"`
CreatedOn *string `json:"createdOn,omitempty"`
DelegatedManagedIdentityResourceId *string `json:"delegatedManagedIdentityResourceId,omitempty"`
Description *string `json:"description,omitempty"`
Id *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
PrincipalId *string `json:"principalId,omitempty"`
PrincipalType *string `json:"principalType,omitempty"`
PropertyBag genruntime.PropertyBag `json:"$propertyBag,omitempty"`
RoleDefinitionId *string `json:"roleDefinitionId,omitempty"`
Scope *string `json:"scope,omitempty"`
Type *string `json:"type,omitempty"`
UpdatedBy *string `json:"updatedBy,omitempty"`
UpdatedOn *string `json:"updatedOn,omitempty"`
}
var _ genruntime.ConvertibleStatus = &RoleAssignment_STATUS{}
// ConvertStatusFrom populates our RoleAssignment_STATUS from the provided source
func (assignment *RoleAssignment_STATUS) ConvertStatusFrom(source genruntime.ConvertibleStatus) error {
src, ok := source.(*v20200801ps.RoleAssignment_STATUS)
if ok {
// Populate our instance from source
return assignment.AssignProperties_From_RoleAssignment_STATUS(src)
}
// Convert to an intermediate form
src = &v20200801ps.RoleAssignment_STATUS{}
err := src.ConvertStatusFrom(source)
if err != nil {
return errors.Wrap(err, "initial step of conversion in ConvertStatusFrom()")
}
// Update our instance from src
err = assignment.AssignProperties_From_RoleAssignment_STATUS(src)
if err != nil {
return errors.Wrap(err, "final step of conversion in ConvertStatusFrom()")
}
return nil
}
// ConvertStatusTo populates the provided destination from our RoleAssignment_STATUS
func (assignment *RoleAssignment_STATUS) ConvertStatusTo(destination genruntime.ConvertibleStatus) error {
dst, ok := destination.(*v20200801ps.RoleAssignment_STATUS)
if ok {
// Populate destination from our instance
return assignment.AssignProperties_To_RoleAssignment_STATUS(dst)
}
// Convert to an intermediate form
dst = &v20200801ps.RoleAssignment_STATUS{}
err := assignment.AssignProperties_To_RoleAssignment_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_RoleAssignment_STATUS populates our RoleAssignment_STATUS from the provided source RoleAssignment_STATUS
func (assignment *RoleAssignment_STATUS) AssignProperties_From_RoleAssignment_STATUS(source *v20200801ps.RoleAssignment_STATUS) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(source.PropertyBag)
// Condition
assignment.Condition = genruntime.ClonePointerToString(source.Condition)
// ConditionVersion
assignment.ConditionVersion = genruntime.ClonePointerToString(source.ConditionVersion)
// Conditions
assignment.Conditions = genruntime.CloneSliceOfCondition(source.Conditions)
// CreatedBy
assignment.CreatedBy = genruntime.ClonePointerToString(source.CreatedBy)
// CreatedOn
assignment.CreatedOn = genruntime.ClonePointerToString(source.CreatedOn)
// DelegatedManagedIdentityResourceId
assignment.DelegatedManagedIdentityResourceId = genruntime.ClonePointerToString(source.DelegatedManagedIdentityResourceId)
// Description
assignment.Description = genruntime.ClonePointerToString(source.Description)
// Id
assignment.Id = genruntime.ClonePointerToString(source.Id)
// Name
assignment.Name = genruntime.ClonePointerToString(source.Name)
// PrincipalId
assignment.PrincipalId = genruntime.ClonePointerToString(source.PrincipalId)
// PrincipalType
assignment.PrincipalType = genruntime.ClonePointerToString(source.PrincipalType)
// RoleDefinitionId
assignment.RoleDefinitionId = genruntime.ClonePointerToString(source.RoleDefinitionId)
// Scope
assignment.Scope = genruntime.ClonePointerToString(source.Scope)
// Type
assignment.Type = genruntime.ClonePointerToString(source.Type)
// UpdatedBy
assignment.UpdatedBy = genruntime.ClonePointerToString(source.UpdatedBy)
// UpdatedOn
assignment.UpdatedOn = genruntime.ClonePointerToString(source.UpdatedOn)
// Update the property bag
if len(propertyBag) > 0 {
assignment.PropertyBag = propertyBag
} else {
assignment.PropertyBag = nil
}
// Invoke the augmentConversionForRoleAssignment_STATUS interface (if implemented) to customize the conversion
var assignmentAsAny any = assignment
if augmentedAssignment, ok := assignmentAsAny.(augmentConversionForRoleAssignment_STATUS); ok {
err := augmentedAssignment.AssignPropertiesFrom(source)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesFrom() for conversion")
}
}
// No error
return nil
}
// AssignProperties_To_RoleAssignment_STATUS populates the provided destination RoleAssignment_STATUS from our RoleAssignment_STATUS
func (assignment *RoleAssignment_STATUS) AssignProperties_To_RoleAssignment_STATUS(destination *v20200801ps.RoleAssignment_STATUS) error {
// Clone the existing property bag
propertyBag := genruntime.NewPropertyBag(assignment.PropertyBag)
// Condition
destination.Condition = genruntime.ClonePointerToString(assignment.Condition)
// ConditionVersion
destination.ConditionVersion = genruntime.ClonePointerToString(assignment.ConditionVersion)
// Conditions
destination.Conditions = genruntime.CloneSliceOfCondition(assignment.Conditions)
// CreatedBy
destination.CreatedBy = genruntime.ClonePointerToString(assignment.CreatedBy)
// CreatedOn
destination.CreatedOn = genruntime.ClonePointerToString(assignment.CreatedOn)
// DelegatedManagedIdentityResourceId
destination.DelegatedManagedIdentityResourceId = genruntime.ClonePointerToString(assignment.DelegatedManagedIdentityResourceId)
// Description
destination.Description = genruntime.ClonePointerToString(assignment.Description)
// Id
destination.Id = genruntime.ClonePointerToString(assignment.Id)
// Name
destination.Name = genruntime.ClonePointerToString(assignment.Name)
// PrincipalId
destination.PrincipalId = genruntime.ClonePointerToString(assignment.PrincipalId)
// PrincipalType
destination.PrincipalType = genruntime.ClonePointerToString(assignment.PrincipalType)
// RoleDefinitionId
destination.RoleDefinitionId = genruntime.ClonePointerToString(assignment.RoleDefinitionId)
// Scope
destination.Scope = genruntime.ClonePointerToString(assignment.Scope)
// Type
destination.Type = genruntime.ClonePointerToString(assignment.Type)
// UpdatedBy
destination.UpdatedBy = genruntime.ClonePointerToString(assignment.UpdatedBy)
// UpdatedOn
destination.UpdatedOn = genruntime.ClonePointerToString(assignment.UpdatedOn)
// Update the property bag
if len(propertyBag) > 0 {
destination.PropertyBag = propertyBag
} else {
destination.PropertyBag = nil
}
// Invoke the augmentConversionForRoleAssignment_STATUS interface (if implemented) to customize the conversion
var assignmentAsAny any = assignment
if augmentedAssignment, ok := assignmentAsAny.(augmentConversionForRoleAssignment_STATUS); ok {
err := augmentedAssignment.AssignPropertiesTo(destination)
if err != nil {
return errors.Wrap(err, "calling augmented AssignPropertiesTo() for conversion")
}
}
// No error
return nil
}
type augmentConversionForRoleAssignment_Spec interface {
AssignPropertiesFrom(src *v20200801ps.RoleAssignment_Spec) error
AssignPropertiesTo(dst *v20200801ps.RoleAssignment_Spec) error
}
type augmentConversionForRoleAssignment_STATUS interface {
AssignPropertiesFrom(src *v20200801ps.RoleAssignment_STATUS) error
AssignPropertiesTo(dst *v20200801ps.RoleAssignment_STATUS) error
}
func init() {
SchemeBuilder.Register(&RoleAssignment{}, &RoleAssignmentList{})
}