Skip to content

Commit af193ef

Browse files
authored
fix(vpc_gw): return Empty on EnableIPMobility (#2007)
1 parent d9816b5 commit af193ef

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

api/vpcgw/v1/vpcgw_sdk.go

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,7 @@ func (s *API) UpgradeGateway(req *UpgradeGatewayRequest, opts ...scw.RequestOpti
18031803
}
18041804

18051805
// EnableIPMobility: Upgrade a Public Gateway to IP mobility (move from NAT IP to routed IP). This is idempotent: repeated calls after the first will return no error but have no effect.
1806-
func (s *API) EnableIPMobility(req *EnableIPMobilityRequest, opts ...scw.RequestOption) (*Gateway, error) {
1806+
func (s *API) EnableIPMobility(req *EnableIPMobilityRequest, opts ...scw.RequestOption) error {
18071807
var err error
18081808

18091809
if req.Zone == "" {
@@ -1812,11 +1812,11 @@ func (s *API) EnableIPMobility(req *EnableIPMobilityRequest, opts ...scw.Request
18121812
}
18131813

18141814
if fmt.Sprint(req.Zone) == "" {
1815-
return nil, errors.New("field Zone cannot be empty in request")
1815+
return errors.New("field Zone cannot be empty in request")
18161816
}
18171817

18181818
if fmt.Sprint(req.GatewayID) == "" {
1819-
return nil, errors.New("field GatewayID cannot be empty in request")
1819+
return errors.New("field GatewayID cannot be empty in request")
18201820
}
18211821

18221822
scwReq := &scw.ScalewayRequest{
@@ -1826,16 +1826,14 @@ func (s *API) EnableIPMobility(req *EnableIPMobilityRequest, opts ...scw.Request
18261826

18271827
err = scwReq.SetBody(req)
18281828
if err != nil {
1829-
return nil, err
1829+
return err
18301830
}
18311831

1832-
var resp Gateway
1833-
1834-
err = s.client.Do(scwReq, &resp, opts...)
1832+
err = s.client.Do(scwReq, nil, opts...)
18351833
if err != nil {
1836-
return nil, err
1834+
return err
18371835
}
1838-
return &resp, nil
1836+
return nil
18391837
}
18401838

18411839
// ListGatewayNetworks: List the connections between Public Gateways and Private Networks (a connection = a GatewayNetwork). You can choose to filter by `gateway-id` to list all Private Networks attached to the specified Public Gateway, or by `private_network_id` to list all Public Gateways attached to the specified Private Network. Other query parameters are also available. The result is an array of GatewayNetwork objects, each giving details of the connection between a given Public Gateway and a given Private Network.

0 commit comments

Comments
 (0)