// Code generated by MockGen. DO NOT EDIT.
// Source: ./internal/service/oauth2/oauth2.go

// Package oauth2 is a generated GoMock package.
package oauth2

import (
	context "context"
	url "net/url"
	reflect "reflect"

	gomock "github.com/golang/mock/gomock"
	account "github.com/tidbcloud/account/idl/pbgen/proto/account"
	oauth2 "github.com/tidbcloud/auth-server/internal/dto/oauth2"
	entity "github.com/tidbcloud/auth-server/internal/entity"
	errs "github.com/tidbcloud/tiinf/errs"
)

// MockOauth2Service is a mock of Oauth2Service interface.
type MockOauth2Service struct {
	ctrl     *gomock.Controller
	recorder *MockOauth2ServiceMockRecorder
}

// MockOauth2ServiceMockRecorder is the mock recorder for MockOauth2Service.
type MockOauth2ServiceMockRecorder struct {
	mock *MockOauth2Service
}

// NewMockOauth2Service creates a new mock instance.
func NewMockOauth2Service(ctrl *gomock.Controller) *MockOauth2Service {
	mock := &MockOauth2Service{ctrl: ctrl}
	mock.recorder = &MockOauth2ServiceMockRecorder{mock}
	return mock
}

// EXPECT returns an object that allows the caller to indicate expected use.
func (m *MockOauth2Service) EXPECT() *MockOauth2ServiceMockRecorder {
	return m.recorder
}

// CreateAccessTokenByCodeGrant mocks base method.
func (m *MockOauth2Service) CreateAccessTokenByCodeGrant(ctx context.Context, clientID, clientSecret, code, redirectURI string) (*oauth2.TokenResponse, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "CreateAccessTokenByCodeGrant", ctx, clientID, clientSecret, code, redirectURI)
	ret0, _ := ret[0].(*oauth2.TokenResponse)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// CreateAccessTokenByCodeGrant indicates an expected call of CreateAccessTokenByCodeGrant.
func (mr *MockOauth2ServiceMockRecorder) CreateAccessTokenByCodeGrant(ctx, clientID, clientSecret, code, redirectURI interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateAccessTokenByCodeGrant", reflect.TypeOf((*MockOauth2Service)(nil).CreateAccessTokenByCodeGrant), ctx, clientID, clientSecret, code, redirectURI)
}

// CreateApplication mocks base method.
func (m *MockOauth2Service) CreateApplication(ctx context.Context, name, redirectURI string, grantType entity.Oauth2GrantType, orgRole, projectRole string) (*entity.Oauth2Application, string, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "CreateApplication", ctx, name, redirectURI, grantType, orgRole, projectRole)
	ret0, _ := ret[0].(*entity.Oauth2Application)
	ret1, _ := ret[1].(string)
	ret2, _ := ret[2].(error)
	return ret0, ret1, ret2
}

// CreateApplication indicates an expected call of CreateApplication.
func (mr *MockOauth2ServiceMockRecorder) CreateApplication(ctx, name, redirectURI, grantType, orgRole, projectRole interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreateApplication", reflect.TypeOf((*MockOauth2Service)(nil).CreateApplication), ctx, name, redirectURI, grantType, orgRole, projectRole)
}

// GetAccessTokenIdentity mocks base method.
func (m *MockOauth2Service) GetAccessTokenIdentity(ctx context.Context, rawAccessToken string) (*entity.Oauth2AccessToken, errs.Error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetAccessTokenIdentity", ctx, rawAccessToken)
	ret0, _ := ret[0].(*entity.Oauth2AccessToken)
	ret1, _ := ret[1].(errs.Error)
	return ret0, ret1
}

// GetAccessTokenIdentity indicates an expected call of GetAccessTokenIdentity.
func (mr *MockOauth2ServiceMockRecorder) GetAccessTokenIdentity(ctx, rawAccessToken interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccessTokenIdentity", reflect.TypeOf((*MockOauth2Service)(nil).GetAccessTokenIdentity), ctx, rawAccessToken)
}

