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