github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/iec/v1/cloudvolumes/results.go (about) 1 package cloudvolumes 2 3 import ( 4 "github.com/huaweicloud/golangsdk" 5 "github.com/huaweicloud/golangsdk/openstack/iec/v1/common" 6 ) 7 8 type commonResult struct { 9 golangsdk.Result 10 } 11 12 type GetResult struct { 13 commonResult 14 } 15 16 // EdgeVolume 云磁盘 17 type EdgeVolume struct { 18 Volume *common.Volume `json:"volume"` 19 } 20 21 func (r GetResult) Extract() (*EdgeVolume, error) { 22 var entity EdgeVolume 23 err := r.ExtractIntoStructPtr(&entity, "") 24 return &entity, err 25 } 26 27 type VolumeType struct { 28 VolumeTypes []common.VolumeType `json:"volume_types"` 29 } 30 31 func (r GetResult) ExtractVolumeType() (*VolumeType, error) { 32 var entity VolumeType 33 err := r.ExtractIntoStructPtr(&entity, "") 34 return &entity, err 35 } 36 37 // Volumes 卷列表对象 38 type Volumes struct { 39 Volumes []common.Volume `json:"volumes"` 40 Count int `json:"count"` 41 } 42 43 type ListResult struct { 44 commonResult 45 } 46 47 func (r ListResult) Extract() (*Volumes, error) { 48 var entity Volumes 49 50 err := r.ExtractInto(&entity) 51 return &entity, err 52 }