diff --git a/CHANGELOG.md b/CHANGELOG.md index f3e871b..7e4fa94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/). ## Unreleased +### Changed +- Fix `privatenetwork/create` and `/details` request struct. ## [8.3.0] - 2024-09-11 ### Added diff --git a/privatenetworks.go b/privatenetworks.go index 0c01c50..43af593 100644 --- a/privatenetworks.go +++ b/privatenetworks.go @@ -62,7 +62,9 @@ func (s *PrivateNetworkService) Create(context context.Context, name string) (*P PrivateNetwork PrivateNetwork } }{} - err := s.client.post(context, "privatenetwork/create", &data, name) + err := s.client.post(context, "privatenetwork/create", &data, struct { + Name string `json:"name"` + }{name}) return &data.Response.PrivateNetwork, err } @@ -73,7 +75,9 @@ func (s *PrivateNetworkService) Details(context context.Context, privateNetworkI PrivateNetwork PrivateNetwork } }{} - err := s.client.post(context, "privatenetwork/details", &data, privateNetworkID) + err := s.client.post(context, "privatenetwork/details", &data, struct { + PrivateNetworkID string `json:"privatenetworkid"` + }{privateNetworkID}) return &data.Response.PrivateNetwork, err } diff --git a/privatenetworks_test.go b/privatenetworks_test.go index 4fa3961..2e09360 100644 --- a/privatenetworks_test.go +++ b/privatenetworks_test.go @@ -140,7 +140,7 @@ func TestPrivateNetworkSegmentsDestroy(t *testing.T) { c := &mockClient{} n := PrivateNetworkService{client: c} - n.DestroySegment(context.Background(), "pn-123ab") + n.DestroySegment(context.Background(), "266979ab-1e05-4fbc-b9e0-577f31c0d2e9") assert.Equal(t, "POST", c.lastMethod, "method used is correct") assert.Equal(t, "privatenetwork/deletesegment", c.lastPath, "path used is correct")