longview_subscriptions.go raw

   1  package linodego
   2  
   3  import (
   4  	"context"
   5  )
   6  
   7  // LongviewSubscription represents a LongviewSubscription object
   8  type LongviewSubscription struct {
   9  	ID              string       `json:"id"`
  10  	Label           string       `json:"label"`
  11  	ClientsIncluded int          `json:"clients_included"`
  12  	Price           *LinodePrice `json:"price"`
  13  	// UpdatedStr string `json:"updated"`
  14  	// Updated *time.Time `json:"-"`
  15  }
  16  
  17  // ListLongviewSubscriptions lists LongviewSubscriptions
  18  func (c *Client) ListLongviewSubscriptions(ctx context.Context, opts *ListOptions) ([]LongviewSubscription, error) {
  19  	return getPaginatedResults[LongviewSubscription](ctx, c, "longview/subscriptions", opts)
  20  }
  21  
  22  // GetLongviewSubscription gets the template with the provided ID
  23  func (c *Client) GetLongviewSubscription(ctx context.Context, templateID string) (*LongviewSubscription, error) {
  24  	e := formatAPIPath("longview/subscriptions/%s", templateID)
  25  	return doGETRequest[LongviewSubscription](ctx, c, e)
  26  }
  27