@@ -965,23 +965,6 @@ type SetACLResponse struct {
965965 DefaultPolicy Action `json:"default_policy"`
966966}
967967
968- // SetSubnetsRequest: set subnets request.
969- type SetSubnetsRequest struct {
970- // Region: region to target. If none is passed will use default region from the config.
971- Region scw.Region `json:"-"`
972-
973- // PrivateNetworkID: private Network ID.
974- PrivateNetworkID string `json:"-"`
975-
976- // Subnets: private Network subnets CIDR.
977- Subnets []scw.IPNet `json:"subnets"`
978- }
979-
980- // SetSubnetsResponse: set subnets response.
981- type SetSubnetsResponse struct {
982- Subnets []scw.IPNet `json:"subnets"`
983- }
984-
985968// UpdatePrivateNetworkRequest: update private network request.
986969type UpdatePrivateNetworkRequest struct {
987970 // Region: region to target. If none is passed will use default region from the config.
@@ -1528,42 +1511,6 @@ func (s *API) ListSubnets(req *ListSubnetsRequest, opts ...scw.RequestOption) (*
15281511 return & resp , nil
15291512}
15301513
1531- // SetSubnets: Set subnets for an existing Private Network. Note that the method is PUT and not PATCH. Any existing subnets will be removed in favor of the new specified set of subnets.
1532- func (s * API ) SetSubnets (req * SetSubnetsRequest , opts ... scw.RequestOption ) (* SetSubnetsResponse , error ) {
1533- var err error
1534-
1535- if req .Region == "" {
1536- defaultRegion , _ := s .client .GetDefaultRegion ()
1537- req .Region = defaultRegion
1538- }
1539-
1540- if fmt .Sprint (req .Region ) == "" {
1541- return nil , errors .New ("field Region cannot be empty in request" )
1542- }
1543-
1544- if fmt .Sprint (req .PrivateNetworkID ) == "" {
1545- return nil , errors .New ("field PrivateNetworkID cannot be empty in request" )
1546- }
1547-
1548- scwReq := & scw.ScalewayRequest {
1549- Method : "PUT" ,
1550- Path : "/vpc/v2/regions/" + fmt .Sprint (req .Region ) + "/private-networks/" + fmt .Sprint (req .PrivateNetworkID ) + "/subnets" ,
1551- }
1552-
1553- err = scwReq .SetBody (req )
1554- if err != nil {
1555- return nil , err
1556- }
1557-
1558- var resp SetSubnetsResponse
1559-
1560- err = s .client .Do (scwReq , & resp , opts ... )
1561- if err != nil {
1562- return nil , err
1563- }
1564- return & resp , nil
1565- }
1566-
15671514// AddSubnets: Add new subnets to an existing Private Network.
15681515func (s * API ) AddSubnets (req * AddSubnetsRequest , opts ... scw.RequestOption ) (* AddSubnetsResponse , error ) {
15691516 var err error
0 commit comments