-
Notifications
You must be signed in to change notification settings - Fork 7
/
results.go
50 lines (41 loc) · 1.17 KB
/
results.go
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
package logstreams
import "github.com/huaweicloud/terraform-provider-hcs/huaweicloudstack/sdk/huaweicloud"
// Log stream Create response
type CreateResponse struct {
ID string `json:"log_stream_id"`
}
// CreateResult is a struct that contains all the return parameters of creation
type CreateResult struct {
golangsdk.Result
}
// Extract from CreateResult
func (r CreateResult) Extract() (*CreateResponse, error) {
s := new(CreateResponse)
err := r.Result.ExtractInto(s)
return s, err
}
// DeleteResult is a struct which contains the result of deletion
type DeleteResult struct {
golangsdk.ErrResult
}
// Log stream response
type LogStream struct {
ID string `json:"log_stream_id"`
Name string `json:"log_stream_name"`
CreationTime int64 `json:"creation_time"`
FilterCount int64 `json:"filter_count"`
}
// Log stream list response
type LogStreams struct {
LogStreams []LogStream `json:"log_streams"`
}
// ListResults contains the body of getting list
type ListResults struct {
golangsdk.Result
}
// Extract list from GetResult
func (r ListResults) Extract() (*LogStreams, error) {
s := new(LogStreams)
err := r.Result.ExtractInto(s)
return s, err
}