github.com/cloudwan/edgelq-sdk@v1.15.4/cellular-api/resources/v1/sim_card_stock/sim_card_stock.pb.collections.go (about) 1 // Code generated by protoc-gen-goten-resource 2 // Resource: SimCardStock 3 // DO NOT EDIT!!! 4 5 package sim_card_stock 6 7 import ( 8 gotenresource "github.com/cloudwan/goten-sdk/runtime/resource" 9 ) 10 11 // proto imports 12 import ( 13 contract "github.com/cloudwan/edgelq-sdk/cellular-api/resources/v1/contract" 14 sim_card "github.com/cloudwan/edgelq-sdk/cellular-api/resources/v1/sim_card" 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 _ = &contract.Contract{} 26 _ = &sim_card.SimCard{} 27 _ = &meta.Meta{} 28 ) 29 30 type SimCardStockList []*SimCardStock 31 32 func (l SimCardStockList) Append(item gotenresource.Resource) gotenresource.ResourceList { 33 return append(l, item.(*SimCardStock)) 34 } 35 36 func (l SimCardStockList) AppendList(list gotenresource.ResourceList) gotenresource.ResourceList { 37 return append(l, list.(SimCardStockList)...) 38 } 39 40 func (l SimCardStockList) 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 SimCardStockList) At(idx int) gotenresource.Resource { 52 return l[idx] 53 } 54 55 func (l SimCardStockList) Set(idx int, res gotenresource.Resource) { 56 l[idx] = res.(*SimCardStock) 57 } 58 59 func (l SimCardStockList) Length() int { 60 return len(l) 61 } 62 63 type SimCardStockChangeList []*SimCardStockChange 64 65 func (l SimCardStockChangeList) Append(item gotenresource.ResourceChange) gotenresource.ResourceChangeList { 66 return append(l, item.(*SimCardStockChange)) 67 } 68 69 func (l SimCardStockChangeList) AppendList(list gotenresource.ResourceChangeList) gotenresource.ResourceChangeList { 70 return append(l, list.(SimCardStockChangeList)...) 71 } 72 73 func (l SimCardStockChangeList) 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 SimCardStockChangeList) At(idx int) gotenresource.ResourceChange { 85 return l[idx] 86 } 87 88 func (l SimCardStockChangeList) Set(idx int, change gotenresource.ResourceChange) { 89 l[idx] = change.(*SimCardStockChange) 90 } 91 92 func (l SimCardStockChangeList) Length() int { 93 return len(l) 94 } 95 96 type SimCardStockNameList []*Name 97 98 func (l SimCardStockNameList) Append(name gotenresource.Name) gotenresource.NameList { 99 return append(l, name.(*Name)) 100 } 101 102 func (l SimCardStockNameList) AppendList(list gotenresource.NameList) gotenresource.NameList { 103 return append(l, list.(SimCardStockNameList)...) 104 } 105 106 func (l SimCardStockNameList) 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 SimCardStockNameList) At(idx int) gotenresource.Name { 118 return l[idx] 119 } 120 121 func (l SimCardStockNameList) Set(idx int, name gotenresource.Name) { 122 l[idx] = name.(*Name) 123 } 124 125 func (l SimCardStockNameList) Length() int { 126 return len(l) 127 } 128 129 type SimCardStockReferenceList []*Reference 130 131 func (l SimCardStockReferenceList) Append(ref gotenresource.Reference) gotenresource.ReferenceList { 132 return append(l, ref.(*Reference)) 133 } 134 135 func (l SimCardStockReferenceList) AppendList(list gotenresource.ReferenceList) gotenresource.ReferenceList { 136 return append(l, list.(SimCardStockReferenceList)...) 137 } 138 139 func (l SimCardStockReferenceList) 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 SimCardStockReferenceList) At(idx int) gotenresource.Reference { 151 return l[idx] 152 } 153 154 func (l SimCardStockReferenceList) Set(idx int, ref gotenresource.Reference) { 155 l[idx] = ref.(*Reference) 156 } 157 158 func (l SimCardStockReferenceList) Length() int { 159 return len(l) 160 } 161 162 type SimCardStockMap map[Name]*SimCardStock 163 164 func (m SimCardStockMap) Get(name gotenresource.Name) gotenresource.Resource { 165 return m[*name.(*Name)] 166 } 167 168 func (m SimCardStockMap) Set(res gotenresource.Resource) { 169 tRes := res.(*SimCardStock) 170 m[*tRes.Name] = tRes 171 } 172 173 func (m SimCardStockMap) Delete(name gotenresource.Name) { 174 delete(m, *name.(*Name)) 175 } 176 177 func (m SimCardStockMap) Length() int { 178 return len(m) 179 } 180 181 func (m SimCardStockMap) ForEach(cb func(gotenresource.Name, gotenresource.Resource) bool) { 182 for name, res := range m { 183 if !cb(&name, res) { 184 break 185 } 186 } 187 } 188 189 type SimCardStockChangeMap map[Name]*SimCardStockChange 190 191 func (m SimCardStockChangeMap) Get(name gotenresource.Name) gotenresource.ResourceChange { 192 return m[*name.(*Name)] 193 } 194 195 func (m SimCardStockChangeMap) Set(change gotenresource.ResourceChange) { 196 tChange := change.(*SimCardStockChange) 197 m[*tChange.GetSimCardStockName()] = tChange 198 } 199 200 func (m SimCardStockChangeMap) Delete(name gotenresource.Name) { 201 delete(m, *name.(*Name)) 202 } 203 204 func (m SimCardStockChangeMap) Length() int { 205 return len(m) 206 } 207 208 func (m SimCardStockChangeMap) ForEach(cb func(gotenresource.Name, gotenresource.ResourceChange) bool) { 209 for name, res := range m { 210 if !cb(&name, res) { 211 break 212 } 213 } 214 }