github.com/cloudwan/edgelq-sdk@v1.15.4/iam/resources/v1/organization/organization.pb.collections.go (about) 1 // Code generated by protoc-gen-goten-resource 2 // Resource: Organization 3 // DO NOT EDIT!!! 4 5 package organization 6 7 import ( 8 gotenresource "github.com/cloudwan/goten-sdk/runtime/resource" 9 ) 10 11 // proto imports 12 import ( 13 iam_common "github.com/cloudwan/edgelq-sdk/iam/resources/v1/common" 14 meta_service "github.com/cloudwan/goten-sdk/meta-service/resources/v1/service" 15 meta "github.com/cloudwan/goten-sdk/types/meta" 16 multi_region_policy "github.com/cloudwan/goten-sdk/types/multi_region_policy" 17 ) 18 19 // ensure the imports are used 20 var ( 21 _ = new(gotenresource.ListQuery) 22 ) 23 24 // make sure we're using proto imports 25 var ( 26 _ = &iam_common.PCR{} 27 _ = &meta_service.Service{} 28 _ = &meta.Meta{} 29 _ = &multi_region_policy.MultiRegionPolicy{} 30 ) 31 32 type OrganizationList []*Organization 33 34 func (l OrganizationList) Append(item gotenresource.Resource) gotenresource.ResourceList { 35 return append(l, item.(*Organization)) 36 } 37 38 func (l OrganizationList) AppendList(list gotenresource.ResourceList) gotenresource.ResourceList { 39 return append(l, list.(OrganizationList)...) 40 } 41 42 func (l OrganizationList) Slice(first, second int) gotenresource.ResourceList { 43 if first > 0 && second > 0 { 44 return l[first:second] 45 } else if first > 0 { 46 return l[first:] 47 } else if second > 0 { 48 return l[:second] 49 } 50 return l[:] 51 } 52 53 func (l OrganizationList) At(idx int) gotenresource.Resource { 54 return l[idx] 55 } 56 57 func (l OrganizationList) Set(idx int, res gotenresource.Resource) { 58 l[idx] = res.(*Organization) 59 } 60 61 func (l OrganizationList) Length() int { 62 return len(l) 63 } 64 65 type OrganizationChangeList []*OrganizationChange 66 67 func (l OrganizationChangeList) Append(item gotenresource.ResourceChange) gotenresource.ResourceChangeList { 68 return append(l, item.(*OrganizationChange)) 69 } 70 71 func (l OrganizationChangeList) AppendList(list gotenresource.ResourceChangeList) gotenresource.ResourceChangeList { 72 return append(l, list.(OrganizationChangeList)...) 73 } 74 75 func (l OrganizationChangeList) Slice(first, second int) gotenresource.ResourceChangeList { 76 if first > 0 && second > 0 { 77 return l[first:second] 78 } else if first > 0 { 79 return l[first:] 80 } else if second > 0 { 81 return l[:second] 82 } 83 return l[:] 84 } 85 86 func (l OrganizationChangeList) At(idx int) gotenresource.ResourceChange { 87 return l[idx] 88 } 89 90 func (l OrganizationChangeList) Set(idx int, change gotenresource.ResourceChange) { 91 l[idx] = change.(*OrganizationChange) 92 } 93 94 func (l OrganizationChangeList) Length() int { 95 return len(l) 96 } 97 98 type OrganizationNameList []*Name 99 100 func (l OrganizationNameList) Append(name gotenresource.Name) gotenresource.NameList { 101 return append(l, name.(*Name)) 102 } 103 104 func (l OrganizationNameList) AppendList(list gotenresource.NameList) gotenresource.NameList { 105 return append(l, list.(OrganizationNameList)...) 106 } 107 108 func (l OrganizationNameList) Slice(first, second int) gotenresource.NameList { 109 if first > 0 && second > 0 { 110 return l[first:second] 111 } else if first > 0 { 112 return l[first:] 113 } else if second > 0 { 114 return l[:second] 115 } 116 return l[:] 117 } 118 119 func (l OrganizationNameList) At(idx int) gotenresource.Name { 120 return l[idx] 121 } 122 123 func (l OrganizationNameList) Set(idx int, name gotenresource.Name) { 124 l[idx] = name.(*Name) 125 } 126 127 func (l OrganizationNameList) Length() int { 128 return len(l) 129 } 130 131 type OrganizationReferenceList []*Reference 132 133 func (l OrganizationReferenceList) Append(ref gotenresource.Reference) gotenresource.ReferenceList { 134 return append(l, ref.(*Reference)) 135 } 136 137 func (l OrganizationReferenceList) AppendList(list gotenresource.ReferenceList) gotenresource.ReferenceList { 138 return append(l, list.(OrganizationReferenceList)...) 139 } 140 141 func (l OrganizationReferenceList) Slice(first, second int) gotenresource.ReferenceList { 142 if first > 0 && second > 0 { 143 return l[first:second] 144 } else if first > 0 { 145 return l[first:] 146 } else if second > 0 { 147 return l[:second] 148 } 149 return l[:] 150 } 151 152 func (l OrganizationReferenceList) At(idx int) gotenresource.Reference { 153 return l[idx] 154 } 155 156 func (l OrganizationReferenceList) Set(idx int, ref gotenresource.Reference) { 157 l[idx] = ref.(*Reference) 158 } 159 160 func (l OrganizationReferenceList) Length() int { 161 return len(l) 162 } 163 164 type OrganizationMap map[Name]*Organization 165 166 func (m OrganizationMap) Get(name gotenresource.Name) gotenresource.Resource { 167 return m[*name.(*Name)] 168 } 169 170 func (m OrganizationMap) Set(res gotenresource.Resource) { 171 tRes := res.(*Organization) 172 m[*tRes.Name] = tRes 173 } 174 175 func (m OrganizationMap) Delete(name gotenresource.Name) { 176 delete(m, *name.(*Name)) 177 } 178 179 func (m OrganizationMap) Length() int { 180 return len(m) 181 } 182 183 func (m OrganizationMap) ForEach(cb func(gotenresource.Name, gotenresource.Resource) bool) { 184 for name, res := range m { 185 if !cb(&name, res) { 186 break 187 } 188 } 189 } 190 191 type OrganizationChangeMap map[Name]*OrganizationChange 192 193 func (m OrganizationChangeMap) Get(name gotenresource.Name) gotenresource.ResourceChange { 194 return m[*name.(*Name)] 195 } 196 197 func (m OrganizationChangeMap) Set(change gotenresource.ResourceChange) { 198 tChange := change.(*OrganizationChange) 199 m[*tChange.GetOrganizationName()] = tChange 200 } 201 202 func (m OrganizationChangeMap) Delete(name gotenresource.Name) { 203 delete(m, *name.(*Name)) 204 } 205 206 func (m OrganizationChangeMap) Length() int { 207 return len(m) 208 } 209 210 func (m OrganizationChangeMap) ForEach(cb func(gotenresource.Name, gotenresource.ResourceChange) bool) { 211 for name, res := range m { 212 if !cb(&name, res) { 213 break 214 } 215 } 216 }