dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts@v1.0.2/clients/interfaces/mocks/NotificationClient.go (about) 1 // Code generated by mockery v2.15.0. DO NOT EDIT. 2 3 package mocks 4 5 import ( 6 context "context" 7 8 common "dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/dtos/common" 9 10 errors "dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/errors" 11 12 mock "github.com/stretchr/testify/mock" 13 14 requests "dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/dtos/requests" 15 16 responses "dev.azure.com/aidainnovazione0090/DeviceManager/_git/go-mod-core-contracts/dtos/responses" 17 ) 18 19 // NotificationClient is an autogenerated mock type for the NotificationClient type 20 type NotificationClient struct { 21 mock.Mock 22 } 23 24 // CleanupNotifications provides a mock function with given fields: ctx 25 func (_m *NotificationClient) CleanupNotifications(ctx context.Context) (common.BaseResponse, errors.EdgeX) { 26 ret := _m.Called(ctx) 27 28 var r0 common.BaseResponse 29 if rf, ok := ret.Get(0).(func(context.Context) common.BaseResponse); ok { 30 r0 = rf(ctx) 31 } else { 32 r0 = ret.Get(0).(common.BaseResponse) 33 } 34 35 var r1 errors.EdgeX 36 if rf, ok := ret.Get(1).(func(context.Context) errors.EdgeX); ok { 37 r1 = rf(ctx) 38 } else { 39 if ret.Get(1) != nil { 40 r1 = ret.Get(1).(errors.EdgeX) 41 } 42 } 43 44 return r0, r1 45 } 46 47 // CleanupNotificationsByAge provides a mock function with given fields: ctx, age 48 func (_m *NotificationClient) CleanupNotificationsByAge(ctx context.Context, age int) (common.BaseResponse, errors.EdgeX) { 49 ret := _m.Called(ctx, age) 50 51 var r0 common.BaseResponse 52 if rf, ok := ret.Get(0).(func(context.Context, int) common.BaseResponse); ok { 53 r0 = rf(ctx, age) 54 } else { 55 r0 = ret.Get(0).(common.BaseResponse) 56 } 57 58 var r1 errors.EdgeX 59 if rf, ok := ret.Get(1).(func(context.Context, int) errors.EdgeX); ok { 60 r1 = rf(ctx, age) 61 } else { 62 if ret.Get(1) != nil { 63 r1 = ret.Get(1).(errors.EdgeX) 64 } 65 } 66 67 return r0, r1 68 } 69 70 // DeleteNotificationById provides a mock function with given fields: ctx, id 71 func (_m *NotificationClient) DeleteNotificationById(ctx context.Context, id string) (common.BaseResponse, errors.EdgeX) { 72 ret := _m.Called(ctx, id) 73 74 var r0 common.BaseResponse 75 if rf, ok := ret.Get(0).(func(context.Context, string) common.BaseResponse); ok { 76 r0 = rf(ctx, id) 77 } else { 78 r0 = ret.Get(0).(common.BaseResponse) 79 } 80 81 var r1 errors.EdgeX 82 if rf, ok := ret.Get(1).(func(context.Context, string) errors.EdgeX); ok { 83 r1 = rf(ctx, id) 84 } else { 85 if ret.Get(1) != nil { 86 r1 = ret.Get(1).(errors.EdgeX) 87 } 88 } 89 90 return r0, r1 91 } 92 93 // DeleteProcessedNotificationsByAge provides a mock function with given fields: ctx, age 94 func (_m *NotificationClient) DeleteProcessedNotificationsByAge(ctx context.Context, age int) (common.BaseResponse, errors.EdgeX) { 95 ret := _m.Called(ctx, age) 96 97 var r0 common.BaseResponse 98 if rf, ok := ret.Get(0).(func(context.Context, int) common.BaseResponse); ok { 99 r0 = rf(ctx, age) 100 } else { 101 r0 = ret.Get(0).(common.BaseResponse) 102 } 103 104 var r1 errors.EdgeX 105 if rf, ok := ret.Get(1).(func(context.Context, int) errors.EdgeX); ok { 106 r1 = rf(ctx, age) 107 } else { 108 if ret.Get(1) != nil { 109 r1 = ret.Get(1).(errors.EdgeX) 110 } 111 } 112 113 return r0, r1 114 } 115 116 // NotificationById provides a mock function with given fields: ctx, id 117 func (_m *NotificationClient) NotificationById(ctx context.Context, id string) (responses.NotificationResponse, errors.EdgeX) { 118 ret := _m.Called(ctx, id) 119 120 var r0 responses.NotificationResponse 121 if rf, ok := ret.Get(0).(func(context.Context, string) responses.NotificationResponse); ok { 122 r0 = rf(ctx, id) 123 } else { 124 r0 = ret.Get(0).(responses.NotificationResponse) 125 } 126 127 var r1 errors.EdgeX 128 if rf, ok := ret.Get(1).(func(context.Context, string) errors.EdgeX); ok { 129 r1 = rf(ctx, id) 130 } else { 131 if ret.Get(1) != nil { 132 r1 = ret.Get(1).(errors.EdgeX) 133 } 134 } 135 136 return r0, r1 137 } 138 139 // NotificationsByCategory provides a mock function with given fields: ctx, category, offset, limit 140 func (_m *NotificationClient) NotificationsByCategory(ctx context.Context, category string, offset int, limit int) (responses.MultiNotificationsResponse, errors.EdgeX) { 141 ret := _m.Called(ctx, category, offset, limit) 142 143 var r0 responses.MultiNotificationsResponse 144 if rf, ok := ret.Get(0).(func(context.Context, string, int, int) responses.MultiNotificationsResponse); ok { 145 r0 = rf(ctx, category, offset, limit) 146 } else { 147 r0 = ret.Get(0).(responses.MultiNotificationsResponse) 148 } 149 150 var r1 errors.EdgeX 151 if rf, ok := ret.Get(1).(func(context.Context, string, int, int) errors.EdgeX); ok { 152 r1 = rf(ctx, category, offset, limit) 153 } else { 154 if ret.Get(1) != nil { 155 r1 = ret.Get(1).(errors.EdgeX) 156 } 157 } 158 159 return r0, r1 160 } 161 162 // NotificationsByLabel provides a mock function with given fields: ctx, label, offset, limit 163 func (_m *NotificationClient) NotificationsByLabel(ctx context.Context, label string, offset int, limit int) (responses.MultiNotificationsResponse, errors.EdgeX) { 164 ret := _m.Called(ctx, label, offset, limit) 165 166 var r0 responses.MultiNotificationsResponse 167 if rf, ok := ret.Get(0).(func(context.Context, string, int, int) responses.MultiNotificationsResponse); ok { 168 r0 = rf(ctx, label, offset, limit) 169 } else { 170 r0 = ret.Get(0).(responses.MultiNotificationsResponse) 171 } 172 173 var r1 errors.EdgeX 174 if rf, ok := ret.Get(1).(func(context.Context, string, int, int) errors.EdgeX); ok { 175 r1 = rf(ctx, label, offset, limit) 176 } else { 177 if ret.Get(1) != nil { 178 r1 = ret.Get(1).(errors.EdgeX) 179 } 180 } 181 182 return r0, r1 183 } 184 185 // NotificationsByStatus provides a mock function with given fields: ctx, status, offset, limit 186 func (_m *NotificationClient) NotificationsByStatus(ctx context.Context, status string, offset int, limit int) (responses.MultiNotificationsResponse, errors.EdgeX) { 187 ret := _m.Called(ctx, status, offset, limit) 188 189 var r0 responses.MultiNotificationsResponse 190 if rf, ok := ret.Get(0).(func(context.Context, string, int, int) responses.MultiNotificationsResponse); ok { 191 r0 = rf(ctx, status, offset, limit) 192 } else { 193 r0 = ret.Get(0).(responses.MultiNotificationsResponse) 194 } 195 196 var r1 errors.EdgeX 197 if rf, ok := ret.Get(1).(func(context.Context, string, int, int) errors.EdgeX); ok { 198 r1 = rf(ctx, status, offset, limit) 199 } else { 200 if ret.Get(1) != nil { 201 r1 = ret.Get(1).(errors.EdgeX) 202 } 203 } 204 205 return r0, r1 206 } 207 208 // NotificationsBySubscriptionName provides a mock function with given fields: ctx, subscriptionName, offset, limit 209 func (_m *NotificationClient) NotificationsBySubscriptionName(ctx context.Context, subscriptionName string, offset int, limit int) (responses.MultiNotificationsResponse, errors.EdgeX) { 210 ret := _m.Called(ctx, subscriptionName, offset, limit) 211 212 var r0 responses.MultiNotificationsResponse 213 if rf, ok := ret.Get(0).(func(context.Context, string, int, int) responses.MultiNotificationsResponse); ok { 214 r0 = rf(ctx, subscriptionName, offset, limit) 215 } else { 216 r0 = ret.Get(0).(responses.MultiNotificationsResponse) 217 } 218 219 var r1 errors.EdgeX 220 if rf, ok := ret.Get(1).(func(context.Context, string, int, int) errors.EdgeX); ok { 221 r1 = rf(ctx, subscriptionName, offset, limit) 222 } else { 223 if ret.Get(1) != nil { 224 r1 = ret.Get(1).(errors.EdgeX) 225 } 226 } 227 228 return r0, r1 229 } 230 231 // NotificationsByTimeRange provides a mock function with given fields: ctx, start, end, offset, limit 232 func (_m *NotificationClient) NotificationsByTimeRange(ctx context.Context, start int, end int, offset int, limit int) (responses.MultiNotificationsResponse, errors.EdgeX) { 233 ret := _m.Called(ctx, start, end, offset, limit) 234 235 var r0 responses.MultiNotificationsResponse 236 if rf, ok := ret.Get(0).(func(context.Context, int, int, int, int) responses.MultiNotificationsResponse); ok { 237 r0 = rf(ctx, start, end, offset, limit) 238 } else { 239 r0 = ret.Get(0).(responses.MultiNotificationsResponse) 240 } 241 242 var r1 errors.EdgeX 243 if rf, ok := ret.Get(1).(func(context.Context, int, int, int, int) errors.EdgeX); ok { 244 r1 = rf(ctx, start, end, offset, limit) 245 } else { 246 if ret.Get(1) != nil { 247 r1 = ret.Get(1).(errors.EdgeX) 248 } 249 } 250 251 return r0, r1 252 } 253 254 // SendNotification provides a mock function with given fields: ctx, reqs 255 func (_m *NotificationClient) SendNotification(ctx context.Context, reqs []requests.AddNotificationRequest) ([]common.BaseWithIdResponse, errors.EdgeX) { 256 ret := _m.Called(ctx, reqs) 257 258 var r0 []common.BaseWithIdResponse 259 if rf, ok := ret.Get(0).(func(context.Context, []requests.AddNotificationRequest) []common.BaseWithIdResponse); ok { 260 r0 = rf(ctx, reqs) 261 } else { 262 if ret.Get(0) != nil { 263 r0 = ret.Get(0).([]common.BaseWithIdResponse) 264 } 265 } 266 267 var r1 errors.EdgeX 268 if rf, ok := ret.Get(1).(func(context.Context, []requests.AddNotificationRequest) errors.EdgeX); ok { 269 r1 = rf(ctx, reqs) 270 } else { 271 if ret.Get(1) != nil { 272 r1 = ret.Get(1).(errors.EdgeX) 273 } 274 } 275 276 return r0, r1 277 } 278 279 type mockConstructorTestingTNewNotificationClient interface { 280 mock.TestingT 281 Cleanup(func()) 282 } 283 284 // NewNotificationClient creates a new instance of NotificationClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. 285 func NewNotificationClient(t mockConstructorTestingTNewNotificationClient) *NotificationClient { 286 mock := &NotificationClient{} 287 mock.Mock.Test(t) 288 289 t.Cleanup(func() { mock.AssertExpectations(t) }) 290 291 return mock 292 }