@@ -18,6 +18,7 @@ type ListOptsBuilder interface {
1818// either `asc' or `desc'. Marker and Limit are used for pagination.
1919type ListOpts struct {
2020 ID string `q:"id"`
21+ Description string `q:"description"`
2122 InternalPortID string `q:"internal_port_id"`
2223 ExternalPort string `q:"external_port"`
2324 InternalIPAddress string `q:"internal_ip_address"`
@@ -63,6 +64,7 @@ func Get(ctx context.Context, c *gophercloud.ServiceClient, floatingIpId string,
6364// CreateOpts contains all the values needed to create a new port forwarding
6465// resource. All attributes are required.
6566type CreateOpts struct {
67+ Description string `json:"description,omitempty"`
6668 InternalPortID string `json:"internal_port_id"`
6769 InternalIPAddress string `json:"internal_ip_address"`
6870 InternalPort int `json:"internal_port"`
@@ -97,22 +99,18 @@ func Create(ctx context.Context, c *gophercloud.ServiceClient, floatingIpId stri
9799
98100// UpdateOpts contains the values used when updating a port forwarding resource.
99101type UpdateOpts struct {
100- InternalPortID string `json:"internal_port_id,omitempty"`
101- InternalIPAddress string `json:"internal_ip_address,omitempty"`
102- InternalPort int `json:"internal_port,omitempty"`
103- ExternalPort int `json:"external_port,omitempty"`
104- Protocol string `json:"protocol,omitempty"`
102+ Description * string `json:"description,omitempty"`
103+ InternalPortID string `json:"internal_port_id,omitempty"`
104+ InternalIPAddress string `json:"internal_ip_address,omitempty"`
105+ InternalPort int `json:"internal_port,omitempty"`
106+ ExternalPort int `json:"external_port,omitempty"`
107+ Protocol string `json:"protocol,omitempty"`
105108}
106109
107110// ToPortForwardingUpdateMap allows UpdateOpts to satisfy the UpdateOptsBuilder
108111// interface
109112func (opts UpdateOpts ) ToPortForwardingUpdateMap () (map [string ]any , error ) {
110- b , err := gophercloud .BuildRequestBody (opts , "port_forwarding" )
111- if err != nil {
112- return nil , err
113- }
114-
115- return b , nil
113+ return gophercloud .BuildRequestBody (opts , "port_forwarding" )
116114}
117115
118116// UpdateOptsBuilder allows extensions to add additional parameters to the
0 commit comments