github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/resources/v4/alerting_policy/alerting_policy.pb.collections.go (about) 1 // Code generated by protoc-gen-goten-resource 2 // Resource: AlertingPolicy 3 // DO NOT EDIT!!! 4 5 package alerting_policy 6 7 import ( 8 gotenresource "github.com/cloudwan/goten-sdk/runtime/resource" 9 ) 10 11 // proto imports 12 import ( 13 notification_channel "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/notification_channel" 14 project "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/project" 15 meta "github.com/cloudwan/goten-sdk/types/meta" 16 ) 17 18 // ensure the imports are used 19 var ( 20 _ = new(gotenresource.ListQuery) 21 ) 22 23 // make sure we're using proto imports 24 var ( 25 _ = ¬ification_channel.NotificationChannel{} 26 _ = &project.Project{} 27 _ = &meta.Meta{} 28 ) 29 30 type AlertingPolicyList []*AlertingPolicy 31 32 func (l AlertingPolicyList) Append(item gotenresource.Resource) gotenresource.ResourceList { 33 return append(l, item.(*AlertingPolicy)) 34 } 35 36 func (l AlertingPolicyList) AppendList(list gotenresource.ResourceList) gotenresource.ResourceList { 37 return append(l, list.(AlertingPolicyList)...) 38 } 39 40 func (l AlertingPolicyList) Slice(first, second int) gotenresource.ResourceList { 41 if first > 0 && second > 0 { 42 return l[first:second] 43 } else if first > 0 { 44 return l[first:] 45 } else if second > 0 { 46 return l[:second] 47 } 48 return l[:] 49 } 50 51 func (l AlertingPolicyList) At(idx int) gotenresource.Resource { 52 return l[idx] 53 } 54 55 func (l AlertingPolicyList) Set(idx int, res gotenresource.Resource) { 56 l[idx] = res.(*AlertingPolicy) 57 } 58 59 func (l AlertingPolicyList) Length() int { 60 return len(l) 61 } 62 63 type AlertingPolicyChangeList []*AlertingPolicyChange 64 65 func (l AlertingPolicyChangeList) Append(item gotenresource.ResourceChange) gotenresource.ResourceChangeList { 66 return append(l, item.(*AlertingPolicyChange)) 67 } 68 69 func (l AlertingPolicyChangeList) AppendList(list gotenresource.ResourceChangeList) gotenresource.ResourceChangeList { 70 return append(l, list.(AlertingPolicyChangeList)...) 71 } 72 73 func (l AlertingPolicyChangeList) Slice(first, second int) gotenresource.ResourceChangeList { 74 if first > 0 && second > 0 { 75 return l[first:second] 76 } else if first > 0 { 77 return l[first:] 78 } else if second > 0 { 79 return l[:second] 80 } 81 return l[:] 82 } 83 84 func (l AlertingPolicyChangeList) At(idx int) gotenresource.ResourceChange { 85 return l[idx] 86 } 87 88 func (l AlertingPolicyChangeList) Set(idx int, change gotenresource.ResourceChange) { 89 l[idx] = change.(*AlertingPolicyChange) 90 } 91 92 func (l AlertingPolicyChangeList) Length() int { 93 return len(l) 94 } 95 96 type AlertingPolicyNameList []*Name 97 98 func (l AlertingPolicyNameList) Append(name gotenresource.Name) gotenresource.NameList { 99 return append(l, name.(*Name)) 100 } 101 102 func (l AlertingPolicyNameList) AppendList(list gotenresource.NameList) gotenresource.NameList { 103 return append(l, list.(AlertingPolicyNameList)...) 104 } 105 106 func (l AlertingPolicyNameList) Slice(first, second int) gotenresource.NameList { 107 if first > 0 && second > 0 { 108 return l[first:second] 109 } else if first > 0 { 110 return l[first:] 111 } else if second > 0 { 112 return l[:second] 113 } 114 return l[:] 115 } 116 117 func (l AlertingPolicyNameList) At(idx int) gotenresource.Name { 118 return l[idx] 119 } 120 121 func (l AlertingPolicyNameList) Set(idx int, name gotenresource.Name) { 122 l[idx] = name.(*Name) 123 } 124 125 func (l AlertingPolicyNameList) Length() int { 126 return len(l) 127 } 128 129 type AlertingPolicyReferenceList []*Reference 130 131 func (l AlertingPolicyReferenceList) Append(ref gotenresource.Reference) gotenresource.ReferenceList { 132 return append(l, ref.(*Reference)) 133 } 134 135 func (l AlertingPolicyReferenceList) AppendList(list gotenresource.ReferenceList) gotenresource.ReferenceList { 136 return append(l, list.(AlertingPolicyReferenceList)...) 137 } 138 139 func (l AlertingPolicyReferenceList) Slice(first, second int) gotenresource.ReferenceList { 140 if first > 0 && second > 0 { 141 return l[first:second] 142 } else if first > 0 { 143 return l[first:] 144 } else if second > 0 { 145 return l[:second] 146 } 147 return l[:] 148 } 149 150 func (l AlertingPolicyReferenceList) At(idx int) gotenresource.Reference { 151 return l[idx] 152 } 153 154 func (l AlertingPolicyReferenceList) Set(idx int, ref gotenresource.Reference) { 155 l[idx] = ref.(*Reference) 156 } 157 158 func (l AlertingPolicyReferenceList) Length() int { 159 return len(l) 160 } 161 162 type AlertingPolicyParentNameList []*ParentName 163 164 func (l AlertingPolicyParentNameList) Append(name gotenresource.Name) gotenresource.ParentNameList { 165 return append(l, name.(*ParentName)) 166 } 167 168 func (l AlertingPolicyParentNameList) AppendList(list gotenresource.ParentNameList) gotenresource.ParentNameList { 169 return append(l, list.(AlertingPolicyParentNameList)...) 170 } 171 172 func (l AlertingPolicyParentNameList) Slice(first, second int) gotenresource.ParentNameList { 173 if first > 0 && second > 0 { 174 return l[first:second] 175 } else if first > 0 { 176 return l[first:] 177 } else if second > 0 { 178 return l[:second] 179 } 180 return l[:] 181 } 182 183 func (l AlertingPolicyParentNameList) At(idx int) gotenresource.Name { 184 return l[idx] 185 } 186 187 func (l AlertingPolicyParentNameList) Set(idx int, name gotenresource.Name) { 188 l[idx] = name.(*ParentName) 189 } 190 191 func (l AlertingPolicyParentNameList) Length() int { 192 return len(l) 193 } 194 195 type AlertingPolicyParentReferenceList []*ParentReference 196 197 func (l AlertingPolicyParentReferenceList) Append(ref gotenresource.Reference) gotenresource.ParentReferenceList { 198 return append(l, ref.(*ParentReference)) 199 } 200 201 func (l AlertingPolicyParentReferenceList) AppendList(list gotenresource.ParentReferenceList) gotenresource.ParentReferenceList { 202 return append(l, list.(AlertingPolicyParentReferenceList)...) 203 } 204 205 func (l AlertingPolicyParentReferenceList) Slice(first, second int) gotenresource.ParentReferenceList { 206 if first > 0 && second > 0 { 207 return l[first:second] 208 } else if first > 0 { 209 return l[first:] 210 } else if second > 0 { 211 return l[:second] 212 } 213 return l[:] 214 } 215 216 func (l AlertingPolicyParentReferenceList) At(idx int) gotenresource.Reference { 217 return l[idx] 218 } 219 220 func (l AlertingPolicyParentReferenceList) Set(idx int, ref gotenresource.Reference) { 221 l[idx] = ref.(*ParentReference) 222 } 223 224 func (l AlertingPolicyParentReferenceList) Length() int { 225 return len(l) 226 } 227 228 type AlertingPolicyMap map[Name]*AlertingPolicy 229 230 func (m AlertingPolicyMap) Get(name gotenresource.Name) gotenresource.Resource { 231 return m[*name.(*Name)] 232 } 233 234 func (m AlertingPolicyMap) Set(res gotenresource.Resource) { 235 tRes := res.(*AlertingPolicy) 236 m[*tRes.Name] = tRes 237 } 238 239 func (m AlertingPolicyMap) Delete(name gotenresource.Name) { 240 delete(m, *name.(*Name)) 241 } 242 243 func (m AlertingPolicyMap) Length() int { 244 return len(m) 245 } 246 247 func (m AlertingPolicyMap) ForEach(cb func(gotenresource.Name, gotenresource.Resource) bool) { 248 for name, res := range m { 249 if !cb(&name, res) { 250 break 251 } 252 } 253 } 254 255 type AlertingPolicyChangeMap map[Name]*AlertingPolicyChange 256 257 func (m AlertingPolicyChangeMap) Get(name gotenresource.Name) gotenresource.ResourceChange { 258 return m[*name.(*Name)] 259 } 260 261 func (m AlertingPolicyChangeMap) Set(change gotenresource.ResourceChange) { 262 tChange := change.(*AlertingPolicyChange) 263 m[*tChange.GetAlertingPolicyName()] = tChange 264 } 265 266 func (m AlertingPolicyChangeMap) Delete(name gotenresource.Name) { 267 delete(m, *name.(*Name)) 268 } 269 270 func (m AlertingPolicyChangeMap) Length() int { 271 return len(m) 272 } 273 274 func (m AlertingPolicyChangeMap) ForEach(cb func(gotenresource.Name, gotenresource.ResourceChange) bool) { 275 for name, res := range m { 276 if !cb(&name, res) { 277 break 278 } 279 } 280 }