// GetAccessTokenInfo mocks base method.
func (m *MockOauth2Service) GetAccessTokenInfo(ctx context.Context, rawAccessToken string) (*oauth2.AccessTokenInfo, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetAccessTokenInfo", ctx, rawAccessToken)
	ret0, _ := ret[0].(*oauth2.AccessTokenInfo)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// GetAccessTokenInfo indicates an expected call of GetAccessTokenInfo.
func (mr *MockOauth2ServiceMockRecorder) GetAccessTokenInfo(ctx, rawAccessToken interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetAccessTokenInfo", reflect.TypeOf((*MockOauth2Service)(nil).GetAccessTokenInfo), ctx, rawAccessToken)
}

// GetApplicationByID mocks base method.
func (m *MockOauth2Service) GetApplicationByID(ctx context.Context, id uint64) (*entity.Oauth2Application, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetApplicationByID", ctx, id)
	ret0, _ := ret[0].(*entity.Oauth2Application)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// GetApplicationByID indicates an expected call of GetApplicationByID.
func (mr *MockOauth2ServiceMockRecorder) GetApplicationByID(ctx, id interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetApplicationByID", reflect.TypeOf((*MockOauth2Service)(nil).GetApplicationByID), ctx, id)
}

// GetUserInfo mocks base method.
func (m *MockOauth2Service) GetUserInfo(ctx context.Context, rawAccessToken string) (*oauth2.UserInfo, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetUserInfo", ctx, rawAccessToken)
	ret0, _ := ret[0].(*oauth2.UserInfo)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// GetUserInfo indicates an expected call of GetUserInfo.
func (mr *MockOauth2ServiceMockRecorder) GetUserInfo(ctx, rawAccessToken interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUserInfo", reflect.TypeOf((*MockOauth2Service)(nil).GetUserInfo), ctx, rawAccessToken)
}

// GetUserLastAccessToken mocks base method.
func (m *MockOauth2Service) GetUserLastAccessToken(ctx context.Context, filter oauth2.TokenFilter) (entity.Oauth2AccessToken, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "GetUserLastAccessToken", ctx, filter)
	ret0, _ := ret[0].(entity.Oauth2AccessToken)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// GetUserLastAccessToken indicates an expected call of GetUserLastAccessToken.
func (mr *MockOauth2ServiceMockRecorder) GetUserLastAccessToken(ctx, filter interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "GetUserLastAccessToken", reflect.TypeOf((*MockOauth2Service)(nil).GetUserLastAccessToken), ctx, filter)
}

// HandleDeviceAuthorizationRequest mocks base method.
func (m *MockOauth2Service) HandleDeviceAuthorizationRequest(ctx context.Context, clientID, clientIP, userAgent string) (*oauth2.DeviceAuthorizationResponse, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "HandleDeviceAuthorizationRequest", ctx, clientID, clientIP, userAgent)
	ret0, _ := ret[0].(*oauth2.DeviceAuthorizationResponse)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// HandleDeviceAuthorizationRequest indicates an expected call of HandleDeviceAuthorizationRequest.
func (mr *MockOauth2ServiceMockRecorder) HandleDeviceAuthorizationRequest(ctx, clientID, clientIP, userAgent interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleDeviceAuthorizationRequest", reflect.TypeOf((*MockOauth2Service)(nil).HandleDeviceAuthorizationRequest), ctx, clientID, clientIP, userAgent)
}

// HandleDeviceTokenRequest mocks base method.
func (m *MockOauth2Service) HandleDeviceTokenRequest(ctx context.Context, clientID, deviceCode string) (*oauth2.TokenResponse, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "HandleDeviceTokenRequest", ctx, clientID, deviceCode)
	ret0, _ := ret[0].(*oauth2.TokenResponse)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// HandleDeviceTokenRequest indicates an expected call of HandleDeviceTokenRequest.
func (mr *MockOauth2ServiceMockRecorder) HandleDeviceTokenRequest(ctx, clientID, deviceCode interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleDeviceTokenRequest", reflect.TypeOf((*MockOauth2Service)(nil).HandleDeviceTokenRequest), ctx, clientID, deviceCode)
}

// HandleInnerDeviceCodeCheckRequest mocks base method.
func (m *MockOauth2Service) HandleInnerDeviceCodeCheckRequest(ctx context.Context, userCode string) (*oauth2.InnerDeviceCheckResponse, errs.Error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "HandleInnerDeviceCodeCheckRequest", ctx, userCode)
	ret0, _ := ret[0].(*oauth2.InnerDeviceCheckResponse)
	ret1, _ := ret[1].(errs.Error)
	return ret0, ret1
}

// HandleInnerDeviceCodeCheckRequest indicates an expected call of HandleInnerDeviceCodeCheckRequest.
func (mr *MockOauth2ServiceMockRecorder) HandleInnerDeviceCodeCheckRequest(ctx, userCode interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleInnerDeviceCodeCheckRequest", reflect.TypeOf((*MockOauth2Service)(nil).HandleInnerDeviceCodeCheckRequest), ctx, userCode)
}

// HandleInnerDeviceCodeConfirmationRequest mocks base method.
func (m *MockOauth2Service) HandleInnerDeviceCodeConfirmationRequest(ctx context.Context, user *account.User, userCode string, approve bool, orgId uint64) errs.Error {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "HandleInnerDeviceCodeConfirmationRequest", ctx, user, userCode, approve, orgId)
	ret0, _ := ret[0].(errs.Error)
	return ret0
}

