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

package reactionservice

import (
	rpc "common/kitex_gen/douyin/rpc"
	"context"
	client "github.com/cloudwego/kitex/client"
	callopt "github.com/cloudwego/kitex/client/callopt"
)

// Client is designed to provide IDL-compatible methods with call-option parameter for kitex framework.
type Client interface {
	Favorite(ctx context.Context, req *rpc.DouyinFavoriteActionRequest, callOptions ...callopt.Option) (r *rpc.DouyinFavoriteActionResponse, err error)
	ListFavorites(ctx context.Context, req *rpc.DouyinFavoriteListRequest, callOptions ...callopt.Option) (r *rpc.DouyinFavoriteListResponse, err error)
	Comment(ctx context.Context, req *rpc.DouyinCommentActionRequest, callOptions ...callopt.Option) (r *rpc.DouyinCommentActionResponse, err error)
	ListComments(ctx context.Context, req *rpc.DouyinCommentListRequest, callOptions ...callopt.Option) (r *rpc.DouyinCommentListResponse, err error)
	TestFavorites(ctx context.Context, req *rpc.FavoriteTestRequest, callOptions ...callopt.Option) (r *rpc.FavoriteTestResponse, 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 &kReactionServiceClient{
		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 kReactionServiceClient struct {
	*kClient
}

func (p *kReactionServiceClient) Favorite(ctx context.Context, req *rpc.DouyinFavoriteActionRequest, callOptions ...callopt.Option) (r *rpc.DouyinFavoriteActionResponse, err error) {
	ctx = client.NewCtxWithCallOptions(ctx, callOptions)
	return p.kClient.Favorite(ctx, req)
}

func (p *kReactionServiceClient) ListFavorites(ctx context.Context, req *rpc.DouyinFavoriteListRequest, callOptions ...callopt.Option) (r *rpc.DouyinFavoriteListResponse, err error) {
	ctx = client.NewCtxWithCallOptions(ctx, callOptions)
	return p.kClient.ListFavorites(ctx, req)
}

func (p *kReactionServiceClient) Comment(ctx context.Context, req *rpc.DouyinCommentActionRequest, callOptions ...callopt.Option) (r *rpc.DouyinCommentActionResponse, err error) {
	ctx = client.NewCtxWithCallOptions(ctx, callOptions)
	return p.kClient.Comment(ctx, req)
}

func (p *kReactionServiceClient) ListComments(ctx context.Context, req *rpc.DouyinCommentListRequest, callOptions ...callopt.Option) (r *rpc.DouyinCommentListResponse, err error) {
	ctx = client.NewCtxWithCallOptions(ctx, callOptions)
	return p.kClient.ListComments(ctx, req)
}

func (p *kReactionServiceClient) TestFavorites(ctx context.Context, req *rpc.FavoriteTestRequest, callOptions ...callopt.Option) (r *rpc.FavoriteTestResponse, err error) {
	ctx = client.NewCtxWithCallOptions(ctx, callOptions)
	return p.kClient.TestFavorites(ctx, req)
}
