github.com/cloudwan/edgelq-sdk@v1.15.4/monitoring/resources/v4/alert/alert.pb.collections.go (about) 1 // Code generated by protoc-gen-goten-resource 2 // Resource: Alert 3 // DO NOT EDIT!!! 4 5 package alert 6 7 import ( 8 gotenresource "github.com/cloudwan/goten-sdk/runtime/resource" 9 ) 10 11 // proto imports 12 import ( 13 alerting_condition "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/alerting_condition" 14 common "github.com/cloudwan/edgelq-sdk/monitoring/resources/v4/common" 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 _ = &alerting_condition.AlertingCondition{} 26 _ = &common.LabelDescriptor{} 27 _ = &meta.Meta{} 28 ) 29 30 type AlertList []*Alert 31 32 func (l AlertList) Append(item gotenresource.Resource) gotenresource.ResourceList { 33 return append(l, item.(*Alert)) 34 } 35 36 func (l AlertList) AppendList(list gotenresource.ResourceList) gotenresource.ResourceList { 37 return append(l, list.(AlertList)...) 38 } 39 40 func (l AlertList) 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 AlertList) At(idx int) gotenresource.Resource { 52 return l[idx] 53 } 54 55 func (l AlertList) Set(idx int, res gotenresource.Resource) { 56 l[idx] = res.(*Alert) 57 } 58 59 func (l AlertList) Length() int { 60 return len(l) 61 } 62 63 type AlertChangeList []*AlertChange 64 65 func (l AlertChangeList) Append(item gotenresource.ResourceChange) gotenresource.ResourceChangeList { 66 return append(l, item.(*AlertChange)) 67 } 68 69 func (l AlertChangeList) AppendList(list gotenresource.ResourceChangeList) gotenresource.ResourceChangeList { 70 return append(l, list.(AlertChangeList)...) 71 } 72 73 func (l AlertChangeList) 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 AlertChangeList) At(idx int) gotenresource.ResourceChange { 85 return l[idx] 86 } 87 88 func (l AlertChangeList) Set(idx int, change gotenresource.ResourceChange) { 89 l[idx] = change.(*AlertChange) 90 } 91 92 func (l AlertChangeList) Length() int { 93 return len(l) 94 } 95 96 type AlertNameList []*Name 97 98 func (l AlertNameList) Append(name gotenresource.Name) gotenresource.NameList { 99 return append(l, name.(*Name)) 100 } 101 102 func (l AlertNameList) AppendList(list gotenresource.NameList) gotenresource.NameList { 103 return append(l, list.(AlertNameList)...) 104 } 105 106 func (l AlertNameList) 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 AlertNameList) At(idx int) gotenresource.Name { 118 return l[idx] 119 } 120 121 func (l AlertNameList) Set(idx int, name gotenresource.Name) { 122 l[idx] = name.(*Name) 123 } 124 125 func (l AlertNameList) Length() int { 126 return len(l) 127 } 128 129 type AlertReferenceList []*Reference 130 131 func (l AlertReferenceList) Append(ref gotenresource.Reference) gotenresource.ReferenceList { 132 return append(l, ref.(*Reference)) 133 } 134 135 func (l AlertReferenceList) AppendList(list gotenresource.ReferenceList) gotenresource.ReferenceList { 136 return append(l, list.(AlertReferenceList)...) 137 } 138 139 func (l AlertReferenceList) 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 AlertReferenceList) At(idx int) gotenresource.Reference { 151 return l[idx] 152 } 153 154 func (l AlertReferenceList) Set(idx int, ref gotenresource.Reference) { 155 l[idx] = ref.(*Reference) 156 } 157 158 func (l AlertReferenceList) Length() int { 159 return len(l) 160 } 161 162 type AlertParentNameList []*ParentName 163 164 func (l AlertParentNameList) Append(name gotenresource.Name) gotenresource.ParentNameList { 165 return append(l, name.(*ParentName)) 166 } 167 168 func (l AlertParentNameList) AppendList(list gotenresource.ParentNameList) gotenresource.ParentNameList { 169 return append(l, list.(AlertParentNameList)...) 170 } 171 172 func (l AlertParentNameList) 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 AlertParentNameList) At(idx int) gotenresource.Name { 184 return l[idx] 185 } 186 187 func (l AlertParentNameList) Set(idx int, name gotenresource.Name) { 188 l[idx] = name.(*ParentName) 189 } 190 191 func (l AlertParentNameList) Length() int { 192 return len(l) 193 } 194 195 type AlertParentReferenceList []*ParentReference 196 197 func (l AlertParentReferenceList) Append(ref gotenresource.Reference) gotenresource.ParentReferenceList { 198 return append(l, ref.(*ParentReference)) 199 } 200 201 func (l AlertParentReferenceList) AppendList(list gotenresource.ParentReferenceList) gotenresource.ParentReferenceList { 202 return append(l, list.(AlertParentReferenceList)...) 203 } 204 205 func (l AlertParentReferenceList) 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 AlertParentReferenceList) At(idx int) gotenresource.Reference { 217 return l[idx] 218 } 219 220 func (l AlertParentReferenceList) Set(idx int, ref gotenresource.Reference) { 221 l[idx] = ref.(*ParentReference) 222 } 223 224 func (l AlertParentReferenceList) Length() int { 225 return len(l) 226 } 227 228 type AlertMap map[Name]*Alert 229 230 func (m AlertMap) Get(name gotenresource.Name) gotenresource.Resource { 231 return m[*name.(*Name)] 232 } 233 234 func (m AlertMap) Set(res gotenresource.Resource) { 235 tRes := res.(*Alert) 236 m[*tRes.Name] = tRes 237 } 238 239 func (m AlertMap) Delete(name gotenresource.Name) { 240 delete(m, *name.(*Name)) 241 } 242 243 func (m AlertMap) Length() int { 244 return len(m) 245 } 246 247 func (m AlertMap) 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 AlertChangeMap map[Name]*AlertChange 256 257 func (m AlertChangeMap) Get(name gotenresource.Name) gotenresource.ResourceChange { 258 return m[*name.(*Name)] 259 } 260 261 func (m AlertChangeMap) Set(change gotenresource.ResourceChange) { 262 tChange := change.(*AlertChange) 263 m[*tChange.GetAlertName()] = tChange 264 } 265 266 func (m AlertChangeMap) Delete(name gotenresource.Name) { 267 delete(m, *name.(*Name)) 268 } 269 270 func (m AlertChangeMap) Length() int { 271 return len(m) 272 } 273 274 func (m AlertChangeMap) ForEach(cb func(gotenresource.Name, gotenresource.ResourceChange) bool) { 275 for name, res := range m { 276 if !cb(&name, res) { 277 break 278 } 279 } 280 }