// Code generated by protoc-gen-grpc-mock. DO NOT EDIT.
// source: external/iam/v2/users.proto

package v2

import (
	"context"

	request "github.com/chef/automate/api/external/iam/v2/request"
	response "github.com/chef/automate/api/external/iam/v2/response"
	"google.golang.org/grpc/codes"
	"google.golang.org/grpc/status"
)

// verify that the mock satisfies the UsersServer interface (at compile time)
var _ UsersServer = &UsersServerMock{}

// NewUsersServerMock gives you a fresh instance of UsersServerMock.
func NewUsersServerMock() *UsersServerMock {
	return &UsersServerMock{validateRequests: true}
}

// NewUsersServerMockWithoutValidation gives you a fresh instance of
// UsersServerMock which does not attempt to validate requests before passing
// them to their respective '*Func'.
func NewUsersServerMockWithoutValidation() *UsersServerMock {
	return &UsersServerMock{}
}

// UsersServerMock is the mock-what-you-want struct that stubs all not-overridden
// methods with "not implemented" returns
type UsersServerMock struct {
	validateRequests bool
	CreateUserFunc   func(context.Context, *request.CreateUserReq) (*response.CreateUserResp, error)
	ListUsersFunc    func(context.Context, *request.ListUsersReq) (*response.ListUsersResp, error)
	GetUserFunc      func(context.Context, *request.GetUserReq) (*response.GetUserResp, error)
	DeleteUserFunc   func(context.Context, *request.DeleteUserReq) (*response.DeleteUserResp, error)
	UpdateUserFunc   func(context.Context, *request.UpdateUserReq) (*response.UpdateUserResp, error)
	UpdateSelfFunc   func(context.Context, *request.UpdateSelfReq) (*response.UpdateSelfResp, error)
}

func (m *UsersServerMock) CreateUser(ctx context.Context, req *request.CreateUserReq) (*response.CreateUserResp, error) {
	if msg, ok := interface{}(req).(interface{ Validate() error }); m.validateRequests && ok {
		if err := msg.Validate(); err != nil {
			return nil, status.Error(codes.InvalidArgument, err.Error())
		}
	}
	if f := m.CreateUserFunc; f != nil {
		return f(ctx, req)
	}
	return nil, status.Error(codes.Internal, "mock: 'CreateUser' not implemented")
}

func (m *UsersServerMock) ListUsers(ctx context.Context, req *request.ListUsersReq) (*response.ListUsersResp, error) {
	if msg, ok := interface{}(req).(interface{ Validate() error }); m.validateRequests && ok {
		if err := msg.Validate(); err != nil {
			return nil, status.Error(codes.InvalidArgument, err.Error())
		}
	}
	if f := m.ListUsersFunc; f != nil {
		return f(ctx, req)
	}
	return nil, status.Error(codes.Internal, "mock: 'ListUsers' not implemented")
}

func (m *UsersServerMock) GetUser(ctx context.Context, req *request.GetUserReq) (*response.GetUserResp, error) {
	if msg, ok := interface{}(req).(interface{ Validate() error }); m.validateRequests && ok {
		if err := msg.Validate(); err != nil {
			return nil, status.Error(codes.InvalidArgument, err.Error())
		}
	}
	if f := m.GetUserFunc; f != nil {
		return f(ctx, req)
	}
	return nil, status.Error(codes.Internal, "mock: 'GetUser' not implemented")
}

func (m *UsersServerMock) DeleteUser(ctx context.Context, req *request.DeleteUserReq) (*response.DeleteUserResp, error) {
	if msg, ok := interface{}(req).(interface{ Validate() error }); m.validateRequests && ok {
		if err := msg.Validate(); err != nil {
			return nil, status.Error(codes.InvalidArgument, err.Error())
		}
	}
	if f := m.DeleteUserFunc; f != nil {
		return f(ctx, req)
	}
	return nil, status.Error(codes.Internal, "mock: 'DeleteUser' not implemented")
}

func (m *UsersServerMock) UpdateUser(ctx context.Context, req *request.UpdateUserReq) (*response.UpdateUserResp, error) {
	if msg, ok := interface{}(req).(interface{ Validate() error }); m.validateRequests && ok {
		if err := msg.Validate(); err != nil {
			return nil, status.Error(codes.InvalidArgument, err.Error())
		}
	}
	if f := m.UpdateUserFunc; f != nil {
		return f(ctx, req)
	}
	return nil, status.Error(codes.Internal, "mock: 'UpdateUser' not implemented")
}

func (m *UsersServerMock) UpdateSelf(ctx context.Context, req *request.UpdateSelfReq) (*response.UpdateSelfResp, error) {
	if msg, ok := interface{}(req).(interface{ Validate() error }); m.validateRequests && ok {
		if err := msg.Validate(); err != nil {
			return nil, status.Error(codes.InvalidArgument, err.Error())
		}
	}
	if f := m.UpdateSelfFunc; f != nil {
		return f(ctx, req)
	}
	return nil, status.Error(codes.Internal, "mock: 'UpdateSelf' not implemented")
}

// Reset resets all overridden functions
func (m *UsersServerMock) Reset() {
	m.CreateUserFunc = nil
	m.ListUsersFunc = nil
	m.GetUserFunc = nil
	m.DeleteUserFunc = nil
	m.UpdateUserFunc = nil
	m.UpdateSelfFunc = nil
}
