func Update(c *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) (r UpdateResult) {
	b, err := opts.ToPortUpdateMap()
	if err != nil {
		r.Err = err
		return
	}
	_, r.Err = c.Put(updateURL(c, id), b, &r.Body, &gophercloud.RequestOpts{
		OkCodes: []int{200, 201},
	})
	return
}
Update accepts a UpdateOpts struct and updates an existing port using the
values provided.
package ports
import (
	"github.com/gophercloud/gophercloud"
	"github.com/gophercloud/gophercloud/pagination"
)
type ListOptsBuilder interface {
	ToPortListQuery() (string, error)
}
type ListOpts struct {
	Status       string `q:"status"`
	Name         string `q:"name"`
	AdminStateUp *bool  `q:"admin_state_up"`
	NetworkID    string `q:"network_id"`
	TenantID     string `q:"tenant_id"`
	DeviceOwner  string `q:"device_owner"`
	MACAddress   string `q:"mac_address"`
	ID           string `q:"id"`
	DeviceID     string `q:"device_id"`
	Limit        int    `q:"limit"`
	Marker       string `q:"marker"`
	SortKey      string `q:"sort_key"`
	SortDir      string `q:"sort_dir"`
}
func (opts ListOpts) ToPortListQuery() (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.ToPortListQuery()
		if err != nil {
			return pagination.Pager{Err: err}
		}
		url += query
	}
	return pagination.NewPager(c, url, func(r pagination.PageResult) pagination.Page {
		return PortPage{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 {
	ToPortCreateMap() (map[string]interface{}, error)
}
type CreateOpts struct {
	NetworkID           string        `json:"network_id" required:"true"`
	Name                string        `json:"name,omitempty"`
	AdminStateUp        *bool         `json:"admin_state_up,omitempty"`
	MACAddress          string        `json:"mac_address,omitempty"`
	FixedIPs            interface{}   `json:"fixed_ips,omitempty"`
	DeviceID            string        `json:"device_id,omitempty"`
	DeviceOwner         string        `json:"device_owner,omitempty"`
	TenantID            string        `json:"tenant_id,omitempty"`
	SecurityGroups      []string      `json:"security_groups,omitempty"`
	AllowedAddressPairs []AddressPair `json:"allowed_address_pairs,omitempty"`
}
func (opts CreateOpts) ToPortCreateMap() (map[string]interface{}, error) {
	return gophercloud.BuildRequestBody(opts, "port")
}
func Create(c *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult) {
	b, err := opts.ToPortCreateMap()
	if err != nil {
		r.Err = err
		return
	}
	_, r.Err = c.Post(createURL(c), b, &r.Body, nil)
	return
}
type UpdateOptsBuilder interface {
	ToPortUpdateMap() (map[string]interface{}, error)
}
type UpdateOpts struct {
	Name                string        `json:"name,omitempty"`
	AdminStateUp        *bool         `json:"admin_state_up,omitempty"`
	FixedIPs            interface{}   `json:"fixed_ips,omitempty"`
	DeviceID            string        `json:"device_id,omitempty"`
	DeviceOwner         string        `json:"device_owner,omitempty"`
	SecurityGroups      []string      `json:"security_groups,omitempty"`
	AllowedAddressPairs []AddressPair `json:"allowed_address_pairs,omitempty"`
}
func (opts UpdateOpts) ToPortUpdateMap() (map[string]interface{}, error) {
	return gophercloud.BuildRequestBody(opts, "port")
}