func (opts UpdateOpts) ToPortUpdateMap() (map[string]interface{}, error) {
	b1, err := opts.UpdateOptsBuilder.ToPortUpdateMap()
	if err != nil {
		return nil, err
	}
	b2, err := gophercloud.BuildRequestBody(opts, "")
	if err != nil {
		return nil, err
	}
	port := b1["port"].(map[string]interface{})
	for k, v := range b2 {
		port[k] = v
	}
	return map[string]interface{}{"port": port}, nil
}
ToPortUpdateMap casts an UpdateOpts struct to a map.
package portsbinding
import (
	"github.com/gophercloud/gophercloud"
	"github.com/gophercloud/gophercloud/openstack/networking/v2/ports"
)
func Get(c *gophercloud.ServiceClient, id string) (r GetResult) {
	_, r.Err = c.Get(getURL(c, id), &r.Body, nil)
	return
}
type CreateOpts struct {
	ports.CreateOptsBuilder `json:"-"`
	HostID string `json:"binding:host_id,omitempty"`
	DNSName string `json:"dns_name,omitempty"`
	VNICType string `json:"binding:vnic_type,omitempty"`
	Profile map[string]string `json:"binding:profile,omitempty"`
}
func (opts CreateOpts) ToPortCreateMap() (map[string]interface{}, error) {
	b1, err := opts.CreateOptsBuilder.ToPortCreateMap()
	if err != nil {
		return nil, err
	}
	b2, err := gophercloud.BuildRequestBody(opts, "")
	if err != nil {
		return nil, err
	}
	port := b1["port"].(map[string]interface{})
	for k, v := range b2 {
		port[k] = v
	}
	return map[string]interface{}{"port": port}, nil
}
func Create(c *gophercloud.ServiceClient, opts ports.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 UpdateOpts struct {
	ports.UpdateOptsBuilder `json:"-"`
	HostID string `json:"binding:host_id,omitempty"`
	DNSName string `json:"dns_name,omitempty"`
	VNICType string `json:"binding:vnic_type,omitempty"`
	Profile map[string]string `json:"binding:profile,omitempty"`
}