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