-
Notifications
You must be signed in to change notification settings - Fork 121
/
zz_generated.resolvers.go
85 lines (74 loc) · 2.85 KB
/
zz_generated.resolvers.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
/*
Copyright 2022 Upbound Inc.
*/
// Code generated by angryjet. DO NOT EDIT.
package v1beta1
import (
"context"
reference "github.com/crossplane/crossplane-runtime/pkg/reference"
resource "github.com/crossplane/upjet/pkg/resource"
errors "github.com/pkg/errors"
v1beta1 "github.com/upbound/provider-aws/apis/sns/v1beta1"
client "sigs.k8s.io/controller-runtime/pkg/client"
)
// ResolveReferences of this AssessmentTarget.
func (mg *AssessmentTarget) ResolveReferences(ctx context.Context, c client.Reader) error {
r := reference.NewAPIResolver(c, mg)
var rsp reference.ResolutionResponse
var err error
rsp, err = r.Resolve(ctx, reference.ResolutionRequest{
CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.ResourceGroupArn),
Extract: resource.ExtractParamPath("arn", true),
Reference: mg.Spec.ForProvider.ResourceGroupArnRef,
Selector: mg.Spec.ForProvider.ResourceGroupArnSelector,
To: reference.To{
List: &ResourceGroupList{},
Managed: &ResourceGroup{},
},
})
if err != nil {
return errors.Wrap(err, "mg.Spec.ForProvider.ResourceGroupArn")
}
mg.Spec.ForProvider.ResourceGroupArn = reference.ToPtrValue(rsp.ResolvedValue)
mg.Spec.ForProvider.ResourceGroupArnRef = rsp.ResolvedReference
return nil
}
// ResolveReferences of this AssessmentTemplate.
func (mg *AssessmentTemplate) ResolveReferences(ctx context.Context, c client.Reader) error {
r := reference.NewAPIResolver(c, mg)
var rsp reference.ResolutionResponse
var err error
for i3 := 0; i3 < len(mg.Spec.ForProvider.EventSubscription); i3++ {
rsp, err = r.Resolve(ctx, reference.ResolutionRequest{
CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.EventSubscription[i3].TopicArn),
Extract: resource.ExtractParamPath("arn", true),
Reference: mg.Spec.ForProvider.EventSubscription[i3].TopicArnRef,
Selector: mg.Spec.ForProvider.EventSubscription[i3].TopicArnSelector,
To: reference.To{
List: &v1beta1.TopicList{},
Managed: &v1beta1.Topic{},
},
})
if err != nil {
return errors.Wrap(err, "mg.Spec.ForProvider.EventSubscription[i3].TopicArn")
}
mg.Spec.ForProvider.EventSubscription[i3].TopicArn = reference.ToPtrValue(rsp.ResolvedValue)
mg.Spec.ForProvider.EventSubscription[i3].TopicArnRef = rsp.ResolvedReference
}
rsp, err = r.Resolve(ctx, reference.ResolutionRequest{
CurrentValue: reference.FromPtrValue(mg.Spec.ForProvider.TargetArn),
Extract: resource.ExtractParamPath("arn", true),
Reference: mg.Spec.ForProvider.TargetArnRef,
Selector: mg.Spec.ForProvider.TargetArnSelector,
To: reference.To{
List: &AssessmentTargetList{},
Managed: &AssessmentTarget{},
},
})
if err != nil {
return errors.Wrap(err, "mg.Spec.ForProvider.TargetArn")
}
mg.Spec.ForProvider.TargetArn = reference.ToPtrValue(rsp.ResolvedValue)
mg.Spec.ForProvider.TargetArnRef = rsp.ResolvedReference
return nil
}