1 package linodego
2 3 import (
4 "context"
5 )
6 7 // AccountAvailability returns the resources availability in a region to an account.
8 type AccountAvailability struct {
9 // region id
10 Region string `json:"region"`
11 12 // the unavailable resources in a region to the customer
13 Unavailable []string `json:"unavailable"`
14 15 // the available resources in a region to the customer
16 Available []string `json:"available"`
17 }
18 19 // ListAccountAvailabilities lists all regions and the resource availabilities to the account.
20 func (c *Client) ListAccountAvailabilities(ctx context.Context, opts *ListOptions) ([]AccountAvailability, error) {
21 return getPaginatedResults[AccountAvailability](ctx, c, "account/availability", opts)
22 }
23 24 // GetAccountAvailability gets the resources availability in a region to the customer.
25 func (c *Client) GetAccountAvailability(ctx context.Context, regionID string) (*AccountAvailability, error) {
26 b := formatAPIPath("account/availability/%s", regionID)
27 return doGETRequest[AccountAvailability](ctx, c, b)
28 }
29