File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
openstack/networking/v2/extensions/layer3/routers Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -122,11 +122,14 @@ func (r RouterPage) IsEmpty() (bool, error) {
122122// and extracts the elements into a slice of Router structs. In other words,
123123// a generic collection is mapped into a relevant slice.
124124func ExtractRouters (r pagination.Page ) ([]Router , error ) {
125- var s struct {
126- Routers []Router `json:"routers"`
127- }
128- err := (r .(RouterPage )).ExtractInto (& s )
129- return s .Routers , err
125+ var s []Router
126+ err := ExtractRoutersInto (r , & s )
127+ return s , err
128+ }
129+
130+ // ExtractRoutersInto extracts the elements into a slice of Router structs.
131+ func ExtractRoutersInto (r pagination.Page , v any ) error {
132+ return r .(RouterPage ).Result .ExtractIntoSlicePtr (v , "routers" )
130133}
131134
132135type commonResult struct {
You can’t perform that action at this time.
0 commit comments