-
Notifications
You must be signed in to change notification settings - Fork 1
/
provisioning_approval_request.pb.namebuilder.go
118 lines (97 loc) · 3.28 KB
/
provisioning_approval_request.pb.namebuilder.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
// Code generated by protoc-gen-goten-resource
// Resource: ProvisioningApprovalRequest
// DO NOT EDIT!!!
package provisioning_approval_request
import (
gotenresource "github.com/cloudwan/goten-sdk/runtime/resource"
)
// proto imports
import (
ntt_meta "github.com/cloudwan/edgelq-sdk/common/types/meta"
provisioning_policy "github.com/cloudwan/edgelq-sdk/devices/resources/v1alpha2/provisioning_policy"
iam_service_account "github.com/cloudwan/edgelq-sdk/iam/resources/v1alpha2/service_account"
)
// make sure we're using proto imports
var (
_ = &ntt_meta.Meta{}
_ = &provisioning_policy.ProvisioningPolicy{}
_ = &iam_service_account.ServiceAccount{}
)
const (
NamePattern_Project_Region_ProvisioningPolicy = "projects/{project}/regions/{region}/provisioningPolicies/{provisioning_policy}/provisioningApprovalRequests/{provisioning_approval_request}"
)
type NamePattern struct {
Pattern gotenresource.NamePattern `firestore:"pattern"`
}
type NameBuilder struct {
nameObj Name
}
func NewNameBuilder() *NameBuilder {
return &NameBuilder{
nameObj: Name{
ProvisioningApprovalRequestId: gotenresource.WildcardId,
ParentName: ParentName{
NamePattern: NamePattern{
// Set default pattern - just first.
Pattern: NamePattern_Project_Region_ProvisioningPolicy,
},
},
},
}
}
func (b *NameBuilder) Name() *Name {
copied := b.nameObj
return &copied
}
func (b *NameBuilder) Reference() *Reference {
return b.nameObj.AsReference()
}
func (b *NameBuilder) Parent() *ParentName {
copied := b.nameObj.ParentName
return &copied
}
func (b *NameBuilder) ParentReference() *ParentReference {
return b.nameObj.ParentName.AsReference()
}
func (b *NameBuilder) SetId(id string) *NameBuilder {
b.nameObj.ProvisioningApprovalRequestId = id
return b
}
func (b *NameBuilder) SetProvisioningPolicy(parent *provisioning_policy.Name) *NameBuilder {
parentName := &b.nameObj.ParentName
switch parent.Pattern {
case provisioning_policy.NamePattern_Project_Region:
parentName.Pattern = NamePattern_Project_Region_ProvisioningPolicy
}
parentName.ProjectId = parent.ProjectId
parentName.RegionId = parent.RegionId
parentName.ProvisioningPolicyId = parent.ProvisioningPolicyId
return b
}
func (b *NameBuilder) SetProjectId(id string) *NameBuilder {
parentName := &b.nameObj.ParentName
parentName.ProjectId = id
// Set pattern if something matches for this set of IDs
if parentName.ProjectId != "" && parentName.RegionId != "" && parentName.ProvisioningPolicyId != "" {
parentName.Pattern = NamePattern_Project_Region_ProvisioningPolicy
}
return b
}
func (b *NameBuilder) SetRegionId(id string) *NameBuilder {
parentName := &b.nameObj.ParentName
parentName.RegionId = id
// Set pattern if something matches for this set of IDs
if parentName.ProjectId != "" && parentName.RegionId != "" && parentName.ProvisioningPolicyId != "" {
parentName.Pattern = NamePattern_Project_Region_ProvisioningPolicy
}
return b
}
func (b *NameBuilder) SetProvisioningPolicyId(id string) *NameBuilder {
parentName := &b.nameObj.ParentName
parentName.ProvisioningPolicyId = id
// Set pattern if something matches for this set of IDs
if parentName.ProjectId != "" && parentName.RegionId != "" && parentName.ProvisioningPolicyId != "" {
parentName.Pattern = NamePattern_Project_Region_ProvisioningPolicy
}
return b
}