-
Notifications
You must be signed in to change notification settings - Fork 82
/
longview_subscriptions.go
36 lines (30 loc) · 1.08 KB
/
longview_subscriptions.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
package linodego
import (
"context"
)
// LongviewSubscription represents a LongviewSubscription object
type LongviewSubscription struct {
ID string `json:"id"`
Label string `json:"label"`
ClientsIncluded int `json:"clients_included"`
Price *LinodePrice `json:"price"`
// UpdatedStr string `json:"updated"`
// Updated *time.Time `json:"-"`
}
// ListLongviewSubscriptions lists LongviewSubscriptions
func (c *Client) ListLongviewSubscriptions(ctx context.Context, opts *ListOptions) ([]LongviewSubscription, error) {
response, err := getPaginatedResults[LongviewSubscription](ctx, c, "longview/subscriptions", opts)
if err != nil {
return nil, err
}
return response, nil
}
// GetLongviewSubscription gets the template with the provided ID
func (c *Client) GetLongviewSubscription(ctx context.Context, templateID string) (*LongviewSubscription, error) {
e := formatAPIPath("longview/subscriptions/%s", templateID)
response, err := doGETRequest[LongviewSubscription](ctx, c, e)
if err != nil {
return nil, err
}
return response, nil
}