// HandleInnerDeviceCodeConfirmationRequest indicates an expected call of HandleInnerDeviceCodeConfirmationRequest.
func (mr *MockOauth2ServiceMockRecorder) HandleInnerDeviceCodeConfirmationRequest(ctx, user, userCode, approve, orgId interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleInnerDeviceCodeConfirmationRequest", reflect.TypeOf((*MockOauth2Service)(nil).HandleInnerDeviceCodeConfirmationRequest), ctx, user, userCode, approve, orgId)
}

// HandleRefreshTokenRequest mocks base method.
func (m *MockOauth2Service) HandleRefreshTokenRequest(ctx context.Context, clientID, clientSecret, refreshToken string) (*oauth2.TokenResponse, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "HandleRefreshTokenRequest", ctx, clientID, clientSecret, refreshToken)
	ret0, _ := ret[0].(*oauth2.TokenResponse)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// HandleRefreshTokenRequest indicates an expected call of HandleRefreshTokenRequest.
func (mr *MockOauth2ServiceMockRecorder) HandleRefreshTokenRequest(ctx, clientID, clientSecret, refreshToken interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleRefreshTokenRequest", reflect.TypeOf((*MockOauth2Service)(nil).HandleRefreshTokenRequest), ctx, clientID, clientSecret, refreshToken)
}

// HandleRevokeTokenRequest mocks base method.
func (m *MockOauth2Service) HandleRevokeTokenRequest(ctx context.Context, clientID, clientSecret, token, tokenTypeHint string) {
	m.ctrl.T.Helper()
	m.ctrl.Call(m, "HandleRevokeTokenRequest", ctx, clientID, clientSecret, token, tokenTypeHint)
}

// HandleRevokeTokenRequest indicates an expected call of HandleRevokeTokenRequest.
func (mr *MockOauth2ServiceMockRecorder) HandleRevokeTokenRequest(ctx, clientID, clientSecret, token, tokenTypeHint interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "HandleRevokeTokenRequest", reflect.TypeOf((*MockOauth2Service)(nil).HandleRevokeTokenRequest), ctx, clientID, clientSecret, token, tokenTypeHint)
}

// InnerAuthorizationCodeApprove mocks base method.
func (m *MockOauth2Service) InnerAuthorizationCodeApprove(ctx context.Context, user *account.User, req *AuthorizeRequest, orgID uint64, projectIDs []uint64) (*entity.Oauth2CodeGrant, *url.URL, errs.Error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "InnerAuthorizationCodeApprove", ctx, user, req, orgID, projectIDs)
	ret0, _ := ret[0].(*entity.Oauth2CodeGrant)
	ret1, _ := ret[1].(*url.URL)
	ret2, _ := ret[2].(errs.Error)
	return ret0, ret1, ret2
}

