// Code generated by Kitex v0.5.1. DO NOT EDIT.

package userservice

import (
	"context"
	client "github.com/cloudwego/kitex/client"
	callopt "github.com/cloudwego/kitex/client/callopt"
	user "github.com/cqqqq777/go-kitex-mall/shared/kitex_gen/user"
)

// Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework.
type Client interface {
	GetVerification(ctx context.Context, req *user.MallVerificationRequest, callOptions ...callopt.Option) (r *user.MallVerificationResponse, err error)
	Register(ctx context.Context, req *user.MallUserRegisterRequest, callOptions ...callopt.Option) (r *user.MallUserRegisterResponse, err error)
	Login(ctx context.Context, req *user.MallUserLoginRequest, callOptions ...callopt.Option) (r *user.MallUserLoginResponse, err error)
	GetUserInfo(ctx context.Context, req *user.MallGetUserInfoRequest, callOptions ...callopt.Option) (r *user.MallGetUserInfoResponse, err error)
	ChangeAvatar(ctx context.Context, req *user.MallChangeUserAvatarRequest, callOptions ...callopt.Option) (r *user.MallChangeUserAvatarResponse, err error)
	ChangeBackground(ctx context.Context, req *user.MallChangeUserBackgroundRequest, callOptions ...callopt.Option) (r *user.MallChangeUserBackgroundResponse, err error)
}

// NewClient creates a client for the service defined in IDL.
func NewClient(destService string, opts ...client.Option) (Client, error) {
	var options []client.Option
	options = append(options, client.WithDestService(destService))

	options = append(options, opts...)

	kc, err := client.NewClient(serviceInfo(), options...)
	if err != nil {
		return nil, err
	}
	return &kUserServiceClient{
		kClient: newServiceClient(kc),
	}, nil
}

// MustNewClient creates a client for the service defined in IDL. It panics if any error occurs.
func MustNewClient(destService string, opts ...client.Option) Client {
	kc, err := NewClient(destService, opts...)
	if err != nil {
		panic(err)
	}
	return kc
}

type kUserServiceClient struct {
	*kClient
}

func (p *kUserServiceClient) GetVerification(ctx context.Context, req *user.MallVerificationRequest, callOptions ...callopt.Option) (r *user.MallVerificationResponse, err error) {
	ctx = client.NewCtxWithCallOptions(ctx, callOptions)
	return p.kClient.GetVerification(ctx, req)
}

func (p *kUserServiceClient) Register(ctx context.Context, req *user.MallUserRegisterRequest, callOptions ...callopt.Option) (r *user.MallUserRegisterResponse, err error) {
	ctx = client.NewCtxWithCallOptions(ctx, callOptions)
	return p.kClient.Register(ctx, req)
}

func (p *kUserServiceClient) Login(ctx context.Context, req *user.MallUserLoginRequest, callOptions ...callopt.Option) (r *user.MallUserLoginResponse, err error) {
	ctx = client.NewCtxWithCallOptions(ctx, callOptions)
	return p.kClient.Login(ctx, req)
}

func (p *kUserServiceClient) GetUserInfo(ctx context.Context, req *user.MallGetUserInfoRequest, callOptions ...callopt.Option) (r *user.MallGetUserInfoResponse, err error) {
	ctx = client.NewCtxWithCallOptions(ctx, callOptions)
	return p.kClient.GetUserInfo(ctx, req)
}

func (p *kUserServiceClient) ChangeAvatar(ctx context.Context, req *user.MallChangeUserAvatarRequest, callOptions ...callopt.Option) (r *user.MallChangeUserAvatarResponse, err error) {
	ctx = client.NewCtxWithCallOptions(ctx, callOptions)
	return p.kClient.ChangeAvatar(ctx, req)
}

func (p *kUserServiceClient) ChangeBackground(ctx context.Context, req *user.MallChangeUserBackgroundRequest, callOptions ...callopt.Option) (r *user.MallChangeUserBackgroundResponse, err error) {
	ctx = client.NewCtxWithCallOptions(ctx, callOptions)
	return p.kClient.ChangeBackground(ctx, req)
}
