github.com/qichengzx/mattermost-server@v4.5.1-0.20180604164826-2c75247c97d0+incompatible/plugin/plugintest/api.go (about) 1 // Code generated by mockery v1.0.0. DO NOT EDIT. 2 3 // Regenerate this file using `make plugin-mocks`. 4 5 package plugintest 6 7 import mock "github.com/stretchr/testify/mock" 8 import model "github.com/mattermost/mattermost-server/model" 9 import plugin "github.com/mattermost/mattermost-server/plugin" 10 11 // APIMOCKINTERNAL is an autogenerated mock type for the APIMOCKINTERNAL type 12 type APIMOCKINTERNAL struct { 13 mock.Mock 14 } 15 16 // AddChannelMember provides a mock function with given fields: channelId, userId 17 func (_m *APIMOCKINTERNAL) AddChannelMember(channelId string, userId string) (*model.ChannelMember, *model.AppError) { 18 ret := _m.Called(channelId, userId) 19 20 var r0 *model.ChannelMember 21 if rf, ok := ret.Get(0).(func(string, string) *model.ChannelMember); ok { 22 r0 = rf(channelId, userId) 23 } else { 24 if ret.Get(0) != nil { 25 r0 = ret.Get(0).(*model.ChannelMember) 26 } 27 } 28 29 var r1 *model.AppError 30 if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { 31 r1 = rf(channelId, userId) 32 } else { 33 if ret.Get(1) != nil { 34 r1 = ret.Get(1).(*model.AppError) 35 } 36 } 37 38 return r0, r1 39 } 40 41 // CreateChannel provides a mock function with given fields: channel 42 func (_m *APIMOCKINTERNAL) CreateChannel(channel *model.Channel) (*model.Channel, *model.AppError) { 43 ret := _m.Called(channel) 44 45 var r0 *model.Channel 46 if rf, ok := ret.Get(0).(func(*model.Channel) *model.Channel); ok { 47 r0 = rf(channel) 48 } else { 49 if ret.Get(0) != nil { 50 r0 = ret.Get(0).(*model.Channel) 51 } 52 } 53 54 var r1 *model.AppError 55 if rf, ok := ret.Get(1).(func(*model.Channel) *model.AppError); ok { 56 r1 = rf(channel) 57 } else { 58 if ret.Get(1) != nil { 59 r1 = ret.Get(1).(*model.AppError) 60 } 61 } 62 63 return r0, r1 64 } 65 66 // CreatePost provides a mock function with given fields: post 67 func (_m *APIMOCKINTERNAL) CreatePost(post *model.Post) (*model.Post, *model.AppError) { 68 ret := _m.Called(post) 69 70 var r0 *model.Post 71 if rf, ok := ret.Get(0).(func(*model.Post) *model.Post); ok { 72 r0 = rf(post) 73 } else { 74 if ret.Get(0) != nil { 75 r0 = ret.Get(0).(*model.Post) 76 } 77 } 78 79 var r1 *model.AppError 80 if rf, ok := ret.Get(1).(func(*model.Post) *model.AppError); ok { 81 r1 = rf(post) 82 } else { 83 if ret.Get(1) != nil { 84 r1 = ret.Get(1).(*model.AppError) 85 } 86 } 87 88 return r0, r1 89 } 90 91 // CreateTeam provides a mock function with given fields: team 92 func (_m *APIMOCKINTERNAL) CreateTeam(team *model.Team) (*model.Team, *model.AppError) { 93 ret := _m.Called(team) 94 95 var r0 *model.Team 96 if rf, ok := ret.Get(0).(func(*model.Team) *model.Team); ok { 97 r0 = rf(team) 98 } else { 99 if ret.Get(0) != nil { 100 r0 = ret.Get(0).(*model.Team) 101 } 102 } 103 104 var r1 *model.AppError 105 if rf, ok := ret.Get(1).(func(*model.Team) *model.AppError); ok { 106 r1 = rf(team) 107 } else { 108 if ret.Get(1) != nil { 109 r1 = ret.Get(1).(*model.AppError) 110 } 111 } 112 113 return r0, r1 114 } 115 116 // CreateUser provides a mock function with given fields: user 117 func (_m *APIMOCKINTERNAL) CreateUser(user *model.User) (*model.User, *model.AppError) { 118 ret := _m.Called(user) 119 120 var r0 *model.User 121 if rf, ok := ret.Get(0).(func(*model.User) *model.User); ok { 122 r0 = rf(user) 123 } else { 124 if ret.Get(0) != nil { 125 r0 = ret.Get(0).(*model.User) 126 } 127 } 128 129 var r1 *model.AppError 130 if rf, ok := ret.Get(1).(func(*model.User) *model.AppError); ok { 131 r1 = rf(user) 132 } else { 133 if ret.Get(1) != nil { 134 r1 = ret.Get(1).(*model.AppError) 135 } 136 } 137 138 return r0, r1 139 } 140 141 // DeleteChannel provides a mock function with given fields: channelId 142 func (_m *APIMOCKINTERNAL) DeleteChannel(channelId string) *model.AppError { 143 ret := _m.Called(channelId) 144 145 var r0 *model.AppError 146 if rf, ok := ret.Get(0).(func(string) *model.AppError); ok { 147 r0 = rf(channelId) 148 } else { 149 if ret.Get(0) != nil { 150 r0 = ret.Get(0).(*model.AppError) 151 } 152 } 153 154 return r0 155 } 156 157 // DeleteChannelMember provides a mock function with given fields: channelId, userId 158 func (_m *APIMOCKINTERNAL) DeleteChannelMember(channelId string, userId string) *model.AppError { 159 ret := _m.Called(channelId, userId) 160 161 var r0 *model.AppError 162 if rf, ok := ret.Get(0).(func(string, string) *model.AppError); ok { 163 r0 = rf(channelId, userId) 164 } else { 165 if ret.Get(0) != nil { 166 r0 = ret.Get(0).(*model.AppError) 167 } 168 } 169 170 return r0 171 } 172 173 // DeletePost provides a mock function with given fields: postId 174 func (_m *APIMOCKINTERNAL) DeletePost(postId string) *model.AppError { 175 ret := _m.Called(postId) 176 177 var r0 *model.AppError 178 if rf, ok := ret.Get(0).(func(string) *model.AppError); ok { 179 r0 = rf(postId) 180 } else { 181 if ret.Get(0) != nil { 182 r0 = ret.Get(0).(*model.AppError) 183 } 184 } 185 186 return r0 187 } 188 189 // DeleteTeam provides a mock function with given fields: teamId 190 func (_m *APIMOCKINTERNAL) DeleteTeam(teamId string) *model.AppError { 191 ret := _m.Called(teamId) 192 193 var r0 *model.AppError 194 if rf, ok := ret.Get(0).(func(string) *model.AppError); ok { 195 r0 = rf(teamId) 196 } else { 197 if ret.Get(0) != nil { 198 r0 = ret.Get(0).(*model.AppError) 199 } 200 } 201 202 return r0 203 } 204 205 // DeleteUser provides a mock function with given fields: userId 206 func (_m *APIMOCKINTERNAL) DeleteUser(userId string) *model.AppError { 207 ret := _m.Called(userId) 208 209 var r0 *model.AppError 210 if rf, ok := ret.Get(0).(func(string) *model.AppError); ok { 211 r0 = rf(userId) 212 } else { 213 if ret.Get(0) != nil { 214 r0 = ret.Get(0).(*model.AppError) 215 } 216 } 217 218 return r0 219 } 220 221 // GetChannel provides a mock function with given fields: channelId 222 func (_m *APIMOCKINTERNAL) GetChannel(channelId string) (*model.Channel, *model.AppError) { 223 ret := _m.Called(channelId) 224 225 var r0 *model.Channel 226 if rf, ok := ret.Get(0).(func(string) *model.Channel); ok { 227 r0 = rf(channelId) 228 } else { 229 if ret.Get(0) != nil { 230 r0 = ret.Get(0).(*model.Channel) 231 } 232 } 233 234 var r1 *model.AppError 235 if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { 236 r1 = rf(channelId) 237 } else { 238 if ret.Get(1) != nil { 239 r1 = ret.Get(1).(*model.AppError) 240 } 241 } 242 243 return r0, r1 244 } 245 246 // GetChannelByName provides a mock function with given fields: name, teamId 247 func (_m *APIMOCKINTERNAL) GetChannelByName(name string, teamId string) (*model.Channel, *model.AppError) { 248 ret := _m.Called(name, teamId) 249 250 var r0 *model.Channel 251 if rf, ok := ret.Get(0).(func(string, string) *model.Channel); ok { 252 r0 = rf(name, teamId) 253 } else { 254 if ret.Get(0) != nil { 255 r0 = ret.Get(0).(*model.Channel) 256 } 257 } 258 259 var r1 *model.AppError 260 if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { 261 r1 = rf(name, teamId) 262 } else { 263 if ret.Get(1) != nil { 264 r1 = ret.Get(1).(*model.AppError) 265 } 266 } 267 268 return r0, r1 269 } 270 271 // GetChannelMember provides a mock function with given fields: channelId, userId 272 func (_m *APIMOCKINTERNAL) GetChannelMember(channelId string, userId string) (*model.ChannelMember, *model.AppError) { 273 ret := _m.Called(channelId, userId) 274 275 var r0 *model.ChannelMember 276 if rf, ok := ret.Get(0).(func(string, string) *model.ChannelMember); ok { 277 r0 = rf(channelId, userId) 278 } else { 279 if ret.Get(0) != nil { 280 r0 = ret.Get(0).(*model.ChannelMember) 281 } 282 } 283 284 var r1 *model.AppError 285 if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { 286 r1 = rf(channelId, userId) 287 } else { 288 if ret.Get(1) != nil { 289 r1 = ret.Get(1).(*model.AppError) 290 } 291 } 292 293 return r0, r1 294 } 295 296 // GetDirectChannel provides a mock function with given fields: userId1, userId2 297 func (_m *APIMOCKINTERNAL) GetDirectChannel(userId1 string, userId2 string) (*model.Channel, *model.AppError) { 298 ret := _m.Called(userId1, userId2) 299 300 var r0 *model.Channel 301 if rf, ok := ret.Get(0).(func(string, string) *model.Channel); ok { 302 r0 = rf(userId1, userId2) 303 } else { 304 if ret.Get(0) != nil { 305 r0 = ret.Get(0).(*model.Channel) 306 } 307 } 308 309 var r1 *model.AppError 310 if rf, ok := ret.Get(1).(func(string, string) *model.AppError); ok { 311 r1 = rf(userId1, userId2) 312 } else { 313 if ret.Get(1) != nil { 314 r1 = ret.Get(1).(*model.AppError) 315 } 316 } 317 318 return r0, r1 319 } 320 321 // GetGroupChannel provides a mock function with given fields: userIds 322 func (_m *APIMOCKINTERNAL) GetGroupChannel(userIds []string) (*model.Channel, *model.AppError) { 323 ret := _m.Called(userIds) 324 325 var r0 *model.Channel 326 if rf, ok := ret.Get(0).(func([]string) *model.Channel); ok { 327 r0 = rf(userIds) 328 } else { 329 if ret.Get(0) != nil { 330 r0 = ret.Get(0).(*model.Channel) 331 } 332 } 333 334 var r1 *model.AppError 335 if rf, ok := ret.Get(1).(func([]string) *model.AppError); ok { 336 r1 = rf(userIds) 337 } else { 338 if ret.Get(1) != nil { 339 r1 = ret.Get(1).(*model.AppError) 340 } 341 } 342 343 return r0, r1 344 } 345 346 // GetPost provides a mock function with given fields: postId 347 func (_m *APIMOCKINTERNAL) GetPost(postId string) (*model.Post, *model.AppError) { 348 ret := _m.Called(postId) 349 350 var r0 *model.Post 351 if rf, ok := ret.Get(0).(func(string) *model.Post); ok { 352 r0 = rf(postId) 353 } else { 354 if ret.Get(0) != nil { 355 r0 = ret.Get(0).(*model.Post) 356 } 357 } 358 359 var r1 *model.AppError 360 if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { 361 r1 = rf(postId) 362 } else { 363 if ret.Get(1) != nil { 364 r1 = ret.Get(1).(*model.AppError) 365 } 366 } 367 368 return r0, r1 369 } 370 371 // GetTeam provides a mock function with given fields: teamId 372 func (_m *APIMOCKINTERNAL) GetTeam(teamId string) (*model.Team, *model.AppError) { 373 ret := _m.Called(teamId) 374 375 var r0 *model.Team 376 if rf, ok := ret.Get(0).(func(string) *model.Team); ok { 377 r0 = rf(teamId) 378 } else { 379 if ret.Get(0) != nil { 380 r0 = ret.Get(0).(*model.Team) 381 } 382 } 383 384 var r1 *model.AppError 385 if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { 386 r1 = rf(teamId) 387 } else { 388 if ret.Get(1) != nil { 389 r1 = ret.Get(1).(*model.AppError) 390 } 391 } 392 393 return r0, r1 394 } 395 396 // GetTeamByName provides a mock function with given fields: name 397 func (_m *APIMOCKINTERNAL) GetTeamByName(name string) (*model.Team, *model.AppError) { 398 ret := _m.Called(name) 399 400 var r0 *model.Team 401 if rf, ok := ret.Get(0).(func(string) *model.Team); ok { 402 r0 = rf(name) 403 } else { 404 if ret.Get(0) != nil { 405 r0 = ret.Get(0).(*model.Team) 406 } 407 } 408 409 var r1 *model.AppError 410 if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { 411 r1 = rf(name) 412 } else { 413 if ret.Get(1) != nil { 414 r1 = ret.Get(1).(*model.AppError) 415 } 416 } 417 418 return r0, r1 419 } 420 421 // GetUser provides a mock function with given fields: userId 422 func (_m *APIMOCKINTERNAL) GetUser(userId string) (*model.User, *model.AppError) { 423 ret := _m.Called(userId) 424 425 var r0 *model.User 426 if rf, ok := ret.Get(0).(func(string) *model.User); ok { 427 r0 = rf(userId) 428 } else { 429 if ret.Get(0) != nil { 430 r0 = ret.Get(0).(*model.User) 431 } 432 } 433 434 var r1 *model.AppError 435 if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { 436 r1 = rf(userId) 437 } else { 438 if ret.Get(1) != nil { 439 r1 = ret.Get(1).(*model.AppError) 440 } 441 } 442 443 return r0, r1 444 } 445 446 // GetUserByEmail provides a mock function with given fields: email 447 func (_m *APIMOCKINTERNAL) GetUserByEmail(email string) (*model.User, *model.AppError) { 448 ret := _m.Called(email) 449 450 var r0 *model.User 451 if rf, ok := ret.Get(0).(func(string) *model.User); ok { 452 r0 = rf(email) 453 } else { 454 if ret.Get(0) != nil { 455 r0 = ret.Get(0).(*model.User) 456 } 457 } 458 459 var r1 *model.AppError 460 if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { 461 r1 = rf(email) 462 } else { 463 if ret.Get(1) != nil { 464 r1 = ret.Get(1).(*model.AppError) 465 } 466 } 467 468 return r0, r1 469 } 470 471 // GetUserByUsername provides a mock function with given fields: name 472 func (_m *APIMOCKINTERNAL) GetUserByUsername(name string) (*model.User, *model.AppError) { 473 ret := _m.Called(name) 474 475 var r0 *model.User 476 if rf, ok := ret.Get(0).(func(string) *model.User); ok { 477 r0 = rf(name) 478 } else { 479 if ret.Get(0) != nil { 480 r0 = ret.Get(0).(*model.User) 481 } 482 } 483 484 var r1 *model.AppError 485 if rf, ok := ret.Get(1).(func(string) *model.AppError); ok { 486 r1 = rf(name) 487 } else { 488 if ret.Get(1) != nil { 489 r1 = ret.Get(1).(*model.AppError) 490 } 491 } 492 493 return r0, r1 494 } 495 496 // KeyValueStore provides a mock function with given fields: 497 func (_m *APIMOCKINTERNAL) KeyValueStore() plugin.KeyValueStore { 498 ret := _m.Called() 499 500 var r0 plugin.KeyValueStore 501 if rf, ok := ret.Get(0).(func() plugin.KeyValueStore); ok { 502 r0 = rf() 503 } else { 504 if ret.Get(0) != nil { 505 r0 = ret.Get(0).(plugin.KeyValueStore) 506 } 507 } 508 509 return r0 510 } 511 512 // LoadPluginConfiguration provides a mock function with given fields: dest 513 func (_m *APIMOCKINTERNAL) LoadPluginConfiguration(dest interface{}) error { 514 ret := _m.Called(dest) 515 516 var r0 error 517 if rf, ok := ret.Get(0).(func(interface{}) error); ok { 518 r0 = rf(dest) 519 } else { 520 r0 = ret.Error(0) 521 } 522 523 return r0 524 } 525 526 // RegisterCommand provides a mock function with given fields: command 527 func (_m *APIMOCKINTERNAL) RegisterCommand(command *model.Command) error { 528 ret := _m.Called(command) 529 530 var r0 error 531 if rf, ok := ret.Get(0).(func(*model.Command) error); ok { 532 r0 = rf(command) 533 } else { 534 r0 = ret.Error(0) 535 } 536 537 return r0 538 } 539 540 // UnregisterCommand provides a mock function with given fields: teamId, trigger 541 func (_m *APIMOCKINTERNAL) UnregisterCommand(teamId string, trigger string) error { 542 ret := _m.Called(teamId, trigger) 543 544 var r0 error 545 if rf, ok := ret.Get(0).(func(string, string) error); ok { 546 r0 = rf(teamId, trigger) 547 } else { 548 r0 = ret.Error(0) 549 } 550 551 return r0 552 } 553 554 // UpdateChannel provides a mock function with given fields: channel 555 func (_m *APIMOCKINTERNAL) UpdateChannel(channel *model.Channel) (*model.Channel, *model.AppError) { 556 ret := _m.Called(channel) 557 558 var r0 *model.Channel 559 if rf, ok := ret.Get(0).(func(*model.Channel) *model.Channel); ok { 560 r0 = rf(channel) 561 } else { 562 if ret.Get(0) != nil { 563 r0 = ret.Get(0).(*model.Channel) 564 } 565 } 566 567 var r1 *model.AppError 568 if rf, ok := ret.Get(1).(func(*model.Channel) *model.AppError); ok { 569 r1 = rf(channel) 570 } else { 571 if ret.Get(1) != nil { 572 r1 = ret.Get(1).(*model.AppError) 573 } 574 } 575 576 return r0, r1 577 } 578 579 // UpdateChannelMemberNotifications provides a mock function with given fields: channelId, userId, notifications 580 func (_m *APIMOCKINTERNAL) UpdateChannelMemberNotifications(channelId string, userId string, notifications map[string]string) (*model.ChannelMember, *model.AppError) { 581 ret := _m.Called(channelId, userId, notifications) 582 583 var r0 *model.ChannelMember 584 if rf, ok := ret.Get(0).(func(string, string, map[string]string) *model.ChannelMember); ok { 585 r0 = rf(channelId, userId, notifications) 586 } else { 587 if ret.Get(0) != nil { 588 r0 = ret.Get(0).(*model.ChannelMember) 589 } 590 } 591 592 var r1 *model.AppError 593 if rf, ok := ret.Get(1).(func(string, string, map[string]string) *model.AppError); ok { 594 r1 = rf(channelId, userId, notifications) 595 } else { 596 if ret.Get(1) != nil { 597 r1 = ret.Get(1).(*model.AppError) 598 } 599 } 600 601 return r0, r1 602 } 603 604 // UpdateChannelMemberRoles provides a mock function with given fields: channelId, userId, newRoles 605 func (_m *APIMOCKINTERNAL) UpdateChannelMemberRoles(channelId string, userId string, newRoles string) (*model.ChannelMember, *model.AppError) { 606 ret := _m.Called(channelId, userId, newRoles) 607 608 var r0 *model.ChannelMember 609 if rf, ok := ret.Get(0).(func(string, string, string) *model.ChannelMember); ok { 610 r0 = rf(channelId, userId, newRoles) 611 } else { 612 if ret.Get(0) != nil { 613 r0 = ret.Get(0).(*model.ChannelMember) 614 } 615 } 616 617 var r1 *model.AppError 618 if rf, ok := ret.Get(1).(func(string, string, string) *model.AppError); ok { 619 r1 = rf(channelId, userId, newRoles) 620 } else { 621 if ret.Get(1) != nil { 622 r1 = ret.Get(1).(*model.AppError) 623 } 624 } 625 626 return r0, r1 627 } 628 629 // UpdatePost provides a mock function with given fields: post 630 func (_m *APIMOCKINTERNAL) UpdatePost(post *model.Post) (*model.Post, *model.AppError) { 631 ret := _m.Called(post) 632 633 var r0 *model.Post 634 if rf, ok := ret.Get(0).(func(*model.Post) *model.Post); ok { 635 r0 = rf(post) 636 } else { 637 if ret.Get(0) != nil { 638 r0 = ret.Get(0).(*model.Post) 639 } 640 } 641 642 var r1 *model.AppError 643 if rf, ok := ret.Get(1).(func(*model.Post) *model.AppError); ok { 644 r1 = rf(post) 645 } else { 646 if ret.Get(1) != nil { 647 r1 = ret.Get(1).(*model.AppError) 648 } 649 } 650 651 return r0, r1 652 } 653 654 // UpdateTeam provides a mock function with given fields: team 655 func (_m *APIMOCKINTERNAL) UpdateTeam(team *model.Team) (*model.Team, *model.AppError) { 656 ret := _m.Called(team) 657 658 var r0 *model.Team 659 if rf, ok := ret.Get(0).(func(*model.Team) *model.Team); ok { 660 r0 = rf(team) 661 } else { 662 if ret.Get(0) != nil { 663 r0 = ret.Get(0).(*model.Team) 664 } 665 } 666 667 var r1 *model.AppError 668 if rf, ok := ret.Get(1).(func(*model.Team) *model.AppError); ok { 669 r1 = rf(team) 670 } else { 671 if ret.Get(1) != nil { 672 r1 = ret.Get(1).(*model.AppError) 673 } 674 } 675 676 return r0, r1 677 } 678 679 // UpdateUser provides a mock function with given fields: user 680 func (_m *APIMOCKINTERNAL) UpdateUser(user *model.User) (*model.User, *model.AppError) { 681 ret := _m.Called(user) 682 683 var r0 *model.User 684 if rf, ok := ret.Get(0).(func(*model.User) *model.User); ok { 685 r0 = rf(user) 686 } else { 687 if ret.Get(0) != nil { 688 r0 = ret.Get(0).(*model.User) 689 } 690 } 691 692 var r1 *model.AppError 693 if rf, ok := ret.Get(1).(func(*model.User) *model.AppError); ok { 694 r1 = rf(user) 695 } else { 696 if ret.Get(1) != nil { 697 r1 = ret.Get(1).(*model.AppError) 698 } 699 } 700 701 return r0, r1 702 }