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