From 347f04829545d57e29f3afc5e13a262db89be3e2 Mon Sep 17 00:00:00 2001 From: Shubham Singh Date: Wed, 8 Oct 2025 09:59:11 +0000 Subject: [PATCH] feat(schema): automate generation of draft-07 schemas Modify generate.go to produce backward-compatible JSON schemas directly from the Go structs --- go.mod | 3 + go.sum | 6 + internal/account/mocks.go | 6 + internal/apps/mocks.go | 227 ++-- .../apps/spec/app-create-schema.draft-07.json | 1208 +++++++++++++++++ .../apps/spec/app-update-schema.draft-07.json | 25 + internal/apps/spec/generate.go | 64 +- internal/common/mocks.go | 1 + internal/doks/spec/cluster-create-schema.json | 16 + internal/droplet/mocks.go | 36 +- internal/networking/mocks.go | 73 +- internal/spaces/mocks.go | 2 + myappspec.yaml | 7 + 13 files changed, 1486 insertions(+), 188 deletions(-) create mode 100644 internal/apps/spec/app-create-schema.draft-07.json create mode 100644 internal/apps/spec/app-update-schema.draft-07.json create mode 100644 myappspec.yaml diff --git a/go.mod b/go.mod index 50f36fd..1fe9f65 100644 --- a/go.mod +++ b/go.mod @@ -26,6 +26,9 @@ require ( github.com/stretchr/objx v0.5.2 // indirect github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect github.com/yosida95/uritemplate/v3 v3.0.2 // indirect + golang.org/x/mod v0.27.0 // indirect + golang.org/x/sync v0.16.0 // indirect golang.org/x/time v0.12.0 // indirect + golang.org/x/tools v0.36.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 4f7aad2..ab9ef7f 100644 --- a/go.sum +++ b/go.sum @@ -53,12 +53,18 @@ github.com/yosida95/uritemplate/v3 v3.0.2 h1:Ed3Oyj9yrmi9087+NczuL5BwkIc4wvTb5zI github.com/yosida95/uritemplate/v3 v3.0.2/go.mod h1:ILOh0sOhIJR3+L/8afwt/kE++YT040gmv5BQTMR2HP4= go.uber.org/mock v0.6.0 h1:hyF9dfmbgIX5EfOdasqLsWD6xqpNZlXblLB/Dbnwv3Y= go.uber.org/mock v0.6.0/go.mod h1:KiVJ4BqZJaMj4svdfmHM0AUx4NJYO8ZNpPnZn1Z+BBU= +golang.org/x/mod v0.27.0 h1:kb+q2PyFnEADO2IEF935ehFUXlWiNjJWtRNgBLSfbxQ= +golang.org/x/mod v0.27.0/go.mod h1:rWI627Fq0DEoudcK+MBkNkCe0EetEaDSwJJkCcjpazc= golang.org/x/oauth2 v0.31.0 h1:8Fq0yVZLh4j4YA47vHKFTa9Ew5XIrCP8LC6UeNZnLxo= golang.org/x/oauth2 v0.31.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA= +golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= +golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= +golang.org/x/tools v0.36.0 h1:kWS0uv/zsvHEle1LbV5LE8QujrxB3wfQyxHfhOk0Qkg= +golang.org/x/tools v0.36.0/go.mod h1:WBDiHKJK8YgLHlcQPYQzNCkUxUypCaa5ZegCVutKm+s= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/internal/account/mocks.go b/internal/account/mocks.go index 74d9f4d..92f5e34 100644 --- a/internal/account/mocks.go +++ b/internal/account/mocks.go @@ -21,6 +21,7 @@ import ( type MockAccountService struct { ctrl *gomock.Controller recorder *MockAccountServiceMockRecorder + isgomock struct{} } // MockAccountServiceMockRecorder is the mock recorder for MockAccountService. @@ -60,6 +61,7 @@ func (mr *MockAccountServiceMockRecorder) Get(arg0 any) *gomock.Call { type MockActionsService struct { ctrl *gomock.Controller recorder *MockActionsServiceMockRecorder + isgomock struct{} } // MockActionsServiceMockRecorder is the mock recorder for MockActionsService. @@ -115,6 +117,7 @@ func (mr *MockActionsServiceMockRecorder) List(arg0, arg1 any) *gomock.Call { type MockBalanceService struct { ctrl *gomock.Controller recorder *MockBalanceServiceMockRecorder + isgomock struct{} } // MockBalanceServiceMockRecorder is the mock recorder for MockBalanceService. @@ -154,6 +157,7 @@ func (mr *MockBalanceServiceMockRecorder) Get(arg0 any) *gomock.Call { type MockBillingHistoryService struct { ctrl *gomock.Controller recorder *MockBillingHistoryServiceMockRecorder + isgomock struct{} } // MockBillingHistoryServiceMockRecorder is the mock recorder for MockBillingHistoryService. @@ -193,6 +197,7 @@ func (mr *MockBillingHistoryServiceMockRecorder) List(arg0, arg1 any) *gomock.Ca type MockInvoicesService struct { ctrl *gomock.Controller recorder *MockInvoicesServiceMockRecorder + isgomock struct{} } // MockInvoicesServiceMockRecorder is the mock recorder for MockInvoicesService. @@ -296,6 +301,7 @@ func (mr *MockInvoicesServiceMockRecorder) List(arg0, arg1 any) *gomock.Call { type MockKeysService struct { ctrl *gomock.Controller recorder *MockKeysServiceMockRecorder + isgomock struct{} } // MockKeysServiceMockRecorder is the mock recorder for MockKeysService. diff --git a/internal/apps/mocks.go b/internal/apps/mocks.go index 9b78afe..3fe249f 100644 --- a/internal/apps/mocks.go +++ b/internal/apps/mocks.go @@ -21,6 +21,7 @@ import ( type MockAppsService struct { ctrl *gomock.Controller recorder *MockAppsServiceMockRecorder + isgomock struct{} } // MockAppsServiceMockRecorder is the mock recorder for MockAppsService. @@ -41,9 +42,9 @@ func (m *MockAppsService) EXPECT() *MockAppsServiceMockRecorder { } // Create mocks base method. -func (m *MockAppsService) Create(arg0 context.Context, arg1 *godo.AppCreateRequest) (*godo.App, *godo.Response, error) { +func (m *MockAppsService) Create(ctx context.Context, create *godo.AppCreateRequest) (*godo.App, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Create", arg0, arg1) + ret := m.ctrl.Call(m, "Create", ctx, create) ret0, _ := ret[0].(*godo.App) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -51,16 +52,16 @@ func (m *MockAppsService) Create(arg0 context.Context, arg1 *godo.AppCreateReque } // Create indicates an expected call of Create. -func (mr *MockAppsServiceMockRecorder) Create(arg0, arg1 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) Create(ctx, create any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockAppsService)(nil).Create), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Create", reflect.TypeOf((*MockAppsService)(nil).Create), ctx, create) } // CreateDeployment mocks base method. -func (m *MockAppsService) CreateDeployment(arg0 context.Context, arg1 string, arg2 ...*godo.DeploymentCreateRequest) (*godo.Deployment, *godo.Response, error) { +func (m *MockAppsService) CreateDeployment(ctx context.Context, appID string, create ...*godo.DeploymentCreateRequest) (*godo.Deployment, *godo.Response, error) { m.ctrl.T.Helper() - varargs := []any{arg0, arg1} - for _, a := range arg2 { + varargs := []any{ctx, appID} + for _, a := range create { varargs = append(varargs, a) } ret := m.ctrl.Call(m, "CreateDeployment", varargs...) @@ -71,31 +72,31 @@ func (m *MockAppsService) CreateDeployment(arg0 context.Context, arg1 string, ar } // CreateDeployment indicates an expected call of CreateDeployment. -func (mr *MockAppsServiceMockRecorder) CreateDeployment(arg0, arg1 any, arg2 ...any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) CreateDeployment(ctx, appID any, create ...any) *gomock.Call { mr.mock.ctrl.T.Helper() - varargs := append([]any{arg0, arg1}, arg2...) + varargs := append([]any{ctx, appID}, create...) return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateDeployment", reflect.TypeOf((*MockAppsService)(nil).CreateDeployment), varargs...) } // Delete mocks base method. -func (m *MockAppsService) Delete(arg0 context.Context, arg1 string) (*godo.Response, error) { +func (m *MockAppsService) Delete(ctx context.Context, appID string) (*godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Delete", arg0, arg1) + ret := m.ctrl.Call(m, "Delete", ctx, appID) ret0, _ := ret[0].(*godo.Response) ret1, _ := ret[1].(error) return ret0, ret1 } // Delete indicates an expected call of Delete. -func (mr *MockAppsServiceMockRecorder) Delete(arg0, arg1 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) Delete(ctx, appID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockAppsService)(nil).Delete), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Delete", reflect.TypeOf((*MockAppsService)(nil).Delete), ctx, appID) } // Detect mocks base method. -func (m *MockAppsService) Detect(arg0 context.Context, arg1 *godo.DetectRequest) (*godo.DetectResponse, *godo.Response, error) { +func (m *MockAppsService) Detect(ctx context.Context, detect *godo.DetectRequest) (*godo.DetectResponse, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Detect", arg0, arg1) + ret := m.ctrl.Call(m, "Detect", ctx, detect) ret0, _ := ret[0].(*godo.DetectResponse) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -103,15 +104,15 @@ func (m *MockAppsService) Detect(arg0 context.Context, arg1 *godo.DetectRequest) } // Detect indicates an expected call of Detect. -func (mr *MockAppsServiceMockRecorder) Detect(arg0, arg1 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) Detect(ctx, detect any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Detect", reflect.TypeOf((*MockAppsService)(nil).Detect), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Detect", reflect.TypeOf((*MockAppsService)(nil).Detect), ctx, detect) } // Get mocks base method. -func (m *MockAppsService) Get(arg0 context.Context, arg1 string) (*godo.App, *godo.Response, error) { +func (m *MockAppsService) Get(ctx context.Context, appID string) (*godo.App, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Get", arg0, arg1) + ret := m.ctrl.Call(m, "Get", ctx, appID) ret0, _ := ret[0].(*godo.App) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -119,15 +120,15 @@ func (m *MockAppsService) Get(arg0 context.Context, arg1 string) (*godo.App, *go } // Get indicates an expected call of Get. -func (mr *MockAppsServiceMockRecorder) Get(arg0, arg1 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) Get(ctx, appID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockAppsService)(nil).Get), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockAppsService)(nil).Get), ctx, appID) } // GetAppDatabaseConnectionDetails mocks base method. -func (m *MockAppsService) GetAppDatabaseConnectionDetails(arg0 context.Context, arg1 string) ([]*godo.GetDatabaseConnectionDetailsResponse, *godo.Response, error) { +func (m *MockAppsService) GetAppDatabaseConnectionDetails(ctx context.Context, appID string) ([]*godo.GetDatabaseConnectionDetailsResponse, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAppDatabaseConnectionDetails", arg0, arg1) + ret := m.ctrl.Call(m, "GetAppDatabaseConnectionDetails", ctx, appID) ret0, _ := ret[0].([]*godo.GetDatabaseConnectionDetailsResponse) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -135,15 +136,15 @@ func (m *MockAppsService) GetAppDatabaseConnectionDetails(arg0 context.Context, } // GetAppDatabaseConnectionDetails indicates an expected call of GetAppDatabaseConnectionDetails. -func (mr *MockAppsServiceMockRecorder) GetAppDatabaseConnectionDetails(arg0, arg1 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) GetAppDatabaseConnectionDetails(ctx, appID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAppDatabaseConnectionDetails", reflect.TypeOf((*MockAppsService)(nil).GetAppDatabaseConnectionDetails), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAppDatabaseConnectionDetails", reflect.TypeOf((*MockAppsService)(nil).GetAppDatabaseConnectionDetails), ctx, appID) } // GetAppHealth mocks base method. -func (m *MockAppsService) GetAppHealth(arg0 context.Context, arg1 string) (*godo.AppHealth, *godo.Response, error) { +func (m *MockAppsService) GetAppHealth(ctx context.Context, appID string) (*godo.AppHealth, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAppHealth", arg0, arg1) + ret := m.ctrl.Call(m, "GetAppHealth", ctx, appID) ret0, _ := ret[0].(*godo.AppHealth) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -151,15 +152,15 @@ func (m *MockAppsService) GetAppHealth(arg0 context.Context, arg1 string) (*godo } // GetAppHealth indicates an expected call of GetAppHealth. -func (mr *MockAppsServiceMockRecorder) GetAppHealth(arg0, arg1 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) GetAppHealth(ctx, appID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAppHealth", reflect.TypeOf((*MockAppsService)(nil).GetAppHealth), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAppHealth", reflect.TypeOf((*MockAppsService)(nil).GetAppHealth), ctx, appID) } // GetAppInstances mocks base method. -func (m *MockAppsService) GetAppInstances(arg0 context.Context, arg1 string, arg2 *godo.GetAppInstancesOpts) ([]*godo.AppInstance, *godo.Response, error) { +func (m *MockAppsService) GetAppInstances(ctx context.Context, appID string, opts *godo.GetAppInstancesOpts) ([]*godo.AppInstance, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetAppInstances", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "GetAppInstances", ctx, appID, opts) ret0, _ := ret[0].([]*godo.AppInstance) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -167,15 +168,15 @@ func (m *MockAppsService) GetAppInstances(arg0 context.Context, arg1 string, arg } // GetAppInstances indicates an expected call of GetAppInstances. -func (mr *MockAppsServiceMockRecorder) GetAppInstances(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) GetAppInstances(ctx, appID, opts any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAppInstances", reflect.TypeOf((*MockAppsService)(nil).GetAppInstances), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAppInstances", reflect.TypeOf((*MockAppsService)(nil).GetAppInstances), ctx, appID, opts) } // GetDeployment mocks base method. -func (m *MockAppsService) GetDeployment(arg0 context.Context, arg1, arg2 string) (*godo.Deployment, *godo.Response, error) { +func (m *MockAppsService) GetDeployment(ctx context.Context, appID, deploymentID string) (*godo.Deployment, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetDeployment", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "GetDeployment", ctx, appID, deploymentID) ret0, _ := ret[0].(*godo.Deployment) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -183,15 +184,15 @@ func (m *MockAppsService) GetDeployment(arg0 context.Context, arg1, arg2 string) } // GetDeployment indicates an expected call of GetDeployment. -func (mr *MockAppsServiceMockRecorder) GetDeployment(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) GetDeployment(ctx, appID, deploymentID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDeployment", reflect.TypeOf((*MockAppsService)(nil).GetDeployment), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetDeployment", reflect.TypeOf((*MockAppsService)(nil).GetDeployment), ctx, appID, deploymentID) } // GetExec mocks base method. -func (m *MockAppsService) GetExec(arg0 context.Context, arg1, arg2, arg3 string) (*godo.AppExec, *godo.Response, error) { +func (m *MockAppsService) GetExec(ctx context.Context, appID, deploymentID, component string) (*godo.AppExec, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetExec", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "GetExec", ctx, appID, deploymentID, component) ret0, _ := ret[0].(*godo.AppExec) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -199,15 +200,15 @@ func (m *MockAppsService) GetExec(arg0 context.Context, arg1, arg2, arg3 string) } // GetExec indicates an expected call of GetExec. -func (mr *MockAppsServiceMockRecorder) GetExec(arg0, arg1, arg2, arg3 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) GetExec(ctx, appID, deploymentID, component any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExec", reflect.TypeOf((*MockAppsService)(nil).GetExec), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExec", reflect.TypeOf((*MockAppsService)(nil).GetExec), ctx, appID, deploymentID, component) } // GetExecWithOpts mocks base method. -func (m *MockAppsService) GetExecWithOpts(arg0 context.Context, arg1, arg2 string, arg3 *godo.AppGetExecOptions) (*godo.AppExec, *godo.Response, error) { +func (m *MockAppsService) GetExecWithOpts(ctx context.Context, appID, componentName string, opts *godo.AppGetExecOptions) (*godo.AppExec, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetExecWithOpts", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "GetExecWithOpts", ctx, appID, componentName, opts) ret0, _ := ret[0].(*godo.AppExec) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -215,15 +216,15 @@ func (m *MockAppsService) GetExecWithOpts(arg0 context.Context, arg1, arg2 strin } // GetExecWithOpts indicates an expected call of GetExecWithOpts. -func (mr *MockAppsServiceMockRecorder) GetExecWithOpts(arg0, arg1, arg2, arg3 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) GetExecWithOpts(ctx, appID, componentName, opts any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExecWithOpts", reflect.TypeOf((*MockAppsService)(nil).GetExecWithOpts), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetExecWithOpts", reflect.TypeOf((*MockAppsService)(nil).GetExecWithOpts), ctx, appID, componentName, opts) } // GetInstanceSize mocks base method. -func (m *MockAppsService) GetInstanceSize(arg0 context.Context, arg1 string) (*godo.AppInstanceSize, *godo.Response, error) { +func (m *MockAppsService) GetInstanceSize(ctx context.Context, slug string) (*godo.AppInstanceSize, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetInstanceSize", arg0, arg1) + ret := m.ctrl.Call(m, "GetInstanceSize", ctx, slug) ret0, _ := ret[0].(*godo.AppInstanceSize) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -231,15 +232,15 @@ func (m *MockAppsService) GetInstanceSize(arg0 context.Context, arg1 string) (*g } // GetInstanceSize indicates an expected call of GetInstanceSize. -func (mr *MockAppsServiceMockRecorder) GetInstanceSize(arg0, arg1 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) GetInstanceSize(ctx, slug any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetInstanceSize", reflect.TypeOf((*MockAppsService)(nil).GetInstanceSize), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetInstanceSize", reflect.TypeOf((*MockAppsService)(nil).GetInstanceSize), ctx, slug) } // GetLogs mocks base method. -func (m *MockAppsService) GetLogs(arg0 context.Context, arg1, arg2, arg3 string, arg4 godo.AppLogType, arg5 bool, arg6 int) (*godo.AppLogs, *godo.Response, error) { +func (m *MockAppsService) GetLogs(ctx context.Context, appID, deploymentID, component string, logType godo.AppLogType, follow bool, tailLines int) (*godo.AppLogs, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetLogs", arg0, arg1, arg2, arg3, arg4, arg5, arg6) + ret := m.ctrl.Call(m, "GetLogs", ctx, appID, deploymentID, component, logType, follow, tailLines) ret0, _ := ret[0].(*godo.AppLogs) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -247,15 +248,15 @@ func (m *MockAppsService) GetLogs(arg0 context.Context, arg1, arg2, arg3 string, } // GetLogs indicates an expected call of GetLogs. -func (mr *MockAppsServiceMockRecorder) GetLogs(arg0, arg1, arg2, arg3, arg4, arg5, arg6 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) GetLogs(ctx, appID, deploymentID, component, logType, follow, tailLines any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLogs", reflect.TypeOf((*MockAppsService)(nil).GetLogs), arg0, arg1, arg2, arg3, arg4, arg5, arg6) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetLogs", reflect.TypeOf((*MockAppsService)(nil).GetLogs), ctx, appID, deploymentID, component, logType, follow, tailLines) } // GetTier mocks base method. -func (m *MockAppsService) GetTier(arg0 context.Context, arg1 string) (*godo.AppTier, *godo.Response, error) { +func (m *MockAppsService) GetTier(ctx context.Context, slug string) (*godo.AppTier, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetTier", arg0, arg1) + ret := m.ctrl.Call(m, "GetTier", ctx, slug) ret0, _ := ret[0].(*godo.AppTier) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -263,15 +264,15 @@ func (m *MockAppsService) GetTier(arg0 context.Context, arg1 string) (*godo.AppT } // GetTier indicates an expected call of GetTier. -func (mr *MockAppsServiceMockRecorder) GetTier(arg0, arg1 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) GetTier(ctx, slug any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTier", reflect.TypeOf((*MockAppsService)(nil).GetTier), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetTier", reflect.TypeOf((*MockAppsService)(nil).GetTier), ctx, slug) } // List mocks base method. -func (m *MockAppsService) List(arg0 context.Context, arg1 *godo.ListOptions) ([]*godo.App, *godo.Response, error) { +func (m *MockAppsService) List(ctx context.Context, opts *godo.ListOptions) ([]*godo.App, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "List", arg0, arg1) + ret := m.ctrl.Call(m, "List", ctx, opts) ret0, _ := ret[0].([]*godo.App) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -279,15 +280,15 @@ func (m *MockAppsService) List(arg0 context.Context, arg1 *godo.ListOptions) ([] } // List indicates an expected call of List. -func (mr *MockAppsServiceMockRecorder) List(arg0, arg1 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) List(ctx, opts any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockAppsService)(nil).List), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockAppsService)(nil).List), ctx, opts) } // ListAlerts mocks base method. -func (m *MockAppsService) ListAlerts(arg0 context.Context, arg1 string) ([]*godo.AppAlert, *godo.Response, error) { +func (m *MockAppsService) ListAlerts(ctx context.Context, appID string) ([]*godo.AppAlert, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListAlerts", arg0, arg1) + ret := m.ctrl.Call(m, "ListAlerts", ctx, appID) ret0, _ := ret[0].([]*godo.AppAlert) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -295,15 +296,15 @@ func (m *MockAppsService) ListAlerts(arg0 context.Context, arg1 string) ([]*godo } // ListAlerts indicates an expected call of ListAlerts. -func (mr *MockAppsServiceMockRecorder) ListAlerts(arg0, arg1 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) ListAlerts(ctx, appID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAlerts", reflect.TypeOf((*MockAppsService)(nil).ListAlerts), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListAlerts", reflect.TypeOf((*MockAppsService)(nil).ListAlerts), ctx, appID) } // ListBuildpacks mocks base method. -func (m *MockAppsService) ListBuildpacks(arg0 context.Context) ([]*godo.Buildpack, *godo.Response, error) { +func (m *MockAppsService) ListBuildpacks(ctx context.Context) ([]*godo.Buildpack, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListBuildpacks", arg0) + ret := m.ctrl.Call(m, "ListBuildpacks", ctx) ret0, _ := ret[0].([]*godo.Buildpack) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -311,15 +312,15 @@ func (m *MockAppsService) ListBuildpacks(arg0 context.Context) ([]*godo.Buildpac } // ListBuildpacks indicates an expected call of ListBuildpacks. -func (mr *MockAppsServiceMockRecorder) ListBuildpacks(arg0 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) ListBuildpacks(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListBuildpacks", reflect.TypeOf((*MockAppsService)(nil).ListBuildpacks), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListBuildpacks", reflect.TypeOf((*MockAppsService)(nil).ListBuildpacks), ctx) } // ListDeployments mocks base method. -func (m *MockAppsService) ListDeployments(arg0 context.Context, arg1 string, arg2 *godo.ListOptions) ([]*godo.Deployment, *godo.Response, error) { +func (m *MockAppsService) ListDeployments(ctx context.Context, appID string, opts *godo.ListOptions) ([]*godo.Deployment, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListDeployments", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "ListDeployments", ctx, appID, opts) ret0, _ := ret[0].([]*godo.Deployment) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -327,15 +328,15 @@ func (m *MockAppsService) ListDeployments(arg0 context.Context, arg1 string, arg } // ListDeployments indicates an expected call of ListDeployments. -func (mr *MockAppsServiceMockRecorder) ListDeployments(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) ListDeployments(ctx, appID, opts any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListDeployments", reflect.TypeOf((*MockAppsService)(nil).ListDeployments), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListDeployments", reflect.TypeOf((*MockAppsService)(nil).ListDeployments), ctx, appID, opts) } // ListInstanceSizes mocks base method. -func (m *MockAppsService) ListInstanceSizes(arg0 context.Context) ([]*godo.AppInstanceSize, *godo.Response, error) { +func (m *MockAppsService) ListInstanceSizes(ctx context.Context) ([]*godo.AppInstanceSize, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListInstanceSizes", arg0) + ret := m.ctrl.Call(m, "ListInstanceSizes", ctx) ret0, _ := ret[0].([]*godo.AppInstanceSize) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -343,15 +344,15 @@ func (m *MockAppsService) ListInstanceSizes(arg0 context.Context) ([]*godo.AppIn } // ListInstanceSizes indicates an expected call of ListInstanceSizes. -func (mr *MockAppsServiceMockRecorder) ListInstanceSizes(arg0 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) ListInstanceSizes(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListInstanceSizes", reflect.TypeOf((*MockAppsService)(nil).ListInstanceSizes), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListInstanceSizes", reflect.TypeOf((*MockAppsService)(nil).ListInstanceSizes), ctx) } // ListRegions mocks base method. -func (m *MockAppsService) ListRegions(arg0 context.Context) ([]*godo.AppRegion, *godo.Response, error) { +func (m *MockAppsService) ListRegions(ctx context.Context) ([]*godo.AppRegion, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListRegions", arg0) + ret := m.ctrl.Call(m, "ListRegions", ctx) ret0, _ := ret[0].([]*godo.AppRegion) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -359,15 +360,15 @@ func (m *MockAppsService) ListRegions(arg0 context.Context) ([]*godo.AppRegion, } // ListRegions indicates an expected call of ListRegions. -func (mr *MockAppsServiceMockRecorder) ListRegions(arg0 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) ListRegions(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRegions", reflect.TypeOf((*MockAppsService)(nil).ListRegions), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListRegions", reflect.TypeOf((*MockAppsService)(nil).ListRegions), ctx) } // ListTiers mocks base method. -func (m *MockAppsService) ListTiers(arg0 context.Context) ([]*godo.AppTier, *godo.Response, error) { +func (m *MockAppsService) ListTiers(ctx context.Context) ([]*godo.AppTier, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListTiers", arg0) + ret := m.ctrl.Call(m, "ListTiers", ctx) ret0, _ := ret[0].([]*godo.AppTier) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -375,15 +376,15 @@ func (m *MockAppsService) ListTiers(arg0 context.Context) ([]*godo.AppTier, *god } // ListTiers indicates an expected call of ListTiers. -func (mr *MockAppsServiceMockRecorder) ListTiers(arg0 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) ListTiers(ctx any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListTiers", reflect.TypeOf((*MockAppsService)(nil).ListTiers), arg0) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListTiers", reflect.TypeOf((*MockAppsService)(nil).ListTiers), ctx) } // Propose mocks base method. -func (m *MockAppsService) Propose(arg0 context.Context, arg1 *godo.AppProposeRequest) (*godo.AppProposeResponse, *godo.Response, error) { +func (m *MockAppsService) Propose(ctx context.Context, propose *godo.AppProposeRequest) (*godo.AppProposeResponse, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Propose", arg0, arg1) + ret := m.ctrl.Call(m, "Propose", ctx, propose) ret0, _ := ret[0].(*godo.AppProposeResponse) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -391,15 +392,15 @@ func (m *MockAppsService) Propose(arg0 context.Context, arg1 *godo.AppProposeReq } // Propose indicates an expected call of Propose. -func (mr *MockAppsServiceMockRecorder) Propose(arg0, arg1 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) Propose(ctx, propose any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Propose", reflect.TypeOf((*MockAppsService)(nil).Propose), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Propose", reflect.TypeOf((*MockAppsService)(nil).Propose), ctx, propose) } // ResetDatabasePassword mocks base method. -func (m *MockAppsService) ResetDatabasePassword(arg0 context.Context, arg1, arg2 string) (*godo.Deployment, *godo.Response, error) { +func (m *MockAppsService) ResetDatabasePassword(ctx context.Context, appID, component string) (*godo.Deployment, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ResetDatabasePassword", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "ResetDatabasePassword", ctx, appID, component) ret0, _ := ret[0].(*godo.Deployment) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -407,15 +408,15 @@ func (m *MockAppsService) ResetDatabasePassword(arg0 context.Context, arg1, arg2 } // ResetDatabasePassword indicates an expected call of ResetDatabasePassword. -func (mr *MockAppsServiceMockRecorder) ResetDatabasePassword(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) ResetDatabasePassword(ctx, appID, component any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResetDatabasePassword", reflect.TypeOf((*MockAppsService)(nil).ResetDatabasePassword), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ResetDatabasePassword", reflect.TypeOf((*MockAppsService)(nil).ResetDatabasePassword), ctx, appID, component) } // Restart mocks base method. -func (m *MockAppsService) Restart(arg0 context.Context, arg1 string, arg2 *godo.AppRestartRequest) (*godo.Deployment, *godo.Response, error) { +func (m *MockAppsService) Restart(ctx context.Context, appID string, opts *godo.AppRestartRequest) (*godo.Deployment, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Restart", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "Restart", ctx, appID, opts) ret0, _ := ret[0].(*godo.Deployment) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -423,15 +424,15 @@ func (m *MockAppsService) Restart(arg0 context.Context, arg1 string, arg2 *godo. } // Restart indicates an expected call of Restart. -func (mr *MockAppsServiceMockRecorder) Restart(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) Restart(ctx, appID, opts any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Restart", reflect.TypeOf((*MockAppsService)(nil).Restart), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Restart", reflect.TypeOf((*MockAppsService)(nil).Restart), ctx, appID, opts) } // ToggleDatabaseTrustedSource mocks base method. -func (m *MockAppsService) ToggleDatabaseTrustedSource(arg0 context.Context, arg1, arg2 string, arg3 godo.ToggleDatabaseTrustedSourceOptions) (*godo.ToggleDatabaseTrustedSourceResponse, *godo.Response, error) { +func (m *MockAppsService) ToggleDatabaseTrustedSource(ctx context.Context, appID, component string, opts godo.ToggleDatabaseTrustedSourceOptions) (*godo.ToggleDatabaseTrustedSourceResponse, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ToggleDatabaseTrustedSource", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "ToggleDatabaseTrustedSource", ctx, appID, component, opts) ret0, _ := ret[0].(*godo.ToggleDatabaseTrustedSourceResponse) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -439,15 +440,15 @@ func (m *MockAppsService) ToggleDatabaseTrustedSource(arg0 context.Context, arg1 } // ToggleDatabaseTrustedSource indicates an expected call of ToggleDatabaseTrustedSource. -func (mr *MockAppsServiceMockRecorder) ToggleDatabaseTrustedSource(arg0, arg1, arg2, arg3 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) ToggleDatabaseTrustedSource(ctx, appID, component, opts any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ToggleDatabaseTrustedSource", reflect.TypeOf((*MockAppsService)(nil).ToggleDatabaseTrustedSource), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ToggleDatabaseTrustedSource", reflect.TypeOf((*MockAppsService)(nil).ToggleDatabaseTrustedSource), ctx, appID, component, opts) } // Update mocks base method. -func (m *MockAppsService) Update(arg0 context.Context, arg1 string, arg2 *godo.AppUpdateRequest) (*godo.App, *godo.Response, error) { +func (m *MockAppsService) Update(ctx context.Context, appID string, update *godo.AppUpdateRequest) (*godo.App, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Update", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "Update", ctx, appID, update) ret0, _ := ret[0].(*godo.App) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -455,15 +456,15 @@ func (m *MockAppsService) Update(arg0 context.Context, arg1 string, arg2 *godo.A } // Update indicates an expected call of Update. -func (mr *MockAppsServiceMockRecorder) Update(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) Update(ctx, appID, update any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockAppsService)(nil).Update), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Update", reflect.TypeOf((*MockAppsService)(nil).Update), ctx, appID, update) } // UpdateAlertDestinations mocks base method. -func (m *MockAppsService) UpdateAlertDestinations(arg0 context.Context, arg1, arg2 string, arg3 *godo.AlertDestinationUpdateRequest) (*godo.AppAlert, *godo.Response, error) { +func (m *MockAppsService) UpdateAlertDestinations(ctx context.Context, appID, alertID string, update *godo.AlertDestinationUpdateRequest) (*godo.AppAlert, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpdateAlertDestinations", arg0, arg1, arg2, arg3) + ret := m.ctrl.Call(m, "UpdateAlertDestinations", ctx, appID, alertID, update) ret0, _ := ret[0].(*godo.AppAlert) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -471,15 +472,15 @@ func (m *MockAppsService) UpdateAlertDestinations(arg0 context.Context, arg1, ar } // UpdateAlertDestinations indicates an expected call of UpdateAlertDestinations. -func (mr *MockAppsServiceMockRecorder) UpdateAlertDestinations(arg0, arg1, arg2, arg3 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) UpdateAlertDestinations(ctx, appID, alertID, update any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAlertDestinations", reflect.TypeOf((*MockAppsService)(nil).UpdateAlertDestinations), arg0, arg1, arg2, arg3) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateAlertDestinations", reflect.TypeOf((*MockAppsService)(nil).UpdateAlertDestinations), ctx, appID, alertID, update) } // UpgradeBuildpack mocks base method. -func (m *MockAppsService) UpgradeBuildpack(arg0 context.Context, arg1 string, arg2 godo.UpgradeBuildpackOptions) (*godo.UpgradeBuildpackResponse, *godo.Response, error) { +func (m *MockAppsService) UpgradeBuildpack(ctx context.Context, appID string, opts godo.UpgradeBuildpackOptions) (*godo.UpgradeBuildpackResponse, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "UpgradeBuildpack", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "UpgradeBuildpack", ctx, appID, opts) ret0, _ := ret[0].(*godo.UpgradeBuildpackResponse) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -487,7 +488,7 @@ func (m *MockAppsService) UpgradeBuildpack(arg0 context.Context, arg1 string, ar } // UpgradeBuildpack indicates an expected call of UpgradeBuildpack. -func (mr *MockAppsServiceMockRecorder) UpgradeBuildpack(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockAppsServiceMockRecorder) UpgradeBuildpack(ctx, appID, opts any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpgradeBuildpack", reflect.TypeOf((*MockAppsService)(nil).UpgradeBuildpack), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpgradeBuildpack", reflect.TypeOf((*MockAppsService)(nil).UpgradeBuildpack), ctx, appID, opts) } diff --git a/internal/apps/spec/app-create-schema.draft-07.json b/internal/apps/spec/app-create-schema.draft-07.json new file mode 100644 index 0000000..ff5693a --- /dev/null +++ b/internal/apps/spec/app-create-schema.draft-07.json @@ -0,0 +1,1208 @@ +{ + "$defs": { + "AppAlertSpec": { + "description": "AppAlertSpec Configuration of an alert for the app or a individual component.", + "properties": { + "disabled": { + "description": "Determines whether or not the alert is disabled.", + "type": "boolean" + }, + "operator": { + "type": "string" + }, + "rule": { + "type": "string" + }, + "value": { + "description": "The meaning is dependent upon the rule. It is used in conjunction with the operator and window to determine when an alert should trigger.", + "type": "number" + }, + "window": { + "type": "string" + } + }, + "type": "object" + }, + "AppAutoscalingSpec": { + "description": "AppAutoscalingSpec struct for AppAutoscalingSpec", + "properties": { + "max_instance_count": { + "description": "The maximum amount of instances for this component. Maximum 250. Consider using a larger instance size if your application requires more than 250 instances.", + "type": "integer" + }, + "metrics": { + "$ref": "#/$defs/AppAutoscalingSpecMetrics" + }, + "min_instance_count": { + "description": "The minimum amount of instances for this component.", + "type": "integer" + } + }, + "type": "object" + }, + "AppAutoscalingSpecMetricCPU": { + "description": "AppAutoscalingSpecMetricCPU struct for AppAutoscalingSpecMetricCPU", + "properties": { + "percent": { + "description": "The average target CPU utilization for the component.", + "type": "integer" + } + }, + "type": "object" + }, + "AppAutoscalingSpecMetrics": { + "description": "AppAutoscalingSpecMetrics struct for AppAutoscalingSpecMetrics", + "properties": { + "cpu": { + "$ref": "#/$defs/AppAutoscalingSpecMetricCPU" + } + }, + "type": "object" + }, + "AppCORSPolicy": { + "description": "AppCORSPolicy struct for AppCORSPolicy", + "properties": { + "allow_credentials": { + "description": "Whether browsers should expose the response to the client-side JavaScript code when the request's credentials mode is `include`. This configures the Access-Control-Allow-Credentials header.", + "type": "boolean" + }, + "allow_headers": { + "description": "The set of allowed HTTP request headers. This configures the Access-Control-Allow-Headers header.", + "items": { + "type": "string" + }, + "type": "array" + }, + "allow_methods": { + "description": "The set of allowed HTTP methods. This configures the Access-Control-Allow-Methods header.", + "items": { + "type": "string" + }, + "type": "array" + }, + "allow_origins": { + "description": "The set of allowed CORS origins. This configures the Access-Control-Allow-Origin header.", + "items": { + "$ref": "#/$defs/AppStringMatch" + }, + "type": "array" + }, + "expose_headers": { + "description": "The set of HTTP response headers that browsers are allowed to access. This configures the Access-Control-Expose-Headers header.", + "items": { + "type": "string" + }, + "type": "array" + }, + "max_age": { + "description": "An optional duration specifying how long browsers can cache the results of a preflight request. This configures the Access-Control-Max-Age header. Example: `5h30m`.", + "type": "string" + } + }, + "type": "object" + }, + "AppCreateRequest": { + "description": "AppCreateRequest struct for AppCreateRequest", + "properties": { + "project_id": { + "description": "Optional. The UUID of the project the app should be assigned.", + "type": "string" + }, + "spec": { + "$ref": "#/$defs/AppSpec" + } + }, + "type": "object" + }, + "AppDatabaseSpec": { + "description": "AppDatabaseSpec struct for AppDatabaseSpec", + "properties": { + "cluster_name": { + "description": "The name of the underlying DigitalOcean DBaaS cluster. This is required for production databases. For dev databases, if cluster_name is not set, a new cluster will be provisioned.", + "type": "string" + }, + "db_name": { + "description": "The name of the MySQL or PostgreSQL database to configure.", + "type": "string" + }, + "db_user": { + "description": "The name of the MySQL or PostgreSQL user to configure.", + "type": "string" + }, + "engine": { + "type": "string" + }, + "name": { + "description": "The database's name. The name must be unique across all components within the same app and cannot use capital letters.", + "type": "string" + }, + "num_nodes": { + "description": "Deprecated.", + "type": "integer" + }, + "production": { + "description": "Whether this is a production or dev database.", + "type": "boolean" + }, + "size": { + "description": "Deprecated.", + "type": "string" + }, + "version": { + "type": "string" + } + }, + "type": "object" + }, + "AppDomainSpec": { + "description": "AppDomainSpec struct for AppDomainSpec", + "properties": { + "certificate": { + "type": "string" + }, + "domain": { + "type": "string" + }, + "minimum_tls_version": { + "description": "Optional. The minimum version of TLS a client application can use to access resources for the domain. Must be one of the following values wrapped within quotations: `\\\"1.2\\\"` or `\\\"1.3\\\"`.", + "type": "string" + }, + "type": { + "type": "string" + }, + "wildcard": { + "type": "boolean" + }, + "zone": { + "description": "Optional. If the domain uses DigitalOcean DNS and you would like App Platform to automatically manage it for you, set this to the name of the domain on your account. For example, If the domain you are adding is `app.domain.com`, the zone could be `domain.com`.", + "type": "string" + } + }, + "type": "object" + }, + "AppEgressSpec": { + "description": "AppEgressSpec Specification for app egress configurations.", + "properties": { + "type": { + "type": "string" + } + }, + "type": "object" + }, + "AppFunctionsSpec": { + "description": "AppFunctionsSpec struct for AppFunctionsSpec", + "properties": { + "alerts": { + "description": "A list of configured alerts the user has enabled.", + "items": { + "$ref": "#/$defs/AppAlertSpec" + }, + "type": "array" + }, + "bitbucket": { + "$ref": "#/$defs/BitbucketSourceSpec" + }, + "cors": { + "$ref": "#/$defs/AppCORSPolicy" + }, + "envs": { + "description": "A list of environment variables made available to the component.", + "items": { + "$ref": "#/$defs/AppVariableDefinition" + }, + "type": "array" + }, + "git": { + "$ref": "#/$defs/GitSourceSpec" + }, + "github": { + "$ref": "#/$defs/GitHubSourceSpec" + }, + "gitlab": { + "$ref": "#/$defs/GitLabSourceSpec" + }, + "log_destinations": { + "description": "A list of configured log forwarding destinations.", + "items": { + "$ref": "#/$defs/AppLogDestinationSpec" + }, + "type": "array" + }, + "name": { + "description": "The name. Must be unique across all components within the same app.", + "type": "string" + }, + "routes": { + "description": "(Deprecated) A list of HTTP routes that should be routed to this component.", + "items": { + "$ref": "#/$defs/AppRouteSpec" + }, + "type": "array" + }, + "source_dir": { + "description": "An optional path to the working directory to use for the build. Must be relative to the root of the repo.", + "type": "string" + } + }, + "type": "object" + }, + "AppIngressSpec": { + "description": "AppIngressSpec Specification for app ingress configurations.", + "properties": { + "load_balancer": { + "type": "string" + }, + "load_balancer_size": { + "type": "integer" + }, + "rules": { + "description": "Rules for configuring HTTP ingress for component routes, CORS, rewrites, and redirects.", + "items": { + "$ref": "#/$defs/AppIngressSpecRule" + }, + "type": "array" + } + }, + "type": "object" + }, + "AppIngressSpecRule": { + "description": "AppIngressSpecRule A rule that configures component routes, rewrites, redirects and cors.", + "properties": { + "component": { + "$ref": "#/$defs/AppIngressSpecRuleRoutingComponent" + }, + "cors": { + "$ref": "#/$defs/AppCORSPolicy" + }, + "match": { + "$ref": "#/$defs/AppIngressSpecRuleMatch" + }, + "redirect": { + "$ref": "#/$defs/AppIngressSpecRuleRoutingRedirect" + } + }, + "type": "object" + }, + "AppIngressSpecRuleMatch": { + "description": "AppIngressSpecRuleMatch The match configuration for a rule.", + "properties": { + "authority": { + "$ref": "#/$defs/AppIngressSpecRuleStringMatch" + }, + "path": { + "$ref": "#/$defs/AppIngressSpecRuleStringMatch" + } + }, + "type": "object" + }, + "AppIngressSpecRuleRoutingComponent": { + "description": "AppIngressSpecRuleRoutingComponent The component routing configuration.", + "properties": { + "name": { + "description": "The name of the component to route to.", + "type": "string" + }, + "preserve_path_prefix": { + "description": "An optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with `path=/api` will have requests to `/api/list` trimmed to `/list`. If this value is `true`, the path will remain `/api/list`. Note: this is not applicable for Functions Components and is mutually exclusive with `rewrite`.", + "type": "boolean" + }, + "rewrite": { + "description": "An optional field that will rewrite the path of the component to be what is specified here. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with `path=/api` will have requests to `/api/list` trimmed to `/list`. If you specified the rewrite to be `/v1/`, requests to `/api/list` would be rewritten to `/v1/list`. Note: this is mutually exclusive with `preserve_path_prefix`.", + "type": "string" + } + }, + "type": "object" + }, + "AppIngressSpecRuleRoutingRedirect": { + "description": "AppIngressSpecRuleRoutingRedirect The redirect routing configuration.", + "properties": { + "authority": { + "description": "The authority/host to redirect to. This can be a hostname or IP address. Note: use `port` to set the port.", + "type": "string" + }, + "port": { + "description": "The port to redirect to.", + "type": "integer" + }, + "redirect_code": { + "description": "The redirect code to use. Defaults to `302`. Supported values are 300, 301, 302, 303, 304, 307, 308.", + "type": "integer" + }, + "scheme": { + "description": "The scheme to redirect to. Supported values are `http` or `https`. Default: `https`.", + "type": "string" + }, + "uri": { + "description": "An optional URI path to redirect to. Note: if this is specified the whole URI of the original request will be overwritten to this value, irrespective of the original request URI being matched.", + "type": "string" + } + }, + "type": "object" + }, + "AppIngressSpecRuleStringMatch": { + "description": "AppIngressSpecRuleStringMatch The string match configuration.", + "properties": { + "exact": { + "type": "string" + }, + "prefix": { + "description": "Prefix-based match. For example, `/api` will match `/api`, `/api/`, and any nested paths such as `/api/v1/endpoint`.", + "type": "string" + } + }, + "type": "object" + }, + "AppJobSpec": { + "description": "AppJobSpec struct for AppJobSpec", + "properties": { + "alerts": { + "description": "A list of configured alerts which apply to the component.", + "items": { + "$ref": "#/$defs/AppAlertSpec" + }, + "type": "array" + }, + "bitbucket": { + "$ref": "#/$defs/BitbucketSourceSpec" + }, + "build_command": { + "description": "An optional build command to run while building this component from source.", + "type": "string" + }, + "dockerfile_path": { + "description": "The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.", + "type": "string" + }, + "environment_slug": { + "description": "An environment slug describing the type of this app. For a full list, please refer to [the product documentation](https://www.digitalocean.com/docs/app-platform/).", + "type": "string" + }, + "envs": { + "description": "A list of environment variables made available to the component.", + "items": { + "$ref": "#/$defs/AppVariableDefinition" + }, + "type": "array" + }, + "git": { + "$ref": "#/$defs/GitSourceSpec" + }, + "github": { + "$ref": "#/$defs/GitHubSourceSpec" + }, + "gitlab": { + "$ref": "#/$defs/GitLabSourceSpec" + }, + "image": { + "$ref": "#/$defs/ImageSourceSpec" + }, + "instance_count": { + "description": "The amount of instances that this component should be scaled to. Default 1, Minimum 1, Maximum 250. Consider using a larger instance size if your application requires more than 250 instances.", + "type": "integer" + }, + "instance_size_slug": { + "description": "The instance size to use for this component.", + "type": "string" + }, + "kind": { + "type": "string" + }, + "log_destinations": { + "description": "A list of configured log forwarding destinations.", + "items": { + "$ref": "#/$defs/AppLogDestinationSpec" + }, + "type": "array" + }, + "name": { + "description": "The name. Must be unique across all components within the same app.", + "type": "string" + }, + "run_command": { + "description": "An optional run command to override the component's default.", + "type": "string" + }, + "source_dir": { + "description": "An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.", + "type": "string" + }, + "termination": { + "$ref": "#/$defs/AppJobSpecTermination" + } + }, + "type": "object" + }, + "AppJobSpecTermination": { + "description": "AppJobSpecTermination struct for AppJobSpecTermination", + "properties": { + "grace_period_seconds": { + "description": "The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. Default: 120, Minimum 1, Maximum 600.", + "type": "integer" + } + }, + "type": "object" + }, + "AppLogDestinationSpec": { + "description": "AppLogDestinationSpec struct for AppLogDestinationSpec", + "properties": { + "datadog": { + "$ref": "#/$defs/AppLogDestinationSpecDataDog" + }, + "endpoint": { + "type": "string" + }, + "headers": { + "items": { + "$ref": "#/$defs/AppLogDestinationSpecHeader" + }, + "type": "array" + }, + "logtail": { + "$ref": "#/$defs/AppLogDestinationSpecLogtail" + }, + "name": { + "description": "Name of the log destination.", + "type": "string" + }, + "open_search": { + "$ref": "#/$defs/AppLogDestinationSpecOpenSearch" + }, + "papertrail": { + "$ref": "#/$defs/AppLogDestinationSpecPapertrail" + }, + "tls_insecure": { + "type": "boolean" + } + }, + "type": "object" + }, + "AppLogDestinationSpecDataDog": { + "description": "AppLogDestinationSpecDataDog DataDog configuration.", + "properties": { + "api_key": { + "description": "Datadog API key.", + "type": "string" + }, + "endpoint": { + "description": "Datadog HTTP log intake endpoint.", + "type": "string" + } + }, + "type": "object" + }, + "AppLogDestinationSpecHeader": { + "description": "AppLogDestinationSpecHeader struct for AppLogDestinationSpecHeader", + "properties": { + "key": { + "description": "The name", + "type": "string" + }, + "value": { + "description": "The header value.", + "type": "string" + } + }, + "type": "object" + }, + "AppLogDestinationSpecLogtail": { + "description": "AppLogDestinationSpecLogtail Logtail configuration.", + "properties": { + "token": { + "description": "Logtail token.", + "type": "string" + } + }, + "type": "object" + }, + "AppLogDestinationSpecOpenSearch": { + "description": "AppLogDestinationSpecOpenSearch OpenSearch configuration.", + "properties": { + "basic_auth": { + "$ref": "#/$defs/OpenSearchBasicAuth" + }, + "cluster_name": { + "description": "The name of a DigitalOcean DBaaS OpenSearch cluster to use as a log forwarding destination. Cannot be specified if `endpoint` is also specified.", + "type": "string" + }, + "endpoint": { + "description": "OpenSearch API Endpoint. Only HTTPS is supported. Format: https://\u003chost\u003e:\u003cport\u003e. Cannot be specified if `cluster_name` is also specified.", + "type": "string" + }, + "index_name": { + "description": "The index name to use for the logs. If not set, the default index name is \\\"logs\\\".", + "type": "string" + } + }, + "type": "object" + }, + "AppLogDestinationSpecPapertrail": { + "description": "AppLogDestinationSpecPapertrail Papertrail configuration.", + "properties": { + "endpoint": { + "description": "Papertrail syslog endpoint.", + "type": "string" + } + }, + "type": "object" + }, + "AppMaintenanceSpec": { + "description": "AppMaintenanceSpec struct for AppMaintenanceSpec", + "properties": { + "archive": { + "description": "Indicates whether the app should be archived. Setting this to true implies that enabled is set to true.", + "type": "boolean" + }, + "enabled": { + "description": "Indicates whether maintenance mode should be enabled for the app.", + "type": "boolean" + }, + "offline_page_url": { + "description": "A custom offline page to display when maintenance mode is enabled or the app is archived.", + "type": "string" + } + }, + "type": "object" + }, + "AppRouteSpec": { + "description": "AppRouteSpec struct for AppRouteSpec", + "properties": { + "path": { + "description": "(Deprecated) An HTTP path prefix. Paths must start with / and must be unique across all components within an app.", + "type": "string" + }, + "preserve_path_prefix": { + "description": "(Deprecated) An optional flag to preserve the path that is forwarded to the backend service. By default, the HTTP request path will be trimmed from the left when forwarded to the component. For example, a component with `path=/api` will have requests to `/api/list` trimmed to `/list`. If this value is `true`, the path will remain `/api/list`. Note: this is not applicable for Functions Components.", + "type": "boolean" + } + }, + "type": "object" + }, + "AppServiceSpec": { + "description": "AppServiceSpec struct for AppServiceSpec", + "properties": { + "alerts": { + "description": "A list of configured alerts which apply to the component.", + "items": { + "$ref": "#/$defs/AppAlertSpec" + }, + "type": "array" + }, + "autoscaling": { + "$ref": "#/$defs/AppAutoscalingSpec" + }, + "bitbucket": { + "$ref": "#/$defs/BitbucketSourceSpec" + }, + "build_command": { + "description": "An optional build command to run while building this component from source.", + "type": "string" + }, + "cors": { + "$ref": "#/$defs/AppCORSPolicy" + }, + "dockerfile_path": { + "description": "The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.", + "type": "string" + }, + "environment_slug": { + "description": "An environment slug describing the type of this app. For a full list, please refer to [the product documentation](https://www.digitalocean.com/docs/app-platform/).", + "type": "string" + }, + "envs": { + "description": "A list of environment variables made available to the component.", + "items": { + "$ref": "#/$defs/AppVariableDefinition" + }, + "type": "array" + }, + "git": { + "$ref": "#/$defs/GitSourceSpec" + }, + "github": { + "$ref": "#/$defs/GitHubSourceSpec" + }, + "gitlab": { + "$ref": "#/$defs/GitLabSourceSpec" + }, + "health_check": { + "$ref": "#/$defs/AppServiceSpecHealthCheck" + }, + "http_port": { + "description": "The internal port on which this service's run command will listen. Default: 8080 If there is not an environment variable with the name `PORT`, one will be automatically added with its value set to the value of this field.", + "type": "integer" + }, + "image": { + "$ref": "#/$defs/ImageSourceSpec" + }, + "instance_count": { + "description": "The amount of instances that this component should be scaled to. Default 1, Minimum 1, Maximum 250. Consider using a larger instance size if your application requires more than 250 instances.", + "type": "integer" + }, + "instance_size_slug": { + "type": "string" + }, + "internal_ports": { + "description": "The ports on which this service will listen for internal traffic.", + "items": { + "type": "integer" + }, + "type": "array" + }, + "liveness_health_check": { + "$ref": "#/$defs/HealthCheckSpec" + }, + "log_destinations": { + "description": "A list of configured log forwarding destinations.", + "items": { + "$ref": "#/$defs/AppLogDestinationSpec" + }, + "type": "array" + }, + "name": { + "description": "The name. Must be unique across all components within the same app.", + "type": "string" + }, + "protocol": { + "type": "string" + }, + "routes": { + "description": "(Deprecated) A list of HTTP routes that should be routed to this component.", + "items": { + "$ref": "#/$defs/AppRouteSpec" + }, + "type": "array" + }, + "run_command": { + "description": "An optional run command to override the component's default.", + "type": "string" + }, + "source_dir": { + "description": "An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.", + "type": "string" + }, + "termination": { + "$ref": "#/$defs/AppServiceSpecTermination" + } + }, + "type": "object" + }, + "AppServiceSpecHealthCheck": { + "description": "AppServiceSpecHealthCheck struct for AppServiceSpecHealthCheck", + "properties": { + "failure_threshold": { + "description": "The number of failed health checks before considered unhealthy. Default: 9, Minimum 1, Maximum 50. When used in liveness_health_check, Default: 18, Minimum 1, Maximum 50.", + "type": "integer" + }, + "http_path": { + "description": "The route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead.", + "type": "string" + }, + "initial_delay_seconds": { + "description": "The number of seconds to wait before beginning health checks. Default: 0 seconds, Minimum 0, Maximum 3600. When used in liveness_health_check, Default: 5 seconds, Minimum 0, Maximum 3600.", + "type": "integer" + }, + "path": { + "description": "Deprecated. Use http_path instead.", + "type": "string" + }, + "period_seconds": { + "description": "The number of seconds to wait between health checks. Default: 10 seconds, Minimum 1, Maximum 300. When used in liveness_health_check, Default: 10 seconds, Minimum 1, Maximum 300.", + "type": "integer" + }, + "port": { + "description": "The port on which the health check will be performed. If not set, the health check will be performed on the component's http_port.", + "type": "integer" + }, + "success_threshold": { + "description": "The number of successful health checks before considered healthy. Default: 1, Minimum 1, Maximum 50. When used in liveness_health_check, Default: 1, Minimum 1, Maximum 1.", + "type": "integer" + }, + "timeout_seconds": { + "description": "The number of seconds after which the check times out. Default: 1 second, Minimum 1, Maximum 120.", + "type": "integer" + } + }, + "type": "object" + }, + "AppServiceSpecTermination": { + "description": "AppServiceSpecTermination struct for AppServiceSpecTermination", + "properties": { + "drain_seconds": { + "description": "The number of seconds to wait between selecting a container instance for termination and issuing the TERM signal. Selecting a container instance for termination begins an asynchronous drain of new requests on upstream load-balancers. Default: 15 seconds, Minimum 1, Maximum 110.", + "type": "integer" + }, + "grace_period_seconds": { + "description": "The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. Default: 120, Minimum 1, Maximum 600.", + "type": "integer" + } + }, + "type": "object" + }, + "AppSpec": { + "description": "AppSpec The desired configuration of an application.", + "properties": { + "alerts": { + "description": "A list of alerts which apply to the app.", + "items": { + "$ref": "#/$defs/AppAlertSpec" + }, + "type": "array" + }, + "databases": { + "description": "Database instances which can provide persistence to workloads within the application.", + "items": { + "$ref": "#/$defs/AppDatabaseSpec" + }, + "type": "array" + }, + "disable_edge_cache": { + "description": "Specification to disable edge (CDN) cache for all domains of the app. Note that this feature is in private preview.", + "type": "boolean" + }, + "disable_email_obfuscation": { + "description": "Specification to disable email obfuscation.", + "type": "boolean" + }, + "domains": { + "description": "A set of hostnames where the application will be available.", + "items": { + "$ref": "#/$defs/AppDomainSpec" + }, + "type": "array" + }, + "egress": { + "$ref": "#/$defs/AppEgressSpec" + }, + "enhanced_threat_control_enabled": { + "description": "Specification to enable enhanced threat control mode, which takes necessary steps to prevent layer 7 DDoS for all domains of the app. Note that this feature is in private preview.", + "type": "boolean" + }, + "envs": { + "description": "A list of environment variables made available to all components in the app.", + "items": { + "$ref": "#/$defs/AppVariableDefinition" + }, + "type": "array" + }, + "features": { + "items": { + "type": "string" + }, + "type": "array" + }, + "functions": { + "description": "Workloads which expose publicly-accessible HTTP services via Functions Components.", + "items": { + "$ref": "#/$defs/AppFunctionsSpec" + }, + "type": "array" + }, + "ingress": { + "$ref": "#/$defs/AppIngressSpec" + }, + "jobs": { + "description": "Pre and post deployment workloads which do not expose publicly-accessible HTTP routes.", + "items": { + "$ref": "#/$defs/AppJobSpec" + }, + "type": "array" + }, + "maintenance": { + "$ref": "#/$defs/AppMaintenanceSpec" + }, + "name": { + "description": "The name of the app. Must be unique across all apps in the same account.", + "type": "string" + }, + "region": { + "type": "string" + }, + "services": { + "description": "Workloads which expose publicly-accessible HTTP services.", + "items": { + "$ref": "#/$defs/AppServiceSpec" + }, + "type": "array" + }, + "static_sites": { + "description": "Content which can be rendered to static web assets.", + "items": { + "$ref": "#/$defs/AppStaticSiteSpec" + }, + "type": "array" + }, + "vpc": { + "$ref": "#/$defs/AppVpcSpec" + }, + "workers": { + "description": "Workloads which do not expose publicly-accessible HTTP services.", + "items": { + "$ref": "#/$defs/AppWorkerSpec" + }, + "type": "array" + } + }, + "type": "object" + }, + "AppStaticSiteSpec": { + "description": "AppStaticSiteSpec struct for AppStaticSiteSpec", + "properties": { + "bitbucket": { + "$ref": "#/$defs/BitbucketSourceSpec" + }, + "build_command": { + "description": "An optional build command to run while building this component from source.", + "type": "string" + }, + "catchall_document": { + "description": "The name of the document to use as the fallback for any requests to documents that are not found when serving this static site. Only 1 of `catchall_document` or `error_document` can be set.", + "type": "string" + }, + "cors": { + "$ref": "#/$defs/AppCORSPolicy" + }, + "dockerfile_path": { + "description": "The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.", + "type": "string" + }, + "environment_slug": { + "description": "An environment slug describing the type of this app. For a full list, please refer to [the product documentation](https://www.digitalocean.com/docs/app-platform/).", + "type": "string" + }, + "envs": { + "description": "A list of environment variables made available to the component.", + "items": { + "$ref": "#/$defs/AppVariableDefinition" + }, + "type": "array" + }, + "error_document": { + "description": "The name of the error document to use when serving this static site. Default: 404.html. If no such file exists within the built assets, App Platform will supply one.", + "type": "string" + }, + "git": { + "$ref": "#/$defs/GitSourceSpec" + }, + "github": { + "$ref": "#/$defs/GitHubSourceSpec" + }, + "gitlab": { + "$ref": "#/$defs/GitLabSourceSpec" + }, + "index_document": { + "type": "string" + }, + "name": { + "description": "The name. Must be unique across all components within the same app.", + "type": "string" + }, + "output_dir": { + "description": "An optional path to where the built assets will be located, relative to the build context. If not set, App Platform will automatically scan for these directory names: `_static`, `dist`, `public`, `build`.", + "type": "string" + }, + "routes": { + "description": "(Deprecated) A list of HTTP routes that should be routed to this component.", + "items": { + "$ref": "#/$defs/AppRouteSpec" + }, + "type": "array" + }, + "source_dir": { + "description": "An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.", + "type": "string" + } + }, + "type": "object" + }, + "AppStringMatch": { + "description": "AppStringMatch struct for AppStringMatch", + "properties": { + "exact": { + "description": "Exact string match. Only 1 of `exact`, `prefix`, or `regex` must be set.", + "type": "string" + }, + "prefix": { + "description": "Prefix-based match. Only 1 of `exact`, `prefix`, or `regex` must be set.", + "type": "string" + }, + "regex": { + "type": "string" + } + }, + "type": "object" + }, + "AppVariableDefinition": { + "description": "AppVariableDefinition struct for AppVariableDefinition", + "properties": { + "key": { + "description": "The name", + "type": "string" + }, + "scope": { + "type": "string" + }, + "type": { + "type": "string" + }, + "value": { + "description": "The value. If the type is `SECRET`, the value will be encrypted on first submission. On following submissions, the encrypted value should be used.", + "type": "string" + } + }, + "type": "object" + }, + "AppVpcSpec": { + "description": "AppVpcSpec Configuration of VPC.", + "properties": { + "id": { + "description": "The id of the target VPC, in UUID format.", + "type": "string" + } + }, + "type": "object" + }, + "AppWorkerSpec": { + "description": "AppWorkerSpec struct for AppWorkerSpec", + "properties": { + "alerts": { + "description": "A list of configured alerts which apply to the component.", + "items": { + "$ref": "#/$defs/AppAlertSpec" + }, + "type": "array" + }, + "autoscaling": { + "$ref": "#/$defs/AppAutoscalingSpec" + }, + "bitbucket": { + "$ref": "#/$defs/BitbucketSourceSpec" + }, + "build_command": { + "description": "An optional build command to run while building this component from source.", + "type": "string" + }, + "dockerfile_path": { + "description": "The path to the Dockerfile relative to the root of the repo. If set, it will be used to build this component. Otherwise, App Platform will attempt to build it using buildpacks.", + "type": "string" + }, + "environment_slug": { + "description": "An environment slug describing the type of this app. For a full list, please refer to [the product documentation](https://www.digitalocean.com/docs/app-platform/).", + "type": "string" + }, + "envs": { + "description": "A list of environment variables made available to the component.", + "items": { + "$ref": "#/$defs/AppVariableDefinition" + }, + "type": "array" + }, + "git": { + "$ref": "#/$defs/GitSourceSpec" + }, + "github": { + "$ref": "#/$defs/GitHubSourceSpec" + }, + "gitlab": { + "$ref": "#/$defs/GitLabSourceSpec" + }, + "image": { + "$ref": "#/$defs/ImageSourceSpec" + }, + "instance_count": { + "description": "The amount of instances that this component should be scaled to. Default 1, Minimum 1, Maximum 250. Consider using a larger instance size if your application requires more than 250 instances.", + "type": "integer" + }, + "instance_size_slug": { + "description": "The instance size to use for this component.", + "type": "string" + }, + "liveness_health_check": { + "$ref": "#/$defs/HealthCheckSpec" + }, + "log_destinations": { + "description": "A list of configured log forwarding destinations.", + "items": { + "$ref": "#/$defs/AppLogDestinationSpec" + }, + "type": "array" + }, + "name": { + "description": "The name. Must be unique across all components within the same app.", + "type": "string" + }, + "run_command": { + "description": "An optional run command to override the component's default.", + "type": "string" + }, + "source_dir": { + "description": "An optional path to the working directory to use for the build. For Dockerfile builds, this will be used as the build context. Must be relative to the root of the repo.", + "type": "string" + }, + "termination": { + "$ref": "#/$defs/AppWorkerSpecTermination" + } + }, + "type": "object" + }, + "AppWorkerSpecTermination": { + "description": "AppWorkerSpecTermination struct for AppWorkerSpecTermination", + "properties": { + "grace_period_seconds": { + "description": "The number of seconds to wait between sending a TERM signal to a container and issuing a KILL which causes immediate shutdown. Default: 120, Minimum 1, Maximum 600.", + "type": "integer" + } + }, + "type": "object" + }, + "BitbucketSourceSpec": { + "description": "BitbucketSourceSpec struct for BitbucketSourceSpec", + "properties": { + "branch": { + "type": "string" + }, + "deploy_on_push": { + "type": "boolean" + }, + "repo": { + "type": "string" + } + }, + "type": "object" + }, + "GitHubSourceSpec": { + "description": "GitHubSourceSpec struct for GitHubSourceSpec", + "properties": { + "branch": { + "type": "string" + }, + "deploy_on_push": { + "type": "boolean" + }, + "repo": { + "type": "string" + } + }, + "type": "object" + }, + "GitLabSourceSpec": { + "description": "GitLabSourceSpec struct for GitLabSourceSpec", + "properties": { + "branch": { + "type": "string" + }, + "deploy_on_push": { + "type": "boolean" + }, + "repo": { + "type": "string" + } + }, + "type": "object" + }, + "GitSourceSpec": { + "description": "GitSourceSpec struct for GitSourceSpec", + "properties": { + "branch": { + "type": "string" + }, + "repo_clone_url": { + "type": "string" + } + }, + "type": "object" + }, + "HealthCheckSpec": { + "description": "HealthCheckSpec struct for HealthCheckSpec", + "properties": { + "failure_threshold": { + "description": "The number of failed health checks before considered unhealthy. Default: 18 seconds, Minimum 1, Maximum 50.", + "type": "integer" + }, + "http_path": { + "description": "The route path used for the HTTP health check ping. If not set, the HTTP health check will be disabled and a TCP health check used instead.", + "type": "string" + }, + "initial_delay_seconds": { + "description": "The number of seconds to wait before beginning health checks. Default: 5 seconds, Minimum 0, Maximum 3600.", + "type": "integer" + }, + "period_seconds": { + "description": "The number of seconds to wait between health checks. Default: 10 seconds, Minimum 1, Maximum 300.", + "type": "integer" + }, + "port": { + "description": "The port on which the health check will be performed.", + "type": "integer" + }, + "success_threshold": { + "description": "The number of successful health checks before considered healthy. Default: 1 second, Minimum 1, Maximum 1.", + "type": "integer" + }, + "timeout_seconds": { + "description": "The number of seconds after which the check times out. Default: 1 second, Minimum 1, Maximum 120.", + "type": "integer" + } + }, + "type": "object" + }, + "ImageSourceSpec": { + "description": "ImageSourceSpec struct for ImageSourceSpec", + "properties": { + "deploy_on_push": { + "$ref": "#/$defs/ImageSourceSpecDeployOnPush" + }, + "digest": { + "description": "The image digest. Cannot be specified if tag is provided.", + "type": "string" + }, + "registry": { + "description": "The registry name. Must be left empty for the `DOCR` registry type. Required for the `DOCKER_HUB` registry type.", + "type": "string" + }, + "registry_credentials": { + "description": "The credentials to be able to pull the image. The value will be encrypted on first submission. On following submissions, the encrypted value should be used. - \\\"$username:$access_token\\\" for registries of type `DOCKER_HUB`. - \\\"$username:$access_token\\\" for registries of type `GHCR`.", + "type": "string" + }, + "registry_type": { + "type": "string" + }, + "repository": { + "description": "The repository name.", + "type": "string" + }, + "tag": { + "description": "The repository tag. Defaults to `latest` if not provided and no digest is provided. Cannot be specified if digest is provided.", + "type": "string" + } + }, + "type": "object" + }, + "ImageSourceSpecDeployOnPush": { + "description": "ImageSourceSpecDeployOnPush struct for ImageSourceSpecDeployOnPush", + "properties": { + "enabled": { + "description": "Automatically deploy new images. Only for DOCR images. Can't be enabled when a specific digest is specified.", + "type": "boolean" + } + }, + "type": "object" + }, + "OpenSearchBasicAuth": { + "description": "OpenSearchBasicAuth Configure Username and/or Password for Basic authentication.", + "properties": { + "password": { + "description": "Password for user defined in User. Is required when `endpoint` is set. Cannot be set if using a DigitalOcean DBaaS OpenSearch cluster.", + "type": "string" + }, + "user": { + "description": "Username to authenticate with. Only required when `endpoint` is set. Defaults to `doadmin` when `cluster_name` is set.", + "type": "string" + } + }, + "type": "object" + } + }, + "$id": "https://github.com/digitalocean/godo/app-create-request", + "$ref": "#/$defs/AppCreateRequest", + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/internal/apps/spec/app-update-schema.draft-07.json b/internal/apps/spec/app-update-schema.draft-07.json new file mode 100644 index 0000000..f56828e --- /dev/null +++ b/internal/apps/spec/app-update-schema.draft-07.json @@ -0,0 +1,25 @@ +{ + "$defs": { + "AppUpdate": { + "properties": { + "update": { + "$ref": "#/$defs/AppUpdateRequest" + } + }, + "type": "object" + }, + "AppUpdateRequest": { + "properties": { + "app_id": { + "type": "string" + }, + "request": { + "$ref": "#/$defs/AppUpdateRequest" + } + }, + "type": "object" + } + }, + "$ref": "#/$defs/AppUpdate", + "$schema": "http://json-schema.org/draft-07/schema#" +} \ No newline at end of file diff --git a/internal/apps/spec/generate.go b/internal/apps/spec/generate.go index f83541d..031cea4 100644 --- a/internal/apps/spec/generate.go +++ b/internal/apps/spec/generate.go @@ -1,15 +1,15 @@ package main import ( - "bytes" "encoding/json" "fmt" "os" "mcp-digitalocean/internal/apps" - + "github.com/digitalocean/godo" "github.com/invopop/jsonschema" + // "github.com/wk8/go-ordered-map/v2" // added for ordered map ) //go:generate go run . @@ -17,58 +17,68 @@ import ( // We generate the JSON schema from godo structs for AppCreateRequest and AppUpdateRequest. // This is necessary since we need to pass the AppSpec to the mcp tool as a raw argument. // Ideally, we shouldn't have to copy the godo files around. However, it's currently not possible to without preserving the struct comments. +// modified the function to a direct way to fix the issue for schema 2020-12 problems and add the logic that intercepts the generated schema and changes its version to draft-07. func main() { reflect := jsonschema.Reflector{ - BaseSchemaID: "", - Anonymous: true, - AssignAnchor: false, AllowAdditionalProperties: true, RequiredFromJSONSchemaTags: true, - DoNotReference: true, - ExpandedStruct: true, - FieldNameTag: "", } - err := reflect.AddGoComments("github.com/digitalocean/godo", "./") if err != nil { panic(fmt.Errorf("failed to add Go comments: %w", err)) } - createSchema, err := reflect.Reflect(&godo.AppCreateRequest{}).MarshalJSON() + // Generate schema for AppCreateRequest + createSchemaObject := reflect.Reflect(&godo.AppCreateRequest{}) + + createSchemaBytes, err := json.Marshal(createSchemaObject) if err != nil { panic(fmt.Errorf("failed to marshal app create schema: %w", err)) } - var createSchemaJSON bytes.Buffer - if err := json.Indent(&createSchemaJSON, createSchema, "", " "); err != nil { - panic(fmt.Errorf("failed to indent JSON: %w", err)) + var createSchemaMap map[string]interface{} + if err := json.Unmarshal(createSchemaBytes, &createSchemaMap); err != nil { + panic(fmt.Errorf("failed to unmarshal create schema to map: %w", err)) } + + createSchemaMap["$schema"] = "http://json-schema.org/draft-07/schema#" - // now write the schema to a file - err = os.WriteFile("./app-create-schema.json", createSchemaJSON.Bytes(), 0644) + finalCreateSchema, err := json.MarshalIndent(createSchemaMap, "", " ") + if err != nil { + panic(fmt.Errorf("failed to marshal final create schema: %w", err)) + } + + // Write the schema to a file + err = os.WriteFile("./app-create-schema.draft-07.json", finalCreateSchema, 0644) if err != nil { panic(fmt.Errorf("failed to write schema to file: %w", err)) } + fmt.Println("Draft-07 schema successfully written to app-create-schema.draft-07.json") - fmt.Println("Schema successfully written to app_create_schema.json") - // Generate schema for AppUpdateRequest - updateSchema, err := reflect.Reflect(&apps.AppUpdate{}).MarshalJSON() + // Generate schema for AppUpdateRequest + updateSchemaObject := reflect.Reflect(&apps.AppUpdate{}) + + updateSchemaBytes, err := json.Marshal(updateSchemaObject) if err != nil { panic(fmt.Errorf("failed to marshal app update schema: %w", err)) } - // Prettify the JSON - var updateSchemaJSON bytes.Buffer - if err := json.Indent(&updateSchemaJSON, updateSchema, "", " "); err != nil { - panic(fmt.Errorf("failed to indent JSON: %w", err)) + var updateSchemaMap map[string]interface{} + if err := json.Unmarshal(updateSchemaBytes, &updateSchemaMap); err != nil { + panic(fmt.Errorf("failed to unmarshal update schema to map: %w", err)) + } + + updateSchemaMap["$schema"] = "http://json-schema.org/draft-07/schema#" + + finalUpdateSchema, err := json.MarshalIndent(updateSchemaMap, "", " ") + if err != nil { + panic(fmt.Errorf("failed to marshal final update schema: %w", err)) } - // Write the schema to a file - err = os.WriteFile("./app-update-schema.json", updateSchemaJSON.Bytes(), 0644) + err = os.WriteFile("./app-update-schema.draft-07.json", finalUpdateSchema, 0644) if err != nil { panic(fmt.Errorf("failed to write schema to file: %w", err)) } - - fmt.Println("Update schema successfully written to app_update_schema.json") -} + fmt.Println("Draft-07 update schema successfully written to app-update-schema.draft-07.json") +} \ No newline at end of file diff --git a/internal/common/mocks.go b/internal/common/mocks.go index fec0454..43d3b5f 100644 --- a/internal/common/mocks.go +++ b/internal/common/mocks.go @@ -21,6 +21,7 @@ import ( type MockRegionsService struct { ctrl *gomock.Controller recorder *MockRegionsServiceMockRecorder + isgomock struct{} } // MockRegionsServiceMockRecorder is the mock recorder for MockRegionsService. diff --git a/internal/doks/spec/cluster-create-schema.json b/internal/doks/spec/cluster-create-schema.json index 4de2978..3cfe59f 100644 --- a/internal/doks/spec/cluster-create-schema.json +++ b/internal/doks/spec/cluster-create-schema.json @@ -145,6 +145,22 @@ } }, "type": "object" + }, + "amd_gpu_device_plugin": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" + }, + "amd_gpu_device_metrics_exporter_plugin": { + "properties": { + "enabled": { + "type": "boolean" + } + }, + "type": "object" } }, "type": "object" diff --git a/internal/droplet/mocks.go b/internal/droplet/mocks.go index 4aa4053..475e38f 100644 --- a/internal/droplet/mocks.go +++ b/internal/droplet/mocks.go @@ -21,6 +21,7 @@ import ( type MockDropletsService struct { ctrl *gomock.Controller recorder *MockDropletsServiceMockRecorder + isgomock struct{} } // MockDropletsServiceMockRecorder is the mock recorder for MockDropletsService. @@ -314,6 +315,7 @@ func (mr *MockDropletsServiceMockRecorder) Snapshots(arg0, arg1, arg2 any) *gomo type MockDropletActionsService struct { ctrl *gomock.Controller recorder *MockDropletActionsServiceMockRecorder + isgomock struct{} } // MockDropletActionsServiceMockRecorder is the mock recorder for MockDropletActionsService. @@ -817,6 +819,7 @@ func (mr *MockDropletActionsServiceMockRecorder) SnapshotByTag(arg0, arg1, arg2 type MockSizesService struct { ctrl *gomock.Controller recorder *MockSizesServiceMockRecorder + isgomock struct{} } // MockSizesServiceMockRecorder is the mock recorder for MockSizesService. @@ -856,6 +859,7 @@ func (mr *MockSizesServiceMockRecorder) List(arg0, arg1 any) *gomock.Call { type MockImagesService struct { ctrl *gomock.Controller recorder *MockImagesServiceMockRecorder + isgomock struct{} } // MockImagesServiceMockRecorder is the mock recorder for MockImagesService. @@ -955,9 +959,9 @@ func (mr *MockImagesServiceMockRecorder) List(arg0, arg1 any) *gomock.Call { } // ListApplication mocks base method. -func (m *MockImagesService) ListApplication(arg0 context.Context, arg1 *godo.ListOptions) ([]godo.Image, *godo.Response, error) { +func (m *MockImagesService) ListApplication(ctx context.Context, opt *godo.ListOptions) ([]godo.Image, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListApplication", arg0, arg1) + ret := m.ctrl.Call(m, "ListApplication", ctx, opt) ret0, _ := ret[0].([]godo.Image) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -965,15 +969,15 @@ func (m *MockImagesService) ListApplication(arg0 context.Context, arg1 *godo.Lis } // ListApplication indicates an expected call of ListApplication. -func (mr *MockImagesServiceMockRecorder) ListApplication(arg0, arg1 any) *gomock.Call { +func (mr *MockImagesServiceMockRecorder) ListApplication(ctx, opt any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListApplication", reflect.TypeOf((*MockImagesService)(nil).ListApplication), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListApplication", reflect.TypeOf((*MockImagesService)(nil).ListApplication), ctx, opt) } // ListByTag mocks base method. -func (m *MockImagesService) ListByTag(arg0 context.Context, arg1 string, arg2 *godo.ListOptions) ([]godo.Image, *godo.Response, error) { +func (m *MockImagesService) ListByTag(ctx context.Context, tag string, opt *godo.ListOptions) ([]godo.Image, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListByTag", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "ListByTag", ctx, tag, opt) ret0, _ := ret[0].([]godo.Image) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -981,15 +985,15 @@ func (m *MockImagesService) ListByTag(arg0 context.Context, arg1 string, arg2 *g } // ListByTag indicates an expected call of ListByTag. -func (mr *MockImagesServiceMockRecorder) ListByTag(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockImagesServiceMockRecorder) ListByTag(ctx, tag, opt any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByTag", reflect.TypeOf((*MockImagesService)(nil).ListByTag), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListByTag", reflect.TypeOf((*MockImagesService)(nil).ListByTag), ctx, tag, opt) } // ListDistribution mocks base method. -func (m *MockImagesService) ListDistribution(arg0 context.Context, arg1 *godo.ListOptions) ([]godo.Image, *godo.Response, error) { +func (m *MockImagesService) ListDistribution(ctx context.Context, opt *godo.ListOptions) ([]godo.Image, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListDistribution", arg0, arg1) + ret := m.ctrl.Call(m, "ListDistribution", ctx, opt) ret0, _ := ret[0].([]godo.Image) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -997,15 +1001,15 @@ func (m *MockImagesService) ListDistribution(arg0 context.Context, arg1 *godo.Li } // ListDistribution indicates an expected call of ListDistribution. -func (mr *MockImagesServiceMockRecorder) ListDistribution(arg0, arg1 any) *gomock.Call { +func (mr *MockImagesServiceMockRecorder) ListDistribution(ctx, opt any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListDistribution", reflect.TypeOf((*MockImagesService)(nil).ListDistribution), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListDistribution", reflect.TypeOf((*MockImagesService)(nil).ListDistribution), ctx, opt) } // ListUser mocks base method. -func (m *MockImagesService) ListUser(arg0 context.Context, arg1 *godo.ListOptions) ([]godo.Image, *godo.Response, error) { +func (m *MockImagesService) ListUser(ctx context.Context, opt *godo.ListOptions) ([]godo.Image, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "ListUser", arg0, arg1) + ret := m.ctrl.Call(m, "ListUser", ctx, opt) ret0, _ := ret[0].([]godo.Image) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -1013,9 +1017,9 @@ func (m *MockImagesService) ListUser(arg0 context.Context, arg1 *godo.ListOption } // ListUser indicates an expected call of ListUser. -func (mr *MockImagesServiceMockRecorder) ListUser(arg0, arg1 any) *gomock.Call { +func (mr *MockImagesServiceMockRecorder) ListUser(ctx, opt any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListUser", reflect.TypeOf((*MockImagesService)(nil).ListUser), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ListUser", reflect.TypeOf((*MockImagesService)(nil).ListUser), ctx, opt) } // Update mocks base method. diff --git a/internal/networking/mocks.go b/internal/networking/mocks.go index c452db8..12be675 100644 --- a/internal/networking/mocks.go +++ b/internal/networking/mocks.go @@ -21,6 +21,7 @@ import ( type MockCertificatesService struct { ctrl *gomock.Controller recorder *MockCertificatesServiceMockRecorder + isgomock struct{} } // MockCertificatesServiceMockRecorder is the mock recorder for MockCertificatesService. @@ -123,6 +124,7 @@ func (mr *MockCertificatesServiceMockRecorder) ListByName(arg0, arg1, arg2 any) type MockDomainsService struct { ctrl *gomock.Controller recorder *MockDomainsServiceMockRecorder + isgomock struct{} } // MockDomainsServiceMockRecorder is the mock recorder for MockDomainsService. @@ -336,6 +338,7 @@ func (mr *MockDomainsServiceMockRecorder) RecordsByTypeAndName(arg0, arg1, arg2, type MockFirewallsService struct { ctrl *gomock.Controller recorder *MockFirewallsServiceMockRecorder + isgomock struct{} } // MockFirewallsServiceMockRecorder is the mock recorder for MockFirewallsService. @@ -564,6 +567,7 @@ func (mr *MockFirewallsServiceMockRecorder) Update(arg0, arg1, arg2 any) *gomock type MockPartnerAttachmentService struct { ctrl *gomock.Controller recorder *MockPartnerAttachmentServiceMockRecorder + isgomock struct{} } // MockPartnerAttachmentServiceMockRecorder is the mock recorder for MockPartnerAttachmentService. @@ -631,9 +635,9 @@ func (mr *MockPartnerAttachmentServiceMockRecorder) Get(arg0, arg1 any) *gomock. } // GetBGPAuthKey mocks base method. -func (m *MockPartnerAttachmentService) GetBGPAuthKey(arg0 context.Context, arg1 string) (*godo.BgpAuthKey, *godo.Response, error) { +func (m *MockPartnerAttachmentService) GetBGPAuthKey(ctx context.Context, iaID string) (*godo.BgpAuthKey, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "GetBGPAuthKey", arg0, arg1) + ret := m.ctrl.Call(m, "GetBGPAuthKey", ctx, iaID) ret0, _ := ret[0].(*godo.BgpAuthKey) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -641,9 +645,9 @@ func (m *MockPartnerAttachmentService) GetBGPAuthKey(arg0 context.Context, arg1 } // GetBGPAuthKey indicates an expected call of GetBGPAuthKey. -func (mr *MockPartnerAttachmentServiceMockRecorder) GetBGPAuthKey(arg0, arg1 any) *gomock.Call { +func (mr *MockPartnerAttachmentServiceMockRecorder) GetBGPAuthKey(ctx, iaID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBGPAuthKey", reflect.TypeOf((*MockPartnerAttachmentService)(nil).GetBGPAuthKey), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetBGPAuthKey", reflect.TypeOf((*MockPartnerAttachmentService)(nil).GetBGPAuthKey), ctx, iaID) } // GetServiceKey mocks base method. @@ -695,9 +699,9 @@ func (mr *MockPartnerAttachmentServiceMockRecorder) ListRoutes(arg0, arg1, arg2 } // RegenerateServiceKey mocks base method. -func (m *MockPartnerAttachmentService) RegenerateServiceKey(arg0 context.Context, arg1 string) (*godo.RegenerateServiceKey, *godo.Response, error) { +func (m *MockPartnerAttachmentService) RegenerateServiceKey(ctx context.Context, iaID string) (*godo.RegenerateServiceKey, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "RegenerateServiceKey", arg0, arg1) + ret := m.ctrl.Call(m, "RegenerateServiceKey", ctx, iaID) ret0, _ := ret[0].(*godo.RegenerateServiceKey) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -705,9 +709,9 @@ func (m *MockPartnerAttachmentService) RegenerateServiceKey(arg0 context.Context } // RegenerateServiceKey indicates an expected call of RegenerateServiceKey. -func (mr *MockPartnerAttachmentServiceMockRecorder) RegenerateServiceKey(arg0, arg1 any) *gomock.Call { +func (mr *MockPartnerAttachmentServiceMockRecorder) RegenerateServiceKey(ctx, iaID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegenerateServiceKey", reflect.TypeOf((*MockPartnerAttachmentService)(nil).RegenerateServiceKey), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RegenerateServiceKey", reflect.TypeOf((*MockPartnerAttachmentService)(nil).RegenerateServiceKey), ctx, iaID) } // SetRoutes mocks base method. @@ -746,6 +750,7 @@ func (mr *MockPartnerAttachmentServiceMockRecorder) Update(arg0, arg1, arg2 any) type MockReservedIPsService struct { ctrl *gomock.Controller recorder *MockReservedIPsServiceMockRecorder + isgomock struct{} } // MockReservedIPsServiceMockRecorder is the mock recorder for MockReservedIPsService. @@ -832,6 +837,7 @@ func (mr *MockReservedIPsServiceMockRecorder) List(arg0, arg1 any) *gomock.Call type MockReservedIPV6sService struct { ctrl *gomock.Controller recorder *MockReservedIPV6sServiceMockRecorder + isgomock struct{} } // MockReservedIPV6sServiceMockRecorder is the mock recorder for MockReservedIPV6sService. @@ -918,6 +924,7 @@ func (mr *MockReservedIPV6sServiceMockRecorder) List(arg0, arg1 any) *gomock.Cal type MockReservedIPActionsService struct { ctrl *gomock.Controller recorder *MockReservedIPActionsServiceMockRecorder + isgomock struct{} } // MockReservedIPActionsServiceMockRecorder is the mock recorder for MockReservedIPActionsService. @@ -938,9 +945,9 @@ func (m *MockReservedIPActionsService) EXPECT() *MockReservedIPActionsServiceMoc } // Assign mocks base method. -func (m *MockReservedIPActionsService) Assign(arg0 context.Context, arg1 string, arg2 int) (*godo.Action, *godo.Response, error) { +func (m *MockReservedIPActionsService) Assign(ctx context.Context, ip string, dropletID int) (*godo.Action, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Assign", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "Assign", ctx, ip, dropletID) ret0, _ := ret[0].(*godo.Action) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -948,15 +955,15 @@ func (m *MockReservedIPActionsService) Assign(arg0 context.Context, arg1 string, } // Assign indicates an expected call of Assign. -func (mr *MockReservedIPActionsServiceMockRecorder) Assign(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockReservedIPActionsServiceMockRecorder) Assign(ctx, ip, dropletID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Assign", reflect.TypeOf((*MockReservedIPActionsService)(nil).Assign), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Assign", reflect.TypeOf((*MockReservedIPActionsService)(nil).Assign), ctx, ip, dropletID) } // Get mocks base method. -func (m *MockReservedIPActionsService) Get(arg0 context.Context, arg1 string, arg2 int) (*godo.Action, *godo.Response, error) { +func (m *MockReservedIPActionsService) Get(ctx context.Context, ip string, actionID int) (*godo.Action, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Get", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "Get", ctx, ip, actionID) ret0, _ := ret[0].(*godo.Action) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -964,15 +971,15 @@ func (m *MockReservedIPActionsService) Get(arg0 context.Context, arg1 string, ar } // Get indicates an expected call of Get. -func (mr *MockReservedIPActionsServiceMockRecorder) Get(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockReservedIPActionsServiceMockRecorder) Get(ctx, ip, actionID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockReservedIPActionsService)(nil).Get), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Get", reflect.TypeOf((*MockReservedIPActionsService)(nil).Get), ctx, ip, actionID) } // List mocks base method. -func (m *MockReservedIPActionsService) List(arg0 context.Context, arg1 string, arg2 *godo.ListOptions) ([]godo.Action, *godo.Response, error) { +func (m *MockReservedIPActionsService) List(ctx context.Context, ip string, opt *godo.ListOptions) ([]godo.Action, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "List", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "List", ctx, ip, opt) ret0, _ := ret[0].([]godo.Action) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -980,15 +987,15 @@ func (m *MockReservedIPActionsService) List(arg0 context.Context, arg1 string, a } // List indicates an expected call of List. -func (mr *MockReservedIPActionsServiceMockRecorder) List(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockReservedIPActionsServiceMockRecorder) List(ctx, ip, opt any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockReservedIPActionsService)(nil).List), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "List", reflect.TypeOf((*MockReservedIPActionsService)(nil).List), ctx, ip, opt) } // Unassign mocks base method. -func (m *MockReservedIPActionsService) Unassign(arg0 context.Context, arg1 string) (*godo.Action, *godo.Response, error) { +func (m *MockReservedIPActionsService) Unassign(ctx context.Context, ip string) (*godo.Action, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Unassign", arg0, arg1) + ret := m.ctrl.Call(m, "Unassign", ctx, ip) ret0, _ := ret[0].(*godo.Action) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -996,15 +1003,16 @@ func (m *MockReservedIPActionsService) Unassign(arg0 context.Context, arg1 strin } // Unassign indicates an expected call of Unassign. -func (mr *MockReservedIPActionsServiceMockRecorder) Unassign(arg0, arg1 any) *gomock.Call { +func (mr *MockReservedIPActionsServiceMockRecorder) Unassign(ctx, ip any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unassign", reflect.TypeOf((*MockReservedIPActionsService)(nil).Unassign), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unassign", reflect.TypeOf((*MockReservedIPActionsService)(nil).Unassign), ctx, ip) } // MockReservedIPV6ActionsService is a mock of ReservedIPV6ActionsService interface. type MockReservedIPV6ActionsService struct { ctrl *gomock.Controller recorder *MockReservedIPV6ActionsServiceMockRecorder + isgomock struct{} } // MockReservedIPV6ActionsServiceMockRecorder is the mock recorder for MockReservedIPV6ActionsService. @@ -1025,9 +1033,9 @@ func (m *MockReservedIPV6ActionsService) EXPECT() *MockReservedIPV6ActionsServic } // Assign mocks base method. -func (m *MockReservedIPV6ActionsService) Assign(arg0 context.Context, arg1 string, arg2 int) (*godo.Action, *godo.Response, error) { +func (m *MockReservedIPV6ActionsService) Assign(ctx context.Context, ip string, dropletID int) (*godo.Action, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Assign", arg0, arg1, arg2) + ret := m.ctrl.Call(m, "Assign", ctx, ip, dropletID) ret0, _ := ret[0].(*godo.Action) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -1035,15 +1043,15 @@ func (m *MockReservedIPV6ActionsService) Assign(arg0 context.Context, arg1 strin } // Assign indicates an expected call of Assign. -func (mr *MockReservedIPV6ActionsServiceMockRecorder) Assign(arg0, arg1, arg2 any) *gomock.Call { +func (mr *MockReservedIPV6ActionsServiceMockRecorder) Assign(ctx, ip, dropletID any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Assign", reflect.TypeOf((*MockReservedIPV6ActionsService)(nil).Assign), arg0, arg1, arg2) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Assign", reflect.TypeOf((*MockReservedIPV6ActionsService)(nil).Assign), ctx, ip, dropletID) } // Unassign mocks base method. -func (m *MockReservedIPV6ActionsService) Unassign(arg0 context.Context, arg1 string) (*godo.Action, *godo.Response, error) { +func (m *MockReservedIPV6ActionsService) Unassign(ctx context.Context, ip string) (*godo.Action, *godo.Response, error) { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "Unassign", arg0, arg1) + ret := m.ctrl.Call(m, "Unassign", ctx, ip) ret0, _ := ret[0].(*godo.Action) ret1, _ := ret[1].(*godo.Response) ret2, _ := ret[2].(error) @@ -1051,15 +1059,16 @@ func (m *MockReservedIPV6ActionsService) Unassign(arg0 context.Context, arg1 str } // Unassign indicates an expected call of Unassign. -func (mr *MockReservedIPV6ActionsServiceMockRecorder) Unassign(arg0, arg1 any) *gomock.Call { +func (mr *MockReservedIPV6ActionsServiceMockRecorder) Unassign(ctx, ip any) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unassign", reflect.TypeOf((*MockReservedIPV6ActionsService)(nil).Unassign), arg0, arg1) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Unassign", reflect.TypeOf((*MockReservedIPV6ActionsService)(nil).Unassign), ctx, ip) } // MockVPCsService is a mock of VPCsService interface. type MockVPCsService struct { ctrl *gomock.Controller recorder *MockVPCsServiceMockRecorder + isgomock struct{} } // MockVPCsServiceMockRecorder is the mock recorder for MockVPCsService. diff --git a/internal/spaces/mocks.go b/internal/spaces/mocks.go index eb06508..d09cdc0 100644 --- a/internal/spaces/mocks.go +++ b/internal/spaces/mocks.go @@ -21,6 +21,7 @@ import ( type MockSpacesKeysService struct { ctrl *gomock.Controller recorder *MockSpacesKeysServiceMockRecorder + isgomock struct{} } // MockSpacesKeysServiceMockRecorder is the mock recorder for MockSpacesKeysService. @@ -123,6 +124,7 @@ func (mr *MockSpacesKeysServiceMockRecorder) Update(arg0, arg1, arg2 any) *gomoc type MockCDNService struct { ctrl *gomock.Controller recorder *MockCDNServiceMockRecorder + isgomock struct{} } // MockCDNServiceMockRecorder is the mock recorder for MockCDNService. diff --git a/myappspec.yaml b/myappspec.yaml new file mode 100644 index 0000000..6e10201 --- /dev/null +++ b/myappspec.yaml @@ -0,0 +1,7 @@ +name: my-test-app +region: nyc3 +services: + - name: web + git: + repo_clone_url: https://github.com/digitalocean/sample-nodejs.git + branch: main \ No newline at end of file