github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/rds/v1/flavors/results.go (about)

     1  package flavors
     2  
     3  import "github.com/huaweicloud/golangsdk"
     4  
     5  type Flavor struct {
     6  	ID       string `json:"id"`
     7  	Name     string `json:"name"`
     8  	Ram      int    `json:"ram"`
     9  	SpecCode string `json:"specCode"`
    10  }
    11  
    12  type ListResult struct {
    13  	golangsdk.Result
    14  }
    15  
    16  func (lr ListResult) Extract() ([]Flavor, error) {
    17  	var a struct {
    18  		Flavors []Flavor `json:"flavors"`
    19  	}
    20  	err := lr.Result.ExtractInto(&a)
    21  	return a.Flavors, err
    22  }