-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbundle.go
More file actions
36 lines (32 loc) · 968 Bytes
/
bundle.go
File metadata and controls
36 lines (32 loc) · 968 Bytes
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
package nimbusec
type Bundle struct {
Id string `json:"id,omitempty"`
Name string `json:"name"`
Start Timestamp `json:"startDate"`
End Timestamp `json:"endDate"`
Quota string `json:"quota"`
Depth int `json:"depth"`
Fast int `json:"fast"`
Deep int `json:"deep"`
Contingent int `json:"contingent"`
Active int `json:"active"`
Engines []string `json:"engines"`
Amount int `json:"amount"`
Currency string `json:"currency"`
}
func (a *API) GetBundle(bundle string) (*Bundle, error) {
dst := new(Bundle)
url := a.BuildURL("/v2/bundle/%s", bundle)
err := a.Get(url, Params{}, dst)
return dst, err
}
func (a *API) FindBundles(filter string) ([]Bundle, error) {
params := Params{}
if filter != EmptyFilter {
params["q"] = filter
}
dst := make([]Bundle, 0)
url := a.BuildURL("/v2/bundle")
err := a.Get(url, params, &dst)
return dst, err
}