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

package services

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

import (
	context "context"
	api "github.com/micro/go-micro/v2/api"
	client "github.com/micro/go-micro/v2/client"
	server "github.com/micro/go-micro/v2/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.ProtoPackageIsVersion3 // please upgrade the proto package

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

// Api Endpoints for PublishService service

func NewPublishServiceEndpoints() []*api.Endpoint {
	return []*api.Endpoint{}
}

// Client API for PublishService service

type PublishService interface {
	PublishList(ctx context.Context, in *DouyinPublishListRequest, opts ...client.CallOption) (*DouyinPublishListResponse, error)
	Publish(ctx context.Context, in *DouyinPublishActionRequest, opts ...client.CallOption) (*DouyinPublishActionResponse, error)
}

type publishService struct {
	c    client.Client
	name string
}

func NewPublishService(name string, c client.Client) PublishService {
	return &publishService{
		c:    c,
		name: name,
	}
}

func (c *publishService) PublishList(ctx context.Context, in *DouyinPublishListRequest, opts ...client.CallOption) (*DouyinPublishListResponse, error) {
	req := c.c.NewRequest(c.name, "PublishService.PublishList", in)
	out := new(DouyinPublishListResponse)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *publishService) Publish(ctx context.Context, in *DouyinPublishActionRequest, opts ...client.CallOption) (*DouyinPublishActionResponse, error) {
	req := c.c.NewRequest(c.name, "PublishService.Publish", in)
	out := new(DouyinPublishActionResponse)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for PublishService service

type PublishServiceHandler interface {
	PublishList(context.Context, *DouyinPublishListRequest, *DouyinPublishListResponse) error
	Publish(context.Context, *DouyinPublishActionRequest, *DouyinPublishActionResponse) error
}

func RegisterPublishServiceHandler(s server.Server, hdlr PublishServiceHandler, opts ...server.HandlerOption) error {
	type publishService interface {
		PublishList(ctx context.Context, in *DouyinPublishListRequest, out *DouyinPublishListResponse) error
		Publish(ctx context.Context, in *DouyinPublishActionRequest, out *DouyinPublishActionResponse) error
	}
	type PublishService struct {
		publishService
	}
	h := &publishServiceHandler{hdlr}
	return s.Handle(s.NewHandler(&PublishService{h}, opts...))
}

type publishServiceHandler struct {
	PublishServiceHandler
}

func (h *publishServiceHandler) PublishList(ctx context.Context, in *DouyinPublishListRequest, out *DouyinPublishListResponse) error {
	return h.PublishServiceHandler.PublishList(ctx, in, out)
}

func (h *publishServiceHandler) Publish(ctx context.Context, in *DouyinPublishActionRequest, out *DouyinPublishActionResponse) error {
	return h.PublishServiceHandler.Publish(ctx, in, out)
}
