From 816ba3a39d0328d35ea1a388bbe898d3d848c2cf Mon Sep 17 00:00:00 2001 From: Ludwig Bedacht Date: Mon, 15 Jan 2024 10:22:18 +0100 Subject: [PATCH] renamed API function --- internal/ionoscloud/client.go | 2 +- internal/ionoscloud/client/client.go | 4 ++-- internal/ionoscloud/clienttest/mock_client.go | 20 +++++++++---------- internal/service/cloud/network.go | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/internal/ionoscloud/client.go b/internal/ionoscloud/client.go index 63ab3bb8..9e65863c 100644 --- a/internal/ionoscloud/client.go +++ b/internal/ionoscloud/client.go @@ -52,7 +52,7 @@ type Client interface { // GetLAN returns the LAN that matches lanID in the specified data center. GetLAN(ctx context.Context, dataCenterID, lanID string) (*ionoscloud.Lan, error) // DestroyLAN deletes the LAN that matches the provided lanID in the specified data center. - DestroyLAN(ctx context.Context, dataCenterID, lanID string) (string, error) + DeleteLAN(ctx context.Context, dataCenterID, lanID string) (string, error) // CheckRequestStatus checks the status of a provided request identified by requestID CheckRequestStatus(ctx context.Context, requestID string) (*ionoscloud.RequestStatus, error) // ListVolumes returns a list of volumes in a specified data center. diff --git a/internal/ionoscloud/client/client.go b/internal/ionoscloud/client/client.go index 1c1b0805..aa12cef8 100644 --- a/internal/ionoscloud/client/client.go +++ b/internal/ionoscloud/client/client.go @@ -225,8 +225,8 @@ func (c *IonosCloudClient) GetLAN(ctx context.Context, dataCenterID, lanID strin return &lan, nil } -// DestroyLAN deletes the LAN that matches the provided lanID in the specified data center. -func (c *IonosCloudClient) DestroyLAN(ctx context.Context, dataCenterID, lanID string) (string, error) { +// DeleteLAN deletes the LAN that matches the provided lanID in the specified data center. +func (c *IonosCloudClient) DeleteLAN(ctx context.Context, dataCenterID, lanID string) (string, error) { if dataCenterID == "" { return "", errDataCenterIDIsEmpty } diff --git a/internal/ionoscloud/clienttest/mock_client.go b/internal/ionoscloud/clienttest/mock_client.go index 1ad84518..c8be0776 100644 --- a/internal/ionoscloud/clienttest/mock_client.go +++ b/internal/ionoscloud/clienttest/mock_client.go @@ -316,8 +316,8 @@ func (_c *MockClient_CreateServer_Call) RunAndReturn(run func(context.Context, s return _c } -// DestroyLAN provides a mock function with given fields: ctx, dataCenterID, lanID -func (_m *MockClient) DestroyLAN(ctx context.Context, dataCenterID string, lanID string) (string, error) { +// DeleteLAN provides a mock function with given fields: ctx, dataCenterID, lanID +func (_m *MockClient) DeleteLAN(ctx context.Context, dataCenterID string, lanID string) (string, error) { ret := _m.Called(ctx, dataCenterID, lanID) var r0 string @@ -340,32 +340,32 @@ func (_m *MockClient) DestroyLAN(ctx context.Context, dataCenterID string, lanID return r0, r1 } -// MockClient_DestroyLAN_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DestroyLAN' -type MockClient_DestroyLAN_Call struct { +// MockClient_DeleteLAN_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DeleteLAN' +type MockClient_DeleteLAN_Call struct { *mock.Call } -// DestroyLAN is a helper method to define mock.On call +// DeleteLAN is a helper method to define mock.On call // - ctx context.Context // - dataCenterID string // - lanID string -func (_e *MockClient_Expecter) DestroyLAN(ctx interface{}, dataCenterID interface{}, lanID interface{}) *MockClient_DestroyLAN_Call { - return &MockClient_DestroyLAN_Call{Call: _e.mock.On("DestroyLAN", ctx, dataCenterID, lanID)} +func (_e *MockClient_Expecter) DeleteLAN(ctx interface{}, dataCenterID interface{}, lanID interface{}) *MockClient_DeleteLAN_Call { + return &MockClient_DeleteLAN_Call{Call: _e.mock.On("DeleteLAN", ctx, dataCenterID, lanID)} } -func (_c *MockClient_DestroyLAN_Call) Run(run func(ctx context.Context, dataCenterID string, lanID string)) *MockClient_DestroyLAN_Call { +func (_c *MockClient_DeleteLAN_Call) Run(run func(ctx context.Context, dataCenterID string, lanID string)) *MockClient_DeleteLAN_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(string), args[2].(string)) }) return _c } -func (_c *MockClient_DestroyLAN_Call) Return(_a0 string, _a1 error) *MockClient_DestroyLAN_Call { +func (_c *MockClient_DeleteLAN_Call) Return(_a0 string, _a1 error) *MockClient_DeleteLAN_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockClient_DestroyLAN_Call) RunAndReturn(run func(context.Context, string, string) (string, error)) *MockClient_DestroyLAN_Call { +func (_c *MockClient_DeleteLAN_Call) RunAndReturn(run func(context.Context, string, string) (string, error)) *MockClient_DeleteLAN_Call { _c.Call.Return(run) return _c } diff --git a/internal/service/cloud/network.go b/internal/service/cloud/network.go index 4d26c314..12131240 100644 --- a/internal/service/cloud/network.go +++ b/internal/service/cloud/network.go @@ -185,7 +185,7 @@ func (s *Service) createLAN() error { func (s *Service) deleteLAN(lanID string) error { log := s.scope.Logger.WithName("DeleteLAN") - requestPath, err := s.API().DestroyLAN(s.ctx, s.DataCenterID(), lanID) + requestPath, err := s.API().DeleteLAN(s.ctx, s.DataCenterID(), lanID) if err != nil { return fmt.Errorf("unable to request LAN deletion in data center: %w", err) }