Rename UpdateRepositoryParams to UpdateEntityParams

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2023-07-04 23:47:55 +00:00
parent 6c6c6636ba
commit 86ed06d6ff
24 changed files with 44 additions and 44 deletions

View file

@ -26,7 +26,7 @@ type RepoStore interface {
GetRepositoryByID(ctx context.Context, repoID string) (params.Repository, error)
ListRepositories(ctx context.Context) ([]params.Repository, error)
DeleteRepository(ctx context.Context, repoID string) error
UpdateRepository(ctx context.Context, repoID string, param params.UpdateRepositoryParams) (params.Repository, error)
UpdateRepository(ctx context.Context, repoID string, param params.UpdateEntityParams) (params.Repository, error)
CreateRepositoryPool(ctx context.Context, repoId string, param params.CreatePoolParams) (params.Pool, error)
@ -45,7 +45,7 @@ type OrgStore interface {
GetOrganizationByID(ctx context.Context, orgID string) (params.Organization, error)
ListOrganizations(ctx context.Context) ([]params.Organization, error)
DeleteOrganization(ctx context.Context, orgID string) error
UpdateOrganization(ctx context.Context, orgID string, param params.UpdateRepositoryParams) (params.Organization, error)
UpdateOrganization(ctx context.Context, orgID string, param params.UpdateEntityParams) (params.Organization, error)
CreateOrganizationPool(ctx context.Context, orgId string, param params.CreatePoolParams) (params.Pool, error)
GetOrganizationPool(ctx context.Context, orgID, poolID string) (params.Pool, error)
@ -63,7 +63,7 @@ type EnterpriseStore interface {
GetEnterpriseByID(ctx context.Context, enterpriseID string) (params.Enterprise, error)
ListEnterprises(ctx context.Context) ([]params.Enterprise, error)
DeleteEnterprise(ctx context.Context, enterpriseID string) error
UpdateEnterprise(ctx context.Context, enterpriseID string, param params.UpdateRepositoryParams) (params.Enterprise, error)
UpdateEnterprise(ctx context.Context, enterpriseID string, param params.UpdateEntityParams) (params.Enterprise, error)
CreateEnterprisePool(ctx context.Context, enterpriseID string, param params.CreatePoolParams) (params.Pool, error)
GetEnterprisePool(ctx context.Context, enterpriseID, poolID string) (params.Pool, error)

View file

@ -1165,21 +1165,21 @@ func (_m *Store) PoolInstanceCount(ctx context.Context, poolID string) (int64, e
}
// UpdateEnterprise provides a mock function with given fields: ctx, enterpriseID, param
func (_m *Store) UpdateEnterprise(ctx context.Context, enterpriseID string, param params.UpdateRepositoryParams) (params.Enterprise, error) {
func (_m *Store) UpdateEnterprise(ctx context.Context, enterpriseID string, param params.UpdateEntityParams) (params.Enterprise, error) {
ret := _m.Called(ctx, enterpriseID, param)
var r0 params.Enterprise
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, params.UpdateRepositoryParams) (params.Enterprise, error)); ok {
if rf, ok := ret.Get(0).(func(context.Context, string, params.UpdateEntityParams) (params.Enterprise, error)); ok {
return rf(ctx, enterpriseID, param)
}
if rf, ok := ret.Get(0).(func(context.Context, string, params.UpdateRepositoryParams) params.Enterprise); ok {
if rf, ok := ret.Get(0).(func(context.Context, string, params.UpdateEntityParams) params.Enterprise); ok {
r0 = rf(ctx, enterpriseID, param)
} else {
r0 = ret.Get(0).(params.Enterprise)
}
if rf, ok := ret.Get(1).(func(context.Context, string, params.UpdateRepositoryParams) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, string, params.UpdateEntityParams) error); ok {
r1 = rf(ctx, enterpriseID, param)
} else {
r1 = ret.Error(1)
@ -1237,21 +1237,21 @@ func (_m *Store) UpdateInstance(ctx context.Context, instanceID string, param pa
}
// UpdateOrganization provides a mock function with given fields: ctx, orgID, param
func (_m *Store) UpdateOrganization(ctx context.Context, orgID string, param params.UpdateRepositoryParams) (params.Organization, error) {
func (_m *Store) UpdateOrganization(ctx context.Context, orgID string, param params.UpdateEntityParams) (params.Organization, error) {
ret := _m.Called(ctx, orgID, param)
var r0 params.Organization
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, params.UpdateRepositoryParams) (params.Organization, error)); ok {
if rf, ok := ret.Get(0).(func(context.Context, string, params.UpdateEntityParams) (params.Organization, error)); ok {
return rf(ctx, orgID, param)
}
if rf, ok := ret.Get(0).(func(context.Context, string, params.UpdateRepositoryParams) params.Organization); ok {
if rf, ok := ret.Get(0).(func(context.Context, string, params.UpdateEntityParams) params.Organization); ok {
r0 = rf(ctx, orgID, param)
} else {
r0 = ret.Get(0).(params.Organization)
}
if rf, ok := ret.Get(1).(func(context.Context, string, params.UpdateRepositoryParams) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, string, params.UpdateEntityParams) error); ok {
r1 = rf(ctx, orgID, param)
} else {
r1 = ret.Error(1)
@ -1285,21 +1285,21 @@ func (_m *Store) UpdateOrganizationPool(ctx context.Context, orgID string, poolI
}
// UpdateRepository provides a mock function with given fields: ctx, repoID, param
func (_m *Store) UpdateRepository(ctx context.Context, repoID string, param params.UpdateRepositoryParams) (params.Repository, error) {
func (_m *Store) UpdateRepository(ctx context.Context, repoID string, param params.UpdateEntityParams) (params.Repository, error) {
ret := _m.Called(ctx, repoID, param)
var r0 params.Repository
var r1 error
if rf, ok := ret.Get(0).(func(context.Context, string, params.UpdateRepositoryParams) (params.Repository, error)); ok {
if rf, ok := ret.Get(0).(func(context.Context, string, params.UpdateEntityParams) (params.Repository, error)); ok {
return rf(ctx, repoID, param)
}
if rf, ok := ret.Get(0).(func(context.Context, string, params.UpdateRepositoryParams) params.Repository); ok {
if rf, ok := ret.Get(0).(func(context.Context, string, params.UpdateEntityParams) params.Repository); ok {
r0 = rf(ctx, repoID, param)
} else {
r0 = ret.Get(0).(params.Repository)
}
if rf, ok := ret.Get(1).(func(context.Context, string, params.UpdateRepositoryParams) error); ok {
if rf, ok := ret.Get(1).(func(context.Context, string, params.UpdateEntityParams) error); ok {
r1 = rf(ctx, repoID, param)
} else {
r1 = ret.Error(1)

View file

@ -99,7 +99,7 @@ func (s *sqlDatabase) DeleteEnterprise(ctx context.Context, enterpriseID string)
return nil
}
func (s *sqlDatabase) UpdateEnterprise(ctx context.Context, enterpriseID string, param params.UpdateRepositoryParams) (params.Enterprise, error) {
func (s *sqlDatabase) UpdateEnterprise(ctx context.Context, enterpriseID string, param params.UpdateEntityParams) (params.Enterprise, error) {
enterprise, err := s.getEnterpriseByID(ctx, enterpriseID)
if err != nil {
return params.Enterprise{}, errors.Wrap(err, "fetching enterprise")

View file

@ -40,7 +40,7 @@ type EnterpriseTestFixtures struct {
CreateEnterpriseParams params.CreateEnterpriseParams
CreatePoolParams params.CreatePoolParams
CreateInstanceParams params.CreateInstanceParams
UpdateRepoParams params.UpdateRepositoryParams
UpdateRepoParams params.UpdateEntityParams
UpdatePoolParams params.UpdatePoolParams
SQLMock sqlmock.Sqlmock
}
@ -142,7 +142,7 @@ func (s *EnterpriseTestSuite) SetupTest() {
Name: "test-instance-name",
OSType: "linux",
},
UpdateRepoParams: params.UpdateRepositoryParams{
UpdateRepoParams: params.UpdateEntityParams{
CredentialsName: "test-update-creds",
WebhookSecret: "test-update-repo-webhook-secret",
},

View file

@ -103,7 +103,7 @@ func (s *sqlDatabase) DeleteOrganization(ctx context.Context, orgID string) erro
return nil
}
func (s *sqlDatabase) UpdateOrganization(ctx context.Context, orgID string, param params.UpdateRepositoryParams) (params.Organization, error) {
func (s *sqlDatabase) UpdateOrganization(ctx context.Context, orgID string, param params.UpdateEntityParams) (params.Organization, error) {
org, err := s.getOrgByID(ctx, orgID)
if err != nil {
return params.Organization{}, errors.Wrap(err, "fetching org")

View file

@ -39,7 +39,7 @@ type OrgTestFixtures struct {
CreateOrgParams params.CreateOrgParams
CreatePoolParams params.CreatePoolParams
CreateInstanceParams params.CreateInstanceParams
UpdateRepoParams params.UpdateRepositoryParams
UpdateRepoParams params.UpdateEntityParams
UpdatePoolParams params.UpdatePoolParams
SQLMock sqlmock.Sqlmock
}
@ -141,7 +141,7 @@ func (s *OrgTestSuite) SetupTest() {
Name: "test-instance-name",
OSType: "linux",
},
UpdateRepoParams: params.UpdateRepositoryParams{
UpdateRepoParams: params.UpdateEntityParams{
CredentialsName: "test-update-creds",
WebhookSecret: "test-update-repo-webhook-secret",
},

View file

@ -103,7 +103,7 @@ func (s *sqlDatabase) DeleteRepository(ctx context.Context, repoID string) error
return nil
}
func (s *sqlDatabase) UpdateRepository(ctx context.Context, repoID string, param params.UpdateRepositoryParams) (params.Repository, error) {
func (s *sqlDatabase) UpdateRepository(ctx context.Context, repoID string, param params.UpdateEntityParams) (params.Repository, error) {
repo, err := s.getRepoByID(ctx, repoID)
if err != nil {
return params.Repository{}, errors.Wrap(err, "fetching repo")

View file

@ -38,7 +38,7 @@ type RepoTestFixtures struct {
CreateRepoParams params.CreateRepoParams
CreatePoolParams params.CreatePoolParams
CreateInstanceParams params.CreateInstanceParams
UpdateRepoParams params.UpdateRepositoryParams
UpdateRepoParams params.UpdateEntityParams
UpdatePoolParams params.UpdatePoolParams
SQLMock sqlmock.Sqlmock
}
@ -153,7 +153,7 @@ func (s *RepoTestSuite) SetupTest() {
Name: "test-instance",
OSType: "linux",
},
UpdateRepoParams: params.UpdateRepositoryParams{
UpdateRepoParams: params.UpdateEntityParams{
CredentialsName: "test-update-creds",
WebhookSecret: "test-update-webhook-secret",
},