From b3413d1540370b93c3a26b5c186067b806c0d220 Mon Sep 17 00:00:00 2001 From: Dmytro Onishchenko Date: Thu, 30 May 2024 11:58:21 +0200 Subject: [PATCH 1/8] Fix alerting update crash for 4xx Changelog --- CHANGELOG.md | 1 + internal/clients/kibana/alerting.go | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3cad84714..b87e8fbc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ ### Fixed - Populate policy_id when importing fleet policies and integrations ([#646](https://github.com/elastic/terraform-provider-elasticstack/pull/646)) +- Fix Kibana alerting ## [0.11.3] - 2024-05-16 diff --git a/internal/clients/kibana/alerting.go b/internal/clients/kibana/alerting.go index 63d562143..7acc4ac6f 100644 --- a/internal/clients/kibana/alerting.go +++ b/internal/clients/kibana/alerting.go @@ -31,6 +31,7 @@ func ruleResponseToModel(spaceID string, res *alerting.RuleResponseProperties) * Name: res.Name, Consumer: res.Consumer, NotifyWhen: string(unwrapOptionalField(res.NotifyWhen)), + Params: res.Params, RuleTypeID: res.RuleTypeId, Schedule: models.AlertingRuleSchedule{ @@ -124,18 +125,26 @@ func UpdateAlertingRule(ctx context.Context, apiClient *clients.ApiClient, rule Tags: rule.Tags, Throttle: *alerting.NewNullableString(rule.Throttle), } + req := client.UpdateRule(ctxWithAuth, rule.RuleID, rule.SpaceID).KbnXsrf("true").UpdateRuleRequest(reqModel) + ruleRes, res, err := req.Execute() if err != nil && res == nil { return nil, diag.FromErr(err) } - rule.RuleID = ruleRes.Id + + if ruleRes != nil { + rule.RuleID = ruleRes.Id + } + defer res.Body.Close() + if diags := utils.CheckHttpError(res, "Unable to update alerting rule"); diags.HasError() { return nil, diags } shouldBeEnabled := rule.Enabled != nil && *rule.Enabled + if shouldBeEnabled && !ruleRes.Enabled { res, err := client.EnableRule(ctxWithAuth, rule.RuleID, rule.SpaceID).KbnXsrf("true").Execute() if err != nil && res == nil { From deb844fb29cce967c85750aa3d79889da14f6127 Mon Sep 17 00:00:00 2001 From: Dmytro Onishchenko Date: Thu, 30 May 2024 16:17:48 +0200 Subject: [PATCH 2/8] Test alerting crashes for 4xx --- internal/clients/kibana/alerting.go | 9 +- internal/clients/kibana/alerting_api_stub.go | 278 +++++++++++++++++++ internal/clients/kibana/alerting_test.go | 75 +++++ 3 files changed, 360 insertions(+), 2 deletions(-) create mode 100644 internal/clients/kibana/alerting_api_stub.go diff --git a/internal/clients/kibana/alerting.go b/internal/clients/kibana/alerting.go index 7acc4ac6f..0a2a49d1d 100644 --- a/internal/clients/kibana/alerting.go +++ b/internal/clients/kibana/alerting.go @@ -63,7 +63,12 @@ func ruleActionsToActionsInner(ruleActions []models.AlertingRuleAction) []alerti return actions } -func CreateAlertingRule(ctx context.Context, apiClient *clients.ApiClient, rule models.AlertingRule) (*models.AlertingRule, diag.Diagnostics) { +type ApiClient interface { + GetAlertingClient() (alerting.AlertingAPI, error) + SetAlertingAuthContext(context.Context) context.Context +} + +func CreateAlertingRule(ctx context.Context, apiClient ApiClient, rule models.AlertingRule) (*models.AlertingRule, diag.Diagnostics) { client, err := apiClient.GetAlertingClient() if err != nil { return nil, diag.FromErr(err) @@ -106,7 +111,7 @@ func CreateAlertingRule(ctx context.Context, apiClient *clients.ApiClient, rule return ruleResponseToModel(rule.SpaceID, ruleRes), utils.CheckHttpError(res, "Unabled to create alerting rule") } -func UpdateAlertingRule(ctx context.Context, apiClient *clients.ApiClient, rule models.AlertingRule) (*models.AlertingRule, diag.Diagnostics) { +func UpdateAlertingRule(ctx context.Context, apiClient ApiClient, rule models.AlertingRule) (*models.AlertingRule, diag.Diagnostics) { client, err := apiClient.GetAlertingClient() if err != nil { return nil, diag.FromErr(err) diff --git a/internal/clients/kibana/alerting_api_stub.go b/internal/clients/kibana/alerting_api_stub.go new file mode 100644 index 000000000..7ea8f6f0d --- /dev/null +++ b/internal/clients/kibana/alerting_api_stub.go @@ -0,0 +1,278 @@ +package kibana + +import ( + "context" + "net/http" + + "github.com/elastic/terraform-provider-elasticstack/generated/alerting" +) + +type FakeAlertingAPI struct { + RuleResponseProperties *alerting.RuleResponseProperties + HttpResponse *http.Response + Error error +} + +// The method stubs are generated initially by the VS Code Quick Fix for the below Blank Identifier definition. +// https://stackoverflow.com/a/77393824 +var _ alerting.AlertingAPI = (*FakeAlertingAPI)(nil) + +// CreateRule implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) CreateRule(ctx context.Context, spaceId string, ruleId string) alerting.ApiCreateRuleRequest { + return alerting.ApiCreateRuleRequest{ApiService: f} +} + +// CreateRuleExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) CreateRuleExecute(r alerting.ApiCreateRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) { + return f.RuleResponseProperties, f.HttpResponse, f.Error +} + +// DeleteRule implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) DeleteRule(ctx context.Context, ruleId string, spaceId string) alerting.ApiDeleteRuleRequest { + panic("unimplemented") +} + +// DeleteRuleExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) DeleteRuleExecute(r alerting.ApiDeleteRuleRequest) (*http.Response, error) { + panic("unimplemented") +} + +// DisableRule implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) DisableRule(ctx context.Context, ruleId string, spaceId string) alerting.ApiDisableRuleRequest { + panic("unimplemented") +} + +// DisableRuleExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) DisableRuleExecute(r alerting.ApiDisableRuleRequest) (*http.Response, error) { + panic("unimplemented") +} + +// EnableRule implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) EnableRule(ctx context.Context, ruleId string, spaceId string) alerting.ApiEnableRuleRequest { + panic("unimplemented") +} + +// EnableRuleExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) EnableRuleExecute(r alerting.ApiEnableRuleRequest) (*http.Response, error) { + panic("unimplemented") +} + +// FindRules implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) FindRules(ctx context.Context, spaceId string) alerting.ApiFindRulesRequest { + panic("unimplemented") +} + +// FindRulesExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) FindRulesExecute(r alerting.ApiFindRulesRequest) (*alerting.FindRules200Response, *http.Response, error) { + panic("unimplemented") +} + +// GetAlertingHealth implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) GetAlertingHealth(ctx context.Context, spaceId string) alerting.ApiGetAlertingHealthRequest { + panic("unimplemented") +} + +// GetAlertingHealthExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) GetAlertingHealthExecute(r alerting.ApiGetAlertingHealthRequest) (*alerting.GetAlertingHealth200Response, *http.Response, error) { + panic("unimplemented") +} + +// GetRule implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) GetRule(ctx context.Context, ruleId string, spaceId string) alerting.ApiGetRuleRequest { + panic("unimplemented") +} + +// GetRuleExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) GetRuleExecute(r alerting.ApiGetRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) { + panic("unimplemented") +} + +// GetRuleTypes implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) GetRuleTypes(ctx context.Context, spaceId string) alerting.ApiGetRuleTypesRequest { + panic("unimplemented") +} + +// GetRuleTypesExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) GetRuleTypesExecute(r alerting.ApiGetRuleTypesRequest) ([]alerting.GetRuleTypes200ResponseInner, *http.Response, error) { + panic("unimplemented") +} + +// LegacyCreateAlert implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyCreateAlert(ctx context.Context, alertId string, spaceId string) alerting.ApiLegacyCreateAlertRequest { + panic("unimplemented") +} + +// LegacyCreateAlertExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyCreateAlertExecute(r alerting.ApiLegacyCreateAlertRequest) (*alerting.AlertResponseProperties, *http.Response, error) { + panic("unimplemented") +} + +// LegacyDisableAlert implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyDisableAlert(ctx context.Context, spaceId string, alertId string) alerting.ApiLegacyDisableAlertRequest { + panic("unimplemented") +} + +// LegacyDisableAlertExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyDisableAlertExecute(r alerting.ApiLegacyDisableAlertRequest) (*http.Response, error) { + panic("unimplemented") +} + +// LegacyEnableAlert implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyEnableAlert(ctx context.Context, spaceId string, alertId string) alerting.ApiLegacyEnableAlertRequest { + panic("unimplemented") +} + +// LegacyEnableAlertExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyEnableAlertExecute(r alerting.ApiLegacyEnableAlertRequest) (*http.Response, error) { + panic("unimplemented") +} + +// LegacyFindAlerts implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyFindAlerts(ctx context.Context, spaceId string) alerting.ApiLegacyFindAlertsRequest { + panic("unimplemented") +} + +// LegacyFindAlertsExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyFindAlertsExecute(r alerting.ApiLegacyFindAlertsRequest) (*alerting.LegacyFindAlerts200Response, *http.Response, error) { + panic("unimplemented") +} + +// LegacyGetAlert implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyGetAlert(ctx context.Context, spaceId string, alertId string) alerting.ApiLegacyGetAlertRequest { + panic("unimplemented") +} + +// LegacyGetAlertExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyGetAlertExecute(r alerting.ApiLegacyGetAlertRequest) (*alerting.AlertResponseProperties, *http.Response, error) { + panic("unimplemented") +} + +// LegacyGetAlertTypes implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyGetAlertTypes(ctx context.Context, spaceId string) alerting.ApiLegacyGetAlertTypesRequest { + panic("unimplemented") +} + +// LegacyGetAlertTypesExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyGetAlertTypesExecute(r alerting.ApiLegacyGetAlertTypesRequest) ([]alerting.LegacyGetAlertTypes200ResponseInner, *http.Response, error) { + panic("unimplemented") +} + +// LegacyGetAlertingHealth implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyGetAlertingHealth(ctx context.Context, spaceId string) alerting.ApiLegacyGetAlertingHealthRequest { + panic("unimplemented") +} + +// LegacyGetAlertingHealthExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyGetAlertingHealthExecute(r alerting.ApiLegacyGetAlertingHealthRequest) (*alerting.LegacyGetAlertingHealth200Response, *http.Response, error) { + panic("unimplemented") +} + +// LegacyMuteAlertInstance implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyMuteAlertInstance(ctx context.Context, spaceId string, alertId string, alertInstanceId string) alerting.ApiLegacyMuteAlertInstanceRequest { + panic("unimplemented") +} + +// LegacyMuteAlertInstanceExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyMuteAlertInstanceExecute(r alerting.ApiLegacyMuteAlertInstanceRequest) (*http.Response, error) { + panic("unimplemented") +} + +// LegacyMuteAllAlertInstances implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyMuteAllAlertInstances(ctx context.Context, spaceId string, alertId string) alerting.ApiLegacyMuteAllAlertInstancesRequest { + panic("unimplemented") +} + +// LegacyMuteAllAlertInstancesExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyMuteAllAlertInstancesExecute(r alerting.ApiLegacyMuteAllAlertInstancesRequest) (*http.Response, error) { + panic("unimplemented") +} + +// LegacyUnmuteAlertInstance implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyUnmuteAlertInstance(ctx context.Context, spaceId string, alertId string, alertInstanceId string) alerting.ApiLegacyUnmuteAlertInstanceRequest { + panic("unimplemented") +} + +// LegacyUnmuteAlertInstanceExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyUnmuteAlertInstanceExecute(r alerting.ApiLegacyUnmuteAlertInstanceRequest) (*http.Response, error) { + panic("unimplemented") +} + +// LegacyUnmuteAllAlertInstances implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyUnmuteAllAlertInstances(ctx context.Context, spaceId string, alertId string) alerting.ApiLegacyUnmuteAllAlertInstancesRequest { + panic("unimplemented") +} + +// LegacyUnmuteAllAlertInstancesExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyUnmuteAllAlertInstancesExecute(r alerting.ApiLegacyUnmuteAllAlertInstancesRequest) (*http.Response, error) { + panic("unimplemented") +} + +// LegacyUpdateAlert implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyUpdateAlert(ctx context.Context, spaceId string, alertId string) alerting.ApiLegacyUpdateAlertRequest { + panic("unimplemented") +} + +// LegacyUpdateAlertExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegacyUpdateAlertExecute(r alerting.ApiLegacyUpdateAlertRequest) (*alerting.AlertResponseProperties, *http.Response, error) { + panic("unimplemented") +} + +// LegaryDeleteAlert implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegaryDeleteAlert(ctx context.Context, spaceId string, alertId string) alerting.ApiLegaryDeleteAlertRequest { + panic("unimplemented") +} + +// LegaryDeleteAlertExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) LegaryDeleteAlertExecute(r alerting.ApiLegaryDeleteAlertRequest) (*http.Response, error) { + panic("unimplemented") +} + +// MuteAlert implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) MuteAlert(ctx context.Context, alertId string, ruleId string, spaceId string) alerting.ApiMuteAlertRequest { + panic("unimplemented") +} + +// MuteAlertExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) MuteAlertExecute(r alerting.ApiMuteAlertRequest) (*http.Response, error) { + panic("unimplemented") +} + +// MuteAllAlerts implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) MuteAllAlerts(ctx context.Context, ruleId string, spaceId string) alerting.ApiMuteAllAlertsRequest { + panic("unimplemented") +} + +// MuteAllAlertsExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) MuteAllAlertsExecute(r alerting.ApiMuteAllAlertsRequest) (*http.Response, error) { + panic("unimplemented") +} + +// UnmuteAlert implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) UnmuteAlert(ctx context.Context, alertId string, ruleId string, spaceId string) alerting.ApiUnmuteAlertRequest { + panic("unimplemented") +} + +// UnmuteAlertExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) UnmuteAlertExecute(r alerting.ApiUnmuteAlertRequest) (*http.Response, error) { + panic("unimplemented") +} + +// UnmuteAllAlerts implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) UnmuteAllAlerts(ctx context.Context, ruleId string, spaceId string) alerting.ApiUnmuteAllAlertsRequest { + panic("unimplemented") +} + +// UnmuteAllAlertsExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) UnmuteAllAlertsExecute(r alerting.ApiUnmuteAllAlertsRequest) (*http.Response, error) { + panic("unimplemented") +} + +// UpdateRule implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) UpdateRule(ctx context.Context, ruleId string, spaceId string) alerting.ApiUpdateRuleRequest { + return alerting.ApiUpdateRuleRequest{ApiService: f} +} + +// UpdateRuleExecute implements alerting.AlertingAPI. +func (f *FakeAlertingAPI) UpdateRuleExecute(r alerting.ApiUpdateRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) { + return f.RuleResponseProperties, f.HttpResponse, f.Error +} diff --git a/internal/clients/kibana/alerting_test.go b/internal/clients/kibana/alerting_test.go index c5bc8771a..ffbd79103 100644 --- a/internal/clients/kibana/alerting_test.go +++ b/internal/clients/kibana/alerting_test.go @@ -1,11 +1,17 @@ package kibana import ( + "context" + "fmt" + "io" + "net/http" + "strings" "testing" "time" "github.com/elastic/terraform-provider-elasticstack/generated/alerting" "github.com/elastic/terraform-provider-elasticstack/internal/models" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/stretchr/testify/require" ) @@ -122,3 +128,72 @@ func Test_ruleResponseToModel(t *testing.T) { }) } } + +func Test_CreateUpdateAlertingRule(t *testing.T) { + getApiClient := func() ApiClient { + return &FakeApiClient{ + &FakeAlertingAPI{ + RuleResponseProperties: nil, + HttpResponse: &http.Response{ + StatusCode: 401, + Body: io.NopCloser(strings.NewReader("some error")), + }, + }, + } + } + + tests := []struct { + name string + testFunc func(ctx context.Context, apiClient ApiClient, rule models.AlertingRule) (*models.AlertingRule, diag.Diagnostics) + client ApiClient + rule models.AlertingRule + expectedRes *models.AlertingRule + expectedErr string + }{ + { + name: "CreateAlertingRule should not crash when client returns 4xx", + testFunc: CreateAlertingRule, + client: getApiClient(), + rule: models.AlertingRule{}, + expectedRes: nil, + expectedErr: "some error", + }, + { + name: "UpdateAlertingRule should not crash when client returns 4xx", + testFunc: UpdateAlertingRule, + client: getApiClient(), + rule: models.AlertingRule{}, + expectedRes: nil, + expectedErr: "some error", + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + rule, diags := tt.testFunc(context.Background(), tt.client, tt.rule) + + if tt.expectedRes == nil { + require.Nil(t, rule) + } else { + require.Equal(t, tt.expectedRes, rule) + } + + if tt.expectedErr != "" { + require.NotEmpty(t, diags) + if !strings.Contains(diags[0].Detail, tt.expectedErr) { + require.Fail(t, fmt.Sprintf("Diags ['%s'] should contain message ['%s']", diags[0].Detail, tt.expectedErr)) + } + } + }) + } +} + +type FakeApiClient struct { + Alerting alerting.AlertingAPI +} + +func (f *FakeApiClient) SetAlertingAuthContext(ctx context.Context) context.Context { return ctx } + +func (f *FakeApiClient) GetAlertingClient() (alerting.AlertingAPI, error) { + return f.Alerting, nil +} From e8fe027d548a0516cd193b2d526cf35db019856e Mon Sep 17 00:00:00 2001 From: Dmytro Onishchenko Date: Thu, 30 May 2024 16:32:55 +0200 Subject: [PATCH 3/8] Udpate Changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b87e8fbc3..4a78cb7a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ### Fixed - Populate policy_id when importing fleet policies and integrations ([#646](https://github.com/elastic/terraform-provider-elasticstack/pull/646)) -- Fix Kibana alerting +- Fix alerting rule update crash when backend responds with HTTP 4xx. ([#649](https://github.com/elastic/terraform-provider-elasticstack/pull/649)) ## [0.11.3] - 2024-05-16 From 3b1657da14cc7a7d5b88a012bbb2a96c550295c6 Mon Sep 17 00:00:00 2001 From: Dmytro Onishchenko Date: Fri, 31 May 2024 19:46:14 +0200 Subject: [PATCH 4/8] Switch to gomock. Handle an empty response with HTTP 200 in CreateRule and UpdateRule. --- generated/alerting/api_alerting_mocks.go | 807 +++++++++++++++++++ go.mod | 4 +- go.sum | 26 +- internal/clients/kibana/alerting.go | 36 +- internal/clients/kibana/alerting_api_stub.go | 278 ------- internal/clients/kibana/alerting_mocks.go | 70 ++ internal/clients/kibana/alerting_test.go | 85 +- tools/connectors_gen.go | 2 + tools/go.mod | 3 +- tools/go.sum | 4 + tools/tools.go | 1 + 11 files changed, 999 insertions(+), 317 deletions(-) create mode 100644 generated/alerting/api_alerting_mocks.go delete mode 100644 internal/clients/kibana/alerting_api_stub.go create mode 100644 internal/clients/kibana/alerting_mocks.go diff --git a/generated/alerting/api_alerting_mocks.go b/generated/alerting/api_alerting_mocks.go new file mode 100644 index 000000000..6b5c46555 --- /dev/null +++ b/generated/alerting/api_alerting_mocks.go @@ -0,0 +1,807 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: ../generated/alerting/api_alerting.go +// +// Generated by this command: +// +// mockgen -destination=../generated/alerting/api_alerting_mocks.go -package=alerting -source ../generated/alerting/api_alerting.go AlertingAPI +// + +// Package alerting is a generated GoMock package. +package alerting + +import ( + context "context" + http "net/http" + reflect "reflect" + + gomock "go.uber.org/mock/gomock" +) + +// MockAlertingAPI is a mock of AlertingAPI interface. +type MockAlertingAPI struct { + ctrl *gomock.Controller + recorder *MockAlertingAPIMockRecorder +} + +// MockAlertingAPIMockRecorder is the mock recorder for MockAlertingAPI. +type MockAlertingAPIMockRecorder struct { + mock *MockAlertingAPI +} + +// NewMockAlertingAPI creates a new mock instance. +func NewMockAlertingAPI(ctrl *gomock.Controller) *MockAlertingAPI { + mock := &MockAlertingAPI{ctrl: ctrl} + mock.recorder = &MockAlertingAPIMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockAlertingAPI) EXPECT() *MockAlertingAPIMockRecorder { + return m.recorder +} + +// CreateRule mocks base method. +func (m *MockAlertingAPI) CreateRule(ctx context.Context, spaceId, ruleId string) ApiCreateRuleRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateRule", ctx, spaceId, ruleId) + ret0, _ := ret[0].(ApiCreateRuleRequest) + return ret0 +} + +// CreateRule indicates an expected call of CreateRule. +func (mr *MockAlertingAPIMockRecorder) CreateRule(ctx, spaceId, ruleId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRule", reflect.TypeOf((*MockAlertingAPI)(nil).CreateRule), ctx, spaceId, ruleId) +} + +// CreateRuleExecute mocks base method. +func (m *MockAlertingAPI) CreateRuleExecute(r ApiCreateRuleRequest) (*RuleResponseProperties, *http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreateRuleExecute", r) + ret0, _ := ret[0].(*RuleResponseProperties) + ret1, _ := ret[1].(*http.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// CreateRuleExecute indicates an expected call of CreateRuleExecute. +func (mr *MockAlertingAPIMockRecorder) CreateRuleExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateRuleExecute", reflect.TypeOf((*MockAlertingAPI)(nil).CreateRuleExecute), r) +} + +// DeleteRule mocks base method. +func (m *MockAlertingAPI) DeleteRule(ctx context.Context, ruleId, spaceId string) ApiDeleteRuleRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteRule", ctx, ruleId, spaceId) + ret0, _ := ret[0].(ApiDeleteRuleRequest) + return ret0 +} + +// DeleteRule indicates an expected call of DeleteRule. +func (mr *MockAlertingAPIMockRecorder) DeleteRule(ctx, ruleId, spaceId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRule", reflect.TypeOf((*MockAlertingAPI)(nil).DeleteRule), ctx, ruleId, spaceId) +} + +// DeleteRuleExecute mocks base method. +func (m *MockAlertingAPI) DeleteRuleExecute(r ApiDeleteRuleRequest) (*http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DeleteRuleExecute", r) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DeleteRuleExecute indicates an expected call of DeleteRuleExecute. +func (mr *MockAlertingAPIMockRecorder) DeleteRuleExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DeleteRuleExecute", reflect.TypeOf((*MockAlertingAPI)(nil).DeleteRuleExecute), r) +} + +// DisableRule mocks base method. +func (m *MockAlertingAPI) DisableRule(ctx context.Context, ruleId, spaceId string) ApiDisableRuleRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DisableRule", ctx, ruleId, spaceId) + ret0, _ := ret[0].(ApiDisableRuleRequest) + return ret0 +} + +// DisableRule indicates an expected call of DisableRule. +func (mr *MockAlertingAPIMockRecorder) DisableRule(ctx, ruleId, spaceId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DisableRule", reflect.TypeOf((*MockAlertingAPI)(nil).DisableRule), ctx, ruleId, spaceId) +} + +// DisableRuleExecute mocks base method. +func (m *MockAlertingAPI) DisableRuleExecute(r ApiDisableRuleRequest) (*http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "DisableRuleExecute", r) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// DisableRuleExecute indicates an expected call of DisableRuleExecute. +func (mr *MockAlertingAPIMockRecorder) DisableRuleExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "DisableRuleExecute", reflect.TypeOf((*MockAlertingAPI)(nil).DisableRuleExecute), r) +} + +// EnableRule mocks base method. +func (m *MockAlertingAPI) EnableRule(ctx context.Context, ruleId, spaceId string) ApiEnableRuleRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EnableRule", ctx, ruleId, spaceId) + ret0, _ := ret[0].(ApiEnableRuleRequest) + return ret0 +} + +// EnableRule indicates an expected call of EnableRule. +func (mr *MockAlertingAPIMockRecorder) EnableRule(ctx, ruleId, spaceId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnableRule", reflect.TypeOf((*MockAlertingAPI)(nil).EnableRule), ctx, ruleId, spaceId) +} + +// EnableRuleExecute mocks base method. +func (m *MockAlertingAPI) EnableRuleExecute(r ApiEnableRuleRequest) (*http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "EnableRuleExecute", r) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// EnableRuleExecute indicates an expected call of EnableRuleExecute. +func (mr *MockAlertingAPIMockRecorder) EnableRuleExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "EnableRuleExecute", reflect.TypeOf((*MockAlertingAPI)(nil).EnableRuleExecute), r) +} + +// FindRules mocks base method. +func (m *MockAlertingAPI) FindRules(ctx context.Context, spaceId string) ApiFindRulesRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FindRules", ctx, spaceId) + ret0, _ := ret[0].(ApiFindRulesRequest) + return ret0 +} + +// FindRules indicates an expected call of FindRules. +func (mr *MockAlertingAPIMockRecorder) FindRules(ctx, spaceId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindRules", reflect.TypeOf((*MockAlertingAPI)(nil).FindRules), ctx, spaceId) +} + +// FindRulesExecute mocks base method. +func (m *MockAlertingAPI) FindRulesExecute(r ApiFindRulesRequest) (*FindRules200Response, *http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "FindRulesExecute", r) + ret0, _ := ret[0].(*FindRules200Response) + ret1, _ := ret[1].(*http.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// FindRulesExecute indicates an expected call of FindRulesExecute. +func (mr *MockAlertingAPIMockRecorder) FindRulesExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "FindRulesExecute", reflect.TypeOf((*MockAlertingAPI)(nil).FindRulesExecute), r) +} + +// GetAlertingHealth mocks base method. +func (m *MockAlertingAPI) GetAlertingHealth(ctx context.Context, spaceId string) ApiGetAlertingHealthRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAlertingHealth", ctx, spaceId) + ret0, _ := ret[0].(ApiGetAlertingHealthRequest) + return ret0 +} + +// GetAlertingHealth indicates an expected call of GetAlertingHealth. +func (mr *MockAlertingAPIMockRecorder) GetAlertingHealth(ctx, spaceId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAlertingHealth", reflect.TypeOf((*MockAlertingAPI)(nil).GetAlertingHealth), ctx, spaceId) +} + +// GetAlertingHealthExecute mocks base method. +func (m *MockAlertingAPI) GetAlertingHealthExecute(r ApiGetAlertingHealthRequest) (*GetAlertingHealth200Response, *http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAlertingHealthExecute", r) + ret0, _ := ret[0].(*GetAlertingHealth200Response) + ret1, _ := ret[1].(*http.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// GetAlertingHealthExecute indicates an expected call of GetAlertingHealthExecute. +func (mr *MockAlertingAPIMockRecorder) GetAlertingHealthExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAlertingHealthExecute", reflect.TypeOf((*MockAlertingAPI)(nil).GetAlertingHealthExecute), r) +} + +// GetRule mocks base method. +func (m *MockAlertingAPI) GetRule(ctx context.Context, ruleId, spaceId string) ApiGetRuleRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRule", ctx, ruleId, spaceId) + ret0, _ := ret[0].(ApiGetRuleRequest) + return ret0 +} + +// GetRule indicates an expected call of GetRule. +func (mr *MockAlertingAPIMockRecorder) GetRule(ctx, ruleId, spaceId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRule", reflect.TypeOf((*MockAlertingAPI)(nil).GetRule), ctx, ruleId, spaceId) +} + +// GetRuleExecute mocks base method. +func (m *MockAlertingAPI) GetRuleExecute(r ApiGetRuleRequest) (*RuleResponseProperties, *http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRuleExecute", r) + ret0, _ := ret[0].(*RuleResponseProperties) + ret1, _ := ret[1].(*http.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// GetRuleExecute indicates an expected call of GetRuleExecute. +func (mr *MockAlertingAPIMockRecorder) GetRuleExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRuleExecute", reflect.TypeOf((*MockAlertingAPI)(nil).GetRuleExecute), r) +} + +// GetRuleTypes mocks base method. +func (m *MockAlertingAPI) GetRuleTypes(ctx context.Context, spaceId string) ApiGetRuleTypesRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRuleTypes", ctx, spaceId) + ret0, _ := ret[0].(ApiGetRuleTypesRequest) + return ret0 +} + +// GetRuleTypes indicates an expected call of GetRuleTypes. +func (mr *MockAlertingAPIMockRecorder) GetRuleTypes(ctx, spaceId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRuleTypes", reflect.TypeOf((*MockAlertingAPI)(nil).GetRuleTypes), ctx, spaceId) +} + +// GetRuleTypesExecute mocks base method. +func (m *MockAlertingAPI) GetRuleTypesExecute(r ApiGetRuleTypesRequest) ([]GetRuleTypes200ResponseInner, *http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetRuleTypesExecute", r) + ret0, _ := ret[0].([]GetRuleTypes200ResponseInner) + ret1, _ := ret[1].(*http.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// GetRuleTypesExecute indicates an expected call of GetRuleTypesExecute. +func (mr *MockAlertingAPIMockRecorder) GetRuleTypesExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetRuleTypesExecute", reflect.TypeOf((*MockAlertingAPI)(nil).GetRuleTypesExecute), r) +} + +// LegacyCreateAlert mocks base method. +func (m *MockAlertingAPI) LegacyCreateAlert(ctx context.Context, alertId, spaceId string) ApiLegacyCreateAlertRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyCreateAlert", ctx, alertId, spaceId) + ret0, _ := ret[0].(ApiLegacyCreateAlertRequest) + return ret0 +} + +// LegacyCreateAlert indicates an expected call of LegacyCreateAlert. +func (mr *MockAlertingAPIMockRecorder) LegacyCreateAlert(ctx, alertId, spaceId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyCreateAlert", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyCreateAlert), ctx, alertId, spaceId) +} + +// LegacyCreateAlertExecute mocks base method. +func (m *MockAlertingAPI) LegacyCreateAlertExecute(r ApiLegacyCreateAlertRequest) (*AlertResponseProperties, *http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyCreateAlertExecute", r) + ret0, _ := ret[0].(*AlertResponseProperties) + ret1, _ := ret[1].(*http.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// LegacyCreateAlertExecute indicates an expected call of LegacyCreateAlertExecute. +func (mr *MockAlertingAPIMockRecorder) LegacyCreateAlertExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyCreateAlertExecute", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyCreateAlertExecute), r) +} + +// LegacyDisableAlert mocks base method. +func (m *MockAlertingAPI) LegacyDisableAlert(ctx context.Context, spaceId, alertId string) ApiLegacyDisableAlertRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyDisableAlert", ctx, spaceId, alertId) + ret0, _ := ret[0].(ApiLegacyDisableAlertRequest) + return ret0 +} + +// LegacyDisableAlert indicates an expected call of LegacyDisableAlert. +func (mr *MockAlertingAPIMockRecorder) LegacyDisableAlert(ctx, spaceId, alertId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyDisableAlert", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyDisableAlert), ctx, spaceId, alertId) +} + +// LegacyDisableAlertExecute mocks base method. +func (m *MockAlertingAPI) LegacyDisableAlertExecute(r ApiLegacyDisableAlertRequest) (*http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyDisableAlertExecute", r) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// LegacyDisableAlertExecute indicates an expected call of LegacyDisableAlertExecute. +func (mr *MockAlertingAPIMockRecorder) LegacyDisableAlertExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyDisableAlertExecute", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyDisableAlertExecute), r) +} + +// LegacyEnableAlert mocks base method. +func (m *MockAlertingAPI) LegacyEnableAlert(ctx context.Context, spaceId, alertId string) ApiLegacyEnableAlertRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyEnableAlert", ctx, spaceId, alertId) + ret0, _ := ret[0].(ApiLegacyEnableAlertRequest) + return ret0 +} + +// LegacyEnableAlert indicates an expected call of LegacyEnableAlert. +func (mr *MockAlertingAPIMockRecorder) LegacyEnableAlert(ctx, spaceId, alertId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyEnableAlert", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyEnableAlert), ctx, spaceId, alertId) +} + +// LegacyEnableAlertExecute mocks base method. +func (m *MockAlertingAPI) LegacyEnableAlertExecute(r ApiLegacyEnableAlertRequest) (*http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyEnableAlertExecute", r) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// LegacyEnableAlertExecute indicates an expected call of LegacyEnableAlertExecute. +func (mr *MockAlertingAPIMockRecorder) LegacyEnableAlertExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyEnableAlertExecute", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyEnableAlertExecute), r) +} + +// LegacyFindAlerts mocks base method. +func (m *MockAlertingAPI) LegacyFindAlerts(ctx context.Context, spaceId string) ApiLegacyFindAlertsRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyFindAlerts", ctx, spaceId) + ret0, _ := ret[0].(ApiLegacyFindAlertsRequest) + return ret0 +} + +// LegacyFindAlerts indicates an expected call of LegacyFindAlerts. +func (mr *MockAlertingAPIMockRecorder) LegacyFindAlerts(ctx, spaceId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyFindAlerts", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyFindAlerts), ctx, spaceId) +} + +// LegacyFindAlertsExecute mocks base method. +func (m *MockAlertingAPI) LegacyFindAlertsExecute(r ApiLegacyFindAlertsRequest) (*LegacyFindAlerts200Response, *http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyFindAlertsExecute", r) + ret0, _ := ret[0].(*LegacyFindAlerts200Response) + ret1, _ := ret[1].(*http.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// LegacyFindAlertsExecute indicates an expected call of LegacyFindAlertsExecute. +func (mr *MockAlertingAPIMockRecorder) LegacyFindAlertsExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyFindAlertsExecute", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyFindAlertsExecute), r) +} + +// LegacyGetAlert mocks base method. +func (m *MockAlertingAPI) LegacyGetAlert(ctx context.Context, spaceId, alertId string) ApiLegacyGetAlertRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyGetAlert", ctx, spaceId, alertId) + ret0, _ := ret[0].(ApiLegacyGetAlertRequest) + return ret0 +} + +// LegacyGetAlert indicates an expected call of LegacyGetAlert. +func (mr *MockAlertingAPIMockRecorder) LegacyGetAlert(ctx, spaceId, alertId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyGetAlert", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyGetAlert), ctx, spaceId, alertId) +} + +// LegacyGetAlertExecute mocks base method. +func (m *MockAlertingAPI) LegacyGetAlertExecute(r ApiLegacyGetAlertRequest) (*AlertResponseProperties, *http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyGetAlertExecute", r) + ret0, _ := ret[0].(*AlertResponseProperties) + ret1, _ := ret[1].(*http.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// LegacyGetAlertExecute indicates an expected call of LegacyGetAlertExecute. +func (mr *MockAlertingAPIMockRecorder) LegacyGetAlertExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyGetAlertExecute", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyGetAlertExecute), r) +} + +// LegacyGetAlertTypes mocks base method. +func (m *MockAlertingAPI) LegacyGetAlertTypes(ctx context.Context, spaceId string) ApiLegacyGetAlertTypesRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyGetAlertTypes", ctx, spaceId) + ret0, _ := ret[0].(ApiLegacyGetAlertTypesRequest) + return ret0 +} + +// LegacyGetAlertTypes indicates an expected call of LegacyGetAlertTypes. +func (mr *MockAlertingAPIMockRecorder) LegacyGetAlertTypes(ctx, spaceId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyGetAlertTypes", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyGetAlertTypes), ctx, spaceId) +} + +// LegacyGetAlertTypesExecute mocks base method. +func (m *MockAlertingAPI) LegacyGetAlertTypesExecute(r ApiLegacyGetAlertTypesRequest) ([]LegacyGetAlertTypes200ResponseInner, *http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyGetAlertTypesExecute", r) + ret0, _ := ret[0].([]LegacyGetAlertTypes200ResponseInner) + ret1, _ := ret[1].(*http.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// LegacyGetAlertTypesExecute indicates an expected call of LegacyGetAlertTypesExecute. +func (mr *MockAlertingAPIMockRecorder) LegacyGetAlertTypesExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyGetAlertTypesExecute", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyGetAlertTypesExecute), r) +} + +// LegacyGetAlertingHealth mocks base method. +func (m *MockAlertingAPI) LegacyGetAlertingHealth(ctx context.Context, spaceId string) ApiLegacyGetAlertingHealthRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyGetAlertingHealth", ctx, spaceId) + ret0, _ := ret[0].(ApiLegacyGetAlertingHealthRequest) + return ret0 +} + +// LegacyGetAlertingHealth indicates an expected call of LegacyGetAlertingHealth. +func (mr *MockAlertingAPIMockRecorder) LegacyGetAlertingHealth(ctx, spaceId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyGetAlertingHealth", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyGetAlertingHealth), ctx, spaceId) +} + +// LegacyGetAlertingHealthExecute mocks base method. +func (m *MockAlertingAPI) LegacyGetAlertingHealthExecute(r ApiLegacyGetAlertingHealthRequest) (*LegacyGetAlertingHealth200Response, *http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyGetAlertingHealthExecute", r) + ret0, _ := ret[0].(*LegacyGetAlertingHealth200Response) + ret1, _ := ret[1].(*http.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// LegacyGetAlertingHealthExecute indicates an expected call of LegacyGetAlertingHealthExecute. +func (mr *MockAlertingAPIMockRecorder) LegacyGetAlertingHealthExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyGetAlertingHealthExecute", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyGetAlertingHealthExecute), r) +} + +// LegacyMuteAlertInstance mocks base method. +func (m *MockAlertingAPI) LegacyMuteAlertInstance(ctx context.Context, spaceId, alertId, alertInstanceId string) ApiLegacyMuteAlertInstanceRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyMuteAlertInstance", ctx, spaceId, alertId, alertInstanceId) + ret0, _ := ret[0].(ApiLegacyMuteAlertInstanceRequest) + return ret0 +} + +// LegacyMuteAlertInstance indicates an expected call of LegacyMuteAlertInstance. +func (mr *MockAlertingAPIMockRecorder) LegacyMuteAlertInstance(ctx, spaceId, alertId, alertInstanceId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyMuteAlertInstance", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyMuteAlertInstance), ctx, spaceId, alertId, alertInstanceId) +} + +// LegacyMuteAlertInstanceExecute mocks base method. +func (m *MockAlertingAPI) LegacyMuteAlertInstanceExecute(r ApiLegacyMuteAlertInstanceRequest) (*http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyMuteAlertInstanceExecute", r) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// LegacyMuteAlertInstanceExecute indicates an expected call of LegacyMuteAlertInstanceExecute. +func (mr *MockAlertingAPIMockRecorder) LegacyMuteAlertInstanceExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyMuteAlertInstanceExecute", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyMuteAlertInstanceExecute), r) +} + +// LegacyMuteAllAlertInstances mocks base method. +func (m *MockAlertingAPI) LegacyMuteAllAlertInstances(ctx context.Context, spaceId, alertId string) ApiLegacyMuteAllAlertInstancesRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyMuteAllAlertInstances", ctx, spaceId, alertId) + ret0, _ := ret[0].(ApiLegacyMuteAllAlertInstancesRequest) + return ret0 +} + +// LegacyMuteAllAlertInstances indicates an expected call of LegacyMuteAllAlertInstances. +func (mr *MockAlertingAPIMockRecorder) LegacyMuteAllAlertInstances(ctx, spaceId, alertId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyMuteAllAlertInstances", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyMuteAllAlertInstances), ctx, spaceId, alertId) +} + +// LegacyMuteAllAlertInstancesExecute mocks base method. +func (m *MockAlertingAPI) LegacyMuteAllAlertInstancesExecute(r ApiLegacyMuteAllAlertInstancesRequest) (*http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyMuteAllAlertInstancesExecute", r) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// LegacyMuteAllAlertInstancesExecute indicates an expected call of LegacyMuteAllAlertInstancesExecute. +func (mr *MockAlertingAPIMockRecorder) LegacyMuteAllAlertInstancesExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyMuteAllAlertInstancesExecute", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyMuteAllAlertInstancesExecute), r) +} + +// LegacyUnmuteAlertInstance mocks base method. +func (m *MockAlertingAPI) LegacyUnmuteAlertInstance(ctx context.Context, spaceId, alertId, alertInstanceId string) ApiLegacyUnmuteAlertInstanceRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyUnmuteAlertInstance", ctx, spaceId, alertId, alertInstanceId) + ret0, _ := ret[0].(ApiLegacyUnmuteAlertInstanceRequest) + return ret0 +} + +// LegacyUnmuteAlertInstance indicates an expected call of LegacyUnmuteAlertInstance. +func (mr *MockAlertingAPIMockRecorder) LegacyUnmuteAlertInstance(ctx, spaceId, alertId, alertInstanceId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyUnmuteAlertInstance", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyUnmuteAlertInstance), ctx, spaceId, alertId, alertInstanceId) +} + +// LegacyUnmuteAlertInstanceExecute mocks base method. +func (m *MockAlertingAPI) LegacyUnmuteAlertInstanceExecute(r ApiLegacyUnmuteAlertInstanceRequest) (*http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyUnmuteAlertInstanceExecute", r) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// LegacyUnmuteAlertInstanceExecute indicates an expected call of LegacyUnmuteAlertInstanceExecute. +func (mr *MockAlertingAPIMockRecorder) LegacyUnmuteAlertInstanceExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyUnmuteAlertInstanceExecute", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyUnmuteAlertInstanceExecute), r) +} + +// LegacyUnmuteAllAlertInstances mocks base method. +func (m *MockAlertingAPI) LegacyUnmuteAllAlertInstances(ctx context.Context, spaceId, alertId string) ApiLegacyUnmuteAllAlertInstancesRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyUnmuteAllAlertInstances", ctx, spaceId, alertId) + ret0, _ := ret[0].(ApiLegacyUnmuteAllAlertInstancesRequest) + return ret0 +} + +// LegacyUnmuteAllAlertInstances indicates an expected call of LegacyUnmuteAllAlertInstances. +func (mr *MockAlertingAPIMockRecorder) LegacyUnmuteAllAlertInstances(ctx, spaceId, alertId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyUnmuteAllAlertInstances", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyUnmuteAllAlertInstances), ctx, spaceId, alertId) +} + +// LegacyUnmuteAllAlertInstancesExecute mocks base method. +func (m *MockAlertingAPI) LegacyUnmuteAllAlertInstancesExecute(r ApiLegacyUnmuteAllAlertInstancesRequest) (*http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyUnmuteAllAlertInstancesExecute", r) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// LegacyUnmuteAllAlertInstancesExecute indicates an expected call of LegacyUnmuteAllAlertInstancesExecute. +func (mr *MockAlertingAPIMockRecorder) LegacyUnmuteAllAlertInstancesExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyUnmuteAllAlertInstancesExecute", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyUnmuteAllAlertInstancesExecute), r) +} + +// LegacyUpdateAlert mocks base method. +func (m *MockAlertingAPI) LegacyUpdateAlert(ctx context.Context, spaceId, alertId string) ApiLegacyUpdateAlertRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyUpdateAlert", ctx, spaceId, alertId) + ret0, _ := ret[0].(ApiLegacyUpdateAlertRequest) + return ret0 +} + +// LegacyUpdateAlert indicates an expected call of LegacyUpdateAlert. +func (mr *MockAlertingAPIMockRecorder) LegacyUpdateAlert(ctx, spaceId, alertId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyUpdateAlert", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyUpdateAlert), ctx, spaceId, alertId) +} + +// LegacyUpdateAlertExecute mocks base method. +func (m *MockAlertingAPI) LegacyUpdateAlertExecute(r ApiLegacyUpdateAlertRequest) (*AlertResponseProperties, *http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegacyUpdateAlertExecute", r) + ret0, _ := ret[0].(*AlertResponseProperties) + ret1, _ := ret[1].(*http.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// LegacyUpdateAlertExecute indicates an expected call of LegacyUpdateAlertExecute. +func (mr *MockAlertingAPIMockRecorder) LegacyUpdateAlertExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegacyUpdateAlertExecute", reflect.TypeOf((*MockAlertingAPI)(nil).LegacyUpdateAlertExecute), r) +} + +// LegaryDeleteAlert mocks base method. +func (m *MockAlertingAPI) LegaryDeleteAlert(ctx context.Context, spaceId, alertId string) ApiLegaryDeleteAlertRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegaryDeleteAlert", ctx, spaceId, alertId) + ret0, _ := ret[0].(ApiLegaryDeleteAlertRequest) + return ret0 +} + +// LegaryDeleteAlert indicates an expected call of LegaryDeleteAlert. +func (mr *MockAlertingAPIMockRecorder) LegaryDeleteAlert(ctx, spaceId, alertId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegaryDeleteAlert", reflect.TypeOf((*MockAlertingAPI)(nil).LegaryDeleteAlert), ctx, spaceId, alertId) +} + +// LegaryDeleteAlertExecute mocks base method. +func (m *MockAlertingAPI) LegaryDeleteAlertExecute(r ApiLegaryDeleteAlertRequest) (*http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "LegaryDeleteAlertExecute", r) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// LegaryDeleteAlertExecute indicates an expected call of LegaryDeleteAlertExecute. +func (mr *MockAlertingAPIMockRecorder) LegaryDeleteAlertExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "LegaryDeleteAlertExecute", reflect.TypeOf((*MockAlertingAPI)(nil).LegaryDeleteAlertExecute), r) +} + +// MuteAlert mocks base method. +func (m *MockAlertingAPI) MuteAlert(ctx context.Context, alertId, ruleId, spaceId string) ApiMuteAlertRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MuteAlert", ctx, alertId, ruleId, spaceId) + ret0, _ := ret[0].(ApiMuteAlertRequest) + return ret0 +} + +// MuteAlert indicates an expected call of MuteAlert. +func (mr *MockAlertingAPIMockRecorder) MuteAlert(ctx, alertId, ruleId, spaceId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MuteAlert", reflect.TypeOf((*MockAlertingAPI)(nil).MuteAlert), ctx, alertId, ruleId, spaceId) +} + +// MuteAlertExecute mocks base method. +func (m *MockAlertingAPI) MuteAlertExecute(r ApiMuteAlertRequest) (*http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MuteAlertExecute", r) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MuteAlertExecute indicates an expected call of MuteAlertExecute. +func (mr *MockAlertingAPIMockRecorder) MuteAlertExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MuteAlertExecute", reflect.TypeOf((*MockAlertingAPI)(nil).MuteAlertExecute), r) +} + +// MuteAllAlerts mocks base method. +func (m *MockAlertingAPI) MuteAllAlerts(ctx context.Context, ruleId, spaceId string) ApiMuteAllAlertsRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MuteAllAlerts", ctx, ruleId, spaceId) + ret0, _ := ret[0].(ApiMuteAllAlertsRequest) + return ret0 +} + +// MuteAllAlerts indicates an expected call of MuteAllAlerts. +func (mr *MockAlertingAPIMockRecorder) MuteAllAlerts(ctx, ruleId, spaceId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MuteAllAlerts", reflect.TypeOf((*MockAlertingAPI)(nil).MuteAllAlerts), ctx, ruleId, spaceId) +} + +// MuteAllAlertsExecute mocks base method. +func (m *MockAlertingAPI) MuteAllAlertsExecute(r ApiMuteAllAlertsRequest) (*http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "MuteAllAlertsExecute", r) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// MuteAllAlertsExecute indicates an expected call of MuteAllAlertsExecute. +func (mr *MockAlertingAPIMockRecorder) MuteAllAlertsExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "MuteAllAlertsExecute", reflect.TypeOf((*MockAlertingAPI)(nil).MuteAllAlertsExecute), r) +} + +// UnmuteAlert mocks base method. +func (m *MockAlertingAPI) UnmuteAlert(ctx context.Context, alertId, ruleId, spaceId string) ApiUnmuteAlertRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UnmuteAlert", ctx, alertId, ruleId, spaceId) + ret0, _ := ret[0].(ApiUnmuteAlertRequest) + return ret0 +} + +// UnmuteAlert indicates an expected call of UnmuteAlert. +func (mr *MockAlertingAPIMockRecorder) UnmuteAlert(ctx, alertId, ruleId, spaceId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnmuteAlert", reflect.TypeOf((*MockAlertingAPI)(nil).UnmuteAlert), ctx, alertId, ruleId, spaceId) +} + +// UnmuteAlertExecute mocks base method. +func (m *MockAlertingAPI) UnmuteAlertExecute(r ApiUnmuteAlertRequest) (*http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UnmuteAlertExecute", r) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UnmuteAlertExecute indicates an expected call of UnmuteAlertExecute. +func (mr *MockAlertingAPIMockRecorder) UnmuteAlertExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnmuteAlertExecute", reflect.TypeOf((*MockAlertingAPI)(nil).UnmuteAlertExecute), r) +} + +// UnmuteAllAlerts mocks base method. +func (m *MockAlertingAPI) UnmuteAllAlerts(ctx context.Context, ruleId, spaceId string) ApiUnmuteAllAlertsRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UnmuteAllAlerts", ctx, ruleId, spaceId) + ret0, _ := ret[0].(ApiUnmuteAllAlertsRequest) + return ret0 +} + +// UnmuteAllAlerts indicates an expected call of UnmuteAllAlerts. +func (mr *MockAlertingAPIMockRecorder) UnmuteAllAlerts(ctx, ruleId, spaceId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnmuteAllAlerts", reflect.TypeOf((*MockAlertingAPI)(nil).UnmuteAllAlerts), ctx, ruleId, spaceId) +} + +// UnmuteAllAlertsExecute mocks base method. +func (m *MockAlertingAPI) UnmuteAllAlertsExecute(r ApiUnmuteAllAlertsRequest) (*http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UnmuteAllAlertsExecute", r) + ret0, _ := ret[0].(*http.Response) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// UnmuteAllAlertsExecute indicates an expected call of UnmuteAllAlertsExecute. +func (mr *MockAlertingAPIMockRecorder) UnmuteAllAlertsExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UnmuteAllAlertsExecute", reflect.TypeOf((*MockAlertingAPI)(nil).UnmuteAllAlertsExecute), r) +} + +// UpdateRule mocks base method. +func (m *MockAlertingAPI) UpdateRule(ctx context.Context, ruleId, spaceId string) ApiUpdateRuleRequest { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateRule", ctx, ruleId, spaceId) + ret0, _ := ret[0].(ApiUpdateRuleRequest) + return ret0 +} + +// UpdateRule indicates an expected call of UpdateRule. +func (mr *MockAlertingAPIMockRecorder) UpdateRule(ctx, ruleId, spaceId any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateRule", reflect.TypeOf((*MockAlertingAPI)(nil).UpdateRule), ctx, ruleId, spaceId) +} + +// UpdateRuleExecute mocks base method. +func (m *MockAlertingAPI) UpdateRuleExecute(r ApiUpdateRuleRequest) (*RuleResponseProperties, *http.Response, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "UpdateRuleExecute", r) + ret0, _ := ret[0].(*RuleResponseProperties) + ret1, _ := ret[1].(*http.Response) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 +} + +// UpdateRuleExecute indicates an expected call of UpdateRuleExecute. +func (mr *MockAlertingAPIMockRecorder) UpdateRuleExecute(r any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "UpdateRuleExecute", reflect.TypeOf((*MockAlertingAPI)(nil).UpdateRuleExecute), r) +} diff --git a/go.mod b/go.mod index 4e9bfa9aa..939053c02 100644 --- a/go.mod +++ b/go.mod @@ -20,6 +20,7 @@ require ( github.com/mitchellh/mapstructure v1.5.0 github.com/oapi-codegen/runtime v1.1.1 github.com/stretchr/testify v1.9.0 + go.uber.org/mock v0.4.0 ) require ( @@ -60,6 +61,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.8.0 // indirect github.com/sirupsen/logrus v1.9.0 // indirect + github.com/vektra/mockery v1.1.2 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect @@ -69,7 +71,7 @@ require ( golang.org/x/net v0.23.0 // indirect golang.org/x/sys v0.20.0 // indirect golang.org/x/text v0.15.0 // indirect - golang.org/x/tools v0.13.0 // indirect + golang.org/x/tools v0.17.0 // indirect google.golang.org/appengine v1.6.8 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240227224415-6ceb2ff114de // indirect google.golang.org/grpc v1.63.2 // indirect diff --git a/go.sum b/go.sum index d641d92c6..16c96b0ca 100644 --- a/go.sum +++ b/go.sum @@ -112,7 +112,6 @@ github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPci github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -139,6 +138,8 @@ github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyua github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro= github.com/oapi-codegen/runtime v1.1.1/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= @@ -149,7 +150,6 @@ github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsK github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= -github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= @@ -159,11 +159,16 @@ github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/vektra/mockery v1.1.2 h1:uc0Yn67rJpjt8U/mAZimdCKn9AeA97BOkjpmtBSlfP4= +github.com/vektra/mockery v1.1.2/go.mod h1:VcfZjKaFOPO+MpN4ZvwPjs4c48lkq1o3Ym8yHZJu0jU= +github.com/vektra/mockery/v2 v2.43.2/go.mod h1:XNTE9RIu3deGAGQRVjP1VZxGpQNm0YedZx4oDs3prr8= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= @@ -175,20 +180,26 @@ github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJ github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b h1:FosyBZYxY34Wul7O/MSKey3txpPYyCqVO5ZyceuQJEI= github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRKQfBXbGkpdV6QMzT3rU1kSTAnfu1dO8dPKjYprgj8= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= @@ -196,10 +207,12 @@ golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -229,10 +242,12 @@ golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200323144430-8dcfad9e016e/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.13.0 h1:Iey4qkscZuv0VvIt8E0neZjtPVQFSc870HQ448QgEmQ= -golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58= +golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= +golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= @@ -246,8 +261,9 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.34.0 h1:Qo/qEd2RZPCf2nKuorzksSknv0d3ERwp1vFG38gSmH4= google.golang.org/protobuf v1.34.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= diff --git a/internal/clients/kibana/alerting.go b/internal/clients/kibana/alerting.go index 0a2a49d1d..657f218e3 100644 --- a/internal/clients/kibana/alerting.go +++ b/internal/clients/kibana/alerting.go @@ -2,12 +2,14 @@ package kibana import ( "context" + "fmt" "net/http" "github.com/elastic/terraform-provider-elasticstack/generated/alerting" "github.com/elastic/terraform-provider-elasticstack/internal/clients" "github.com/elastic/terraform-provider-elasticstack/internal/models" "github.com/elastic/terraform-provider-elasticstack/internal/utils" + "github.com/hashicorp/terraform-plugin-sdk/v2/diag" ) @@ -103,12 +105,24 @@ func CreateAlertingRule(ctx context.Context, apiClient ApiClient, rule models.Al return nil, diag.Errorf("Status code [%d], Saved object [%s/%s] conflict (Rule ID already exists in this Space)", res.StatusCode, rule.SpaceID, rule.RuleID) } - if ruleRes != nil { - rule.RuleID = ruleRes.Id + defer res.Body.Close() + + diags := utils.CheckHttpError(res, "Unabled to create alerting rule") + if diags.HasError() { + return nil, diags } - defer res.Body.Close() - return ruleResponseToModel(rule.SpaceID, ruleRes), utils.CheckHttpError(res, "Unabled to create alerting rule") + if ruleRes == nil { + return nil, diag.Diagnostics{diag.Diagnostic{ + Severity: diag.Error, + Summary: "Create rule returned an empty response", + Detail: fmt.Sprintf("Create rule returned an empty response with HTTP status code [%d].", res.StatusCode), + }} + } + + rule.RuleID = ruleRes.Id + + return ruleResponseToModel(rule.SpaceID, ruleRes), nil } func UpdateAlertingRule(ctx context.Context, apiClient ApiClient, rule models.AlertingRule) (*models.AlertingRule, diag.Diagnostics) { @@ -138,16 +152,22 @@ func UpdateAlertingRule(ctx context.Context, apiClient ApiClient, rule models.Al return nil, diag.FromErr(err) } - if ruleRes != nil { - rule.RuleID = ruleRes.Id - } - defer res.Body.Close() if diags := utils.CheckHttpError(res, "Unable to update alerting rule"); diags.HasError() { return nil, diags } + if ruleRes == nil { + return nil, diag.Diagnostics{diag.Diagnostic{ + Severity: diag.Error, + Summary: "Update rule returned an empty response", + Detail: fmt.Sprintf("Update rule returned an empty response with HTTP status code [%d].", res.StatusCode), + }} + } + + rule.RuleID = ruleRes.Id + shouldBeEnabled := rule.Enabled != nil && *rule.Enabled if shouldBeEnabled && !ruleRes.Enabled { diff --git a/internal/clients/kibana/alerting_api_stub.go b/internal/clients/kibana/alerting_api_stub.go deleted file mode 100644 index 7ea8f6f0d..000000000 --- a/internal/clients/kibana/alerting_api_stub.go +++ /dev/null @@ -1,278 +0,0 @@ -package kibana - -import ( - "context" - "net/http" - - "github.com/elastic/terraform-provider-elasticstack/generated/alerting" -) - -type FakeAlertingAPI struct { - RuleResponseProperties *alerting.RuleResponseProperties - HttpResponse *http.Response - Error error -} - -// The method stubs are generated initially by the VS Code Quick Fix for the below Blank Identifier definition. -// https://stackoverflow.com/a/77393824 -var _ alerting.AlertingAPI = (*FakeAlertingAPI)(nil) - -// CreateRule implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) CreateRule(ctx context.Context, spaceId string, ruleId string) alerting.ApiCreateRuleRequest { - return alerting.ApiCreateRuleRequest{ApiService: f} -} - -// CreateRuleExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) CreateRuleExecute(r alerting.ApiCreateRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) { - return f.RuleResponseProperties, f.HttpResponse, f.Error -} - -// DeleteRule implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) DeleteRule(ctx context.Context, ruleId string, spaceId string) alerting.ApiDeleteRuleRequest { - panic("unimplemented") -} - -// DeleteRuleExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) DeleteRuleExecute(r alerting.ApiDeleteRuleRequest) (*http.Response, error) { - panic("unimplemented") -} - -// DisableRule implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) DisableRule(ctx context.Context, ruleId string, spaceId string) alerting.ApiDisableRuleRequest { - panic("unimplemented") -} - -// DisableRuleExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) DisableRuleExecute(r alerting.ApiDisableRuleRequest) (*http.Response, error) { - panic("unimplemented") -} - -// EnableRule implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) EnableRule(ctx context.Context, ruleId string, spaceId string) alerting.ApiEnableRuleRequest { - panic("unimplemented") -} - -// EnableRuleExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) EnableRuleExecute(r alerting.ApiEnableRuleRequest) (*http.Response, error) { - panic("unimplemented") -} - -// FindRules implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) FindRules(ctx context.Context, spaceId string) alerting.ApiFindRulesRequest { - panic("unimplemented") -} - -// FindRulesExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) FindRulesExecute(r alerting.ApiFindRulesRequest) (*alerting.FindRules200Response, *http.Response, error) { - panic("unimplemented") -} - -// GetAlertingHealth implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) GetAlertingHealth(ctx context.Context, spaceId string) alerting.ApiGetAlertingHealthRequest { - panic("unimplemented") -} - -// GetAlertingHealthExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) GetAlertingHealthExecute(r alerting.ApiGetAlertingHealthRequest) (*alerting.GetAlertingHealth200Response, *http.Response, error) { - panic("unimplemented") -} - -// GetRule implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) GetRule(ctx context.Context, ruleId string, spaceId string) alerting.ApiGetRuleRequest { - panic("unimplemented") -} - -// GetRuleExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) GetRuleExecute(r alerting.ApiGetRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) { - panic("unimplemented") -} - -// GetRuleTypes implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) GetRuleTypes(ctx context.Context, spaceId string) alerting.ApiGetRuleTypesRequest { - panic("unimplemented") -} - -// GetRuleTypesExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) GetRuleTypesExecute(r alerting.ApiGetRuleTypesRequest) ([]alerting.GetRuleTypes200ResponseInner, *http.Response, error) { - panic("unimplemented") -} - -// LegacyCreateAlert implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyCreateAlert(ctx context.Context, alertId string, spaceId string) alerting.ApiLegacyCreateAlertRequest { - panic("unimplemented") -} - -// LegacyCreateAlertExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyCreateAlertExecute(r alerting.ApiLegacyCreateAlertRequest) (*alerting.AlertResponseProperties, *http.Response, error) { - panic("unimplemented") -} - -// LegacyDisableAlert implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyDisableAlert(ctx context.Context, spaceId string, alertId string) alerting.ApiLegacyDisableAlertRequest { - panic("unimplemented") -} - -// LegacyDisableAlertExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyDisableAlertExecute(r alerting.ApiLegacyDisableAlertRequest) (*http.Response, error) { - panic("unimplemented") -} - -// LegacyEnableAlert implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyEnableAlert(ctx context.Context, spaceId string, alertId string) alerting.ApiLegacyEnableAlertRequest { - panic("unimplemented") -} - -// LegacyEnableAlertExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyEnableAlertExecute(r alerting.ApiLegacyEnableAlertRequest) (*http.Response, error) { - panic("unimplemented") -} - -// LegacyFindAlerts implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyFindAlerts(ctx context.Context, spaceId string) alerting.ApiLegacyFindAlertsRequest { - panic("unimplemented") -} - -// LegacyFindAlertsExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyFindAlertsExecute(r alerting.ApiLegacyFindAlertsRequest) (*alerting.LegacyFindAlerts200Response, *http.Response, error) { - panic("unimplemented") -} - -// LegacyGetAlert implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyGetAlert(ctx context.Context, spaceId string, alertId string) alerting.ApiLegacyGetAlertRequest { - panic("unimplemented") -} - -// LegacyGetAlertExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyGetAlertExecute(r alerting.ApiLegacyGetAlertRequest) (*alerting.AlertResponseProperties, *http.Response, error) { - panic("unimplemented") -} - -// LegacyGetAlertTypes implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyGetAlertTypes(ctx context.Context, spaceId string) alerting.ApiLegacyGetAlertTypesRequest { - panic("unimplemented") -} - -// LegacyGetAlertTypesExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyGetAlertTypesExecute(r alerting.ApiLegacyGetAlertTypesRequest) ([]alerting.LegacyGetAlertTypes200ResponseInner, *http.Response, error) { - panic("unimplemented") -} - -// LegacyGetAlertingHealth implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyGetAlertingHealth(ctx context.Context, spaceId string) alerting.ApiLegacyGetAlertingHealthRequest { - panic("unimplemented") -} - -// LegacyGetAlertingHealthExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyGetAlertingHealthExecute(r alerting.ApiLegacyGetAlertingHealthRequest) (*alerting.LegacyGetAlertingHealth200Response, *http.Response, error) { - panic("unimplemented") -} - -// LegacyMuteAlertInstance implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyMuteAlertInstance(ctx context.Context, spaceId string, alertId string, alertInstanceId string) alerting.ApiLegacyMuteAlertInstanceRequest { - panic("unimplemented") -} - -// LegacyMuteAlertInstanceExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyMuteAlertInstanceExecute(r alerting.ApiLegacyMuteAlertInstanceRequest) (*http.Response, error) { - panic("unimplemented") -} - -// LegacyMuteAllAlertInstances implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyMuteAllAlertInstances(ctx context.Context, spaceId string, alertId string) alerting.ApiLegacyMuteAllAlertInstancesRequest { - panic("unimplemented") -} - -// LegacyMuteAllAlertInstancesExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyMuteAllAlertInstancesExecute(r alerting.ApiLegacyMuteAllAlertInstancesRequest) (*http.Response, error) { - panic("unimplemented") -} - -// LegacyUnmuteAlertInstance implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyUnmuteAlertInstance(ctx context.Context, spaceId string, alertId string, alertInstanceId string) alerting.ApiLegacyUnmuteAlertInstanceRequest { - panic("unimplemented") -} - -// LegacyUnmuteAlertInstanceExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyUnmuteAlertInstanceExecute(r alerting.ApiLegacyUnmuteAlertInstanceRequest) (*http.Response, error) { - panic("unimplemented") -} - -// LegacyUnmuteAllAlertInstances implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyUnmuteAllAlertInstances(ctx context.Context, spaceId string, alertId string) alerting.ApiLegacyUnmuteAllAlertInstancesRequest { - panic("unimplemented") -} - -// LegacyUnmuteAllAlertInstancesExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyUnmuteAllAlertInstancesExecute(r alerting.ApiLegacyUnmuteAllAlertInstancesRequest) (*http.Response, error) { - panic("unimplemented") -} - -// LegacyUpdateAlert implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyUpdateAlert(ctx context.Context, spaceId string, alertId string) alerting.ApiLegacyUpdateAlertRequest { - panic("unimplemented") -} - -// LegacyUpdateAlertExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegacyUpdateAlertExecute(r alerting.ApiLegacyUpdateAlertRequest) (*alerting.AlertResponseProperties, *http.Response, error) { - panic("unimplemented") -} - -// LegaryDeleteAlert implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegaryDeleteAlert(ctx context.Context, spaceId string, alertId string) alerting.ApiLegaryDeleteAlertRequest { - panic("unimplemented") -} - -// LegaryDeleteAlertExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) LegaryDeleteAlertExecute(r alerting.ApiLegaryDeleteAlertRequest) (*http.Response, error) { - panic("unimplemented") -} - -// MuteAlert implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) MuteAlert(ctx context.Context, alertId string, ruleId string, spaceId string) alerting.ApiMuteAlertRequest { - panic("unimplemented") -} - -// MuteAlertExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) MuteAlertExecute(r alerting.ApiMuteAlertRequest) (*http.Response, error) { - panic("unimplemented") -} - -// MuteAllAlerts implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) MuteAllAlerts(ctx context.Context, ruleId string, spaceId string) alerting.ApiMuteAllAlertsRequest { - panic("unimplemented") -} - -// MuteAllAlertsExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) MuteAllAlertsExecute(r alerting.ApiMuteAllAlertsRequest) (*http.Response, error) { - panic("unimplemented") -} - -// UnmuteAlert implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) UnmuteAlert(ctx context.Context, alertId string, ruleId string, spaceId string) alerting.ApiUnmuteAlertRequest { - panic("unimplemented") -} - -// UnmuteAlertExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) UnmuteAlertExecute(r alerting.ApiUnmuteAlertRequest) (*http.Response, error) { - panic("unimplemented") -} - -// UnmuteAllAlerts implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) UnmuteAllAlerts(ctx context.Context, ruleId string, spaceId string) alerting.ApiUnmuteAllAlertsRequest { - panic("unimplemented") -} - -// UnmuteAllAlertsExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) UnmuteAllAlertsExecute(r alerting.ApiUnmuteAllAlertsRequest) (*http.Response, error) { - panic("unimplemented") -} - -// UpdateRule implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) UpdateRule(ctx context.Context, ruleId string, spaceId string) alerting.ApiUpdateRuleRequest { - return alerting.ApiUpdateRuleRequest{ApiService: f} -} - -// UpdateRuleExecute implements alerting.AlertingAPI. -func (f *FakeAlertingAPI) UpdateRuleExecute(r alerting.ApiUpdateRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) { - return f.RuleResponseProperties, f.HttpResponse, f.Error -} diff --git a/internal/clients/kibana/alerting_mocks.go b/internal/clients/kibana/alerting_mocks.go new file mode 100644 index 000000000..6ec4df61e --- /dev/null +++ b/internal/clients/kibana/alerting_mocks.go @@ -0,0 +1,70 @@ +// Code generated by MockGen. DO NOT EDIT. +// Source: ../internal/clients/kibana/alerting.go +// +// Generated by this command: +// +// mockgen -destination=../internal/clients/kibana/alerting_mocks.go -package=kibana -source ../internal/clients/kibana/alerting.go ApiClient +// + +// Package kibana is a generated GoMock package. +package kibana + +import ( + context "context" + reflect "reflect" + + alerting "github.com/elastic/terraform-provider-elasticstack/generated/alerting" + gomock "go.uber.org/mock/gomock" +) + +// MockApiClient is a mock of ApiClient interface. +type MockApiClient struct { + ctrl *gomock.Controller + recorder *MockApiClientMockRecorder +} + +// MockApiClientMockRecorder is the mock recorder for MockApiClient. +type MockApiClientMockRecorder struct { + mock *MockApiClient +} + +// NewMockApiClient creates a new mock instance. +func NewMockApiClient(ctrl *gomock.Controller) *MockApiClient { + mock := &MockApiClient{ctrl: ctrl} + mock.recorder = &MockApiClientMockRecorder{mock} + return mock +} + +// EXPECT returns an object that allows the caller to indicate expected use. +func (m *MockApiClient) EXPECT() *MockApiClientMockRecorder { + return m.recorder +} + +// GetAlertingClient mocks base method. +func (m *MockApiClient) GetAlertingClient() (alerting.AlertingAPI, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "GetAlertingClient") + ret0, _ := ret[0].(alerting.AlertingAPI) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// GetAlertingClient indicates an expected call of GetAlertingClient. +func (mr *MockApiClientMockRecorder) GetAlertingClient() *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAlertingClient", reflect.TypeOf((*MockApiClient)(nil).GetAlertingClient)) +} + +// SetAlertingAuthContext mocks base method. +func (m *MockApiClient) SetAlertingAuthContext(arg0 context.Context) context.Context { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SetAlertingAuthContext", arg0) + ret0, _ := ret[0].(context.Context) + return ret0 +} + +// SetAlertingAuthContext indicates an expected call of SetAlertingAuthContext. +func (mr *MockApiClientMockRecorder) SetAlertingAuthContext(arg0 any) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SetAlertingAuthContext", reflect.TypeOf((*MockApiClient)(nil).SetAlertingAuthContext), arg0) +} diff --git a/internal/clients/kibana/alerting_test.go b/internal/clients/kibana/alerting_test.go index ffbd79103..f98b6c0b0 100644 --- a/internal/clients/kibana/alerting_test.go +++ b/internal/clients/kibana/alerting_test.go @@ -13,6 +13,7 @@ import ( "github.com/elastic/terraform-provider-elasticstack/internal/models" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/stretchr/testify/require" + gomock "go.uber.org/mock/gomock" ) func Test_ruleResponseToModel(t *testing.T) { @@ -130,16 +131,14 @@ func Test_ruleResponseToModel(t *testing.T) { } func Test_CreateUpdateAlertingRule(t *testing.T) { - getApiClient := func() ApiClient { - return &FakeApiClient{ - &FakeAlertingAPI{ - RuleResponseProperties: nil, - HttpResponse: &http.Response{ - StatusCode: 401, - Body: io.NopCloser(strings.NewReader("some error")), - }, - }, - } + ctrl := gomock.NewController(t) + + getApiClient := func() (ApiClient, *alerting.MockAlertingAPI) { + apiClient := NewMockApiClient(ctrl) + apiClient.EXPECT().SetAlertingAuthContext(gomock.Any()).DoAndReturn(func(ctx context.Context) context.Context {return ctx}) + alertingClient := alerting.NewMockAlertingAPI(ctrl) + apiClient.EXPECT().GetAlertingClient().DoAndReturn(func() (alerting.AlertingAPI, error) { return alertingClient, nil}) + return apiClient, alertingClient } tests := []struct { @@ -151,21 +150,69 @@ func Test_CreateUpdateAlertingRule(t *testing.T) { expectedErr string }{ { - name: "CreateAlertingRule should not crash when client returns 4xx", + name: "CreateAlertingRule should not crash when backend returns 4xx", testFunc: CreateAlertingRule, - client: getApiClient(), + client: func() ApiClient { + apiClient, alertingClient := getApiClient() + alertingClient.EXPECT().CreateRule(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func (ctx context.Context, spaceId string, ruleId string) alerting.ApiCreateRuleRequest { return alerting.ApiCreateRuleRequest{ApiService: alertingClient} }) + alertingClient.EXPECT().CreateRuleExecute(gomock.Any()).DoAndReturn(func(r alerting.ApiCreateRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) {return nil, &http.Response{ + StatusCode: 401, + Body: io.NopCloser(strings.NewReader("some error")), + }, nil}) + return apiClient + }(), rule: models.AlertingRule{}, expectedRes: nil, expectedErr: "some error", }, { - name: "UpdateAlertingRule should not crash when client returns 4xx", + name: "UpdateAlertingRule should not crash when backend returns 4xx", testFunc: UpdateAlertingRule, - client: getApiClient(), + client: func() ApiClient { + apiClient, alertingClient := getApiClient() + alertingClient.EXPECT().UpdateRule(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func (ctx context.Context, spaceId string, ruleId string) alerting.ApiUpdateRuleRequest { return alerting.ApiUpdateRuleRequest{ApiService: alertingClient} }) + alertingClient.EXPECT().UpdateRuleExecute(gomock.Any()).DoAndReturn(func(r alerting.ApiUpdateRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) {return nil, &http.Response{ + StatusCode: 401, + Body: io.NopCloser(strings.NewReader("some error")), + }, nil}) + return apiClient + }(), rule: models.AlertingRule{}, expectedRes: nil, expectedErr: "some error", }, + { + name: "CreateAlertingRule should not crash when backend returns an empty response and HTTP 200", + testFunc: CreateAlertingRule, + client: func() ApiClient { + apiClient, alertingClient := getApiClient() + alertingClient.EXPECT().CreateRule(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func (ctx context.Context, spaceId string, ruleId string) alerting.ApiCreateRuleRequest { return alerting.ApiCreateRuleRequest{ApiService: alertingClient} }) + alertingClient.EXPECT().CreateRuleExecute(gomock.Any()).DoAndReturn(func(r alerting.ApiCreateRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) {return nil, &http.Response{ + StatusCode: 200, + Body: io.NopCloser(strings.NewReader("everything seems fine")), + }, nil}) + return apiClient + }(), + rule: models.AlertingRule{}, + expectedRes: nil, + expectedErr: "empty response", + }, + { + name: "UpdateAlertingRule should not crash when backend returns an empty response and HTTP 200", + testFunc: UpdateAlertingRule, + client: func() ApiClient { + apiClient, alertingClient := getApiClient() + alertingClient.EXPECT().UpdateRule(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func (ctx context.Context, spaceId string, ruleId string) alerting.ApiUpdateRuleRequest { return alerting.ApiUpdateRuleRequest{ApiService: alertingClient} }) + alertingClient.EXPECT().UpdateRuleExecute(gomock.Any()).DoAndReturn(func(r alerting.ApiUpdateRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) {return nil, &http.Response{ + StatusCode: 200, + Body: io.NopCloser(strings.NewReader("everything seems fine")), + }, nil}) + return apiClient + }(), + rule: models.AlertingRule{}, + expectedRes: nil, + expectedErr: "empty response", + }, } for _, tt := range tests { @@ -187,13 +234,3 @@ func Test_CreateUpdateAlertingRule(t *testing.T) { }) } } - -type FakeApiClient struct { - Alerting alerting.AlertingAPI -} - -func (f *FakeApiClient) SetAlertingAuthContext(ctx context.Context) context.Context { return ctx } - -func (f *FakeApiClient) GetAlertingClient() (alerting.AlertingAPI, error) { - return f.Alerting, nil -} diff --git a/tools/connectors_gen.go b/tools/connectors_gen.go index aa9f40c78..a16a4045a 100644 --- a/tools/connectors_gen.go +++ b/tools/connectors_gen.go @@ -1,3 +1,5 @@ //go:generate go run github.com/deepmap/oapi-codegen/v2/cmd/oapi-codegen -package connectors -o ../generated/connectors/connectors.gen.go -generate "types,client" ../generated/connectors/bundled.yaml +//go:generate go run go.uber.org/mock/mockgen -destination=../generated/alerting/api_alerting_mocks.go -package=alerting -source ../generated/alerting/api_alerting.go AlertingAPI +//go:generate go run go.uber.org/mock/mockgen -destination=../internal/clients/kibana/alerting_mocks.go -package=kibana -source ../internal/clients/kibana/alerting.go ApiClient package tools diff --git a/tools/go.mod b/tools/go.mod index 6f8ca58e7..f0e2dc0a6 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -10,6 +10,7 @@ require ( github.com/golangci/golangci-lint v1.58.2 github.com/goreleaser/goreleaser v1.26.1 github.com/hashicorp/terraform-plugin-docs v0.18.0 + go.uber.org/mock v0.4.0 ) require ( @@ -243,7 +244,7 @@ require ( github.com/hashicorp/terraform-exec v0.20.0 // indirect github.com/hashicorp/terraform-json v0.21.0 // indirect github.com/hexops/gotextdiff v1.0.3 // indirect - github.com/huandu/xstrings v1.3.3 // indirect + github.com/huandu/xstrings v1.4.0 // indirect github.com/imdario/mergo v0.3.16 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/invopop/jsonschema v0.12.0 // indirect diff --git a/tools/go.sum b/tools/go.sum index fc2538cf1..0f74c7626 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -626,6 +626,7 @@ github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUq github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= @@ -1049,6 +1050,7 @@ github.com/uudashr/gocognit v1.1.2 h1:l6BAEKJqQH2UpKAPKdMfZf5kE4W/2xk8pfU1OVLvni github.com/uudashr/gocognit v1.1.2/go.mod h1:aAVdLURqcanke8h3vg35BC++eseDm66Z7KmchI5et4k= github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts= github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk= +github.com/vektra/mockery/v2 v2.43.2/go.mod h1:XNTE9RIu3deGAGQRVjP1VZxGpQNm0YedZx4oDs3prr8= github.com/wagoodman/go-partybus v0.0.0-20230516145632-8ccac152c651 h1:jIVmlAFIqV3d+DOxazTR9v+zgj8+VYuQBzPgBZvWBHA= github.com/wagoodman/go-partybus v0.0.0-20230516145632-8ccac152c651/go.mod h1:b26F2tHLqaoRQf8DywqzVaV1MQ9yvjb0OMcNl7Nxu20= github.com/wagoodman/go-progress v0.0.0-20220614130704-4b1c25a33c7c h1:gFwUKtkv6QzQsFdIjvPqd0Qdw42DHUEbbUdiUTI1uco= @@ -1133,6 +1135,8 @@ go.uber.org/automaxprocs v1.5.3/go.mod h1:eRbA25aqJrxAbsLO0xy5jVwPt7FQnRgjW+efnw go.uber.org/goleak v1.1.11-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= +go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= diff --git a/tools/tools.go b/tools/tools.go index 6c4ccd488..8f4739a37 100644 --- a/tools/tools.go +++ b/tools/tools.go @@ -9,4 +9,5 @@ import ( _ "github.com/golangci/golangci-lint/cmd/golangci-lint" _ "github.com/goreleaser/goreleaser" _ "github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs" + _ "go.uber.org/mock/mockgen" ) From 610927305f877bb1718eb0b61dab0f9624d9f918 Mon Sep 17 00:00:00 2001 From: Dmytro Onishchenko Date: Fri, 31 May 2024 19:49:08 +0200 Subject: [PATCH 5/8] Fix fmt --- internal/clients/kibana/alerting_test.go | 86 ++++++++++++++---------- 1 file changed, 51 insertions(+), 35 deletions(-) diff --git a/internal/clients/kibana/alerting_test.go b/internal/clients/kibana/alerting_test.go index f98b6c0b0..2a9d0b4d2 100644 --- a/internal/clients/kibana/alerting_test.go +++ b/internal/clients/kibana/alerting_test.go @@ -131,13 +131,13 @@ func Test_ruleResponseToModel(t *testing.T) { } func Test_CreateUpdateAlertingRule(t *testing.T) { - ctrl := gomock.NewController(t) + ctrl := gomock.NewController(t) getApiClient := func() (ApiClient, *alerting.MockAlertingAPI) { apiClient := NewMockApiClient(ctrl) - apiClient.EXPECT().SetAlertingAuthContext(gomock.Any()).DoAndReturn(func(ctx context.Context) context.Context {return ctx}) + apiClient.EXPECT().SetAlertingAuthContext(gomock.Any()).DoAndReturn(func(ctx context.Context) context.Context { return ctx }) alertingClient := alerting.NewMockAlertingAPI(ctrl) - apiClient.EXPECT().GetAlertingClient().DoAndReturn(func() (alerting.AlertingAPI, error) { return alertingClient, nil}) + apiClient.EXPECT().GetAlertingClient().DoAndReturn(func() (alerting.AlertingAPI, error) { return alertingClient, nil }) return apiClient, alertingClient } @@ -150,15 +150,19 @@ func Test_CreateUpdateAlertingRule(t *testing.T) { expectedErr string }{ { - name: "CreateAlertingRule should not crash when backend returns 4xx", - testFunc: CreateAlertingRule, - client: func() ApiClient { + name: "CreateAlertingRule should not crash when backend returns 4xx", + testFunc: CreateAlertingRule, + client: func() ApiClient { apiClient, alertingClient := getApiClient() - alertingClient.EXPECT().CreateRule(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func (ctx context.Context, spaceId string, ruleId string) alerting.ApiCreateRuleRequest { return alerting.ApiCreateRuleRequest{ApiService: alertingClient} }) - alertingClient.EXPECT().CreateRuleExecute(gomock.Any()).DoAndReturn(func(r alerting.ApiCreateRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) {return nil, &http.Response{ - StatusCode: 401, - Body: io.NopCloser(strings.NewReader("some error")), - }, nil}) + alertingClient.EXPECT().CreateRule(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func(ctx context.Context, spaceId string, ruleId string) alerting.ApiCreateRuleRequest { + return alerting.ApiCreateRuleRequest{ApiService: alertingClient} + }) + alertingClient.EXPECT().CreateRuleExecute(gomock.Any()).DoAndReturn(func(r alerting.ApiCreateRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) { + return nil, &http.Response{ + StatusCode: 401, + Body: io.NopCloser(strings.NewReader("some error")), + }, nil + }) return apiClient }(), rule: models.AlertingRule{}, @@ -166,15 +170,19 @@ func Test_CreateUpdateAlertingRule(t *testing.T) { expectedErr: "some error", }, { - name: "UpdateAlertingRule should not crash when backend returns 4xx", - testFunc: UpdateAlertingRule, - client: func() ApiClient { + name: "UpdateAlertingRule should not crash when backend returns 4xx", + testFunc: UpdateAlertingRule, + client: func() ApiClient { apiClient, alertingClient := getApiClient() - alertingClient.EXPECT().UpdateRule(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func (ctx context.Context, spaceId string, ruleId string) alerting.ApiUpdateRuleRequest { return alerting.ApiUpdateRuleRequest{ApiService: alertingClient} }) - alertingClient.EXPECT().UpdateRuleExecute(gomock.Any()).DoAndReturn(func(r alerting.ApiUpdateRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) {return nil, &http.Response{ - StatusCode: 401, - Body: io.NopCloser(strings.NewReader("some error")), - }, nil}) + alertingClient.EXPECT().UpdateRule(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func(ctx context.Context, spaceId string, ruleId string) alerting.ApiUpdateRuleRequest { + return alerting.ApiUpdateRuleRequest{ApiService: alertingClient} + }) + alertingClient.EXPECT().UpdateRuleExecute(gomock.Any()).DoAndReturn(func(r alerting.ApiUpdateRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) { + return nil, &http.Response{ + StatusCode: 401, + Body: io.NopCloser(strings.NewReader("some error")), + }, nil + }) return apiClient }(), rule: models.AlertingRule{}, @@ -182,15 +190,19 @@ func Test_CreateUpdateAlertingRule(t *testing.T) { expectedErr: "some error", }, { - name: "CreateAlertingRule should not crash when backend returns an empty response and HTTP 200", - testFunc: CreateAlertingRule, - client: func() ApiClient { + name: "CreateAlertingRule should not crash when backend returns an empty response and HTTP 200", + testFunc: CreateAlertingRule, + client: func() ApiClient { apiClient, alertingClient := getApiClient() - alertingClient.EXPECT().CreateRule(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func (ctx context.Context, spaceId string, ruleId string) alerting.ApiCreateRuleRequest { return alerting.ApiCreateRuleRequest{ApiService: alertingClient} }) - alertingClient.EXPECT().CreateRuleExecute(gomock.Any()).DoAndReturn(func(r alerting.ApiCreateRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) {return nil, &http.Response{ - StatusCode: 200, - Body: io.NopCloser(strings.NewReader("everything seems fine")), - }, nil}) + alertingClient.EXPECT().CreateRule(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func(ctx context.Context, spaceId string, ruleId string) alerting.ApiCreateRuleRequest { + return alerting.ApiCreateRuleRequest{ApiService: alertingClient} + }) + alertingClient.EXPECT().CreateRuleExecute(gomock.Any()).DoAndReturn(func(r alerting.ApiCreateRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) { + return nil, &http.Response{ + StatusCode: 200, + Body: io.NopCloser(strings.NewReader("everything seems fine")), + }, nil + }) return apiClient }(), rule: models.AlertingRule{}, @@ -198,15 +210,19 @@ func Test_CreateUpdateAlertingRule(t *testing.T) { expectedErr: "empty response", }, { - name: "UpdateAlertingRule should not crash when backend returns an empty response and HTTP 200", - testFunc: UpdateAlertingRule, - client: func() ApiClient { + name: "UpdateAlertingRule should not crash when backend returns an empty response and HTTP 200", + testFunc: UpdateAlertingRule, + client: func() ApiClient { apiClient, alertingClient := getApiClient() - alertingClient.EXPECT().UpdateRule(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func (ctx context.Context, spaceId string, ruleId string) alerting.ApiUpdateRuleRequest { return alerting.ApiUpdateRuleRequest{ApiService: alertingClient} }) - alertingClient.EXPECT().UpdateRuleExecute(gomock.Any()).DoAndReturn(func(r alerting.ApiUpdateRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) {return nil, &http.Response{ - StatusCode: 200, - Body: io.NopCloser(strings.NewReader("everything seems fine")), - }, nil}) + alertingClient.EXPECT().UpdateRule(gomock.Any(), gomock.Any(), gomock.Any()).DoAndReturn(func(ctx context.Context, spaceId string, ruleId string) alerting.ApiUpdateRuleRequest { + return alerting.ApiUpdateRuleRequest{ApiService: alertingClient} + }) + alertingClient.EXPECT().UpdateRuleExecute(gomock.Any()).DoAndReturn(func(r alerting.ApiUpdateRuleRequest) (*alerting.RuleResponseProperties, *http.Response, error) { + return nil, &http.Response{ + StatusCode: 200, + Body: io.NopCloser(strings.NewReader("everything seems fine")), + }, nil + }) return apiClient }(), rule: models.AlertingRule{}, From a002e74ffe099345cd3dc8b77187c959b47acc09 Mon Sep 17 00:00:00 2001 From: Dmytro Onishchenko Date: Fri, 31 May 2024 19:54:21 +0200 Subject: [PATCH 6/8] Fix go.mod --- go.mod | 7 +++++++ go.sum | 26 ++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) diff --git a/go.mod b/go.mod index 939053c02..82d35ab76 100644 --- a/go.mod +++ b/go.mod @@ -24,6 +24,9 @@ require ( ) require ( + github.com/Masterminds/goutils v1.1.1 // indirect + github.com/Masterminds/semver/v3 v3.2.0 // indirect + github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect github.com/agext/levenshtein v1.2.3 // indirect github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect @@ -50,6 +53,8 @@ require ( github.com/hashicorp/terraform-registry-address v0.2.3 // indirect github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect + github.com/huandu/xstrings v1.3.3 // indirect + github.com/imdario/mergo v0.3.15 // indirect github.com/kr/pretty v0.3.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -60,7 +65,9 @@ require ( github.com/oklog/run v1.1.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.8.0 // indirect + github.com/shopspring/decimal v1.2.0 // indirect github.com/sirupsen/logrus v1.9.0 // indirect + github.com/spf13/cast v1.3.1 // indirect github.com/vektra/mockery v1.1.2 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect diff --git a/go.sum b/go.sum index 16c96b0ca..e8d858978 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,11 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= +github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= +github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= +github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= +github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= +github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/ProtonMail/go-crypto v1.1.0-alpha.2 h1:bkyFVUP+ROOARdgCiJzNQo2V2kiB97LyUpzH9P6Hrlg= @@ -53,6 +59,7 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -104,6 +111,11 @@ github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= +github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= +github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= +github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= @@ -128,6 +140,7 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= +github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= @@ -136,6 +149,7 @@ github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQ github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= @@ -153,15 +167,20 @@ github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTE github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= +github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= +github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= +github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= @@ -191,6 +210,7 @@ go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -203,6 +223,7 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= +golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -225,11 +246,13 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= +golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -238,6 +261,7 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= +golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -267,6 +291,8 @@ gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8 gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From a7943f3677f69c5749e3754ba3e983a40240ffc3 Mon Sep 17 00:00:00 2001 From: Dmytro Onishchenko Date: Fri, 31 May 2024 19:54:46 +0200 Subject: [PATCH 7/8] Update generated files --- generated/connectors/connectors.gen.go | 58 +++++++++++++------------- generated/fleet/fleet.gen.go | 18 ++++---- 2 files changed, 38 insertions(+), 38 deletions(-) diff --git a/generated/connectors/connectors.gen.go b/generated/connectors/connectors.gen.go index 600b88067..c60db1be8 100644 --- a/generated/connectors/connectors.gen.go +++ b/generated/connectors/connectors.gen.go @@ -1,6 +1,6 @@ // Package connectors provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0 DO NOT EDIT. +// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT. package connectors import ( @@ -2418,7 +2418,7 @@ func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesCasesWebho return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -2446,7 +2446,7 @@ func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesEmail(v Co return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -2474,7 +2474,7 @@ func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesIndex(v Co return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -2502,7 +2502,7 @@ func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesJira(v Con return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -2530,7 +2530,7 @@ func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesOpsgenie(v return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -2558,7 +2558,7 @@ func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesPagerduty( return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -2586,7 +2586,7 @@ func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesResilient( return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -2614,7 +2614,7 @@ func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesServerlog( return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -2642,7 +2642,7 @@ func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesServicenow return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -2670,7 +2670,7 @@ func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesServicenow return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -2698,7 +2698,7 @@ func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesServicenow return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -2726,7 +2726,7 @@ func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesSlack(v Co return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -2754,7 +2754,7 @@ func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesSlackApi(v return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -2782,7 +2782,7 @@ func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesSwimlane(v return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -2810,7 +2810,7 @@ func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesTeams(v Co return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -2838,7 +2838,7 @@ func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesTines(v Co return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -2866,7 +2866,7 @@ func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesWebhook(v return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -2894,7 +2894,7 @@ func (t *ConnectorResponseProperties) MergeConnectorResponsePropertiesXmatters(v return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -2985,7 +2985,7 @@ func (t *LegacyRunConnectorGeneralResponse_Data) MergeLegacyRunConnectorGeneralR return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -3011,7 +3011,7 @@ func (t *LegacyRunConnectorGeneralResponse_Data) MergeLegacyRunConnectorGeneralR return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -3047,7 +3047,7 @@ func (t *RunConnectorGeneralResponse_Data) MergeRunConnectorGeneralResponseData0 return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -3073,7 +3073,7 @@ func (t *RunConnectorGeneralResponse_Data) MergeRunConnectorGeneralResponseData1 return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -3109,7 +3109,7 @@ func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_DestIp) Mer return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -3135,7 +3135,7 @@ func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_DestIp) Mer return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -3171,7 +3171,7 @@ func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_MalwareHash return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -3197,7 +3197,7 @@ func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_MalwareHash return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -3233,7 +3233,7 @@ func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_SourceIp) M return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -3259,7 +3259,7 @@ func (t *RunConnectorSubactionPushtoservice_SubActionParams_Incident_SourceIp) M return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } diff --git a/generated/fleet/fleet.gen.go b/generated/fleet/fleet.gen.go index 1f4685dd4..990ba1b7b 100644 --- a/generated/fleet/fleet.gen.go +++ b/generated/fleet/fleet.gen.go @@ -1,6 +1,6 @@ // Package fleet provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.0.0 DO NOT EDIT. +// Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.0 DO NOT EDIT. package fleet import ( @@ -961,7 +961,7 @@ func (t *OutputCreateRequest) MergeOutputCreateRequestElasticsearch(v OutputCrea return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -989,7 +989,7 @@ func (t *OutputCreateRequest) MergeOutputCreateRequestKafka(v OutputCreateReques return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -1017,7 +1017,7 @@ func (t *OutputCreateRequest) MergeOutputCreateRequestLogstash(v OutputCreateReq return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -1080,7 +1080,7 @@ func (t *OutputUpdateRequest) MergeOutputUpdateRequestElasticsearch(v OutputUpda return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -1108,7 +1108,7 @@ func (t *OutputUpdateRequest) MergeOutputUpdateRequestKafka(v OutputUpdateReques return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -1136,7 +1136,7 @@ func (t *OutputUpdateRequest) MergeOutputUpdateRequestLogstash(v OutputUpdateReq return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -1197,7 +1197,7 @@ func (t *PackageItemType) MergeKibanaSavedObjectType(v KibanaSavedObjectType) er return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } @@ -1223,7 +1223,7 @@ func (t *PackageItemType) MergeElasticsearchAssetType(v ElasticsearchAssetType) return err } - merged, err := runtime.JsonMerge(t.union, b) + merged, err := runtime.JSONMerge(t.union, b) t.union = merged return err } From 48589151cbff63500f07af9511bf81c5cff8fe5b Mon Sep 17 00:00:00 2001 From: Dmytro Onishchenko Date: Fri, 31 May 2024 19:57:10 +0200 Subject: [PATCH 8/8] Update go.mod for both tools and main --- go.mod | 8 -------- go.sum | 46 +++------------------------------------------- tools/go.sum | 3 +-- 3 files changed, 4 insertions(+), 53 deletions(-) diff --git a/go.mod b/go.mod index 82d35ab76..63a897be3 100644 --- a/go.mod +++ b/go.mod @@ -24,9 +24,6 @@ require ( ) require ( - github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver/v3 v3.2.0 // indirect - github.com/Masterminds/sprig/v3 v3.2.3 // indirect github.com/ProtonMail/go-crypto v1.1.0-alpha.2 // indirect github.com/agext/levenshtein v1.2.3 // indirect github.com/apapsch/go-jsonmerge/v2 v2.0.0 // indirect @@ -53,8 +50,6 @@ require ( github.com/hashicorp/terraform-registry-address v0.2.3 // indirect github.com/hashicorp/terraform-svchost v0.1.1 // indirect github.com/hashicorp/yamux v0.1.1 // indirect - github.com/huandu/xstrings v1.3.3 // indirect - github.com/imdario/mergo v0.3.15 // indirect github.com/kr/pretty v0.3.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -65,10 +60,7 @@ require ( github.com/oklog/run v1.1.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.8.0 // indirect - github.com/shopspring/decimal v1.2.0 // indirect github.com/sirupsen/logrus v1.9.0 // indirect - github.com/spf13/cast v1.3.1 // indirect - github.com/vektra/mockery v1.1.2 // indirect github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect github.com/vmihailenco/msgpack/v5 v5.4.1 // indirect github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect diff --git a/go.sum b/go.sum index e8d858978..a9c5914ff 100644 --- a/go.sum +++ b/go.sum @@ -1,11 +1,5 @@ dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= dario.cat/mergo v1.0.0/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk= -github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= -github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= -github.com/Masterminds/semver/v3 v3.2.0 h1:3MEsd0SM6jqZojhjLWWeBY+Kcjy9i6MQAeY7YgDP83g= -github.com/Masterminds/semver/v3 v3.2.0/go.mod h1:qvl/7zhW3nngYb5+80sSMF+FG2BjYrf8m9wsX0PNOMQ= -github.com/Masterminds/sprig/v3 v3.2.3 h1:eL2fZNezLomi0uOLqjQoN6BfsDD+fyLtgbJMAj9n6YA= -github.com/Masterminds/sprig/v3 v3.2.3/go.mod h1:rXcFaZ2zZbLRJv/xSysmlgIM1u11eBaRMhvYXJNkGuM= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/ProtonMail/go-crypto v1.1.0-alpha.2 h1:bkyFVUP+ROOARdgCiJzNQo2V2kiB97LyUpzH9P6Hrlg= @@ -59,7 +53,6 @@ github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= @@ -111,11 +104,6 @@ github.com/hashicorp/terraform-svchost v0.1.1 h1:EZZimZ1GxdqFRinZ1tpJwVxxt49xc/S github.com/hashicorp/terraform-svchost v0.1.1/go.mod h1:mNsjQfZyf/Jhz35v6/0LWcv26+X7JPS+buii2c9/ctc= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= -github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= -github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= -github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/imdario/mergo v0.3.15 h1:M8XP7IuFNsqUx6VPK2P9OSmsYsI/YFaGil0uD21V3dM= -github.com/imdario/mergo v0.3.15/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jhump/protoreflect v1.15.1 h1:HUMERORf3I3ZdX05WaQ6MIpd/NJ434hTp5YiKgfCL6c= @@ -124,6 +112,7 @@ github.com/juju/gnuflag v0.0.0-20171113085948-2ce1bb71843d/go.mod h1:2PavIy+JPci github.com/kevinburke/ssh_config v1.2.0 h1:x584FjTGwHzMwvHx18PXxbBVzfnxogHaAReU4gf13a4= github.com/kevinburke/ssh_config v1.2.0/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0= github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -140,7 +129,6 @@ github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWE github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b h1:j7+1HpAFS1zy5+Q4qx1fWh90gTKwiN4QCGoY9TWyyO4= github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b/go.mod h1:01TrycV0kFyexm33Z7vhZRXopbI8J3TDReVlkTgMUxE= -github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= @@ -149,11 +137,8 @@ github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQ github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/mapstructure v1.5.0 h1:jeMsZIYE/09sWLaz43PL7Gy6RuMjD2eJVyuac5Z2hdY= github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= -github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= -github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oapi-codegen/runtime v1.1.1 h1:EXLHh0DXIJnWhdRPN2w4MXAzFyE4CskzhNLUmtpMYro= github.com/oapi-codegen/runtime v1.1.1/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg= github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= @@ -164,30 +149,21 @@ github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsK github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8= github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8= github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= -github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ= -github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/sirupsen/logrus v1.9.0 h1:trlNQbNUG3OdDrDil03MCb1H2o9nJ1x4/5LYw7byDE0= github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ= github.com/skeema/knownhosts v1.2.2 h1:Iug2P4fLmDw9f41PB6thxUkNUkJzB5i+1/exaj40L3A= github.com/skeema/knownhosts v1.2.2/go.mod h1:xYbVRSPxqBZFrdmDyMmsOs+uX1UZC3nTN3ThzgDxUwo= -github.com/spf13/cast v1.3.1 h1:nFm6S0SMdyzrzcmThSipiEubIDy8WEXKNZ0UOgiRpng= -github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= github.com/spkg/bom v0.0.0-20160624110644-59b7046e48ad/go.mod h1:qLr4V1qq6nMqFKkMo8ZTx3f+BZEkzsRUY10Xsm2mwU0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= -github.com/vektra/mockery v1.1.2 h1:uc0Yn67rJpjt8U/mAZimdCKn9AeA97BOkjpmtBSlfP4= -github.com/vektra/mockery v1.1.2/go.mod h1:VcfZjKaFOPO+MpN4ZvwPjs4c48lkq1o3Ym8yHZJu0jU= -github.com/vektra/mockery/v2 v2.43.2/go.mod h1:XNTE9RIu3deGAGQRVjP1VZxGpQNm0YedZx4oDs3prr8= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.4+incompatible h1:dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI= github.com/vmihailenco/msgpack v4.0.4+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= @@ -199,7 +175,6 @@ github.com/x-cray/logrus-prefixed-formatter v0.5.2 h1:00txxvfBM9muc0jiLIEAkAcIMJ github.com/x-cray/logrus-prefixed-formatter v0.5.2/go.mod h1:2duySbKsL6M18s5GU7VPsoEPHyzalCE06qoARUCeBBE= github.com/xanzy/ssh-agent v0.3.3 h1:+/15pJfg/RsTxqYcX6fHqOXZwwMP+2VyYWJeWM2qQFM= github.com/xanzy/ssh-agent v0.3.3/go.mod h1:6dzNDKs0J9rVPHPhaGCukekBHKqfl+L3KghI1Bc68Uw= -github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= github.com/zclconf/go-cty v1.14.4 h1:uXXczd9QDGsgu0i/QFR/hzI5NYCHLf6NQw/atrbnhq8= github.com/zclconf/go-cty v1.14.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE= @@ -208,32 +183,25 @@ github.com/zclconf/go-cty-debug v0.0.0-20191215020915-b22d67c1ba0b/go.mod h1:ZRK go.uber.org/mock v0.4.0 h1:VcM4ZOtdbR4f6VXfiOpwpVJDL6lCReaZ6mw31wqh7KU= go.uber.org/mock v0.4.0/go.mod h1:a6FSlNadKUHUa9IP5Vyt1zh4fC7uAwxMutEAscFbkZc= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.16.0 h1:QX4fJ0Rr5cPQCF7O9lh9Se4pmwfwskqZfq5moyldzic= golang.org/x/mod v0.16.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -246,13 +214,11 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y= golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.20.0 h1:VnkxpohqXaOBYJtBmEppKUG6mXpi+4O6purfc2+sMhw= golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -261,17 +227,14 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk= golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200323144430-8dcfad9e016e/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.17.0 h1:FvmRgNOcs3kOa+T20R1uhfP9F6HgG2mfxDv1vrx1Htc= golang.org/x/tools v0.17.0/go.mod h1:xsh6VxdV005rRVaS6SSAf9oiAqljS7UZUacMZ8Bnsps= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.6.8 h1:IhEN5q69dyKagZPYMSdIjS2HqprW324FRQZJcGqPAsM= @@ -285,14 +248,11 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.34.0 h1:Qo/qEd2RZPCf2nKuorzksSknv0d3ERwp1vFG38gSmH4= google.golang.org/protobuf v1.34.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= -gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/warnings.v0 v0.1.2 h1:wFXVbFY8DY5/xOe1ECiWdKCzZlxgshcYVNkBHstARME= gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tools/go.sum b/tools/go.sum index 0f74c7626..a851d48df 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -624,8 +624,8 @@ github.com/hashicorp/terraform-plugin-docs v0.18.0 h1:2bINhzXc+yDeAcafurshCrIjtd github.com/hashicorp/terraform-plugin-docs v0.18.0/go.mod h1:iIUfaJpdUmpi+rI42Kgq+63jAjI8aZVTyxp3Bvk9Hg8= github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM= github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg= -github.com/huandu/xstrings v1.3.3 h1:/Gcsuc1x8JVbJ9/rlye4xZnVAbEkGauT8lbebqcQws4= github.com/huandu/xstrings v1.3.3/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/huandu/xstrings v1.4.0 h1:D17IlohoQq4UcpqD7fDk80P7l+lwAmlFaBHgOipl2FU= github.com/huandu/xstrings v1.4.0/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= @@ -1050,7 +1050,6 @@ github.com/uudashr/gocognit v1.1.2 h1:l6BAEKJqQH2UpKAPKdMfZf5kE4W/2xk8pfU1OVLvni github.com/uudashr/gocognit v1.1.2/go.mod h1:aAVdLURqcanke8h3vg35BC++eseDm66Z7KmchI5et4k= github.com/vbatts/tar-split v0.11.5 h1:3bHCTIheBm1qFTcgh9oPu+nNBtX+XJIupG/vacinCts= github.com/vbatts/tar-split v0.11.5/go.mod h1:yZbwRsSeGjusneWgA781EKej9HF8vme8okylkAeNKLk= -github.com/vektra/mockery/v2 v2.43.2/go.mod h1:XNTE9RIu3deGAGQRVjP1VZxGpQNm0YedZx4oDs3prr8= github.com/wagoodman/go-partybus v0.0.0-20230516145632-8ccac152c651 h1:jIVmlAFIqV3d+DOxazTR9v+zgj8+VYuQBzPgBZvWBHA= github.com/wagoodman/go-partybus v0.0.0-20230516145632-8ccac152c651/go.mod h1:b26F2tHLqaoRQf8DywqzVaV1MQ9yvjb0OMcNl7Nxu20= github.com/wagoodman/go-progress v0.0.0-20220614130704-4b1c25a33c7c h1:gFwUKtkv6QzQsFdIjvPqd0Qdw42DHUEbbUdiUTI1uco=