2023-03-08 14:54:35 -06:00
// Code generated by mockery v2.16.0. DO NOT EDIT.
2022-07-06 18:51:44 -05:00
package publicdashboards
import (
context "context"
2023-01-16 09:33:55 -06:00
dashboards "github.com/grafana/grafana/pkg/services/dashboards"
2022-07-06 18:51:44 -05:00
mock "github.com/stretchr/testify/mock"
2023-01-16 09:33:55 -06:00
models "github.com/grafana/grafana/pkg/services/publicdashboards/models"
2022-07-06 18:51:44 -05:00
)
// FakePublicDashboardStore is an autogenerated mock type for the Store type
type FakePublicDashboardStore struct {
mock . Mock
}
2022-11-03 14:30:12 -05:00
// Create provides a mock function with given fields: ctx, cmd
func ( _m * FakePublicDashboardStore ) Create ( ctx context . Context , cmd models . SavePublicDashboardCommand ) ( int64 , error ) {
ret := _m . Called ( ctx , cmd )
var r0 int64
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , models . SavePublicDashboardCommand ) int64 ) ; ok {
r0 = rf ( ctx , cmd )
} else {
r0 = ret . Get ( 0 ) . ( int64 )
}
var r1 error
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , models . SavePublicDashboardCommand ) error ) ; ok {
r1 = rf ( ctx , cmd )
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2023-03-08 14:54:35 -06:00
// Delete provides a mock function with given fields: ctx, uid
func ( _m * FakePublicDashboardStore ) Delete ( ctx context . Context , uid string ) ( int64 , error ) {
ret := _m . Called ( ctx , uid )
2022-10-31 16:16:07 -05:00
var r0 int64
2023-03-08 14:54:35 -06:00
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) int64 ) ; ok {
r0 = rf ( ctx , uid )
2022-10-31 16:16:07 -05:00
} else {
r0 = ret . Get ( 0 ) . ( int64 )
}
var r1 error
2023-03-08 14:54:35 -06:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , string ) error ) ; ok {
r1 = rf ( ctx , uid )
2022-10-31 16:16:07 -05:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2022-10-26 12:49:43 -05:00
// ExistsEnabledByAccessToken provides a mock function with given fields: ctx, accessToken
func ( _m * FakePublicDashboardStore ) ExistsEnabledByAccessToken ( ctx context . Context , accessToken string ) ( bool , error ) {
ret := _m . Called ( ctx , accessToken )
2022-08-10 12:14:48 -05:00
2022-10-26 12:49:43 -05:00
var r0 bool
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) bool ) ; ok {
r0 = rf ( ctx , accessToken )
2022-08-10 12:14:48 -05:00
} else {
2022-10-26 12:49:43 -05:00
r0 = ret . Get ( 0 ) . ( bool )
2022-08-10 12:14:48 -05:00
}
var r1 error
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , string ) error ) ; ok {
2022-10-26 12:49:43 -05:00
r1 = rf ( ctx , accessToken )
2022-07-06 18:51:44 -05:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2022-10-26 12:49:43 -05:00
// ExistsEnabledByDashboardUid provides a mock function with given fields: ctx, dashboardUid
func ( _m * FakePublicDashboardStore ) ExistsEnabledByDashboardUid ( ctx context . Context , dashboardUid string ) ( bool , error ) {
ret := _m . Called ( ctx , dashboardUid )
2022-07-21 14:56:20 -05:00
2022-10-26 12:49:43 -05:00
var r0 bool
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) bool ) ; ok {
r0 = rf ( ctx , dashboardUid )
2022-07-21 14:56:20 -05:00
} else {
2022-10-26 12:49:43 -05:00
r0 = ret . Get ( 0 ) . ( bool )
2022-07-21 14:56:20 -05:00
}
var r1 error
2022-10-26 12:49:43 -05:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , string ) error ) ; ok {
r1 = rf ( ctx , dashboardUid )
2022-07-21 14:56:20 -05:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2022-10-26 12:49:43 -05:00
// Find provides a mock function with given fields: ctx, uid
func ( _m * FakePublicDashboardStore ) Find ( ctx context . Context , uid string ) ( * models . PublicDashboard , error ) {
ret := _m . Called ( ctx , uid )
2022-08-26 14:28:54 -05:00
2022-10-26 12:49:43 -05:00
var r0 * models . PublicDashboard
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) * models . PublicDashboard ) ; ok {
r0 = rf ( ctx , uid )
2022-08-26 14:28:54 -05:00
} else {
if ret . Get ( 0 ) != nil {
2022-10-26 12:49:43 -05:00
r0 = ret . Get ( 0 ) . ( * models . PublicDashboard )
2022-08-26 14:28:54 -05:00
}
}
var r1 error
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , string ) error ) ; ok {
2022-10-26 12:49:43 -05:00
r1 = rf ( ctx , uid )
2022-08-26 14:28:54 -05:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2022-10-26 12:49:43 -05:00
// FindAll provides a mock function with given fields: ctx, orgId
func ( _m * FakePublicDashboardStore ) FindAll ( ctx context . Context , orgId int64 ) ( [ ] models . PublicDashboardListResponse , error ) {
ret := _m . Called ( ctx , orgId )
2022-07-06 18:51:44 -05:00
2022-10-26 12:49:43 -05:00
var r0 [ ] models . PublicDashboardListResponse
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 ) [ ] models . PublicDashboardListResponse ) ; ok {
r0 = rf ( ctx , orgId )
2022-07-06 18:51:44 -05:00
} else {
if ret . Get ( 0 ) != nil {
2022-10-26 12:49:43 -05:00
r0 = ret . Get ( 0 ) . ( [ ] models . PublicDashboardListResponse )
2022-07-06 18:51:44 -05:00
}
}
var r1 error
2022-10-26 12:49:43 -05:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , int64 ) error ) ; ok {
r1 = rf ( ctx , orgId )
2022-07-06 18:51:44 -05:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2022-10-26 12:49:43 -05:00
// FindByAccessToken provides a mock function with given fields: ctx, accessToken
func ( _m * FakePublicDashboardStore ) FindByAccessToken ( ctx context . Context , accessToken string ) ( * models . PublicDashboard , error ) {
2022-10-06 15:35:19 -05:00
ret := _m . Called ( ctx , accessToken )
2022-10-26 12:49:43 -05:00
var r0 * models . PublicDashboard
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) * models . PublicDashboard ) ; ok {
2022-10-06 15:35:19 -05:00
r0 = rf ( ctx , accessToken )
} else {
2022-10-26 12:49:43 -05:00
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( * models . PublicDashboard )
}
2022-10-06 15:35:19 -05:00
}
var r1 error
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , string ) error ) ; ok {
r1 = rf ( ctx , accessToken )
} else {
r1 = ret . Error ( 1 )
2023-03-08 14:54:35 -06:00
}
return r0 , r1
}
// FindByDashboardFolder provides a mock function with given fields: ctx, dashboard
func ( _m * FakePublicDashboardStore ) FindByDashboardFolder ( ctx context . Context , dashboard * dashboards . Dashboard ) ( [ ] * models . PublicDashboard , error ) {
ret := _m . Called ( ctx , dashboard )
var r0 [ ] * models . PublicDashboard
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , * dashboards . Dashboard ) [ ] * models . PublicDashboard ) ; ok {
r0 = rf ( ctx , dashboard )
} else {
if ret . Get ( 0 ) != nil {
r0 = ret . Get ( 0 ) . ( [ ] * models . PublicDashboard )
}
}
var r1 error
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , * dashboards . Dashboard ) error ) ; ok {
r1 = rf ( ctx , dashboard )
} else {
r1 = ret . Error ( 1 )
2022-10-06 15:35:19 -05:00
}
return r0 , r1
}
2022-10-26 12:49:43 -05:00
// FindByDashboardUid provides a mock function with given fields: ctx, orgId, dashboardUid
func ( _m * FakePublicDashboardStore ) FindByDashboardUid ( ctx context . Context , orgId int64 , dashboardUid string ) ( * models . PublicDashboard , error ) {
ret := _m . Called ( ctx , orgId , dashboardUid )
2022-10-13 00:36:05 -05:00
2022-10-26 12:49:43 -05:00
var r0 * models . PublicDashboard
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 , string ) * models . PublicDashboard ) ; ok {
r0 = rf ( ctx , orgId , dashboardUid )
2022-10-13 00:36:05 -05:00
} else {
if ret . Get ( 0 ) != nil {
2022-10-26 12:49:43 -05:00
r0 = ret . Get ( 0 ) . ( * models . PublicDashboard )
2022-10-13 00:36:05 -05:00
}
}
var r1 error
2022-10-26 12:49:43 -05:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , int64 , string ) error ) ; ok {
r1 = rf ( ctx , orgId , dashboardUid )
2022-10-13 00:36:05 -05:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2022-10-31 09:22:27 -05:00
// FindDashboard provides a mock function with given fields: ctx, orgId, dashboardUid
2023-01-16 09:33:55 -06:00
func ( _m * FakePublicDashboardStore ) FindDashboard ( ctx context . Context , orgId int64 , dashboardUid string ) ( * dashboards . Dashboard , error ) {
2022-10-31 09:22:27 -05:00
ret := _m . Called ( ctx , orgId , dashboardUid )
2022-10-25 14:29:18 -05:00
2023-01-16 09:33:55 -06:00
var r0 * dashboards . Dashboard
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , int64 , string ) * dashboards . Dashboard ) ; ok {
2022-10-31 09:22:27 -05:00
r0 = rf ( ctx , orgId , dashboardUid )
2022-10-25 14:29:18 -05:00
} else {
2022-10-26 12:49:43 -05:00
if ret . Get ( 0 ) != nil {
2023-01-16 09:33:55 -06:00
r0 = ret . Get ( 0 ) . ( * dashboards . Dashboard )
2022-10-26 12:49:43 -05:00
}
2022-10-25 14:29:18 -05:00
}
var r1 error
2022-10-31 09:22:27 -05:00
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , int64 , string ) error ) ; ok {
r1 = rf ( ctx , orgId , dashboardUid )
2022-10-25 14:29:18 -05:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2022-10-26 12:49:43 -05:00
// GetOrgIdByAccessToken provides a mock function with given fields: ctx, accessToken
func ( _m * FakePublicDashboardStore ) GetOrgIdByAccessToken ( ctx context . Context , accessToken string ) ( int64 , error ) {
ret := _m . Called ( ctx , accessToken )
2022-07-19 18:44:41 -05:00
2022-10-26 12:49:43 -05:00
var r0 int64
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , string ) int64 ) ; ok {
r0 = rf ( ctx , accessToken )
2022-07-19 18:44:41 -05:00
} else {
2022-10-26 12:49:43 -05:00
r0 = ret . Get ( 0 ) . ( int64 )
2022-07-19 18:44:41 -05:00
}
var r1 error
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , string ) error ) ; ok {
2022-10-26 12:49:43 -05:00
r1 = rf ( ctx , accessToken )
2022-07-19 18:44:41 -05:00
} else {
r1 = ret . Error ( 1 )
}
return r0 , r1
}
2022-11-03 14:30:12 -05:00
// Update provides a mock function with given fields: ctx, cmd
func ( _m * FakePublicDashboardStore ) Update ( ctx context . Context , cmd models . SavePublicDashboardCommand ) ( int64 , error ) {
2022-07-06 18:51:44 -05:00
ret := _m . Called ( ctx , cmd )
2022-11-03 14:30:12 -05:00
var r0 int64
if rf , ok := ret . Get ( 0 ) . ( func ( context . Context , models . SavePublicDashboardCommand ) int64 ) ; ok {
2022-07-06 18:51:44 -05:00
r0 = rf ( ctx , cmd )
} else {
2022-11-03 14:30:12 -05:00
r0 = ret . Get ( 0 ) . ( int64 )
2022-07-06 18:51:44 -05:00
}
2022-11-03 14:30:12 -05:00
var r1 error
if rf , ok := ret . Get ( 1 ) . ( func ( context . Context , models . SavePublicDashboardCommand ) error ) ; ok {
r1 = rf ( ctx , cmd )
2022-07-06 18:51:44 -05:00
} else {
2022-11-03 14:30:12 -05:00
r1 = ret . Error ( 1 )
2022-07-06 18:51:44 -05:00
}
2022-11-03 14:30:12 -05:00
return r0 , r1
2022-07-06 18:51:44 -05:00
}
2023-01-16 09:33:55 -06:00
type mockConstructorTestingTNewFakePublicDashboardStore interface {
mock . TestingT
Cleanup ( func ( ) )
}
// NewFakePublicDashboardStore creates a new instance of FakePublicDashboardStore. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
func NewFakePublicDashboardStore ( t mockConstructorTestingTNewFakePublicDashboardStore ) * FakePublicDashboardStore {
2022-07-06 18:51:44 -05:00
mock := & FakePublicDashboardStore { }
mock . Mock . Test ( t )
t . Cleanup ( func ( ) { mock . AssertExpectations ( t ) } )
return mock
}