// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: proto/trader.proto

/*
Package bitesla_srv_trader is a generated protocol buffer package.

It is generated from these files:
	proto/trader.proto

It has these top-level messages:
	TraderInfo
	TraderInfos
	StrategyInfo
*/
package bitesla_srv_trader

import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"

import (
	context "context"
	client "github.com/micro/go-micro/client"
	server "github.com/micro/go-micro/server"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ client.Option
var _ server.Option

// Client API for Trader service

type TraderService interface {
	ListTrader(ctx context.Context, in *TraderInfo, opts ...client.CallOption) (*TraderInfos, error)
	PutTrader(ctx context.Context, in *TraderInfo, opts ...client.CallOption) (*TraderInfo, error)
	GetTraderDetail(ctx context.Context, in *TraderInfo, opts ...client.CallOption) (*TraderInfo, error)
	DeleteTrader(ctx context.Context, in *TraderInfo, opts ...client.CallOption) (*TraderInfo, error)
	SwitchTrader(ctx context.Context, in *TraderInfo, opts ...client.CallOption) (*TraderInfo, error)
	UpdateTraderStatus(ctx context.Context, in *TraderInfo, opts ...client.CallOption) (*TraderInfo, error)
}

type traderService struct {
	c    client.Client
	name string
}

func NewTraderService(name string, c client.Client) TraderService {
	if c == nil {
		c = client.NewClient()
	}
	if len(name) == 0 {
		name = "bitesla.srv.trader"
	}
	return &traderService{
		c:    c,
		name: name,
	}
}

func (c *traderService) ListTrader(ctx context.Context, in *TraderInfo, opts ...client.CallOption) (*TraderInfos, error) {
	req := c.c.NewRequest(c.name, "Trader.ListTrader", in)
	out := new(TraderInfos)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *traderService) PutTrader(ctx context.Context, in *TraderInfo, opts ...client.CallOption) (*TraderInfo, error) {
	req := c.c.NewRequest(c.name, "Trader.PutTrader", in)
	out := new(TraderInfo)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *traderService) GetTraderDetail(ctx context.Context, in *TraderInfo, opts ...client.CallOption) (*TraderInfo, error) {
	req := c.c.NewRequest(c.name, "Trader.GetTraderDetail", in)
	out := new(TraderInfo)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *traderService) DeleteTrader(ctx context.Context, in *TraderInfo, opts ...client.CallOption) (*TraderInfo, error) {
	req := c.c.NewRequest(c.name, "Trader.DeleteTrader", in)
	out := new(TraderInfo)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *traderService) SwitchTrader(ctx context.Context, in *TraderInfo, opts ...client.CallOption) (*TraderInfo, error) {
	req := c.c.NewRequest(c.name, "Trader.SwitchTrader", in)
	out := new(TraderInfo)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *traderService) UpdateTraderStatus(ctx context.Context, in *TraderInfo, opts ...client.CallOption) (*TraderInfo, error) {
	req := c.c.NewRequest(c.name, "Trader.UpdateTraderStatus", in)
	out := new(TraderInfo)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for Trader service

type TraderHandler interface {
	ListTrader(context.Context, *TraderInfo, *TraderInfos) error
	PutTrader(context.Context, *TraderInfo, *TraderInfo) error
	GetTraderDetail(context.Context, *TraderInfo, *TraderInfo) error
	DeleteTrader(context.Context, *TraderInfo, *TraderInfo) error
	SwitchTrader(context.Context, *TraderInfo, *TraderInfo) error
	UpdateTraderStatus(context.Context, *TraderInfo, *TraderInfo) error
}

func RegisterTraderHandler(s server.Server, hdlr TraderHandler, opts ...server.HandlerOption) error {
	type trader interface {
		ListTrader(ctx context.Context, in *TraderInfo, out *TraderInfos) error
		PutTrader(ctx context.Context, in *TraderInfo, out *TraderInfo) error
		GetTraderDetail(ctx context.Context, in *TraderInfo, out *TraderInfo) error
		DeleteTrader(ctx context.Context, in *TraderInfo, out *TraderInfo) error
		SwitchTrader(ctx context.Context, in *TraderInfo, out *TraderInfo) error
		UpdateTraderStatus(ctx context.Context, in *TraderInfo, out *TraderInfo) error
	}
	type Trader struct {
		trader
	}
	h := &traderHandler{hdlr}
	return s.Handle(s.NewHandler(&Trader{h}, opts...))
}

type traderHandler struct {
	TraderHandler
}

func (h *traderHandler) ListTrader(ctx context.Context, in *TraderInfo, out *TraderInfos) error {
	return h.TraderHandler.ListTrader(ctx, in, out)
}

func (h *traderHandler) PutTrader(ctx context.Context, in *TraderInfo, out *TraderInfo) error {
	return h.TraderHandler.PutTrader(ctx, in, out)
}

func (h *traderHandler) GetTraderDetail(ctx context.Context, in *TraderInfo, out *TraderInfo) error {
	return h.TraderHandler.GetTraderDetail(ctx, in, out)
}

func (h *traderHandler) DeleteTrader(ctx context.Context, in *TraderInfo, out *TraderInfo) error {
	return h.TraderHandler.DeleteTrader(ctx, in, out)
}

func (h *traderHandler) SwitchTrader(ctx context.Context, in *TraderInfo, out *TraderInfo) error {
	return h.TraderHandler.SwitchTrader(ctx, in, out)
}

func (h *traderHandler) UpdateTraderStatus(ctx context.Context, in *TraderInfo, out *TraderInfo) error {
	return h.TraderHandler.UpdateTraderStatus(ctx, in, out)
}
