-
Notifications
You must be signed in to change notification settings - Fork 0
/
internet_quality_rating.pb.namebuilder.go
118 lines (97 loc) · 2.9 KB
/
internet_quality_rating.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: InternetQualityRating
// DO NOT EDIT!!!
package internet_quality_rating
import (
gotenresource "github.com/cloudwan/goten-sdk/runtime/resource"
)
// proto imports
import (
ntt_meta "github.com/cloudwan/edgelq-sdk/common/types/meta"
probe "github.com/cloudwan/watchdog-sdk/resources/v1alpha2/probe"
timestamp "github.com/golang/protobuf/ptypes/timestamp"
)
// make sure we're using proto imports
var (
_ = &ntt_meta.Meta{}
_ = ×tamp.Timestamp{}
_ = &probe.Probe{}
)
const (
NamePattern_Project_Region_Probe = "projects/{project}/regions/{region}/probes/{probe}/internetQualityRatings/{internet_quality_rating}"
)
type NamePattern struct {
Pattern gotenresource.NamePattern `firestore:"pattern"`
}
type NameBuilder struct {
nameObj Name
}
func NewNameBuilder() *NameBuilder {
return &NameBuilder{
nameObj: Name{
InternetQualityRatingId: gotenresource.WildcardId,
ParentName: ParentName{
NamePattern: NamePattern{
// Set default pattern - just first.
Pattern: NamePattern_Project_Region_Probe,
},
},
},
}
}
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.InternetQualityRatingId = id
return b
}
func (b *NameBuilder) SetProbe(parent *probe.Name) *NameBuilder {
parentName := &b.nameObj.ParentName
switch parent.Pattern {
case probe.NamePattern_Project_Region:
parentName.Pattern = NamePattern_Project_Region_Probe
}
parentName.ProjectId = parent.ProjectId
parentName.RegionId = parent.RegionId
parentName.ProbeId = parent.ProbeId
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.ProbeId != "" {
parentName.Pattern = NamePattern_Project_Region_Probe
}
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.ProbeId != "" {
parentName.Pattern = NamePattern_Project_Region_Probe
}
return b
}
func (b *NameBuilder) SetProbeId(id string) *NameBuilder {
parentName := &b.nameObj.ParentName
parentName.ProbeId = id
// Set pattern if something matches for this set of IDs
if parentName.ProjectId != "" && parentName.RegionId != "" && parentName.ProbeId != "" {
parentName.Pattern = NamePattern_Project_Region_Probe
}
return b
}