internal/resources/providers/awslib/s3/mock_s3.go (199 lines of code) (raw):

// Licensed to Elasticsearch B.V. under one or more contributor // license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright // ownership. Elasticsearch B.V. licenses this file to you under // the Apache License, Version 2.0 (the "License"); you may // not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. // Code generated by mockery v2.53.3. DO NOT EDIT. package s3 import ( context "context" awslib "github.com/elastic/cloudbeat/internal/resources/providers/awslib" mock "github.com/stretchr/testify/mock" services3 "github.com/aws/aws-sdk-go-v2/service/s3" ) // MockS3 is an autogenerated mock type for the S3 type type MockS3 struct { mock.Mock } type MockS3_Expecter struct { mock *mock.Mock } func (_m *MockS3) EXPECT() *MockS3_Expecter { return &MockS3_Expecter{mock: &_m.Mock} } // DescribeBuckets provides a mock function with given fields: ctx func (_m *MockS3) DescribeBuckets(ctx context.Context) ([]awslib.AwsResource, error) { ret := _m.Called(ctx) if len(ret) == 0 { panic("no return value specified for DescribeBuckets") } var r0 []awslib.AwsResource var r1 error if rf, ok := ret.Get(0).(func(context.Context) ([]awslib.AwsResource, error)); ok { return rf(ctx) } if rf, ok := ret.Get(0).(func(context.Context) []awslib.AwsResource); ok { r0 = rf(ctx) } else { if ret.Get(0) != nil { r0 = ret.Get(0).([]awslib.AwsResource) } } if rf, ok := ret.Get(1).(func(context.Context) error); ok { r1 = rf(ctx) } else { r1 = ret.Error(1) } return r0, r1 } // MockS3_DescribeBuckets_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'DescribeBuckets' type MockS3_DescribeBuckets_Call struct { *mock.Call } // DescribeBuckets is a helper method to define mock.On call // - ctx context.Context func (_e *MockS3_Expecter) DescribeBuckets(ctx interface{}) *MockS3_DescribeBuckets_Call { return &MockS3_DescribeBuckets_Call{Call: _e.mock.On("DescribeBuckets", ctx)} } func (_c *MockS3_DescribeBuckets_Call) Run(run func(ctx context.Context)) *MockS3_DescribeBuckets_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context)) }) return _c } func (_c *MockS3_DescribeBuckets_Call) Return(_a0 []awslib.AwsResource, _a1 error) *MockS3_DescribeBuckets_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *MockS3_DescribeBuckets_Call) RunAndReturn(run func(context.Context) ([]awslib.AwsResource, error)) *MockS3_DescribeBuckets_Call { _c.Call.Return(run) return _c } // GetBucketACL provides a mock function with given fields: ctx, bucketName, region func (_m *MockS3) GetBucketACL(ctx context.Context, bucketName *string, region string) (*services3.GetBucketAclOutput, error) { ret := _m.Called(ctx, bucketName, region) if len(ret) == 0 { panic("no return value specified for GetBucketACL") } var r0 *services3.GetBucketAclOutput var r1 error if rf, ok := ret.Get(0).(func(context.Context, *string, string) (*services3.GetBucketAclOutput, error)); ok { return rf(ctx, bucketName, region) } if rf, ok := ret.Get(0).(func(context.Context, *string, string) *services3.GetBucketAclOutput); ok { r0 = rf(ctx, bucketName, region) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(*services3.GetBucketAclOutput) } } if rf, ok := ret.Get(1).(func(context.Context, *string, string) error); ok { r1 = rf(ctx, bucketName, region) } else { r1 = ret.Error(1) } return r0, r1 } // MockS3_GetBucketACL_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBucketACL' type MockS3_GetBucketACL_Call struct { *mock.Call } // GetBucketACL is a helper method to define mock.On call // - ctx context.Context // - bucketName *string // - region string func (_e *MockS3_Expecter) GetBucketACL(ctx interface{}, bucketName interface{}, region interface{}) *MockS3_GetBucketACL_Call { return &MockS3_GetBucketACL_Call{Call: _e.mock.On("GetBucketACL", ctx, bucketName, region)} } func (_c *MockS3_GetBucketACL_Call) Run(run func(ctx context.Context, bucketName *string, region string)) *MockS3_GetBucketACL_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*string), args[2].(string)) }) return _c } func (_c *MockS3_GetBucketACL_Call) Return(_a0 *services3.GetBucketAclOutput, _a1 error) *MockS3_GetBucketACL_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *MockS3_GetBucketACL_Call) RunAndReturn(run func(context.Context, *string, string) (*services3.GetBucketAclOutput, error)) *MockS3_GetBucketACL_Call { _c.Call.Return(run) return _c } // GetBucketLogging provides a mock function with given fields: ctx, bucketName, region func (_m *MockS3) GetBucketLogging(ctx context.Context, bucketName *string, region string) (Logging, error) { ret := _m.Called(ctx, bucketName, region) if len(ret) == 0 { panic("no return value specified for GetBucketLogging") } var r0 Logging var r1 error if rf, ok := ret.Get(0).(func(context.Context, *string, string) (Logging, error)); ok { return rf(ctx, bucketName, region) } if rf, ok := ret.Get(0).(func(context.Context, *string, string) Logging); ok { r0 = rf(ctx, bucketName, region) } else { r0 = ret.Get(0).(Logging) } if rf, ok := ret.Get(1).(func(context.Context, *string, string) error); ok { r1 = rf(ctx, bucketName, region) } else { r1 = ret.Error(1) } return r0, r1 } // MockS3_GetBucketLogging_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBucketLogging' type MockS3_GetBucketLogging_Call struct { *mock.Call } // GetBucketLogging is a helper method to define mock.On call // - ctx context.Context // - bucketName *string // - region string func (_e *MockS3_Expecter) GetBucketLogging(ctx interface{}, bucketName interface{}, region interface{}) *MockS3_GetBucketLogging_Call { return &MockS3_GetBucketLogging_Call{Call: _e.mock.On("GetBucketLogging", ctx, bucketName, region)} } func (_c *MockS3_GetBucketLogging_Call) Run(run func(ctx context.Context, bucketName *string, region string)) *MockS3_GetBucketLogging_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*string), args[2].(string)) }) return _c } func (_c *MockS3_GetBucketLogging_Call) Return(_a0 Logging, _a1 error) *MockS3_GetBucketLogging_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *MockS3_GetBucketLogging_Call) RunAndReturn(run func(context.Context, *string, string) (Logging, error)) *MockS3_GetBucketLogging_Call { _c.Call.Return(run) return _c } // GetBucketPolicy provides a mock function with given fields: ctx, bucketName, region func (_m *MockS3) GetBucketPolicy(ctx context.Context, bucketName *string, region string) (BucketPolicy, error) { ret := _m.Called(ctx, bucketName, region) if len(ret) == 0 { panic("no return value specified for GetBucketPolicy") } var r0 BucketPolicy var r1 error if rf, ok := ret.Get(0).(func(context.Context, *string, string) (BucketPolicy, error)); ok { return rf(ctx, bucketName, region) } if rf, ok := ret.Get(0).(func(context.Context, *string, string) BucketPolicy); ok { r0 = rf(ctx, bucketName, region) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(BucketPolicy) } } if rf, ok := ret.Get(1).(func(context.Context, *string, string) error); ok { r1 = rf(ctx, bucketName, region) } else { r1 = ret.Error(1) } return r0, r1 } // MockS3_GetBucketPolicy_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBucketPolicy' type MockS3_GetBucketPolicy_Call struct { *mock.Call } // GetBucketPolicy is a helper method to define mock.On call // - ctx context.Context // - bucketName *string // - region string func (_e *MockS3_Expecter) GetBucketPolicy(ctx interface{}, bucketName interface{}, region interface{}) *MockS3_GetBucketPolicy_Call { return &MockS3_GetBucketPolicy_Call{Call: _e.mock.On("GetBucketPolicy", ctx, bucketName, region)} } func (_c *MockS3_GetBucketPolicy_Call) Run(run func(ctx context.Context, bucketName *string, region string)) *MockS3_GetBucketPolicy_Call { _c.Call.Run(func(args mock.Arguments) { run(args[0].(context.Context), args[1].(*string), args[2].(string)) }) return _c } func (_c *MockS3_GetBucketPolicy_Call) Return(_a0 BucketPolicy, _a1 error) *MockS3_GetBucketPolicy_Call { _c.Call.Return(_a0, _a1) return _c } func (_c *MockS3_GetBucketPolicy_Call) RunAndReturn(run func(context.Context, *string, string) (BucketPolicy, error)) *MockS3_GetBucketPolicy_Call { _c.Call.Return(run) return _c } // NewMockS3 creates a new instance of MockS3. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. // The first argument is typically a *testing.T value. func NewMockS3(t interface { mock.TestingT Cleanup(func()) }) *MockS3 { mock := &MockS3{} mock.Mock.Test(t) t.Cleanup(func() { mock.AssertExpectations(t) }) return mock }