// InnerAuthorizationCodeApprove indicates an expected call of InnerAuthorizationCodeApprove.
func (mr *MockOauth2ServiceMockRecorder) InnerAuthorizationCodeApprove(ctx, user, req, orgID, projectIDs interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InnerAuthorizationCodeApprove", reflect.TypeOf((*MockOauth2Service)(nil).InnerAuthorizationCodeApprove), ctx, user, req, orgID, projectIDs)
}

// InnerAuthorizationCodeRequestValidate mocks base method.
func (m *MockOauth2Service) InnerAuthorizationCodeRequestValidate(ctx context.Context, user *account.User, clientID, responseType, redirectURI, state string, scopes []string) (*AuthorizeRequest, errs.Error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "InnerAuthorizationCodeRequestValidate", ctx, user, clientID, responseType, redirectURI, state, scopes)
	ret0, _ := ret[0].(*AuthorizeRequest)
	ret1, _ := ret[1].(errs.Error)
	return ret0, ret1
}

// InnerAuthorizationCodeRequestValidate indicates an expected call of InnerAuthorizationCodeRequestValidate.
func (mr *MockOauth2ServiceMockRecorder) InnerAuthorizationCodeRequestValidate(ctx, user, clientID, responseType, redirectURI, state, scopes interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InnerAuthorizationCodeRequestValidate", reflect.TypeOf((*MockOauth2Service)(nil).InnerAuthorizationCodeRequestValidate), ctx, user, clientID, responseType, redirectURI, state, scopes)
}

// InnerQueryUserAuthorizedApplications mocks base method.
func (m *MockOauth2Service) InnerQueryUserAuthorizedApplications(ctx context.Context, req oauth2.UserAuthorizedAppsFilter) []oauth2.InnerApplication {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "InnerQueryUserAuthorizedApplications", ctx, req)
	ret0, _ := ret[0].([]oauth2.InnerApplication)
	return ret0
}

// InnerQueryUserAuthorizedApplications indicates an expected call of InnerQueryUserAuthorizedApplications.
func (mr *MockOauth2ServiceMockRecorder) InnerQueryUserAuthorizedApplications(ctx, req interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "InnerQueryUserAuthorizedApplications", reflect.TypeOf((*MockOauth2Service)(nil).InnerQueryUserAuthorizedApplications), ctx, req)
}

// QueryOauth2Applications mocks base method.
func (m *MockOauth2Service) QueryOauth2Applications(ctx context.Context, filter oauth2.QueryAppsParam) ([]entity.Oauth2Application, error) {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "QueryOauth2Applications", ctx, filter)
	ret0, _ := ret[0].([]entity.Oauth2Application)
	ret1, _ := ret[1].(error)
	return ret0, ret1
}

// QueryOauth2Applications indicates an expected call of QueryOauth2Applications.
func (mr *MockOauth2ServiceMockRecorder) QueryOauth2Applications(ctx, filter interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "QueryOauth2Applications", reflect.TypeOf((*MockOauth2Service)(nil).QueryOauth2Applications), ctx, filter)
}

// RevokeTokenByFilter mocks base method.
func (m *MockOauth2Service) RevokeTokenByFilter(ctx context.Context, req oauth2.RevokeTokenFilter) error {
	m.ctrl.T.Helper()
	ret := m.ctrl.Call(m, "RevokeTokenByFilter", ctx, req)
	ret0, _ := ret[0].(error)
	return ret0
}

// RevokeTokenByFilter indicates an expected call of RevokeTokenByFilter.
func (mr *MockOauth2ServiceMockRecorder) RevokeTokenByFilter(ctx, req interface{}) *gomock.Call {
	mr.mock.ctrl.T.Helper()
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "RevokeTokenByFilter", reflect.TypeOf((*MockOauth2Service)(nil).RevokeTokenByFilter), ctx, req)
}
