zone.go raw

   1  package network
   2  
   3  import (
   4  	liquidweb "github.com/liquidweb/liquidweb-go"
   5  
   6  	"github.com/liquidweb/liquidweb-go/types"
   7  )
   8  
   9  // Zone is a grouping of network resources.
  10  type Zone struct {
  11  	ID             types.FlexInt                     `json:"id,omitempty"`
  12  	IsDefault      types.NumericalBoolean            `json:"is_default,omitempty"`
  13  	Name           string                            `json:"name,omitempty"`
  14  	Region         ZoneRegion                        `json:"region,omitempty"`
  15  	Status         string                            `json:"status,omitempty"`
  16  	ValidSourceHVS map[string]types.NumericalBoolean `json:"valid_source_hvs,omitempty"`
  17  }
  18  
  19  // ZoneRegion describes the zone the resources should be in.
  20  type ZoneRegion struct {
  21  	ID   int    `json:"id"`
  22  	Name string `json:"name"`
  23  }
  24  
  25  // ZoneParams are the set of parameters you can pass to the API for Network Zones.
  26  type ZoneParams struct {
  27  	ID int `json:"id,omitempty"`
  28  }
  29  
  30  // ZoneListParams are the set of parameters you can pass to the API for listing Network Zones.
  31  type ZoneListParams struct {
  32  	PageNum  int    `json:"page_num,omitempty"`
  33  	PageSize int    `json:"page_size,omitempty"`
  34  	Region   string `json:"region,omitempty"`
  35  }
  36  
  37  // ZoneList is an envelope for the API result containing either a list of zones or an error.
  38  type ZoneList struct {
  39  	liquidweb.ListMeta
  40  	Items []Zone `json:"items,omitempty"`
  41  }
  42