func (opts CreateOpts) ToSubnetCreateMap() (map[string]interface{}, error) {
	return gophercloud.BuildRequestBody(opts, "subnet")
}
ToSubnetCreateMap casts a CreateOpts struct to a map.
package subnets
import (
	"github.com/gophercloud/gophercloud"
	"github.com/gophercloud/gophercloud/pagination"
)
type ListOptsBuilder interface {
	ToSubnetListQuery() (string, error)
}
type ListOpts struct {
	Name       string `q:"name"`
	EnableDHCP *bool  `q:"enable_dhcp"`
	NetworkID  string `q:"network_id"`
	TenantID   string `q:"tenant_id"`
	IPVersion  int    `q:"ip_version"`
	GatewayIP  string `q:"gateway_ip"`
	CIDR       string `q:"cidr"`
	ID         string `q:"id"`
	Limit      int    `q:"limit"`
	Marker     string `q:"marker"`
	SortKey    string `q:"sort_key"`
	SortDir    string `q:"sort_dir"`
}
func (opts ListOpts) ToSubnetListQuery() (string, error) {
	q, err := gophercloud.BuildQueryString(opts)
	return q.String(), err
}
func List(c *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager {
	url := listURL(c)
	if opts != nil {
		query, err := opts.ToSubnetListQuery()
		if err != nil {
			return pagination.Pager{Err: err}
		}
		url += query
	}
	return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page {
		return SubnetPage{pagination.LinkedPageBase{PageResult: r}}
	})
}
func Get(c *gophercloud.ServiceClient, id string) (r GetResult) {
	_, r.Err = c.Get(getURL(c, id), &r.Body, nil)
	return
}
type CreateOptsBuilder interface {
	ToSubnetCreateMap() (map[string]interface{}, error)
}
type CreateOpts struct {
	NetworkID       string                `json:"network_id" required:"true"`
	CIDR            string                `json:"cidr" required:"true"`
	Name            string                `json:"name,omitempty"`
	TenantID        string                `json:"tenant_id,omitempty"`
	AllocationPools []AllocationPool      `json:"allocation_pools,omitempty"`
	GatewayIP       *string               `json:"gateway_ip"`
	IPVersion       gophercloud.IPVersion `json:"ip_version,omitempty"`
	EnableDHCP      *bool                 `json:"enable_dhcp,omitempty"`
	DNSNameservers  []string              `json:"dns_nameservers,omitempty"`
	HostRoutes      []HostRoute           `json:"host_routes,omitempty"`
}