github.com/gophercloud/gophercloud@v1.11.0/openstack/messaging/v2/claims/results.go (about) 1 package claims 2 3 import "github.com/gophercloud/gophercloud" 4 5 func (r CreateResult) Extract() ([]Messages, error) { 6 var s struct { 7 Messages []Messages `json:"messages"` 8 } 9 err := r.ExtractInto(&s) 10 return s.Messages, err 11 } 12 13 func (r GetResult) Extract() (*Claim, error) { 14 var s *Claim 15 err := r.ExtractInto(&s) 16 return s, err 17 } 18 19 // CreateResult is the response of a Create operations. 20 type CreateResult struct { 21 gophercloud.Result 22 } 23 24 // GetResult is the response of a Get operations. 25 type GetResult struct { 26 gophercloud.Result 27 } 28 29 // UpdateResult is the response of a Update operations. 30 type UpdateResult struct { 31 gophercloud.ErrResult 32 } 33 34 // DeleteResult is the result from a Delete operation. Call its ExtractErr 35 // method to determine if the call succeeded or failed. 36 type DeleteResult struct { 37 gophercloud.ErrResult 38 } 39 40 type Messages struct { 41 Age float32 `json:"age"` 42 Href string `json:"href"` 43 TTL int `json:"ttl"` 44 Body map[string]interface{} `json:"body"` 45 } 46 47 type Claim struct { 48 Age float32 `json:"age"` 49 Href string `json:"href"` 50 Messages []Messages `json:"messages"` 51 TTL int `json:"ttl"` 52 }