From 8e38ea6c7847acb17f1ed18556c6d3f5d45e51ce Mon Sep 17 00:00:00 2001 From: Murad Biashimov Date: Thu, 12 Feb 2026 09:26:41 +0100 Subject: [PATCH] feat(cmk): add endpoints Contributes to NEX-2336 --- Taskfile.yml | 2 +- client_generated.go | 4 + client_mock.go | 687 ++++++++++++++++++++++++----- config.yaml | 7 + generator/main.go | 41 +- generator/models.go | 10 +- go.mod | 1 + go.sum | 2 + handler/cmk/cmk.go | 268 +++++++++++ handler/mysql/mysql.go | 14 +- handler/postgresql/postgresql.go | 36 +- handler/privatelink/privatelink.go | 129 ++---- handler/staticip/staticip.go | 162 ++++--- 13 files changed, 1030 insertions(+), 333 deletions(-) create mode 100644 handler/cmk/cmk.go diff --git a/Taskfile.yml b/Taskfile.yml index c2a7414..6ffed70 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -20,7 +20,7 @@ tasks: - curl -s -o openapi.json https://api.aiven.io/doc/openapi.json go-generate: cmds: - - rm -rf {{.GEN_OUT_DIR}} + - rm -rf {{.GEN_OUT_DIR}} client_mock.go - GEN_OUT_DIR={{.GEN_OUT_DIR}} go run -tags=generator ./generator/... - task: fmt-imports requires: diff --git a/client_generated.go b/client_generated.go index 60c12e8..a5bb43e 100644 --- a/client_generated.go +++ b/client_generated.go @@ -15,6 +15,7 @@ import ( byoc "github.com/aiven/go-client-codegen/handler/byoc" clickhouse "github.com/aiven/go-client-codegen/handler/clickhouse" cloud "github.com/aiven/go-client-codegen/handler/cloud" + cmk "github.com/aiven/go-client-codegen/handler/cmk" domain "github.com/aiven/go-client-codegen/handler/domain" flink "github.com/aiven/go-client-codegen/handler/flink" flinkapplication "github.com/aiven/go-client-codegen/handler/flinkapplication" @@ -64,6 +65,7 @@ func newClient(doer doer) Client { ApplicationUserHandler: applicationuser.NewHandler(doer), BillingGroupHandler: billinggroup.NewHandler(doer), ByocHandler: byoc.NewHandler(doer), + CMKHandler: cmk.NewHandler(doer), ClickHouseHandler: clickhouse.NewHandler(doer), CloudHandler: cloud.NewHandler(doer), DomainHandler: domain.NewHandler(doer), @@ -110,6 +112,7 @@ type client struct { applicationuser.ApplicationUserHandler billinggroup.BillingGroupHandler byoc.ByocHandler + cmk.CMKHandler clickhouse.ClickHouseHandler cloud.CloudHandler domain.DomainHandler @@ -154,6 +157,7 @@ type Client interface { applicationuser.Handler billinggroup.Handler byoc.Handler + cmk.Handler clickhouse.Handler cloud.Handler domain.Handler diff --git a/client_mock.go b/client_mock.go index 41d9aa1..c71f8c1 100644 --- a/client_mock.go +++ b/client_mock.go @@ -19,6 +19,7 @@ import ( "github.com/aiven/go-client-codegen/handler/byoc" "github.com/aiven/go-client-codegen/handler/clickhouse" "github.com/aiven/go-client-codegen/handler/cloud" + "github.com/aiven/go-client-codegen/handler/cmk" "github.com/aiven/go-client-codegen/handler/domain" "github.com/aiven/go-client-codegen/handler/flink" "github.com/aiven/go-client-codegen/handler/flinkapplication" @@ -4574,6 +4575,450 @@ func (_c *MockClient_BillingGroupUpdate_Call) RunAndReturn(run func(ctx context. return _c } +// CMKAccessCheckTrigger provides a mock function for the type MockClient +func (_mock *MockClient) CMKAccessCheckTrigger(ctx context.Context, project string, cmkid string) (*cmk.CMKAccessCheckTriggerOut, error) { + ret := _mock.Called(ctx, project, cmkid) + + if len(ret) == 0 { + panic("no return value specified for CMKAccessCheckTrigger") + } + + var r0 *cmk.CMKAccessCheckTriggerOut + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*cmk.CMKAccessCheckTriggerOut, error)); ok { + return returnFunc(ctx, project, cmkid) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *cmk.CMKAccessCheckTriggerOut); ok { + r0 = returnFunc(ctx, project, cmkid) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cmk.CMKAccessCheckTriggerOut) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = returnFunc(ctx, project, cmkid) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_CMKAccessCheckTrigger_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CMKAccessCheckTrigger' +type MockClient_CMKAccessCheckTrigger_Call struct { + *mock.Call +} + +// CMKAccessCheckTrigger is a helper method to define mock.On call +// - ctx context.Context +// - project string +// - cmkid string +func (_e *MockClient_Expecter) CMKAccessCheckTrigger(ctx interface{}, project interface{}, cmkid interface{}) *MockClient_CMKAccessCheckTrigger_Call { + return &MockClient_CMKAccessCheckTrigger_Call{Call: _e.mock.On("CMKAccessCheckTrigger", ctx, project, cmkid)} +} + +func (_c *MockClient_CMKAccessCheckTrigger_Call) Run(run func(ctx context.Context, project string, cmkid string)) *MockClient_CMKAccessCheckTrigger_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockClient_CMKAccessCheckTrigger_Call) Return(cMKAccessCheckTriggerOut *cmk.CMKAccessCheckTriggerOut, err error) *MockClient_CMKAccessCheckTrigger_Call { + _c.Call.Return(cMKAccessCheckTriggerOut, err) + return _c +} + +func (_c *MockClient_CMKAccessCheckTrigger_Call) RunAndReturn(run func(ctx context.Context, project string, cmkid string) (*cmk.CMKAccessCheckTriggerOut, error)) *MockClient_CMKAccessCheckTrigger_Call { + _c.Call.Return(run) + return _c +} + +// CMKAccessorsList provides a mock function for the type MockClient +func (_mock *MockClient) CMKAccessorsList(ctx context.Context, project string) (*cmk.CMKAccessorsListOut, error) { + ret := _mock.Called(ctx, project) + + if len(ret) == 0 { + panic("no return value specified for CMKAccessorsList") + } + + var r0 *cmk.CMKAccessorsListOut + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string) (*cmk.CMKAccessorsListOut, error)); ok { + return returnFunc(ctx, project) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string) *cmk.CMKAccessorsListOut); ok { + r0 = returnFunc(ctx, project) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cmk.CMKAccessorsListOut) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string) error); ok { + r1 = returnFunc(ctx, project) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_CMKAccessorsList_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CMKAccessorsList' +type MockClient_CMKAccessorsList_Call struct { + *mock.Call +} + +// CMKAccessorsList is a helper method to define mock.On call +// - ctx context.Context +// - project string +func (_e *MockClient_Expecter) CMKAccessorsList(ctx interface{}, project interface{}) *MockClient_CMKAccessorsList_Call { + return &MockClient_CMKAccessorsList_Call{Call: _e.mock.On("CMKAccessorsList", ctx, project)} +} + +func (_c *MockClient_CMKAccessorsList_Call) Run(run func(ctx context.Context, project string)) *MockClient_CMKAccessorsList_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + run( + arg0, + arg1, + ) + }) + return _c +} + +func (_c *MockClient_CMKAccessorsList_Call) Return(cMKAccessorsListOut *cmk.CMKAccessorsListOut, err error) *MockClient_CMKAccessorsList_Call { + _c.Call.Return(cMKAccessorsListOut, err) + return _c +} + +func (_c *MockClient_CMKAccessorsList_Call) RunAndReturn(run func(ctx context.Context, project string) (*cmk.CMKAccessorsListOut, error)) *MockClient_CMKAccessorsList_Call { + _c.Call.Return(run) + return _c +} + +// CMKCreate provides a mock function for the type MockClient +func (_mock *MockClient) CMKCreate(ctx context.Context, project string, in *cmk.CMKCreateIn) (*cmk.CMKCreateOut, error) { + ret := _mock.Called(ctx, project, in) + + if len(ret) == 0 { + panic("no return value specified for CMKCreate") + } + + var r0 *cmk.CMKCreateOut + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, *cmk.CMKCreateIn) (*cmk.CMKCreateOut, error)); ok { + return returnFunc(ctx, project, in) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, *cmk.CMKCreateIn) *cmk.CMKCreateOut); ok { + r0 = returnFunc(ctx, project, in) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cmk.CMKCreateOut) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, *cmk.CMKCreateIn) error); ok { + r1 = returnFunc(ctx, project, in) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_CMKCreate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CMKCreate' +type MockClient_CMKCreate_Call struct { + *mock.Call +} + +// CMKCreate is a helper method to define mock.On call +// - ctx context.Context +// - project string +// - in *cmk.CMKCreateIn +func (_e *MockClient_Expecter) CMKCreate(ctx interface{}, project interface{}, in interface{}) *MockClient_CMKCreate_Call { + return &MockClient_CMKCreate_Call{Call: _e.mock.On("CMKCreate", ctx, project, in)} +} + +func (_c *MockClient_CMKCreate_Call) Run(run func(ctx context.Context, project string, in *cmk.CMKCreateIn)) *MockClient_CMKCreate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 *cmk.CMKCreateIn + if args[2] != nil { + arg2 = args[2].(*cmk.CMKCreateIn) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockClient_CMKCreate_Call) Return(cMKCreateOut *cmk.CMKCreateOut, err error) *MockClient_CMKCreate_Call { + _c.Call.Return(cMKCreateOut, err) + return _c +} + +func (_c *MockClient_CMKCreate_Call) RunAndReturn(run func(ctx context.Context, project string, in *cmk.CMKCreateIn) (*cmk.CMKCreateOut, error)) *MockClient_CMKCreate_Call { + _c.Call.Return(run) + return _c +} + +// CMKDelete provides a mock function for the type MockClient +func (_mock *MockClient) CMKDelete(ctx context.Context, project string, cmkid string) (*cmk.CMKDeleteOut, error) { + ret := _mock.Called(ctx, project, cmkid) + + if len(ret) == 0 { + panic("no return value specified for CMKDelete") + } + + var r0 *cmk.CMKDeleteOut + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*cmk.CMKDeleteOut, error)); ok { + return returnFunc(ctx, project, cmkid) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *cmk.CMKDeleteOut); ok { + r0 = returnFunc(ctx, project, cmkid) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cmk.CMKDeleteOut) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = returnFunc(ctx, project, cmkid) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_CMKDelete_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CMKDelete' +type MockClient_CMKDelete_Call struct { + *mock.Call +} + +// CMKDelete is a helper method to define mock.On call +// - ctx context.Context +// - project string +// - cmkid string +func (_e *MockClient_Expecter) CMKDelete(ctx interface{}, project interface{}, cmkid interface{}) *MockClient_CMKDelete_Call { + return &MockClient_CMKDelete_Call{Call: _e.mock.On("CMKDelete", ctx, project, cmkid)} +} + +func (_c *MockClient_CMKDelete_Call) Run(run func(ctx context.Context, project string, cmkid string)) *MockClient_CMKDelete_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockClient_CMKDelete_Call) Return(cMKDeleteOut *cmk.CMKDeleteOut, err error) *MockClient_CMKDelete_Call { + _c.Call.Return(cMKDeleteOut, err) + return _c +} + +func (_c *MockClient_CMKDelete_Call) RunAndReturn(run func(ctx context.Context, project string, cmkid string) (*cmk.CMKDeleteOut, error)) *MockClient_CMKDelete_Call { + _c.Call.Return(run) + return _c +} + +// CMKGet provides a mock function for the type MockClient +func (_mock *MockClient) CMKGet(ctx context.Context, project string, cmkid string) (*cmk.CMKGetOut, error) { + ret := _mock.Called(ctx, project, cmkid) + + if len(ret) == 0 { + panic("no return value specified for CMKGet") + } + + var r0 *cmk.CMKGetOut + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*cmk.CMKGetOut, error)); ok { + return returnFunc(ctx, project, cmkid) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *cmk.CMKGetOut); ok { + r0 = returnFunc(ctx, project, cmkid) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cmk.CMKGetOut) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok { + r1 = returnFunc(ctx, project, cmkid) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_CMKGet_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CMKGet' +type MockClient_CMKGet_Call struct { + *mock.Call +} + +// CMKGet is a helper method to define mock.On call +// - ctx context.Context +// - project string +// - cmkid string +func (_e *MockClient_Expecter) CMKGet(ctx interface{}, project interface{}, cmkid interface{}) *MockClient_CMKGet_Call { + return &MockClient_CMKGet_Call{Call: _e.mock.On("CMKGet", ctx, project, cmkid)} +} + +func (_c *MockClient_CMKGet_Call) Run(run func(ctx context.Context, project string, cmkid string)) *MockClient_CMKGet_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + run( + arg0, + arg1, + arg2, + ) + }) + return _c +} + +func (_c *MockClient_CMKGet_Call) Return(cMKGetOut *cmk.CMKGetOut, err error) *MockClient_CMKGet_Call { + _c.Call.Return(cMKGetOut, err) + return _c +} + +func (_c *MockClient_CMKGet_Call) RunAndReturn(run func(ctx context.Context, project string, cmkid string) (*cmk.CMKGetOut, error)) *MockClient_CMKGet_Call { + _c.Call.Return(run) + return _c +} + +// CMKUpdate provides a mock function for the type MockClient +func (_mock *MockClient) CMKUpdate(ctx context.Context, project string, cmkid string, in *cmk.CMKUpdateIn) (*cmk.CMKUpdateOut, error) { + ret := _mock.Called(ctx, project, cmkid, in) + + if len(ret) == 0 { + panic("no return value specified for CMKUpdate") + } + + var r0 *cmk.CMKUpdateOut + var r1 error + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *cmk.CMKUpdateIn) (*cmk.CMKUpdateOut, error)); ok { + return returnFunc(ctx, project, cmkid, in) + } + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *cmk.CMKUpdateIn) *cmk.CMKUpdateOut); ok { + r0 = returnFunc(ctx, project, cmkid, in) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*cmk.CMKUpdateOut) + } + } + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, *cmk.CMKUpdateIn) error); ok { + r1 = returnFunc(ctx, project, cmkid, in) + } else { + r1 = ret.Error(1) + } + return r0, r1 +} + +// MockClient_CMKUpdate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CMKUpdate' +type MockClient_CMKUpdate_Call struct { + *mock.Call +} + +// CMKUpdate is a helper method to define mock.On call +// - ctx context.Context +// - project string +// - cmkid string +// - in *cmk.CMKUpdateIn +func (_e *MockClient_Expecter) CMKUpdate(ctx interface{}, project interface{}, cmkid interface{}, in interface{}) *MockClient_CMKUpdate_Call { + return &MockClient_CMKUpdate_Call{Call: _e.mock.On("CMKUpdate", ctx, project, cmkid, in)} +} + +func (_c *MockClient_CMKUpdate_Call) Run(run func(ctx context.Context, project string, cmkid string, in *cmk.CMKUpdateIn)) *MockClient_CMKUpdate_Call { + _c.Call.Run(func(args mock.Arguments) { + var arg0 context.Context + if args[0] != nil { + arg0 = args[0].(context.Context) + } + var arg1 string + if args[1] != nil { + arg1 = args[1].(string) + } + var arg2 string + if args[2] != nil { + arg2 = args[2].(string) + } + var arg3 *cmk.CMKUpdateIn + if args[3] != nil { + arg3 = args[3].(*cmk.CMKUpdateIn) + } + run( + arg0, + arg1, + arg2, + arg3, + ) + }) + return _c +} + +func (_c *MockClient_CMKUpdate_Call) Return(cMKUpdateOut *cmk.CMKUpdateOut, err error) *MockClient_CMKUpdate_Call { + _c.Call.Return(cMKUpdateOut, err) + return _c +} + +func (_c *MockClient_CMKUpdate_Call) RunAndReturn(run func(ctx context.Context, project string, cmkid string, in *cmk.CMKUpdateIn) (*cmk.CMKUpdateOut, error)) *MockClient_CMKUpdate_Call { + _c.Call.Return(run) + return _c +} + // CheckPasswordStrengthExistingUser provides a mock function for the type MockClient func (_mock *MockClient) CheckPasswordStrengthExistingUser(ctx context.Context, in *user.CheckPasswordStrengthExistingUserIn) (*user.CheckPasswordStrengthExistingUserOut, error) { ret := _mock.Called(ctx, in) @@ -5683,7 +6128,7 @@ func (_c *MockClient_ListServiceVersions_Call) RunAndReturn(run func(ctx context } // MySQLServiceQueryStatistics provides a mock function for the type MockClient -func (_mock *MockClient) MySQLServiceQueryStatistics(ctx context.Context, project1 string, serviceName string, in *mysql.MySqlserviceQueryStatisticsIn) ([]mysql.QueryOut, error) { +func (_mock *MockClient) MySQLServiceQueryStatistics(ctx context.Context, project1 string, serviceName string, in *mysql.MySqlServiceQueryStatisticsIn) ([]mysql.QueryOut, error) { ret := _mock.Called(ctx, project1, serviceName, in) if len(ret) == 0 { @@ -5692,17 +6137,17 @@ func (_mock *MockClient) MySQLServiceQueryStatistics(ctx context.Context, projec var r0 []mysql.QueryOut var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *mysql.MySqlserviceQueryStatisticsIn) ([]mysql.QueryOut, error)); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *mysql.MySqlServiceQueryStatisticsIn) ([]mysql.QueryOut, error)); ok { return returnFunc(ctx, project1, serviceName, in) } - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *mysql.MySqlserviceQueryStatisticsIn) []mysql.QueryOut); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *mysql.MySqlServiceQueryStatisticsIn) []mysql.QueryOut); ok { r0 = returnFunc(ctx, project1, serviceName, in) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]mysql.QueryOut) } } - if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, *mysql.MySqlserviceQueryStatisticsIn) error); ok { + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, *mysql.MySqlServiceQueryStatisticsIn) error); ok { r1 = returnFunc(ctx, project1, serviceName, in) } else { r1 = ret.Error(1) @@ -5719,12 +6164,12 @@ type MockClient_MySQLServiceQueryStatistics_Call struct { // - ctx context.Context // - project1 string // - serviceName string -// - in *mysql.MySqlserviceQueryStatisticsIn +// - in *mysql.MySqlServiceQueryStatisticsIn func (_e *MockClient_Expecter) MySQLServiceQueryStatistics(ctx interface{}, project1 interface{}, serviceName interface{}, in interface{}) *MockClient_MySQLServiceQueryStatistics_Call { return &MockClient_MySQLServiceQueryStatistics_Call{Call: _e.mock.On("MySQLServiceQueryStatistics", ctx, project1, serviceName, in)} } -func (_c *MockClient_MySQLServiceQueryStatistics_Call) Run(run func(ctx context.Context, project1 string, serviceName string, in *mysql.MySqlserviceQueryStatisticsIn)) *MockClient_MySQLServiceQueryStatistics_Call { +func (_c *MockClient_MySQLServiceQueryStatistics_Call) Run(run func(ctx context.Context, project1 string, serviceName string, in *mysql.MySqlServiceQueryStatisticsIn)) *MockClient_MySQLServiceQueryStatistics_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { @@ -5738,9 +6183,9 @@ func (_c *MockClient_MySQLServiceQueryStatistics_Call) Run(run func(ctx context. if args[2] != nil { arg2 = args[2].(string) } - var arg3 *mysql.MySqlserviceQueryStatisticsIn + var arg3 *mysql.MySqlServiceQueryStatisticsIn if args[3] != nil { - arg3 = args[3].(*mysql.MySqlserviceQueryStatisticsIn) + arg3 = args[3].(*mysql.MySqlServiceQueryStatisticsIn) } run( arg0, @@ -5757,7 +6202,7 @@ func (_c *MockClient_MySQLServiceQueryStatistics_Call) Return(queryOuts []mysql. return _c } -func (_c *MockClient_MySQLServiceQueryStatistics_Call) RunAndReturn(run func(ctx context.Context, project1 string, serviceName string, in *mysql.MySqlserviceQueryStatisticsIn) ([]mysql.QueryOut, error)) *MockClient_MySQLServiceQueryStatistics_Call { +func (_c *MockClient_MySQLServiceQueryStatistics_Call) RunAndReturn(run func(ctx context.Context, project1 string, serviceName string, in *mysql.MySqlServiceQueryStatisticsIn) ([]mysql.QueryOut, error)) *MockClient_MySQLServiceQueryStatistics_Call { _c.Call.Return(run) return _c } @@ -9496,7 +9941,7 @@ func (_c *MockClient_PGServiceAvailableExtensions_Call) RunAndReturn(run func(ct } // PGServiceQueryStatistics provides a mock function for the type MockClient -func (_mock *MockClient) PGServiceQueryStatistics(ctx context.Context, project1 string, serviceName string, in *postgresql.PgserviceQueryStatisticsIn) ([]postgresql.QueryOut, error) { +func (_mock *MockClient) PGServiceQueryStatistics(ctx context.Context, project1 string, serviceName string, in *postgresql.PgServiceQueryStatisticsIn) ([]postgresql.QueryOut, error) { ret := _mock.Called(ctx, project1, serviceName, in) if len(ret) == 0 { @@ -9505,17 +9950,17 @@ func (_mock *MockClient) PGServiceQueryStatistics(ctx context.Context, project1 var r0 []postgresql.QueryOut var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *postgresql.PgserviceQueryStatisticsIn) ([]postgresql.QueryOut, error)); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *postgresql.PgServiceQueryStatisticsIn) ([]postgresql.QueryOut, error)); ok { return returnFunc(ctx, project1, serviceName, in) } - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *postgresql.PgserviceQueryStatisticsIn) []postgresql.QueryOut); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *postgresql.PgServiceQueryStatisticsIn) []postgresql.QueryOut); ok { r0 = returnFunc(ctx, project1, serviceName, in) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]postgresql.QueryOut) } } - if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, *postgresql.PgserviceQueryStatisticsIn) error); ok { + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, *postgresql.PgServiceQueryStatisticsIn) error); ok { r1 = returnFunc(ctx, project1, serviceName, in) } else { r1 = ret.Error(1) @@ -9532,12 +9977,12 @@ type MockClient_PGServiceQueryStatistics_Call struct { // - ctx context.Context // - project1 string // - serviceName string -// - in *postgresql.PgserviceQueryStatisticsIn +// - in *postgresql.PgServiceQueryStatisticsIn func (_e *MockClient_Expecter) PGServiceQueryStatistics(ctx interface{}, project1 interface{}, serviceName interface{}, in interface{}) *MockClient_PGServiceQueryStatistics_Call { return &MockClient_PGServiceQueryStatistics_Call{Call: _e.mock.On("PGServiceQueryStatistics", ctx, project1, serviceName, in)} } -func (_c *MockClient_PGServiceQueryStatistics_Call) Run(run func(ctx context.Context, project1 string, serviceName string, in *postgresql.PgserviceQueryStatisticsIn)) *MockClient_PGServiceQueryStatistics_Call { +func (_c *MockClient_PGServiceQueryStatistics_Call) Run(run func(ctx context.Context, project1 string, serviceName string, in *postgresql.PgServiceQueryStatisticsIn)) *MockClient_PGServiceQueryStatistics_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { @@ -9551,9 +9996,9 @@ func (_c *MockClient_PGServiceQueryStatistics_Call) Run(run func(ctx context.Con if args[2] != nil { arg2 = args[2].(string) } - var arg3 *postgresql.PgserviceQueryStatisticsIn + var arg3 *postgresql.PgServiceQueryStatisticsIn if args[3] != nil { - arg3 = args[3].(*postgresql.PgserviceQueryStatisticsIn) + arg3 = args[3].(*postgresql.PgServiceQueryStatisticsIn) } run( arg0, @@ -9570,7 +10015,7 @@ func (_c *MockClient_PGServiceQueryStatistics_Call) Return(queryOuts []postgresq return _c } -func (_c *MockClient_PGServiceQueryStatistics_Call) RunAndReturn(run func(ctx context.Context, project1 string, serviceName string, in *postgresql.PgserviceQueryStatisticsIn) ([]postgresql.QueryOut, error)) *MockClient_PGServiceQueryStatistics_Call { +func (_c *MockClient_PGServiceQueryStatistics_Call) RunAndReturn(run func(ctx context.Context, project1 string, serviceName string, in *postgresql.PgServiceQueryStatisticsIn) ([]postgresql.QueryOut, error)) *MockClient_PGServiceQueryStatistics_Call { _c.Call.Return(run) return _c } @@ -11555,26 +12000,26 @@ func (_c *MockClient_ProjectServiceTypesList_Call) RunAndReturn(run func(ctx con } // ProjectStaticIPAssociate provides a mock function for the type MockClient -func (_mock *MockClient) ProjectStaticIPAssociate(ctx context.Context, project1 string, staticIpAddressId string, in *staticip.ProjectStaticIpassociateIn) (*staticip.ProjectStaticIpassociateOut, error) { +func (_mock *MockClient) ProjectStaticIPAssociate(ctx context.Context, project1 string, staticIpAddressId string, in *staticip.ProjectStaticIpAssociateIn) (*staticip.ProjectStaticIpAssociateOut, error) { ret := _mock.Called(ctx, project1, staticIpAddressId, in) if len(ret) == 0 { panic("no return value specified for ProjectStaticIPAssociate") } - var r0 *staticip.ProjectStaticIpassociateOut + var r0 *staticip.ProjectStaticIpAssociateOut var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *staticip.ProjectStaticIpassociateIn) (*staticip.ProjectStaticIpassociateOut, error)); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *staticip.ProjectStaticIpAssociateIn) (*staticip.ProjectStaticIpAssociateOut, error)); ok { return returnFunc(ctx, project1, staticIpAddressId, in) } - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *staticip.ProjectStaticIpassociateIn) *staticip.ProjectStaticIpassociateOut); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *staticip.ProjectStaticIpAssociateIn) *staticip.ProjectStaticIpAssociateOut); ok { r0 = returnFunc(ctx, project1, staticIpAddressId, in) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*staticip.ProjectStaticIpassociateOut) + r0 = ret.Get(0).(*staticip.ProjectStaticIpAssociateOut) } } - if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, *staticip.ProjectStaticIpassociateIn) error); ok { + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, *staticip.ProjectStaticIpAssociateIn) error); ok { r1 = returnFunc(ctx, project1, staticIpAddressId, in) } else { r1 = ret.Error(1) @@ -11591,12 +12036,12 @@ type MockClient_ProjectStaticIPAssociate_Call struct { // - ctx context.Context // - project1 string // - staticIpAddressId string -// - in *staticip.ProjectStaticIpassociateIn +// - in *staticip.ProjectStaticIpAssociateIn func (_e *MockClient_Expecter) ProjectStaticIPAssociate(ctx interface{}, project1 interface{}, staticIpAddressId interface{}, in interface{}) *MockClient_ProjectStaticIPAssociate_Call { return &MockClient_ProjectStaticIPAssociate_Call{Call: _e.mock.On("ProjectStaticIPAssociate", ctx, project1, staticIpAddressId, in)} } -func (_c *MockClient_ProjectStaticIPAssociate_Call) Run(run func(ctx context.Context, project1 string, staticIpAddressId string, in *staticip.ProjectStaticIpassociateIn)) *MockClient_ProjectStaticIPAssociate_Call { +func (_c *MockClient_ProjectStaticIPAssociate_Call) Run(run func(ctx context.Context, project1 string, staticIpAddressId string, in *staticip.ProjectStaticIpAssociateIn)) *MockClient_ProjectStaticIPAssociate_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { @@ -11610,9 +12055,9 @@ func (_c *MockClient_ProjectStaticIPAssociate_Call) Run(run func(ctx context.Con if args[2] != nil { arg2 = args[2].(string) } - var arg3 *staticip.ProjectStaticIpassociateIn + var arg3 *staticip.ProjectStaticIpAssociateIn if args[3] != nil { - arg3 = args[3].(*staticip.ProjectStaticIpassociateIn) + arg3 = args[3].(*staticip.ProjectStaticIpAssociateIn) } run( arg0, @@ -11624,12 +12069,12 @@ func (_c *MockClient_ProjectStaticIPAssociate_Call) Run(run func(ctx context.Con return _c } -func (_c *MockClient_ProjectStaticIPAssociate_Call) Return(projectStaticIpassociateOut *staticip.ProjectStaticIpassociateOut, err error) *MockClient_ProjectStaticIPAssociate_Call { - _c.Call.Return(projectStaticIpassociateOut, err) +func (_c *MockClient_ProjectStaticIPAssociate_Call) Return(projectStaticIpAssociateOut *staticip.ProjectStaticIpAssociateOut, err error) *MockClient_ProjectStaticIPAssociate_Call { + _c.Call.Return(projectStaticIpAssociateOut, err) return _c } -func (_c *MockClient_ProjectStaticIPAssociate_Call) RunAndReturn(run func(ctx context.Context, project1 string, staticIpAddressId string, in *staticip.ProjectStaticIpassociateIn) (*staticip.ProjectStaticIpassociateOut, error)) *MockClient_ProjectStaticIPAssociate_Call { +func (_c *MockClient_ProjectStaticIPAssociate_Call) RunAndReturn(run func(ctx context.Context, project1 string, staticIpAddressId string, in *staticip.ProjectStaticIpAssociateIn) (*staticip.ProjectStaticIpAssociateOut, error)) *MockClient_ProjectStaticIPAssociate_Call { _c.Call.Return(run) return _c } @@ -11703,23 +12148,23 @@ func (_c *MockClient_ProjectStaticIPAvailabilityList_Call) RunAndReturn(run func } // ProjectStaticIPDissociate provides a mock function for the type MockClient -func (_mock *MockClient) ProjectStaticIPDissociate(ctx context.Context, project1 string, staticIpAddressId string) (*staticip.ProjectStaticIpdissociateOut, error) { +func (_mock *MockClient) ProjectStaticIPDissociate(ctx context.Context, project1 string, staticIpAddressId string) (*staticip.ProjectStaticIpDissociateOut, error) { ret := _mock.Called(ctx, project1, staticIpAddressId) if len(ret) == 0 { panic("no return value specified for ProjectStaticIPDissociate") } - var r0 *staticip.ProjectStaticIpdissociateOut + var r0 *staticip.ProjectStaticIpDissociateOut var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*staticip.ProjectStaticIpdissociateOut, error)); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*staticip.ProjectStaticIpDissociateOut, error)); ok { return returnFunc(ctx, project1, staticIpAddressId) } - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *staticip.ProjectStaticIpdissociateOut); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *staticip.ProjectStaticIpDissociateOut); ok { r0 = returnFunc(ctx, project1, staticIpAddressId) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*staticip.ProjectStaticIpdissociateOut) + r0 = ret.Get(0).(*staticip.ProjectStaticIpDissociateOut) } } if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok { @@ -11766,37 +12211,37 @@ func (_c *MockClient_ProjectStaticIPDissociate_Call) Run(run func(ctx context.Co return _c } -func (_c *MockClient_ProjectStaticIPDissociate_Call) Return(projectStaticIpdissociateOut *staticip.ProjectStaticIpdissociateOut, err error) *MockClient_ProjectStaticIPDissociate_Call { - _c.Call.Return(projectStaticIpdissociateOut, err) +func (_c *MockClient_ProjectStaticIPDissociate_Call) Return(projectStaticIpDissociateOut *staticip.ProjectStaticIpDissociateOut, err error) *MockClient_ProjectStaticIPDissociate_Call { + _c.Call.Return(projectStaticIpDissociateOut, err) return _c } -func (_c *MockClient_ProjectStaticIPDissociate_Call) RunAndReturn(run func(ctx context.Context, project1 string, staticIpAddressId string) (*staticip.ProjectStaticIpdissociateOut, error)) *MockClient_ProjectStaticIPDissociate_Call { +func (_c *MockClient_ProjectStaticIPDissociate_Call) RunAndReturn(run func(ctx context.Context, project1 string, staticIpAddressId string) (*staticip.ProjectStaticIpDissociateOut, error)) *MockClient_ProjectStaticIPDissociate_Call { _c.Call.Return(run) return _c } // ProjectStaticIPPatch provides a mock function for the type MockClient -func (_mock *MockClient) ProjectStaticIPPatch(ctx context.Context, project1 string, staticIpAddressId string, in *staticip.ProjectStaticIppatchIn) (*staticip.ProjectStaticIppatchOut, error) { +func (_mock *MockClient) ProjectStaticIPPatch(ctx context.Context, project1 string, staticIpAddressId string, in *staticip.ProjectStaticIpPatchIn) (*staticip.ProjectStaticIpPatchOut, error) { ret := _mock.Called(ctx, project1, staticIpAddressId, in) if len(ret) == 0 { panic("no return value specified for ProjectStaticIPPatch") } - var r0 *staticip.ProjectStaticIppatchOut + var r0 *staticip.ProjectStaticIpPatchOut var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *staticip.ProjectStaticIppatchIn) (*staticip.ProjectStaticIppatchOut, error)); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *staticip.ProjectStaticIpPatchIn) (*staticip.ProjectStaticIpPatchOut, error)); ok { return returnFunc(ctx, project1, staticIpAddressId, in) } - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *staticip.ProjectStaticIppatchIn) *staticip.ProjectStaticIppatchOut); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *staticip.ProjectStaticIpPatchIn) *staticip.ProjectStaticIpPatchOut); ok { r0 = returnFunc(ctx, project1, staticIpAddressId, in) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*staticip.ProjectStaticIppatchOut) + r0 = ret.Get(0).(*staticip.ProjectStaticIpPatchOut) } } - if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, *staticip.ProjectStaticIppatchIn) error); ok { + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, *staticip.ProjectStaticIpPatchIn) error); ok { r1 = returnFunc(ctx, project1, staticIpAddressId, in) } else { r1 = ret.Error(1) @@ -11813,12 +12258,12 @@ type MockClient_ProjectStaticIPPatch_Call struct { // - ctx context.Context // - project1 string // - staticIpAddressId string -// - in *staticip.ProjectStaticIppatchIn +// - in *staticip.ProjectStaticIpPatchIn func (_e *MockClient_Expecter) ProjectStaticIPPatch(ctx interface{}, project1 interface{}, staticIpAddressId interface{}, in interface{}) *MockClient_ProjectStaticIPPatch_Call { return &MockClient_ProjectStaticIPPatch_Call{Call: _e.mock.On("ProjectStaticIPPatch", ctx, project1, staticIpAddressId, in)} } -func (_c *MockClient_ProjectStaticIPPatch_Call) Run(run func(ctx context.Context, project1 string, staticIpAddressId string, in *staticip.ProjectStaticIppatchIn)) *MockClient_ProjectStaticIPPatch_Call { +func (_c *MockClient_ProjectStaticIPPatch_Call) Run(run func(ctx context.Context, project1 string, staticIpAddressId string, in *staticip.ProjectStaticIpPatchIn)) *MockClient_ProjectStaticIPPatch_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { @@ -11832,9 +12277,9 @@ func (_c *MockClient_ProjectStaticIPPatch_Call) Run(run func(ctx context.Context if args[2] != nil { arg2 = args[2].(string) } - var arg3 *staticip.ProjectStaticIppatchIn + var arg3 *staticip.ProjectStaticIpPatchIn if args[3] != nil { - arg3 = args[3].(*staticip.ProjectStaticIppatchIn) + arg3 = args[3].(*staticip.ProjectStaticIpPatchIn) } run( arg0, @@ -11846,12 +12291,12 @@ func (_c *MockClient_ProjectStaticIPPatch_Call) Run(run func(ctx context.Context return _c } -func (_c *MockClient_ProjectStaticIPPatch_Call) Return(projectStaticIppatchOut *staticip.ProjectStaticIppatchOut, err error) *MockClient_ProjectStaticIPPatch_Call { - _c.Call.Return(projectStaticIppatchOut, err) +func (_c *MockClient_ProjectStaticIPPatch_Call) Return(projectStaticIpPatchOut *staticip.ProjectStaticIpPatchOut, err error) *MockClient_ProjectStaticIPPatch_Call { + _c.Call.Return(projectStaticIpPatchOut, err) return _c } -func (_c *MockClient_ProjectStaticIPPatch_Call) RunAndReturn(run func(ctx context.Context, project1 string, staticIpAddressId string, in *staticip.ProjectStaticIppatchIn) (*staticip.ProjectStaticIppatchOut, error)) *MockClient_ProjectStaticIPPatch_Call { +func (_c *MockClient_ProjectStaticIPPatch_Call) RunAndReturn(run func(ctx context.Context, project1 string, staticIpAddressId string, in *staticip.ProjectStaticIpPatchIn) (*staticip.ProjectStaticIpPatchOut, error)) *MockClient_ProjectStaticIPPatch_Call { _c.Call.Return(run) return _c } @@ -21610,7 +22055,7 @@ func (_c *MockClient_ServiceOpenSearchSecuritySet_Call) RunAndReturn(run func(ct } // ServicePGBouncerCreate provides a mock function for the type MockClient -func (_mock *MockClient) ServicePGBouncerCreate(ctx context.Context, project1 string, serviceName string, in *postgresql.ServicePgbouncerCreateIn) error { +func (_mock *MockClient) ServicePGBouncerCreate(ctx context.Context, project1 string, serviceName string, in *postgresql.ServicePgBouncerCreateIn) error { ret := _mock.Called(ctx, project1, serviceName, in) if len(ret) == 0 { @@ -21618,7 +22063,7 @@ func (_mock *MockClient) ServicePGBouncerCreate(ctx context.Context, project1 st } var r0 error - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *postgresql.ServicePgbouncerCreateIn) error); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *postgresql.ServicePgBouncerCreateIn) error); ok { r0 = returnFunc(ctx, project1, serviceName, in) } else { r0 = ret.Error(0) @@ -21635,12 +22080,12 @@ type MockClient_ServicePGBouncerCreate_Call struct { // - ctx context.Context // - project1 string // - serviceName string -// - in *postgresql.ServicePgbouncerCreateIn +// - in *postgresql.ServicePgBouncerCreateIn func (_e *MockClient_Expecter) ServicePGBouncerCreate(ctx interface{}, project1 interface{}, serviceName interface{}, in interface{}) *MockClient_ServicePGBouncerCreate_Call { return &MockClient_ServicePGBouncerCreate_Call{Call: _e.mock.On("ServicePGBouncerCreate", ctx, project1, serviceName, in)} } -func (_c *MockClient_ServicePGBouncerCreate_Call) Run(run func(ctx context.Context, project1 string, serviceName string, in *postgresql.ServicePgbouncerCreateIn)) *MockClient_ServicePGBouncerCreate_Call { +func (_c *MockClient_ServicePGBouncerCreate_Call) Run(run func(ctx context.Context, project1 string, serviceName string, in *postgresql.ServicePgBouncerCreateIn)) *MockClient_ServicePGBouncerCreate_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { @@ -21654,9 +22099,9 @@ func (_c *MockClient_ServicePGBouncerCreate_Call) Run(run func(ctx context.Conte if args[2] != nil { arg2 = args[2].(string) } - var arg3 *postgresql.ServicePgbouncerCreateIn + var arg3 *postgresql.ServicePgBouncerCreateIn if args[3] != nil { - arg3 = args[3].(*postgresql.ServicePgbouncerCreateIn) + arg3 = args[3].(*postgresql.ServicePgBouncerCreateIn) } run( arg0, @@ -21673,7 +22118,7 @@ func (_c *MockClient_ServicePGBouncerCreate_Call) Return(err error) *MockClient_ return _c } -func (_c *MockClient_ServicePGBouncerCreate_Call) RunAndReturn(run func(ctx context.Context, project1 string, serviceName string, in *postgresql.ServicePgbouncerCreateIn) error) *MockClient_ServicePGBouncerCreate_Call { +func (_c *MockClient_ServicePGBouncerCreate_Call) RunAndReturn(run func(ctx context.Context, project1 string, serviceName string, in *postgresql.ServicePgBouncerCreateIn) error) *MockClient_ServicePGBouncerCreate_Call { _c.Call.Return(run) return _c } @@ -21748,7 +22193,7 @@ func (_c *MockClient_ServicePGBouncerDelete_Call) RunAndReturn(run func(ctx cont } // ServicePGBouncerUpdate provides a mock function for the type MockClient -func (_mock *MockClient) ServicePGBouncerUpdate(ctx context.Context, project1 string, serviceName string, poolName string, in *postgresql.ServicePgbouncerUpdateIn) error { +func (_mock *MockClient) ServicePGBouncerUpdate(ctx context.Context, project1 string, serviceName string, poolName string, in *postgresql.ServicePgBouncerUpdateIn) error { ret := _mock.Called(ctx, project1, serviceName, poolName, in) if len(ret) == 0 { @@ -21756,7 +22201,7 @@ func (_mock *MockClient) ServicePGBouncerUpdate(ctx context.Context, project1 st } var r0 error - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, string, *postgresql.ServicePgbouncerUpdateIn) error); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, string, *postgresql.ServicePgBouncerUpdateIn) error); ok { r0 = returnFunc(ctx, project1, serviceName, poolName, in) } else { r0 = ret.Error(0) @@ -21774,12 +22219,12 @@ type MockClient_ServicePGBouncerUpdate_Call struct { // - project1 string // - serviceName string // - poolName string -// - in *postgresql.ServicePgbouncerUpdateIn +// - in *postgresql.ServicePgBouncerUpdateIn func (_e *MockClient_Expecter) ServicePGBouncerUpdate(ctx interface{}, project1 interface{}, serviceName interface{}, poolName interface{}, in interface{}) *MockClient_ServicePGBouncerUpdate_Call { return &MockClient_ServicePGBouncerUpdate_Call{Call: _e.mock.On("ServicePGBouncerUpdate", ctx, project1, serviceName, poolName, in)} } -func (_c *MockClient_ServicePGBouncerUpdate_Call) Run(run func(ctx context.Context, project1 string, serviceName string, poolName string, in *postgresql.ServicePgbouncerUpdateIn)) *MockClient_ServicePGBouncerUpdate_Call { +func (_c *MockClient_ServicePGBouncerUpdate_Call) Run(run func(ctx context.Context, project1 string, serviceName string, poolName string, in *postgresql.ServicePgBouncerUpdateIn)) *MockClient_ServicePGBouncerUpdate_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { @@ -21797,9 +22242,9 @@ func (_c *MockClient_ServicePGBouncerUpdate_Call) Run(run func(ctx context.Conte if args[3] != nil { arg3 = args[3].(string) } - var arg4 *postgresql.ServicePgbouncerUpdateIn + var arg4 *postgresql.ServicePgBouncerUpdateIn if args[4] != nil { - arg4 = args[4].(*postgresql.ServicePgbouncerUpdateIn) + arg4 = args[4].(*postgresql.ServicePgBouncerUpdateIn) } run( arg0, @@ -21817,7 +22262,7 @@ func (_c *MockClient_ServicePGBouncerUpdate_Call) Return(err error) *MockClient_ return _c } -func (_c *MockClient_ServicePGBouncerUpdate_Call) RunAndReturn(run func(ctx context.Context, project1 string, serviceName string, poolName string, in *postgresql.ServicePgbouncerUpdateIn) error) *MockClient_ServicePGBouncerUpdate_Call { +func (_c *MockClient_ServicePGBouncerUpdate_Call) RunAndReturn(run func(ctx context.Context, project1 string, serviceName string, poolName string, in *postgresql.ServicePgBouncerUpdateIn) error) *MockClient_ServicePGBouncerUpdate_Call { _c.Call.Return(run) return _c } @@ -21897,26 +22342,26 @@ func (_c *MockClient_ServicePrivatelinkAWSConnectionList_Call) RunAndReturn(run } // ServicePrivatelinkAWSCreate provides a mock function for the type MockClient -func (_mock *MockClient) ServicePrivatelinkAWSCreate(ctx context.Context, project1 string, serviceName string, in *privatelink.ServicePrivatelinkAwscreateIn) (*privatelink.ServicePrivatelinkAwscreateOut, error) { +func (_mock *MockClient) ServicePrivatelinkAWSCreate(ctx context.Context, project1 string, serviceName string, in *privatelink.ServicePrivatelinkAwsCreateIn) (*privatelink.ServicePrivatelinkAwsCreateOut, error) { ret := _mock.Called(ctx, project1, serviceName, in) if len(ret) == 0 { panic("no return value specified for ServicePrivatelinkAWSCreate") } - var r0 *privatelink.ServicePrivatelinkAwscreateOut + var r0 *privatelink.ServicePrivatelinkAwsCreateOut var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *privatelink.ServicePrivatelinkAwscreateIn) (*privatelink.ServicePrivatelinkAwscreateOut, error)); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *privatelink.ServicePrivatelinkAwsCreateIn) (*privatelink.ServicePrivatelinkAwsCreateOut, error)); ok { return returnFunc(ctx, project1, serviceName, in) } - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *privatelink.ServicePrivatelinkAwscreateIn) *privatelink.ServicePrivatelinkAwscreateOut); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *privatelink.ServicePrivatelinkAwsCreateIn) *privatelink.ServicePrivatelinkAwsCreateOut); ok { r0 = returnFunc(ctx, project1, serviceName, in) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*privatelink.ServicePrivatelinkAwscreateOut) + r0 = ret.Get(0).(*privatelink.ServicePrivatelinkAwsCreateOut) } } - if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, *privatelink.ServicePrivatelinkAwscreateIn) error); ok { + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, *privatelink.ServicePrivatelinkAwsCreateIn) error); ok { r1 = returnFunc(ctx, project1, serviceName, in) } else { r1 = ret.Error(1) @@ -21933,12 +22378,12 @@ type MockClient_ServicePrivatelinkAWSCreate_Call struct { // - ctx context.Context // - project1 string // - serviceName string -// - in *privatelink.ServicePrivatelinkAwscreateIn +// - in *privatelink.ServicePrivatelinkAwsCreateIn func (_e *MockClient_Expecter) ServicePrivatelinkAWSCreate(ctx interface{}, project1 interface{}, serviceName interface{}, in interface{}) *MockClient_ServicePrivatelinkAWSCreate_Call { return &MockClient_ServicePrivatelinkAWSCreate_Call{Call: _e.mock.On("ServicePrivatelinkAWSCreate", ctx, project1, serviceName, in)} } -func (_c *MockClient_ServicePrivatelinkAWSCreate_Call) Run(run func(ctx context.Context, project1 string, serviceName string, in *privatelink.ServicePrivatelinkAwscreateIn)) *MockClient_ServicePrivatelinkAWSCreate_Call { +func (_c *MockClient_ServicePrivatelinkAWSCreate_Call) Run(run func(ctx context.Context, project1 string, serviceName string, in *privatelink.ServicePrivatelinkAwsCreateIn)) *MockClient_ServicePrivatelinkAWSCreate_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { @@ -21952,9 +22397,9 @@ func (_c *MockClient_ServicePrivatelinkAWSCreate_Call) Run(run func(ctx context. if args[2] != nil { arg2 = args[2].(string) } - var arg3 *privatelink.ServicePrivatelinkAwscreateIn + var arg3 *privatelink.ServicePrivatelinkAwsCreateIn if args[3] != nil { - arg3 = args[3].(*privatelink.ServicePrivatelinkAwscreateIn) + arg3 = args[3].(*privatelink.ServicePrivatelinkAwsCreateIn) } run( arg0, @@ -21966,34 +22411,34 @@ func (_c *MockClient_ServicePrivatelinkAWSCreate_Call) Run(run func(ctx context. return _c } -func (_c *MockClient_ServicePrivatelinkAWSCreate_Call) Return(servicePrivatelinkAwscreateOut *privatelink.ServicePrivatelinkAwscreateOut, err error) *MockClient_ServicePrivatelinkAWSCreate_Call { - _c.Call.Return(servicePrivatelinkAwscreateOut, err) +func (_c *MockClient_ServicePrivatelinkAWSCreate_Call) Return(servicePrivatelinkAwsCreateOut *privatelink.ServicePrivatelinkAwsCreateOut, err error) *MockClient_ServicePrivatelinkAWSCreate_Call { + _c.Call.Return(servicePrivatelinkAwsCreateOut, err) return _c } -func (_c *MockClient_ServicePrivatelinkAWSCreate_Call) RunAndReturn(run func(ctx context.Context, project1 string, serviceName string, in *privatelink.ServicePrivatelinkAwscreateIn) (*privatelink.ServicePrivatelinkAwscreateOut, error)) *MockClient_ServicePrivatelinkAWSCreate_Call { +func (_c *MockClient_ServicePrivatelinkAWSCreate_Call) RunAndReturn(run func(ctx context.Context, project1 string, serviceName string, in *privatelink.ServicePrivatelinkAwsCreateIn) (*privatelink.ServicePrivatelinkAwsCreateOut, error)) *MockClient_ServicePrivatelinkAWSCreate_Call { _c.Call.Return(run) return _c } // ServicePrivatelinkAWSDelete provides a mock function for the type MockClient -func (_mock *MockClient) ServicePrivatelinkAWSDelete(ctx context.Context, project1 string, serviceName string) (*privatelink.ServicePrivatelinkAwsdeleteOut, error) { +func (_mock *MockClient) ServicePrivatelinkAWSDelete(ctx context.Context, project1 string, serviceName string) (*privatelink.ServicePrivatelinkAwsDeleteOut, error) { ret := _mock.Called(ctx, project1, serviceName) if len(ret) == 0 { panic("no return value specified for ServicePrivatelinkAWSDelete") } - var r0 *privatelink.ServicePrivatelinkAwsdeleteOut + var r0 *privatelink.ServicePrivatelinkAwsDeleteOut var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*privatelink.ServicePrivatelinkAwsdeleteOut, error)); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*privatelink.ServicePrivatelinkAwsDeleteOut, error)); ok { return returnFunc(ctx, project1, serviceName) } - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *privatelink.ServicePrivatelinkAwsdeleteOut); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *privatelink.ServicePrivatelinkAwsDeleteOut); ok { r0 = returnFunc(ctx, project1, serviceName) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*privatelink.ServicePrivatelinkAwsdeleteOut) + r0 = ret.Get(0).(*privatelink.ServicePrivatelinkAwsDeleteOut) } } if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok { @@ -22040,34 +22485,34 @@ func (_c *MockClient_ServicePrivatelinkAWSDelete_Call) Run(run func(ctx context. return _c } -func (_c *MockClient_ServicePrivatelinkAWSDelete_Call) Return(servicePrivatelinkAwsdeleteOut *privatelink.ServicePrivatelinkAwsdeleteOut, err error) *MockClient_ServicePrivatelinkAWSDelete_Call { - _c.Call.Return(servicePrivatelinkAwsdeleteOut, err) +func (_c *MockClient_ServicePrivatelinkAWSDelete_Call) Return(servicePrivatelinkAwsDeleteOut *privatelink.ServicePrivatelinkAwsDeleteOut, err error) *MockClient_ServicePrivatelinkAWSDelete_Call { + _c.Call.Return(servicePrivatelinkAwsDeleteOut, err) return _c } -func (_c *MockClient_ServicePrivatelinkAWSDelete_Call) RunAndReturn(run func(ctx context.Context, project1 string, serviceName string) (*privatelink.ServicePrivatelinkAwsdeleteOut, error)) *MockClient_ServicePrivatelinkAWSDelete_Call { +func (_c *MockClient_ServicePrivatelinkAWSDelete_Call) RunAndReturn(run func(ctx context.Context, project1 string, serviceName string) (*privatelink.ServicePrivatelinkAwsDeleteOut, error)) *MockClient_ServicePrivatelinkAWSDelete_Call { _c.Call.Return(run) return _c } // ServicePrivatelinkAWSGet provides a mock function for the type MockClient -func (_mock *MockClient) ServicePrivatelinkAWSGet(ctx context.Context, project1 string, serviceName string) (*privatelink.ServicePrivatelinkAwsgetOut, error) { +func (_mock *MockClient) ServicePrivatelinkAWSGet(ctx context.Context, project1 string, serviceName string) (*privatelink.ServicePrivatelinkAwsGetOut, error) { ret := _mock.Called(ctx, project1, serviceName) if len(ret) == 0 { panic("no return value specified for ServicePrivatelinkAWSGet") } - var r0 *privatelink.ServicePrivatelinkAwsgetOut + var r0 *privatelink.ServicePrivatelinkAwsGetOut var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*privatelink.ServicePrivatelinkAwsgetOut, error)); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) (*privatelink.ServicePrivatelinkAwsGetOut, error)); ok { return returnFunc(ctx, project1, serviceName) } - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *privatelink.ServicePrivatelinkAwsgetOut); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string) *privatelink.ServicePrivatelinkAwsGetOut); ok { r0 = returnFunc(ctx, project1, serviceName) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*privatelink.ServicePrivatelinkAwsgetOut) + r0 = ret.Get(0).(*privatelink.ServicePrivatelinkAwsGetOut) } } if returnFunc, ok := ret.Get(1).(func(context.Context, string, string) error); ok { @@ -22114,37 +22559,37 @@ func (_c *MockClient_ServicePrivatelinkAWSGet_Call) Run(run func(ctx context.Con return _c } -func (_c *MockClient_ServicePrivatelinkAWSGet_Call) Return(servicePrivatelinkAwsgetOut *privatelink.ServicePrivatelinkAwsgetOut, err error) *MockClient_ServicePrivatelinkAWSGet_Call { - _c.Call.Return(servicePrivatelinkAwsgetOut, err) +func (_c *MockClient_ServicePrivatelinkAWSGet_Call) Return(servicePrivatelinkAwsGetOut *privatelink.ServicePrivatelinkAwsGetOut, err error) *MockClient_ServicePrivatelinkAWSGet_Call { + _c.Call.Return(servicePrivatelinkAwsGetOut, err) return _c } -func (_c *MockClient_ServicePrivatelinkAWSGet_Call) RunAndReturn(run func(ctx context.Context, project1 string, serviceName string) (*privatelink.ServicePrivatelinkAwsgetOut, error)) *MockClient_ServicePrivatelinkAWSGet_Call { +func (_c *MockClient_ServicePrivatelinkAWSGet_Call) RunAndReturn(run func(ctx context.Context, project1 string, serviceName string) (*privatelink.ServicePrivatelinkAwsGetOut, error)) *MockClient_ServicePrivatelinkAWSGet_Call { _c.Call.Return(run) return _c } // ServicePrivatelinkAWSUpdate provides a mock function for the type MockClient -func (_mock *MockClient) ServicePrivatelinkAWSUpdate(ctx context.Context, project1 string, serviceName string, in *privatelink.ServicePrivatelinkAwsupdateIn) (*privatelink.ServicePrivatelinkAwsupdateOut, error) { +func (_mock *MockClient) ServicePrivatelinkAWSUpdate(ctx context.Context, project1 string, serviceName string, in *privatelink.ServicePrivatelinkAwsUpdateIn) (*privatelink.ServicePrivatelinkAwsUpdateOut, error) { ret := _mock.Called(ctx, project1, serviceName, in) if len(ret) == 0 { panic("no return value specified for ServicePrivatelinkAWSUpdate") } - var r0 *privatelink.ServicePrivatelinkAwsupdateOut + var r0 *privatelink.ServicePrivatelinkAwsUpdateOut var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *privatelink.ServicePrivatelinkAwsupdateIn) (*privatelink.ServicePrivatelinkAwsupdateOut, error)); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *privatelink.ServicePrivatelinkAwsUpdateIn) (*privatelink.ServicePrivatelinkAwsUpdateOut, error)); ok { return returnFunc(ctx, project1, serviceName, in) } - if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *privatelink.ServicePrivatelinkAwsupdateIn) *privatelink.ServicePrivatelinkAwsupdateOut); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, string, *privatelink.ServicePrivatelinkAwsUpdateIn) *privatelink.ServicePrivatelinkAwsUpdateOut); ok { r0 = returnFunc(ctx, project1, serviceName, in) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*privatelink.ServicePrivatelinkAwsupdateOut) + r0 = ret.Get(0).(*privatelink.ServicePrivatelinkAwsUpdateOut) } } - if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, *privatelink.ServicePrivatelinkAwsupdateIn) error); ok { + if returnFunc, ok := ret.Get(1).(func(context.Context, string, string, *privatelink.ServicePrivatelinkAwsUpdateIn) error); ok { r1 = returnFunc(ctx, project1, serviceName, in) } else { r1 = ret.Error(1) @@ -22161,12 +22606,12 @@ type MockClient_ServicePrivatelinkAWSUpdate_Call struct { // - ctx context.Context // - project1 string // - serviceName string -// - in *privatelink.ServicePrivatelinkAwsupdateIn +// - in *privatelink.ServicePrivatelinkAwsUpdateIn func (_e *MockClient_Expecter) ServicePrivatelinkAWSUpdate(ctx interface{}, project1 interface{}, serviceName interface{}, in interface{}) *MockClient_ServicePrivatelinkAWSUpdate_Call { return &MockClient_ServicePrivatelinkAWSUpdate_Call{Call: _e.mock.On("ServicePrivatelinkAWSUpdate", ctx, project1, serviceName, in)} } -func (_c *MockClient_ServicePrivatelinkAWSUpdate_Call) Run(run func(ctx context.Context, project1 string, serviceName string, in *privatelink.ServicePrivatelinkAwsupdateIn)) *MockClient_ServicePrivatelinkAWSUpdate_Call { +func (_c *MockClient_ServicePrivatelinkAWSUpdate_Call) Run(run func(ctx context.Context, project1 string, serviceName string, in *privatelink.ServicePrivatelinkAwsUpdateIn)) *MockClient_ServicePrivatelinkAWSUpdate_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { @@ -22180,9 +22625,9 @@ func (_c *MockClient_ServicePrivatelinkAWSUpdate_Call) Run(run func(ctx context. if args[2] != nil { arg2 = args[2].(string) } - var arg3 *privatelink.ServicePrivatelinkAwsupdateIn + var arg3 *privatelink.ServicePrivatelinkAwsUpdateIn if args[3] != nil { - arg3 = args[3].(*privatelink.ServicePrivatelinkAwsupdateIn) + arg3 = args[3].(*privatelink.ServicePrivatelinkAwsUpdateIn) } run( arg0, @@ -22194,12 +22639,12 @@ func (_c *MockClient_ServicePrivatelinkAWSUpdate_Call) Run(run func(ctx context. return _c } -func (_c *MockClient_ServicePrivatelinkAWSUpdate_Call) Return(servicePrivatelinkAwsupdateOut *privatelink.ServicePrivatelinkAwsupdateOut, err error) *MockClient_ServicePrivatelinkAWSUpdate_Call { - _c.Call.Return(servicePrivatelinkAwsupdateOut, err) +func (_c *MockClient_ServicePrivatelinkAWSUpdate_Call) Return(servicePrivatelinkAwsUpdateOut *privatelink.ServicePrivatelinkAwsUpdateOut, err error) *MockClient_ServicePrivatelinkAWSUpdate_Call { + _c.Call.Return(servicePrivatelinkAwsUpdateOut, err) return _c } -func (_c *MockClient_ServicePrivatelinkAWSUpdate_Call) RunAndReturn(run func(ctx context.Context, project1 string, serviceName string, in *privatelink.ServicePrivatelinkAwsupdateIn) (*privatelink.ServicePrivatelinkAwsupdateOut, error)) *MockClient_ServicePrivatelinkAWSUpdate_Call { +func (_c *MockClient_ServicePrivatelinkAWSUpdate_Call) RunAndReturn(run func(ctx context.Context, project1 string, serviceName string, in *privatelink.ServicePrivatelinkAwsUpdateIn) (*privatelink.ServicePrivatelinkAwsUpdateOut, error)) *MockClient_ServicePrivatelinkAWSUpdate_Call { _c.Call.Return(run) return _c } @@ -24911,26 +25356,26 @@ func (_c *MockClient_ServiceUserGet_Call) RunAndReturn(run func(ctx context.Cont } // StaticIPCreate provides a mock function for the type MockClient -func (_mock *MockClient) StaticIPCreate(ctx context.Context, project1 string, in *staticip.StaticIpcreateIn) (*staticip.StaticIpcreateOut, error) { +func (_mock *MockClient) StaticIPCreate(ctx context.Context, project1 string, in *staticip.StaticIpCreateIn) (*staticip.StaticIpCreateOut, error) { ret := _mock.Called(ctx, project1, in) if len(ret) == 0 { panic("no return value specified for StaticIPCreate") } - var r0 *staticip.StaticIpcreateOut + var r0 *staticip.StaticIpCreateOut var r1 error - if returnFunc, ok := ret.Get(0).(func(context.Context, string, *staticip.StaticIpcreateIn) (*staticip.StaticIpcreateOut, error)); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, *staticip.StaticIpCreateIn) (*staticip.StaticIpCreateOut, error)); ok { return returnFunc(ctx, project1, in) } - if returnFunc, ok := ret.Get(0).(func(context.Context, string, *staticip.StaticIpcreateIn) *staticip.StaticIpcreateOut); ok { + if returnFunc, ok := ret.Get(0).(func(context.Context, string, *staticip.StaticIpCreateIn) *staticip.StaticIpCreateOut); ok { r0 = returnFunc(ctx, project1, in) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*staticip.StaticIpcreateOut) + r0 = ret.Get(0).(*staticip.StaticIpCreateOut) } } - if returnFunc, ok := ret.Get(1).(func(context.Context, string, *staticip.StaticIpcreateIn) error); ok { + if returnFunc, ok := ret.Get(1).(func(context.Context, string, *staticip.StaticIpCreateIn) error); ok { r1 = returnFunc(ctx, project1, in) } else { r1 = ret.Error(1) @@ -24946,12 +25391,12 @@ type MockClient_StaticIPCreate_Call struct { // StaticIPCreate is a helper method to define mock.On call // - ctx context.Context // - project1 string -// - in *staticip.StaticIpcreateIn +// - in *staticip.StaticIpCreateIn func (_e *MockClient_Expecter) StaticIPCreate(ctx interface{}, project1 interface{}, in interface{}) *MockClient_StaticIPCreate_Call { return &MockClient_StaticIPCreate_Call{Call: _e.mock.On("StaticIPCreate", ctx, project1, in)} } -func (_c *MockClient_StaticIPCreate_Call) Run(run func(ctx context.Context, project1 string, in *staticip.StaticIpcreateIn)) *MockClient_StaticIPCreate_Call { +func (_c *MockClient_StaticIPCreate_Call) Run(run func(ctx context.Context, project1 string, in *staticip.StaticIpCreateIn)) *MockClient_StaticIPCreate_Call { _c.Call.Run(func(args mock.Arguments) { var arg0 context.Context if args[0] != nil { @@ -24961,9 +25406,9 @@ func (_c *MockClient_StaticIPCreate_Call) Run(run func(ctx context.Context, proj if args[1] != nil { arg1 = args[1].(string) } - var arg2 *staticip.StaticIpcreateIn + var arg2 *staticip.StaticIpCreateIn if args[2] != nil { - arg2 = args[2].(*staticip.StaticIpcreateIn) + arg2 = args[2].(*staticip.StaticIpCreateIn) } run( arg0, @@ -24974,12 +25419,12 @@ func (_c *MockClient_StaticIPCreate_Call) Run(run func(ctx context.Context, proj return _c } -func (_c *MockClient_StaticIPCreate_Call) Return(staticIpcreateOut *staticip.StaticIpcreateOut, err error) *MockClient_StaticIPCreate_Call { - _c.Call.Return(staticIpcreateOut, err) +func (_c *MockClient_StaticIPCreate_Call) Return(staticIpCreateOut *staticip.StaticIpCreateOut, err error) *MockClient_StaticIPCreate_Call { + _c.Call.Return(staticIpCreateOut, err) return _c } -func (_c *MockClient_StaticIPCreate_Call) RunAndReturn(run func(ctx context.Context, project1 string, in *staticip.StaticIpcreateIn) (*staticip.StaticIpcreateOut, error)) *MockClient_StaticIPCreate_Call { +func (_c *MockClient_StaticIPCreate_Call) RunAndReturn(run func(ctx context.Context, project1 string, in *staticip.StaticIpCreateIn) (*staticip.StaticIpCreateOut, error)) *MockClient_StaticIPCreate_Call { _c.Call.Return(run) return _c } diff --git a/config.yaml b/config.yaml index d9e7c88..22d30c5 100644 --- a/config.yaml +++ b/config.yaml @@ -75,6 +75,13 @@ Byoc: - CustomCloudEnvironmentPermissionsSet - CustomCloudEnvironmentProvision - CustomCloudEnvironmentUpdate +CMK: + - CMKAccessCheckTrigger + - CMKAccessorsList + - CMKCreate + - CMKDelete + - CMKGet + - CMKUpdate ClickHouse: - ServiceClickHouseCurrentQueries - ServiceClickHouseDatabaseCreate diff --git a/generator/main.go b/generator/main.go index d23ef5c..b039e9d 100644 --- a/generator/main.go +++ b/generator/main.go @@ -18,7 +18,7 @@ import ( "time" "github.com/dave/jennifer/jen" - "github.com/iancoleman/strcase" + "github.com/ettle/strcase" "github.com/kelseyhightower/envconfig" "github.com/rs/zerolog" "github.com/rs/zerolog/log" @@ -60,17 +60,16 @@ func main() { err := exec() if err != nil { - log.Err(err).Send() + fmt.Println(err) os.Exit(1) } } const ( - doerName = "doer" - handlerTypeName = "Handler" - queryParamName = "query" - queryParamTypeSuffix = "Query" - queryParamArraySize = 2 + doerName = "doer" + handlerTypeName = "Handler" + queryParamName = "query" + queryParamArraySize = 2 ) //nolint:funlen,gocognit,gocyclo // It's a generator, it's supposed to be long, and we won't expand it. @@ -401,7 +400,7 @@ func exec() error { if rsp.CamelName != schemaOut.CamelName { // Takes original name and turns to camel. // "CamelName" field might have been modified because of name collisions - outReturn.Dot(customCamelCase(rsp.name)) + outReturn.Dot(customCamelCase(rsp.name, false)) if forcePointer { // return &out.Foo @@ -482,7 +481,7 @@ func writeStruct(f *jen.File, s *Schema) error { continue } - constant := s.CamelName + customCamelCase(literal) + constant := s.CamelName + customCamelCase(literal, false) // KafkaMirror ReplicationPolicyClassType makes bad generated name if strings.HasPrefix(literal, "org.apache.kafka.connect.mirror.") { @@ -546,7 +545,7 @@ func fmtStruct(s *Schema) *jen.Statement { uniqueNames := make(map[string]string, len(jsonNames)) for _, jsonName := range jsonNames { p := s.Properties[jsonName] - goName := customCamelCase(jsonName) + goName := customCamelCase(jsonName, false) if exist, ok := uniqueNames[goName]; ok { log.Warn().Msgf("Found field collision: %q overrides %q -> %q", p.path(), exist, jsonName) } @@ -694,6 +693,24 @@ func fmtQueryParamType() *jen.Statement { var reNonWord = regexp.MustCompile(`\W+`) -func customCamelCase(s string) string { - return strcase.ToCamel(reNonWord.ReplaceAllString(s, "_")) +func customCamelCase(s string, private bool) string { + c := strcase.NewCaser( + false, + map[string]bool{ + "CMK": true, + }, + strcase.NewSplitFn( + []rune{'_'}, + strcase.SplitCase, + strcase.SplitAcronym, + strcase.PreserveNumberFormatting, + strcase.SplitAfterNumber, + ), + ) + + clean := reNonWord.ReplaceAllString(s, "_") + if private { + return c.ToCamel(clean) + } + return c.ToCase(clean, strcase.TitleCase, 0) } diff --git a/generator/models.go b/generator/models.go index 2f0f109..de8b0e9 100644 --- a/generator/models.go +++ b/generator/models.go @@ -226,14 +226,14 @@ func (s *Schema) init(doc *Doc, scope map[string]*Schema, name string) { } s.name = name - s.CamelName = customCamelCase(s.name) + s.CamelName = customCamelCase(s.name, false) if s.isEnum() { const enumTypeSuffix = "Type" betterName := getEnumName(s) if betterName != s.name { - s.CamelName = cleanEnumName.ReplaceAllString(customCamelCase(betterName), "") + s.CamelName + s.CamelName = cleanEnumName.ReplaceAllString(customCamelCase(betterName, false), "") + s.CamelName } if !strings.Contains(s.CamelName, enumTypeSuffix) { @@ -264,11 +264,11 @@ func (s *Schema) init(doc *Doc, scope map[string]*Schema, name string) { // Makes structure private if s.isPrivate() { - s.CamelName = lowerFirst(s.CamelName) + s.CamelName = customCamelCase(s.CamelName, true) } if s.parent != nil && s.parent.isPrivate() { - s.CamelName = customCamelCase(s.parent.CamelName) + s.CamelName = customCamelCase(s.parent.CamelName, false) } // Some cases just impossible to cover @@ -373,7 +373,7 @@ func (s *Schema) init(doc *Doc, scope map[string]*Schema, name string) { } if parent.isPrivate() { - s.CamelName = customCamelCase(parent.CamelName) + s.CamelName = customCamelCase(parent.CamelName, false) } else { // Adds parent's name s.CamelName = strings.TrimSuffix(parent.CamelName, suffix) + s.CamelName diff --git a/go.mod b/go.mod index 0ff4287..a8ab27f 100644 --- a/go.mod +++ b/go.mod @@ -17,6 +17,7 @@ require ( require ( github.com/davecgh/go-spew v1.1.1 // indirect + github.com/ettle/strcase v0.2.0 // indirect github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-cleanhttp v0.5.2 // indirect github.com/mattn/go-colorable v0.1.13 // indirect diff --git a/go.sum b/go.sum index cc0f109..6a0c412 100644 --- a/go.sum +++ b/go.sum @@ -3,6 +3,8 @@ github.com/dave/jennifer v1.7.1 h1:B4jJJDHelWcDhlRQxWeo0Npa/pYKBLrirAQoTN45txo= github.com/dave/jennifer v1.7.1/go.mod h1:nXbxhEmQfOZhWml3D1cDK5M1FLnMSozpbFN/m3RmGZc= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/ettle/strcase v0.2.0 h1:fGNiVF21fHXpX1niBgk0aROov1LagYsOwV/xqKDKR/Q= +github.com/ettle/strcase v0.2.0/go.mod h1:DajmHElDSaX76ITe3/VHVyMin4LWSJN5Z909Wp+ED1A= github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= diff --git a/handler/cmk/cmk.go b/handler/cmk/cmk.go new file mode 100644 index 0000000..fb45cdb --- /dev/null +++ b/handler/cmk/cmk.go @@ -0,0 +1,268 @@ +// Code generated by Aiven. DO NOT EDIT. + +package cmk + +import ( + "context" + "encoding/json" + "fmt" + "net/url" + "time" +) + +type Handler interface { + // CMKAccessCheckTrigger trigger an access check on CMK + // POST /v1/project/{project}/secrets/cmks/{cmk_id}/access_check + // https://api.aiven.io/doc/#tag/Secrets/operation/CMKAccessCheckTrigger + CMKAccessCheckTrigger(ctx context.Context, project string, cmkid string) (*CMKAccessCheckTriggerOut, error) + + // CMKAccessorsList list CMK accessors + // GET /v1/project/{project}/secrets/cmks/accessors + // https://api.aiven.io/doc/#tag/Secrets/operation/CMKAccessorsList + CMKAccessorsList(ctx context.Context, project string) (*CMKAccessorsListOut, error) + + // CMKCreate create new CMK + // POST /v1/project/{project}/secrets/cmks + // https://api.aiven.io/doc/#tag/Project/operation/CMKCreate + CMKCreate(ctx context.Context, project string, in *CMKCreateIn) (*CMKCreateOut, error) + + // CMKDelete delete CMK + // DELETE /v1/project/{project}/secrets/cmks/{cmk_id} + // https://api.aiven.io/doc/#tag/Secrets/operation/CMKDelete + CMKDelete(ctx context.Context, project string, cmkid string) (*CMKDeleteOut, error) + + // CMKGet get CMK details + // GET /v1/project/{project}/secrets/cmks/{cmk_id} + // https://api.aiven.io/doc/#tag/Secrets/operation/CMKGet + CMKGet(ctx context.Context, project string, cmkid string) (*CMKGetOut, error) + + // CMKUpdate update CMK + // POST /v1/project/{project}/secrets/cmks/{cmk_id} + // https://api.aiven.io/doc/#tag/Secrets/operation/CMKUpdate + CMKUpdate(ctx context.Context, project string, cmkid string, in *CMKUpdateIn) (*CMKUpdateOut, error) +} + +// doer http client +type doer interface { + Do(ctx context.Context, operationID, method, path string, in any, query ...[2]string) ([]byte, error) +} + +func NewHandler(doer doer) CMKHandler { + return CMKHandler{doer} +} + +type CMKHandler struct { + doer doer +} + +func (h *CMKHandler) CMKAccessCheckTrigger(ctx context.Context, project string, cmkid string) (*CMKAccessCheckTriggerOut, error) { + path := fmt.Sprintf("/v1/project/%s/secrets/cmks/%s/access_check", url.PathEscape(project), url.PathEscape(cmkid)) + b, err := h.doer.Do(ctx, "CMKAccessCheckTrigger", "POST", path, nil) + if err != nil { + return nil, err + } + out := new(cmkAccessCheckTriggerOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return &out.CMK, nil +} +func (h *CMKHandler) CMKAccessorsList(ctx context.Context, project string) (*CMKAccessorsListOut, error) { + path := fmt.Sprintf("/v1/project/%s/secrets/cmks/accessors", url.PathEscape(project)) + b, err := h.doer.Do(ctx, "CMKAccessorsList", "GET", path, nil) + if err != nil { + return nil, err + } + out := new(cmkAccessorsListOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return &out.Accessors, nil +} +func (h *CMKHandler) CMKCreate(ctx context.Context, project string, in *CMKCreateIn) (*CMKCreateOut, error) { + path := fmt.Sprintf("/v1/project/%s/secrets/cmks", url.PathEscape(project)) + b, err := h.doer.Do(ctx, "CMKCreate", "POST", path, in) + if err != nil { + return nil, err + } + out := new(cmkCreateOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return &out.CMK, nil +} +func (h *CMKHandler) CMKDelete(ctx context.Context, project string, cmkid string) (*CMKDeleteOut, error) { + path := fmt.Sprintf("/v1/project/%s/secrets/cmks/%s", url.PathEscape(project), url.PathEscape(cmkid)) + b, err := h.doer.Do(ctx, "CMKDelete", "DELETE", path, nil) + if err != nil { + return nil, err + } + out := new(cmkDeleteOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return &out.CMK, nil +} +func (h *CMKHandler) CMKGet(ctx context.Context, project string, cmkid string) (*CMKGetOut, error) { + path := fmt.Sprintf("/v1/project/%s/secrets/cmks/%s", url.PathEscape(project), url.PathEscape(cmkid)) + b, err := h.doer.Do(ctx, "CMKGet", "GET", path, nil) + if err != nil { + return nil, err + } + out := new(cmkGetOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return &out.CMK, nil +} +func (h *CMKHandler) CMKUpdate(ctx context.Context, project string, cmkid string, in *CMKUpdateIn) (*CMKUpdateOut, error) { + path := fmt.Sprintf("/v1/project/%s/secrets/cmks/%s", url.PathEscape(project), url.PathEscape(cmkid)) + b, err := h.doer.Do(ctx, "CMKUpdate", "POST", path, in) + if err != nil { + return nil, err + } + out := new(cmkUpdateOut) + err = json.Unmarshal(b, out) + if err != nil { + return nil, err + } + return &out.CMK, nil +} + +// AwsOut CMKAccessorsAWS +type AwsOut struct { + Principal string `json:"principal"` +} + +// CMKAccessCheckTriggerOut CMK +type CMKAccessCheckTriggerOut struct { + CreatedAt time.Time `json:"created_at"` // Created At + DefaultCMK bool `json:"default_cmk"` // Default Cmk + Id string `json:"id"` // ID + Resource string `json:"resource"` + UpdatedAt time.Time `json:"updated_at"` // Updated At +} + +// CMKAccessorsListOut CMKAccessors +type CMKAccessorsListOut struct { + Aws *AwsOut `json:"aws,omitempty"` // CMKAccessorsAWS + Gcp GcpOut `json:"gcp"` // CMKAccessorsGCP + Oci OciOut `json:"oci"` // CMKAccessorsOCI +} + +// CMKCreateIn CMKCreateRequestBody +type CMKCreateIn struct { + DefaultCMK *bool `json:"default_cmk,omitempty"` // Mark the created CMK as default for all newly created services. + Provider ProviderType `json:"provider"` // CMK provider + Resource string `json:"resource"` // Resource name +} + +// CMKCreateOut CMK +type CMKCreateOut struct { + CreatedAt time.Time `json:"created_at"` // Created at + DefaultCMK bool `json:"default_cmk"` // CMK is used as a default for all newly created services. + Id string `json:"id"` // Customer Managed Key identifier (CMK ID) + Provider ProviderType `json:"provider"` // CMK provider + Resource string `json:"resource"` // Resource name + Status CMKStatusType `json:"status"` // Status + UpdatedAt time.Time `json:"updated_at"` // Updated at +} + +// CMKDeleteOut CMK +type CMKDeleteOut struct { + CreatedAt time.Time `json:"created_at"` // Created At + DefaultCMK bool `json:"default_cmk"` // Default Cmk + Id string `json:"id"` // ID + Resource string `json:"resource"` + UpdatedAt time.Time `json:"updated_at"` // Updated At +} + +// CMKGetOut CMK +type CMKGetOut struct { + CreatedAt time.Time `json:"created_at"` // Created At + DefaultCMK bool `json:"default_cmk"` // Default Cmk + Id string `json:"id"` // ID + Resource string `json:"resource"` + UpdatedAt time.Time `json:"updated_at"` // Updated At +} +type CMKStatusType string + +const ( + CMKStatusTypeCurrent CMKStatusType = "current" + CMKStatusTypeDeleted CMKStatusType = "deleted" + CMKStatusTypeOld CMKStatusType = "old" +) + +func CMKStatusTypeChoices() []string { + return []string{"current", "deleted", "old"} +} + +// CMKUpdateIn CMKUpdateRequestBody +type CMKUpdateIn struct { + DefaultCMK *bool `json:"default_cmk,omitempty"` // Mark the created CMK as default for all newly created services. +} + +// CMKUpdateOut CMK +type CMKUpdateOut struct { + CreatedAt time.Time `json:"created_at"` // Created At + DefaultCMK bool `json:"default_cmk"` // Default Cmk + Id string `json:"id"` // ID + Resource string `json:"resource"` + UpdatedAt time.Time `json:"updated_at"` // Updated At +} + +// GcpOut CMKAccessorsGCP +type GcpOut struct { + AccessGroup string `json:"access_group"` // Access Group +} + +// OciOut CMKAccessorsOCI +type OciOut struct { + AccessGroup string `json:"access_group"` // Access Group +} +type ProviderType string + +const ( + ProviderTypeAws ProviderType = "aws" + ProviderTypeGcp ProviderType = "gcp" + ProviderTypeOci ProviderType = "oci" +) + +func ProviderTypeChoices() []string { + return []string{"aws", "gcp", "oci"} +} + +// cmkAccessCheckTriggerOut CMKAccessCheckTriggerResponse +type cmkAccessCheckTriggerOut struct { + CMK CMKAccessCheckTriggerOut `json:"cmk"` // CMK +} + +// cmkAccessorsListOut CMKAccessorsListResponse +type cmkAccessorsListOut struct { + Accessors CMKAccessorsListOut `json:"accessors"` // CMKAccessors +} + +// cmkCreateOut CMKCreateResponse +type cmkCreateOut struct { + CMK CMKCreateOut `json:"cmk"` // CMK +} + +// cmkDeleteOut CMKDeleteResponse +type cmkDeleteOut struct { + CMK CMKDeleteOut `json:"cmk"` // CMK +} + +// cmkGetOut CMKGetResponse +type cmkGetOut struct { + CMK CMKGetOut `json:"cmk"` // CMK +} + +// cmkUpdateOut CMKUpdateResponse +type cmkUpdateOut struct { + CMK CMKUpdateOut `json:"cmk"` // CMK +} diff --git a/handler/mysql/mysql.go b/handler/mysql/mysql.go index 543932f..c9a9e76 100644 --- a/handler/mysql/mysql.go +++ b/handler/mysql/mysql.go @@ -14,7 +14,7 @@ type Handler interface { // POST /v1/project/{project}/service/{service_name}/mysql/query/stats // https://api.aiven.io/doc/#tag/Service:_MySQL/operation/MySQLServiceQueryStatistics // Required roles or permissions: service:data:write - MySQLServiceQueryStatistics(ctx context.Context, project string, serviceName string, in *MySqlserviceQueryStatisticsIn) ([]QueryOut, error) + MySQLServiceQueryStatistics(ctx context.Context, project string, serviceName string, in *MySqlServiceQueryStatisticsIn) ([]QueryOut, error) } // doer http client @@ -30,13 +30,13 @@ type MySQLHandler struct { doer doer } -func (h *MySQLHandler) MySQLServiceQueryStatistics(ctx context.Context, project string, serviceName string, in *MySqlserviceQueryStatisticsIn) ([]QueryOut, error) { +func (h *MySQLHandler) MySQLServiceQueryStatistics(ctx context.Context, project string, serviceName string, in *MySqlServiceQueryStatisticsIn) ([]QueryOut, error) { path := fmt.Sprintf("/v1/project/%s/service/%s/mysql/query/stats", url.PathEscape(project), url.PathEscape(serviceName)) b, err := h.doer.Do(ctx, "MySQLServiceQueryStatistics", "POST", path, in) if err != nil { return nil, err } - out := new(mySqlserviceQueryStatisticsOut) + out := new(mySqlServiceQueryStatisticsOut) err = json.Unmarshal(b, out) if err != nil { return nil, err @@ -44,8 +44,8 @@ func (h *MySQLHandler) MySQLServiceQueryStatistics(ctx context.Context, project return out.Queries, nil } -// MySqlserviceQueryStatisticsIn MySQLServiceQueryStatisticsRequestBody -type MySqlserviceQueryStatisticsIn struct { +// MySqlServiceQueryStatisticsIn MySQLServiceQueryStatisticsRequestBody +type MySqlServiceQueryStatisticsIn struct { Limit *int `json:"limit,omitempty"` // Limit for number of results Offset *int `json:"offset,omitempty"` // Offset for retrieved results based on sort order OrderBy *string `json:"order_by,omitempty"` // Sort order can be either asc or desc and multiple comma separated columns with their own order can be specified: :asc,:desc. Accepted sort columns are: avg_timer_wait, count_star, digest, digest_text, first_seen, last_seen, max_timer_wait, min_timer_wait, query_sample_seen, query_sample_text, query_sample_timer_wait, quantile_95, quantile_99, quantile_999, schema_name, sum_created_tmp_disk_tables, sum_created_tmp_tables, sum_errors, sum_lock_time, sum_no_good_index_used, sum_no_index_used, sum_rows_affected, sum_rows_examined, sum_rows_sent, sum_select_full_join, sum_select_full_range_join, sum_select_range, sum_select_range_check, sum_select_scan, sum_sort_merge_passes, sum_sort_range, sum_sort_rows, sum_sort_scan, sum_timer_wait, sum_warnings @@ -88,7 +88,7 @@ type QueryOut struct { SumWarnings *float64 `json:"sum_warnings,omitempty"` // Query statistic } -// mySqlserviceQueryStatisticsOut MySQLServiceQueryStatisticsResponse -type mySqlserviceQueryStatisticsOut struct { +// mySqlServiceQueryStatisticsOut MySQLServiceQueryStatisticsResponse +type mySqlServiceQueryStatisticsOut struct { Queries []QueryOut `json:"queries"` // List of query statistics } diff --git a/handler/postgresql/postgresql.go b/handler/postgresql/postgresql.go index ffdc178..05b7ad2 100644 --- a/handler/postgresql/postgresql.go +++ b/handler/postgresql/postgresql.go @@ -20,7 +20,7 @@ type Handler interface { // POST /v1/project/{project}/service/{service_name}/pg/query/stats // https://api.aiven.io/doc/#tag/Service:_PostgreSQL/operation/PGServiceQueryStatistics // Required roles or permissions: service:data:write - PGServiceQueryStatistics(ctx context.Context, project string, serviceName string, in *PgserviceQueryStatisticsIn) ([]QueryOut, error) + PGServiceQueryStatistics(ctx context.Context, project string, serviceName string, in *PgServiceQueryStatisticsIn) ([]QueryOut, error) // PgAvailableExtensions list PostgreSQL extensions available for this tenant grouped by PG version // GET /v1/tenants/{tenant}/pg-available-extensions @@ -31,7 +31,7 @@ type Handler interface { // POST /v1/project/{project}/service/{service_name}/connection_pool // https://api.aiven.io/doc/#tag/Service:_PostgreSQL/operation/ServicePGBouncerCreate // Required roles or permissions: service:data:write - ServicePGBouncerCreate(ctx context.Context, project string, serviceName string, in *ServicePgbouncerCreateIn) error + ServicePGBouncerCreate(ctx context.Context, project string, serviceName string, in *ServicePgBouncerCreateIn) error // ServicePGBouncerDelete delete a connection pool // DELETE /v1/project/{project}/service/{service_name}/connection_pool/{pool_name} @@ -43,7 +43,7 @@ type Handler interface { // PUT /v1/project/{project}/service/{service_name}/connection_pool/{pool_name} // https://api.aiven.io/doc/#tag/Service:_PostgreSQL/operation/ServicePGBouncerUpdate // Required roles or permissions: service:data:write - ServicePGBouncerUpdate(ctx context.Context, project string, serviceName string, poolName string, in *ServicePgbouncerUpdateIn) error + ServicePGBouncerUpdate(ctx context.Context, project string, serviceName string, poolName string, in *ServicePgBouncerUpdateIn) error } // doer http client @@ -65,20 +65,20 @@ func (h *PostgreSQLHandler) PGServiceAvailableExtensions(ctx context.Context, pr if err != nil { return nil, err } - out := new(pgserviceAvailableExtensionsOut) + out := new(pgServiceAvailableExtensionsOut) err = json.Unmarshal(b, out) if err != nil { return nil, err } return out.Extensions, nil } -func (h *PostgreSQLHandler) PGServiceQueryStatistics(ctx context.Context, project string, serviceName string, in *PgserviceQueryStatisticsIn) ([]QueryOut, error) { +func (h *PostgreSQLHandler) PGServiceQueryStatistics(ctx context.Context, project string, serviceName string, in *PgServiceQueryStatisticsIn) ([]QueryOut, error) { path := fmt.Sprintf("/v1/project/%s/service/%s/pg/query/stats", url.PathEscape(project), url.PathEscape(serviceName)) b, err := h.doer.Do(ctx, "PGServiceQueryStatistics", "POST", path, in) if err != nil { return nil, err } - out := new(pgserviceQueryStatisticsOut) + out := new(pgServiceQueryStatisticsOut) err = json.Unmarshal(b, out) if err != nil { return nil, err @@ -98,7 +98,7 @@ func (h *PostgreSQLHandler) PgAvailableExtensions(ctx context.Context, tenant st } return out.Pg, nil } -func (h *PostgreSQLHandler) ServicePGBouncerCreate(ctx context.Context, project string, serviceName string, in *ServicePgbouncerCreateIn) error { +func (h *PostgreSQLHandler) ServicePGBouncerCreate(ctx context.Context, project string, serviceName string, in *ServicePgBouncerCreateIn) error { path := fmt.Sprintf("/v1/project/%s/service/%s/connection_pool", url.PathEscape(project), url.PathEscape(serviceName)) _, err := h.doer.Do(ctx, "ServicePGBouncerCreate", "POST", path, in) return err @@ -108,7 +108,7 @@ func (h *PostgreSQLHandler) ServicePGBouncerDelete(ctx context.Context, project _, err := h.doer.Do(ctx, "ServicePGBouncerDelete", "DELETE", path, nil) return err } -func (h *PostgreSQLHandler) ServicePGBouncerUpdate(ctx context.Context, project string, serviceName string, poolName string, in *ServicePgbouncerUpdateIn) error { +func (h *PostgreSQLHandler) ServicePGBouncerUpdate(ctx context.Context, project string, serviceName string, poolName string, in *ServicePgBouncerUpdateIn) error { path := fmt.Sprintf("/v1/project/%s/service/%s/connection_pool/%s", url.PathEscape(project), url.PathEscape(serviceName), url.PathEscape(poolName)) _, err := h.doer.Do(ctx, "ServicePGBouncerUpdate", "PUT", path, in) return err @@ -124,8 +124,8 @@ type PgOut struct { Version string `json:"version"` // PostgreSQL version } -// PgserviceQueryStatisticsIn PGServiceQueryStatisticsRequestBody -type PgserviceQueryStatisticsIn struct { +// PgServiceQueryStatisticsIn PGServiceQueryStatisticsRequestBody +type PgServiceQueryStatisticsIn struct { Limit *int `json:"limit,omitempty"` // Limit for number of results Offset *int `json:"offset,omitempty"` // Offset for retrieved results based on sort order OrderBy *string `json:"order_by,omitempty"` // Sort order can be either asc or desc and multiple comma separated columns with their own order can be specified: :asc,:desc. Accepted sort columns are: blk_read_time, blk_write_time, calls, database_name, local_blks_dirtied, local_blks_hit, local_blks_read, local_blks_written, max_plan_time, max_time, mean_plan_time, mean_time, min_plan_time, min_time, query, queryid, rows, shared_blks_dirtied, shared_blks_hit, shared_blks_read, shared_blks_written, stddev_plan_time, stddev_time, temp_blks_read, temp_blks_written, total_plan_time, total_time, user_name, wal_bytes, wal_fpi, wal_records @@ -176,8 +176,8 @@ type QueryOut struct { WalRecords *float64 `json:"wal_records,omitempty"` // Query statistic } -// ServicePgbouncerCreateIn ServicePGBouncerCreateRequestBody -type ServicePgbouncerCreateIn struct { +// ServicePgBouncerCreateIn ServicePGBouncerCreateRequestBody +type ServicePgBouncerCreateIn struct { Database string `json:"database"` // Service database name PoolMode PoolModeType `json:"pool_mode,omitempty"` // PGBouncer pool mode PoolName string `json:"pool_name"` // Connection pool name @@ -185,8 +185,8 @@ type ServicePgbouncerCreateIn struct { Username *string `json:"username,omitempty"` // Service username } -// ServicePgbouncerUpdateIn ServicePGBouncerUpdateRequestBody -type ServicePgbouncerUpdateIn struct { +// ServicePgBouncerUpdateIn ServicePGBouncerUpdateRequestBody +type ServicePgBouncerUpdateIn struct { Database *string `json:"database,omitempty"` // Service database name PoolMode PoolModeType `json:"pool_mode,omitempty"` // PGBouncer pool mode PoolSize *int `json:"pool_size,omitempty"` // Size of PGBouncer's PostgreSQL side connection pool @@ -198,12 +198,12 @@ type pgAvailableExtensionsOut struct { Pg []PgOut `json:"pg,omitempty"` // Supported PostgreSQL versions } -// pgserviceAvailableExtensionsOut PGServiceAvailableExtensionsResponse -type pgserviceAvailableExtensionsOut struct { +// pgServiceAvailableExtensionsOut PGServiceAvailableExtensionsResponse +type pgServiceAvailableExtensionsOut struct { Extensions []ExtensionOut `json:"extensions"` // Extensions available for loading with CREATE EXTENSION in this service } -// pgserviceQueryStatisticsOut PGServiceQueryStatisticsResponse -type pgserviceQueryStatisticsOut struct { +// pgServiceQueryStatisticsOut PGServiceQueryStatisticsResponse +type pgServiceQueryStatisticsOut struct { Queries []QueryOut `json:"queries"` // List of query statistics } diff --git a/handler/privatelink/privatelink.go b/handler/privatelink/privatelink.go index 0fb5f8e..32c6659 100644 --- a/handler/privatelink/privatelink.go +++ b/handler/privatelink/privatelink.go @@ -25,25 +25,25 @@ type Handler interface { // POST /v1/project/{project}/service/{service_name}/privatelink/aws // https://api.aiven.io/doc/#tag/Service/operation/ServicePrivatelinkAWSCreate // Required roles or permissions: service:configuration:write - ServicePrivatelinkAWSCreate(ctx context.Context, project string, serviceName string, in *ServicePrivatelinkAwscreateIn) (*ServicePrivatelinkAwscreateOut, error) + ServicePrivatelinkAWSCreate(ctx context.Context, project string, serviceName string, in *ServicePrivatelinkAwsCreateIn) (*ServicePrivatelinkAwsCreateOut, error) // ServicePrivatelinkAWSDelete delete an AWS Privatelink Endpoint Service // DELETE /v1/project/{project}/service/{service_name}/privatelink/aws // https://api.aiven.io/doc/#tag/Service/operation/ServicePrivatelinkAWSDelete // Required roles or permissions: service:configuration:write - ServicePrivatelinkAWSDelete(ctx context.Context, project string, serviceName string) (*ServicePrivatelinkAwsdeleteOut, error) + ServicePrivatelinkAWSDelete(ctx context.Context, project string, serviceName string) (*ServicePrivatelinkAwsDeleteOut, error) // ServicePrivatelinkAWSGet get AWS Privatelink Endpoint Service information // GET /v1/project/{project}/service/{service_name}/privatelink/aws // https://api.aiven.io/doc/#tag/Service/operation/ServicePrivatelinkAWSGet // Required roles or permissions: service:configuration:write - ServicePrivatelinkAWSGet(ctx context.Context, project string, serviceName string) (*ServicePrivatelinkAwsgetOut, error) + ServicePrivatelinkAWSGet(ctx context.Context, project string, serviceName string) (*ServicePrivatelinkAwsGetOut, error) // ServicePrivatelinkAWSUpdate update an AWS Privatelink Endpoint Service // PUT /v1/project/{project}/service/{service_name}/privatelink/aws // https://api.aiven.io/doc/#tag/Service/operation/ServicePrivatelinkAWSUpdate // Required roles or permissions: service:configuration:write - ServicePrivatelinkAWSUpdate(ctx context.Context, project string, serviceName string, in *ServicePrivatelinkAwsupdateIn) (*ServicePrivatelinkAwsupdateOut, error) + ServicePrivatelinkAWSUpdate(ctx context.Context, project string, serviceName string, in *ServicePrivatelinkAwsUpdateIn) (*ServicePrivatelinkAwsUpdateOut, error) // ServicePrivatelinkAzureConnectionApproval approve an Azure private endpoint connection pending user approval // POST /v1/project/{project}/service/{service_name}/privatelink/azure/connections/{privatelink_connection_id}/approve @@ -120,59 +120,59 @@ func (h *PrivatelinkHandler) ServicePrivatelinkAWSConnectionList(ctx context.Con if err != nil { return nil, err } - out := new(servicePrivatelinkAwsconnectionListOut) + out := new(servicePrivatelinkAwsConnectionListOut) err = json.Unmarshal(b, out) if err != nil { return nil, err } return out.Connections, nil } -func (h *PrivatelinkHandler) ServicePrivatelinkAWSCreate(ctx context.Context, project string, serviceName string, in *ServicePrivatelinkAwscreateIn) (*ServicePrivatelinkAwscreateOut, error) { +func (h *PrivatelinkHandler) ServicePrivatelinkAWSCreate(ctx context.Context, project string, serviceName string, in *ServicePrivatelinkAwsCreateIn) (*ServicePrivatelinkAwsCreateOut, error) { path := fmt.Sprintf("/v1/project/%s/service/%s/privatelink/aws", url.PathEscape(project), url.PathEscape(serviceName)) b, err := h.doer.Do(ctx, "ServicePrivatelinkAWSCreate", "POST", path, in) if err != nil { return nil, err } - out := new(ServicePrivatelinkAwscreateOut) + out := new(ServicePrivatelinkAwsCreateOut) err = json.Unmarshal(b, out) if err != nil { return nil, err } return out, nil } -func (h *PrivatelinkHandler) ServicePrivatelinkAWSDelete(ctx context.Context, project string, serviceName string) (*ServicePrivatelinkAwsdeleteOut, error) { +func (h *PrivatelinkHandler) ServicePrivatelinkAWSDelete(ctx context.Context, project string, serviceName string) (*ServicePrivatelinkAwsDeleteOut, error) { path := fmt.Sprintf("/v1/project/%s/service/%s/privatelink/aws", url.PathEscape(project), url.PathEscape(serviceName)) b, err := h.doer.Do(ctx, "ServicePrivatelinkAWSDelete", "DELETE", path, nil) if err != nil { return nil, err } - out := new(ServicePrivatelinkAwsdeleteOut) + out := new(ServicePrivatelinkAwsDeleteOut) err = json.Unmarshal(b, out) if err != nil { return nil, err } return out, nil } -func (h *PrivatelinkHandler) ServicePrivatelinkAWSGet(ctx context.Context, project string, serviceName string) (*ServicePrivatelinkAwsgetOut, error) { +func (h *PrivatelinkHandler) ServicePrivatelinkAWSGet(ctx context.Context, project string, serviceName string) (*ServicePrivatelinkAwsGetOut, error) { path := fmt.Sprintf("/v1/project/%s/service/%s/privatelink/aws", url.PathEscape(project), url.PathEscape(serviceName)) b, err := h.doer.Do(ctx, "ServicePrivatelinkAWSGet", "GET", path, nil) if err != nil { return nil, err } - out := new(ServicePrivatelinkAwsgetOut) + out := new(ServicePrivatelinkAwsGetOut) err = json.Unmarshal(b, out) if err != nil { return nil, err } return out, nil } -func (h *PrivatelinkHandler) ServicePrivatelinkAWSUpdate(ctx context.Context, project string, serviceName string, in *ServicePrivatelinkAwsupdateIn) (*ServicePrivatelinkAwsupdateOut, error) { +func (h *PrivatelinkHandler) ServicePrivatelinkAWSUpdate(ctx context.Context, project string, serviceName string, in *ServicePrivatelinkAwsUpdateIn) (*ServicePrivatelinkAwsUpdateOut, error) { path := fmt.Sprintf("/v1/project/%s/service/%s/privatelink/aws", url.PathEscape(project), url.PathEscape(serviceName)) b, err := h.doer.Do(ctx, "ServicePrivatelinkAWSUpdate", "PUT", path, in) if err != nil { return nil, err } - out := new(ServicePrivatelinkAwsupdateOut) + out := new(ServicePrivatelinkAwsUpdateOut) err = json.Unmarshal(b, out) if err != nil { return nil, err @@ -295,90 +295,57 @@ type PrivatelinkAvailabilityOut struct { PriceUsd string `json:"price_usd"` // Hourly privatelink price in this cloud region } -// ServicePrivatelinkAwscreateIn ServicePrivatelinkAWSCreateRequestBody -type ServicePrivatelinkAwscreateIn struct { +// ServicePrivatelinkAwsCreateIn ServicePrivatelinkAWSCreateRequestBody +type ServicePrivatelinkAwsCreateIn struct { Principals []string `json:"principals"` // ARNs of principals allowed connecting to the service } -// ServicePrivatelinkAwscreateOut ServicePrivatelinkAWSCreateResponse -type ServicePrivatelinkAwscreateOut struct { - AwsServiceId *string `json:"aws_service_id,omitempty"` // AWS VPC endpoint service ID - AwsServiceName *string `json:"aws_service_name,omitempty"` // AWS VPC endpoint service name - Principals []string `json:"principals"` // ARNs of principals allowed connecting to the service - State ServicePrivatelinkAwscreateStateType `json:"state"` // Privatelink resource state +// ServicePrivatelinkAwsCreateOut ServicePrivatelinkAWSCreateResponse +type ServicePrivatelinkAwsCreateOut struct { + AwsServiceId *string `json:"aws_service_id,omitempty"` // AWS VPC endpoint service ID + AwsServiceName *string `json:"aws_service_name,omitempty"` // AWS VPC endpoint service name + Principals []string `json:"principals"` // ARNs of principals allowed connecting to the service + State ServicePrivatelinkAwsStateType `json:"state"` // Privatelink resource state } -type ServicePrivatelinkAwscreateStateType string -const ( - ServicePrivatelinkAwscreateStateTypeActive ServicePrivatelinkAwscreateStateType = "active" - ServicePrivatelinkAwscreateStateTypeCreating ServicePrivatelinkAwscreateStateType = "creating" - ServicePrivatelinkAwscreateStateTypeDeleting ServicePrivatelinkAwscreateStateType = "deleting" -) - -func ServicePrivatelinkAwscreateStateTypeChoices() []string { - return []string{"active", "creating", "deleting"} -} - -// ServicePrivatelinkAwsdeleteOut ServicePrivatelinkAWSDeleteResponse -type ServicePrivatelinkAwsdeleteOut struct { - AwsServiceId *string `json:"aws_service_id,omitempty"` // AWS VPC endpoint service ID - AwsServiceName *string `json:"aws_service_name,omitempty"` // AWS VPC endpoint service name - Principals []string `json:"principals"` // ARNs of principals allowed connecting to the service - State ServicePrivatelinkAwsdeleteStateType `json:"state"` // Privatelink resource state -} -type ServicePrivatelinkAwsdeleteStateType string - -const ( - ServicePrivatelinkAwsdeleteStateTypeActive ServicePrivatelinkAwsdeleteStateType = "active" - ServicePrivatelinkAwsdeleteStateTypeCreating ServicePrivatelinkAwsdeleteStateType = "creating" - ServicePrivatelinkAwsdeleteStateTypeDeleting ServicePrivatelinkAwsdeleteStateType = "deleting" -) - -func ServicePrivatelinkAwsdeleteStateTypeChoices() []string { - return []string{"active", "creating", "deleting"} +// ServicePrivatelinkAwsDeleteOut ServicePrivatelinkAWSDeleteResponse +type ServicePrivatelinkAwsDeleteOut struct { + AwsServiceId *string `json:"aws_service_id,omitempty"` // AWS VPC endpoint service ID + AwsServiceName *string `json:"aws_service_name,omitempty"` // AWS VPC endpoint service name + Principals []string `json:"principals"` // ARNs of principals allowed connecting to the service + State ServicePrivatelinkAwsStateType `json:"state"` // Privatelink resource state } -// ServicePrivatelinkAwsgetOut ServicePrivatelinkAWSGetResponse -type ServicePrivatelinkAwsgetOut struct { - AwsServiceId *string `json:"aws_service_id,omitempty"` // AWS VPC endpoint service ID - AwsServiceName *string `json:"aws_service_name,omitempty"` // AWS VPC endpoint service name - Principals []string `json:"principals"` // ARNs of principals allowed connecting to the service - State ServicePrivatelinkAwsgetStateType `json:"state"` // Privatelink resource state +// ServicePrivatelinkAwsGetOut ServicePrivatelinkAWSGetResponse +type ServicePrivatelinkAwsGetOut struct { + AwsServiceId *string `json:"aws_service_id,omitempty"` // AWS VPC endpoint service ID + AwsServiceName *string `json:"aws_service_name,omitempty"` // AWS VPC endpoint service name + Principals []string `json:"principals"` // ARNs of principals allowed connecting to the service + State ServicePrivatelinkAwsStateType `json:"state"` // Privatelink resource state } -type ServicePrivatelinkAwsgetStateType string +type ServicePrivatelinkAwsStateType string const ( - ServicePrivatelinkAwsgetStateTypeActive ServicePrivatelinkAwsgetStateType = "active" - ServicePrivatelinkAwsgetStateTypeCreating ServicePrivatelinkAwsgetStateType = "creating" - ServicePrivatelinkAwsgetStateTypeDeleting ServicePrivatelinkAwsgetStateType = "deleting" + ServicePrivatelinkAwsStateTypeActive ServicePrivatelinkAwsStateType = "active" + ServicePrivatelinkAwsStateTypeCreating ServicePrivatelinkAwsStateType = "creating" + ServicePrivatelinkAwsStateTypeDeleting ServicePrivatelinkAwsStateType = "deleting" ) -func ServicePrivatelinkAwsgetStateTypeChoices() []string { +func ServicePrivatelinkAwsStateTypeChoices() []string { return []string{"active", "creating", "deleting"} } -// ServicePrivatelinkAwsupdateIn ServicePrivatelinkAWSUpdateRequestBody -type ServicePrivatelinkAwsupdateIn struct { +// ServicePrivatelinkAwsUpdateIn ServicePrivatelinkAWSUpdateRequestBody +type ServicePrivatelinkAwsUpdateIn struct { Principals []string `json:"principals"` // ARNs of principals allowed connecting to the service } -// ServicePrivatelinkAwsupdateOut ServicePrivatelinkAWSUpdateResponse -type ServicePrivatelinkAwsupdateOut struct { - AwsServiceId *string `json:"aws_service_id,omitempty"` // AWS VPC endpoint service ID - AwsServiceName *string `json:"aws_service_name,omitempty"` // AWS VPC endpoint service name - Principals []string `json:"principals"` // ARNs of principals allowed connecting to the service - State ServicePrivatelinkAwsupdateStateType `json:"state"` // Privatelink resource state -} -type ServicePrivatelinkAwsupdateStateType string - -const ( - ServicePrivatelinkAwsupdateStateTypeActive ServicePrivatelinkAwsupdateStateType = "active" - ServicePrivatelinkAwsupdateStateTypeCreating ServicePrivatelinkAwsupdateStateType = "creating" - ServicePrivatelinkAwsupdateStateTypeDeleting ServicePrivatelinkAwsupdateStateType = "deleting" -) - -func ServicePrivatelinkAwsupdateStateTypeChoices() []string { - return []string{"active", "creating", "deleting"} +// ServicePrivatelinkAwsUpdateOut ServicePrivatelinkAWSUpdateResponse +type ServicePrivatelinkAwsUpdateOut struct { + AwsServiceId *string `json:"aws_service_id,omitempty"` // AWS VPC endpoint service ID + AwsServiceName *string `json:"aws_service_name,omitempty"` // AWS VPC endpoint service name + Principals []string `json:"principals"` // ARNs of principals allowed connecting to the service + State ServicePrivatelinkAwsStateType `json:"state"` // Privatelink resource state } // ServicePrivatelinkAzureConnectionApprovalOut ServicePrivatelinkAzureConnectionApprovalResponse @@ -491,8 +458,8 @@ type publicPrivatelinkAvailabilityListOut struct { PrivatelinkAvailability []PrivatelinkAvailabilityOut `json:"privatelink_availability"` // Privatelink pricing information for supported clouds } -// servicePrivatelinkAwsconnectionListOut ServicePrivatelinkAWSConnectionListResponse -type servicePrivatelinkAwsconnectionListOut struct { +// servicePrivatelinkAwsConnectionListOut ServicePrivatelinkAWSConnectionListResponse +type servicePrivatelinkAwsConnectionListOut struct { Connections []ConnectionOut `json:"connections"` // AWS Privatelink VPC Endpoint connection list } diff --git a/handler/staticip/staticip.go b/handler/staticip/staticip.go index 5f42c0d..a5a7392 100644 --- a/handler/staticip/staticip.go +++ b/handler/staticip/staticip.go @@ -14,7 +14,7 @@ type Handler interface { // POST /v1/project/{project}/static-ips/{static_ip_address_id}/association // https://api.aiven.io/doc/#tag/StaticIP/operation/ProjectStaticIPAssociate // Required roles or permissions: service:configuration:write - ProjectStaticIPAssociate(ctx context.Context, project string, staticIpAddressId string, in *ProjectStaticIpassociateIn) (*ProjectStaticIpassociateOut, error) + ProjectStaticIPAssociate(ctx context.Context, project string, staticIpAddressId string, in *ProjectStaticIpAssociateIn) (*ProjectStaticIpAssociateOut, error) // ProjectStaticIPAvailabilityList list static IP address cloud availability and prices for a project // GET /v1/project/{project}/static-ip-availability @@ -26,13 +26,13 @@ type Handler interface { // DELETE /v1/project/{project}/static-ips/{static_ip_address_id}/association // https://api.aiven.io/doc/#tag/StaticIP/operation/ProjectStaticIPDissociate // Required roles or permissions: service:configuration:write - ProjectStaticIPDissociate(ctx context.Context, project string, staticIpAddressId string) (*ProjectStaticIpdissociateOut, error) + ProjectStaticIPDissociate(ctx context.Context, project string, staticIpAddressId string) (*ProjectStaticIpDissociateOut, error) // ProjectStaticIPPatch update a static IP address configuration // PATCH /v1/project/{project}/static-ips/{static_ip_address_id} // https://api.aiven.io/doc/#tag/StaticIP/operation/ProjectStaticIPPatch // Required roles or permissions: operator - ProjectStaticIPPatch(ctx context.Context, project string, staticIpAddressId string, in *ProjectStaticIppatchIn) (*ProjectStaticIppatchOut, error) + ProjectStaticIPPatch(ctx context.Context, project string, staticIpAddressId string, in *ProjectStaticIpPatchIn) (*ProjectStaticIpPatchOut, error) // PublicStaticIPAvailabilityList list static IP clouds and prices // GET /v1/tenants/{tenant}/static-ip-availability @@ -43,7 +43,7 @@ type Handler interface { // POST /v1/project/{project}/static-ips // https://api.aiven.io/doc/#tag/StaticIP/operation/StaticIPCreate // Required roles or permissions: operator - StaticIPCreate(ctx context.Context, project string, in *StaticIpcreateIn) (*StaticIpcreateOut, error) + StaticIPCreate(ctx context.Context, project string, in *StaticIpCreateIn) (*StaticIpCreateOut, error) // StaticIPList list static IP addresses // GET /v1/project/{project}/static-ips @@ -65,13 +65,13 @@ type StaticIPHandler struct { doer doer } -func (h *StaticIPHandler) ProjectStaticIPAssociate(ctx context.Context, project string, staticIpAddressId string, in *ProjectStaticIpassociateIn) (*ProjectStaticIpassociateOut, error) { +func (h *StaticIPHandler) ProjectStaticIPAssociate(ctx context.Context, project string, staticIpAddressId string, in *ProjectStaticIpAssociateIn) (*ProjectStaticIpAssociateOut, error) { path := fmt.Sprintf("/v1/project/%s/static-ips/%s/association", url.PathEscape(project), url.PathEscape(staticIpAddressId)) b, err := h.doer.Do(ctx, "ProjectStaticIPAssociate", "POST", path, in) if err != nil { return nil, err } - out := new(ProjectStaticIpassociateOut) + out := new(ProjectStaticIpAssociateOut) err = json.Unmarshal(b, out) if err != nil { return nil, err @@ -84,33 +84,33 @@ func (h *StaticIPHandler) ProjectStaticIPAvailabilityList(ctx context.Context, p if err != nil { return nil, err } - out := new(projectStaticIpavailabilityListOut) + out := new(projectStaticIpAvailabilityListOut) err = json.Unmarshal(b, out) if err != nil { return nil, err } return out.StaticIpAddressAvailability, nil } -func (h *StaticIPHandler) ProjectStaticIPDissociate(ctx context.Context, project string, staticIpAddressId string) (*ProjectStaticIpdissociateOut, error) { +func (h *StaticIPHandler) ProjectStaticIPDissociate(ctx context.Context, project string, staticIpAddressId string) (*ProjectStaticIpDissociateOut, error) { path := fmt.Sprintf("/v1/project/%s/static-ips/%s/association", url.PathEscape(project), url.PathEscape(staticIpAddressId)) b, err := h.doer.Do(ctx, "ProjectStaticIPDissociate", "DELETE", path, nil) if err != nil { return nil, err } - out := new(ProjectStaticIpdissociateOut) + out := new(ProjectStaticIpDissociateOut) err = json.Unmarshal(b, out) if err != nil { return nil, err } return out, nil } -func (h *StaticIPHandler) ProjectStaticIPPatch(ctx context.Context, project string, staticIpAddressId string, in *ProjectStaticIppatchIn) (*ProjectStaticIppatchOut, error) { +func (h *StaticIPHandler) ProjectStaticIPPatch(ctx context.Context, project string, staticIpAddressId string, in *ProjectStaticIpPatchIn) (*ProjectStaticIpPatchOut, error) { path := fmt.Sprintf("/v1/project/%s/static-ips/%s", url.PathEscape(project), url.PathEscape(staticIpAddressId)) b, err := h.doer.Do(ctx, "ProjectStaticIPPatch", "PATCH", path, in) if err != nil { return nil, err } - out := new(ProjectStaticIppatchOut) + out := new(ProjectStaticIpPatchOut) err = json.Unmarshal(b, out) if err != nil { return nil, err @@ -123,20 +123,20 @@ func (h *StaticIPHandler) PublicStaticIPAvailabilityList(ctx context.Context, te if err != nil { return nil, err } - out := new(publicStaticIpavailabilityListOut) + out := new(publicStaticIpAvailabilityListOut) err = json.Unmarshal(b, out) if err != nil { return nil, err } return out.StaticIpAddressAvailability, nil } -func (h *StaticIPHandler) StaticIPCreate(ctx context.Context, project string, in *StaticIpcreateIn) (*StaticIpcreateOut, error) { +func (h *StaticIPHandler) StaticIPCreate(ctx context.Context, project string, in *StaticIpCreateIn) (*StaticIpCreateOut, error) { path := fmt.Sprintf("/v1/project/%s/static-ips", url.PathEscape(project)) b, err := h.doer.Do(ctx, "StaticIPCreate", "POST", path, in) if err != nil { return nil, err } - out := new(StaticIpcreateOut) + out := new(StaticIpCreateOut) err = json.Unmarshal(b, out) if err != nil { return nil, err @@ -149,7 +149,7 @@ func (h *StaticIPHandler) StaticIPList(ctx context.Context, project string) ([]S if err != nil { return nil, err } - out := new(staticIplistOut) + out := new(staticIpListOut) err = json.Unmarshal(b, out) if err != nil { return nil, err @@ -157,85 +157,85 @@ func (h *StaticIPHandler) StaticIPList(ctx context.Context, project string) ([]S return out.StaticIps, nil } -// ProjectStaticIpassociateIn ProjectStaticIPAssociateRequestBody -type ProjectStaticIpassociateIn struct { +// ProjectStaticIpAssociateIn ProjectStaticIPAssociateRequestBody +type ProjectStaticIpAssociateIn struct { ServiceName string `json:"service_name"` // Service name } -// ProjectStaticIpassociateOut ProjectStaticIPAssociateResponse -type ProjectStaticIpassociateOut struct { +// ProjectStaticIpAssociateOut ProjectStaticIPAssociateResponse +type ProjectStaticIpAssociateOut struct { CloudName string `json:"cloud_name"` // Target cloud IpAddress string `json:"ip_address"` // IPv4 address ServiceName string `json:"service_name"` // Service name - State ProjectStaticIpassociateStateType `json:"state"` // Static IP address state + State ProjectStaticIpAssociateStateType `json:"state"` // Static IP address state StaticIpAddressId string `json:"static_ip_address_id"` // Static IP address identifier TerminationProtection bool `json:"termination_protection"` // Static IP address is protected against deletion } -type ProjectStaticIpassociateStateType string +type ProjectStaticIpAssociateStateType string const ( - ProjectStaticIpassociateStateTypeAssigned ProjectStaticIpassociateStateType = "assigned" - ProjectStaticIpassociateStateTypeAvailable ProjectStaticIpassociateStateType = "available" - ProjectStaticIpassociateStateTypeCreated ProjectStaticIpassociateStateType = "created" - ProjectStaticIpassociateStateTypeCreating ProjectStaticIpassociateStateType = "creating" - ProjectStaticIpassociateStateTypeDeleted ProjectStaticIpassociateStateType = "deleted" - ProjectStaticIpassociateStateTypeDeleting ProjectStaticIpassociateStateType = "deleting" + ProjectStaticIpAssociateStateTypeAssigned ProjectStaticIpAssociateStateType = "assigned" + ProjectStaticIpAssociateStateTypeAvailable ProjectStaticIpAssociateStateType = "available" + ProjectStaticIpAssociateStateTypeCreated ProjectStaticIpAssociateStateType = "created" + ProjectStaticIpAssociateStateTypeCreating ProjectStaticIpAssociateStateType = "creating" + ProjectStaticIpAssociateStateTypeDeleted ProjectStaticIpAssociateStateType = "deleted" + ProjectStaticIpAssociateStateTypeDeleting ProjectStaticIpAssociateStateType = "deleting" ) -func ProjectStaticIpassociateStateTypeChoices() []string { +func ProjectStaticIpAssociateStateTypeChoices() []string { return []string{"assigned", "available", "created", "creating", "deleted", "deleting"} } -// ProjectStaticIpdissociateOut ProjectStaticIPDissociateResponse -type ProjectStaticIpdissociateOut struct { +// ProjectStaticIpDissociateOut ProjectStaticIPDissociateResponse +type ProjectStaticIpDissociateOut struct { CloudName string `json:"cloud_name"` // Target cloud IpAddress string `json:"ip_address"` // IPv4 address ServiceName string `json:"service_name"` // Service name - State ProjectStaticIpdissociateStateType `json:"state"` // Static IP address state + State ProjectStaticIpDissociateStateType `json:"state"` // Static IP address state StaticIpAddressId string `json:"static_ip_address_id"` // Static IP address identifier TerminationProtection bool `json:"termination_protection"` // Static IP address is protected against deletion } -type ProjectStaticIpdissociateStateType string +type ProjectStaticIpDissociateStateType string const ( - ProjectStaticIpdissociateStateTypeAssigned ProjectStaticIpdissociateStateType = "assigned" - ProjectStaticIpdissociateStateTypeAvailable ProjectStaticIpdissociateStateType = "available" - ProjectStaticIpdissociateStateTypeCreated ProjectStaticIpdissociateStateType = "created" - ProjectStaticIpdissociateStateTypeCreating ProjectStaticIpdissociateStateType = "creating" - ProjectStaticIpdissociateStateTypeDeleted ProjectStaticIpdissociateStateType = "deleted" - ProjectStaticIpdissociateStateTypeDeleting ProjectStaticIpdissociateStateType = "deleting" + ProjectStaticIpDissociateStateTypeAssigned ProjectStaticIpDissociateStateType = "assigned" + ProjectStaticIpDissociateStateTypeAvailable ProjectStaticIpDissociateStateType = "available" + ProjectStaticIpDissociateStateTypeCreated ProjectStaticIpDissociateStateType = "created" + ProjectStaticIpDissociateStateTypeCreating ProjectStaticIpDissociateStateType = "creating" + ProjectStaticIpDissociateStateTypeDeleted ProjectStaticIpDissociateStateType = "deleted" + ProjectStaticIpDissociateStateTypeDeleting ProjectStaticIpDissociateStateType = "deleting" ) -func ProjectStaticIpdissociateStateTypeChoices() []string { +func ProjectStaticIpDissociateStateTypeChoices() []string { return []string{"assigned", "available", "created", "creating", "deleted", "deleting"} } -// ProjectStaticIppatchIn ProjectStaticIPPatchRequestBody -type ProjectStaticIppatchIn struct { +// ProjectStaticIpPatchIn ProjectStaticIPPatchRequestBody +type ProjectStaticIpPatchIn struct { TerminationProtection *bool `json:"termination_protection,omitempty"` // Static IP address is protected against deletion } -// ProjectStaticIppatchOut ProjectStaticIPPatchResponse -type ProjectStaticIppatchOut struct { +// ProjectStaticIpPatchOut ProjectStaticIPPatchResponse +type ProjectStaticIpPatchOut struct { CloudName string `json:"cloud_name"` // Target cloud IpAddress string `json:"ip_address"` // IPv4 address ServiceName string `json:"service_name"` // Service name - State ProjectStaticIppatchStateType `json:"state"` // Static IP address state + State ProjectStaticIpPatchStateType `json:"state"` // Static IP address state StaticIpAddressId string `json:"static_ip_address_id"` // Static IP address identifier TerminationProtection bool `json:"termination_protection"` // Static IP address is protected against deletion } -type ProjectStaticIppatchStateType string +type ProjectStaticIpPatchStateType string const ( - ProjectStaticIppatchStateTypeAssigned ProjectStaticIppatchStateType = "assigned" - ProjectStaticIppatchStateTypeAvailable ProjectStaticIppatchStateType = "available" - ProjectStaticIppatchStateTypeCreated ProjectStaticIppatchStateType = "created" - ProjectStaticIppatchStateTypeCreating ProjectStaticIppatchStateType = "creating" - ProjectStaticIppatchStateTypeDeleted ProjectStaticIppatchStateType = "deleted" - ProjectStaticIppatchStateTypeDeleting ProjectStaticIppatchStateType = "deleting" + ProjectStaticIpPatchStateTypeAssigned ProjectStaticIpPatchStateType = "assigned" + ProjectStaticIpPatchStateTypeAvailable ProjectStaticIpPatchStateType = "available" + ProjectStaticIpPatchStateTypeCreated ProjectStaticIpPatchStateType = "created" + ProjectStaticIpPatchStateTypeCreating ProjectStaticIpPatchStateType = "creating" + ProjectStaticIpPatchStateTypeDeleted ProjectStaticIpPatchStateType = "deleted" + ProjectStaticIpPatchStateTypeDeleting ProjectStaticIpPatchStateType = "deleting" ) -func ProjectStaticIppatchStateTypeChoices() []string { +func ProjectStaticIpPatchStateTypeChoices() []string { return []string{"assigned", "available", "created", "creating", "deleted", "deleting"} } @@ -243,6 +243,22 @@ type StaticIpAddressAvailabilityOut struct { CloudName string `json:"cloud_name"` // Target cloud PriceUsd string `json:"price_usd"` // Hourly static IP address price in this cloud region } + +// StaticIpCreateIn StaticIPCreateRequestBody +type StaticIpCreateIn struct { + CloudName string `json:"cloud_name"` // Target cloud + TerminationProtection *bool `json:"termination_protection,omitempty"` // Static IP address is protected against deletion +} + +// StaticIpCreateOut StaticIPCreateResponse +type StaticIpCreateOut struct { + CloudName string `json:"cloud_name"` // Target cloud + IpAddress string `json:"ip_address"` // IPv4 address + ServiceName string `json:"service_name"` // Service name + State StaticIpStateType `json:"state"` // Static IP address state + StaticIpAddressId string `json:"static_ip_address_id"` // Static IP address identifier + TerminationProtection bool `json:"termination_protection"` // Static IP address is protected against deletion +} type StaticIpOut struct { CloudName string `json:"cloud_name"` // Target cloud IpAddress string `json:"ip_address"` // IPv4 address @@ -266,47 +282,17 @@ func StaticIpStateTypeChoices() []string { return []string{"assigned", "available", "created", "creating", "deleted", "deleting"} } -// StaticIpcreateIn StaticIPCreateRequestBody -type StaticIpcreateIn struct { - CloudName string `json:"cloud_name"` // Target cloud - TerminationProtection *bool `json:"termination_protection,omitempty"` // Static IP address is protected against deletion -} - -// StaticIpcreateOut StaticIPCreateResponse -type StaticIpcreateOut struct { - CloudName string `json:"cloud_name"` // Target cloud - IpAddress string `json:"ip_address"` // IPv4 address - ServiceName string `json:"service_name"` // Service name - State StaticIpcreateStateType `json:"state"` // Static IP address state - StaticIpAddressId string `json:"static_ip_address_id"` // Static IP address identifier - TerminationProtection bool `json:"termination_protection"` // Static IP address is protected against deletion -} -type StaticIpcreateStateType string - -const ( - StaticIpcreateStateTypeAssigned StaticIpcreateStateType = "assigned" - StaticIpcreateStateTypeAvailable StaticIpcreateStateType = "available" - StaticIpcreateStateTypeCreated StaticIpcreateStateType = "created" - StaticIpcreateStateTypeCreating StaticIpcreateStateType = "creating" - StaticIpcreateStateTypeDeleted StaticIpcreateStateType = "deleted" - StaticIpcreateStateTypeDeleting StaticIpcreateStateType = "deleting" -) - -func StaticIpcreateStateTypeChoices() []string { - return []string{"assigned", "available", "created", "creating", "deleted", "deleting"} -} - -// projectStaticIpavailabilityListOut ProjectStaticIPAvailabilityListResponse -type projectStaticIpavailabilityListOut struct { +// projectStaticIpAvailabilityListOut ProjectStaticIPAvailabilityListResponse +type projectStaticIpAvailabilityListOut struct { StaticIpAddressAvailability []StaticIpAddressAvailabilityOut `json:"static_ip_address_availability"` // Paginated array } -// publicStaticIpavailabilityListOut PublicStaticIPAvailabilityListResponse -type publicStaticIpavailabilityListOut struct { +// publicStaticIpAvailabilityListOut PublicStaticIPAvailabilityListResponse +type publicStaticIpAvailabilityListOut struct { StaticIpAddressAvailability []StaticIpAddressAvailabilityOut `json:"static_ip_address_availability"` // Paginated array } -// staticIplistOut StaticIPListResponse -type staticIplistOut struct { +// staticIpListOut StaticIPListResponse +type staticIpListOut struct { StaticIps []StaticIpOut `json:"static_ips"` // Paginated array }