File: results.go

package info (click to toggle)
golang-github-gophercloud-gophercloud 1.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 11,416 kB
  • sloc: sh: 99; makefile: 21
file content (52 lines) | stat: -rw-r--r-- 1,188 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package claims

import "github.com/gophercloud/gophercloud"

func (r CreateResult) Extract() ([]Messages, error) {
	var s struct {
		Messages []Messages `json:"messages"`
	}
	err := r.ExtractInto(&s)
	return s.Messages, err
}

func (r GetResult) Extract() (*Claim, error) {
	var s *Claim
	err := r.ExtractInto(&s)
	return s, err
}

// CreateResult is the response of a Create operations.
type CreateResult struct {
	gophercloud.Result
}

// GetResult is the response of a Get operations.
type GetResult struct {
	gophercloud.Result
}

// UpdateResult is the response of a Update operations.
type UpdateResult struct {
	gophercloud.ErrResult
}

// DeleteResult is the result from a Delete operation. Call its ExtractErr
// method to determine if the call succeeded or failed.
type DeleteResult struct {
	gophercloud.ErrResult
}

type Messages struct {
	Age  float32                `json:"age"`
	Href string                 `json:"href"`
	TTL  int                    `json:"ttl"`
	Body map[string]interface{} `json:"body"`
}

type Claim struct {
	Age      float32    `json:"age"`
	Href     string     `json:"href"`
	Messages []Messages `json:"messages"`
	TTL      int        `json:"ttl"`
}