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

package proto

import (
	fmt "fmt"
	proto "github.com/golang/protobuf/proto"
	_ "github.com/golang/protobuf/ptypes/timestamp"
	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 PromotionSrv service

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

// Client API for PromotionSrv service

type PromotionSrvService interface {
	GetPromotionById(ctx context.Context, in *SearchId, opts ...client.CallOption) (*Promotion, error)
	GetPromotions(ctx context.Context, in *SearchParams, opts ...client.CallOption) (*Promotions, error)
	CreatePromotion(ctx context.Context, in *Promotion, opts ...client.CallOption) (*Response, error)
	UpdatePromotion(ctx context.Context, in *Promotion, opts ...client.CallOption) (*Response, error)
	DeletePromotion(ctx context.Context, in *SearchId, opts ...client.CallOption) (*Response, error)
	BeforeCreatePromotion(ctx context.Context, in *Promotion, opts ...client.CallOption) (*ValidationErr, error)
	BeforeUpdatePromotion(ctx context.Context, in *Promotion, opts ...client.CallOption) (*ValidationErr, error)
	BeforeDeletePromotion(ctx context.Context, in *Promotion, opts ...client.CallOption) (*ValidationErr, error)
	AfterCreatePromotion(ctx context.Context, in *Promotion, opts ...client.CallOption) (*AfterFuncErr, error)
	AfterUpdatePromotion(ctx context.Context, in *Promotion, opts ...client.CallOption) (*AfterFuncErr, error)
	AfterDeletePromotion(ctx context.Context, in *Promotion, opts ...client.CallOption) (*AfterFuncErr, error)
}

type promotionSrvService struct {
	c    client.Client
	name string
}

func NewPromotionSrvService(name string, c client.Client) PromotionSrvService {
	return &promotionSrvService{
		c:    c,
		name: name,
	}
}

func (c *promotionSrvService) GetPromotionById(ctx context.Context, in *SearchId, opts ...client.CallOption) (*Promotion, error) {
	req := c.c.NewRequest(c.name, "PromotionSrv.GetPromotionById", in)
	out := new(Promotion)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *promotionSrvService) GetPromotions(ctx context.Context, in *SearchParams, opts ...client.CallOption) (*Promotions, error) {
	req := c.c.NewRequest(c.name, "PromotionSrv.GetPromotions", in)
	out := new(Promotions)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *promotionSrvService) CreatePromotion(ctx context.Context, in *Promotion, opts ...client.CallOption) (*Response, error) {
	req := c.c.NewRequest(c.name, "PromotionSrv.CreatePromotion", in)
	out := new(Response)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *promotionSrvService) UpdatePromotion(ctx context.Context, in *Promotion, opts ...client.CallOption) (*Response, error) {
	req := c.c.NewRequest(c.name, "PromotionSrv.UpdatePromotion", in)
	out := new(Response)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *promotionSrvService) DeletePromotion(ctx context.Context, in *SearchId, opts ...client.CallOption) (*Response, error) {
	req := c.c.NewRequest(c.name, "PromotionSrv.DeletePromotion", in)
	out := new(Response)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *promotionSrvService) BeforeCreatePromotion(ctx context.Context, in *Promotion, opts ...client.CallOption) (*ValidationErr, error) {
	req := c.c.NewRequest(c.name, "PromotionSrv.BeforeCreatePromotion", in)
	out := new(ValidationErr)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *promotionSrvService) BeforeUpdatePromotion(ctx context.Context, in *Promotion, opts ...client.CallOption) (*ValidationErr, error) {
	req := c.c.NewRequest(c.name, "PromotionSrv.BeforeUpdatePromotion", in)
	out := new(ValidationErr)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *promotionSrvService) BeforeDeletePromotion(ctx context.Context, in *Promotion, opts ...client.CallOption) (*ValidationErr, error) {
	req := c.c.NewRequest(c.name, "PromotionSrv.BeforeDeletePromotion", in)
	out := new(ValidationErr)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *promotionSrvService) AfterCreatePromotion(ctx context.Context, in *Promotion, opts ...client.CallOption) (*AfterFuncErr, error) {
	req := c.c.NewRequest(c.name, "PromotionSrv.AfterCreatePromotion", in)
	out := new(AfterFuncErr)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *promotionSrvService) AfterUpdatePromotion(ctx context.Context, in *Promotion, opts ...client.CallOption) (*AfterFuncErr, error) {
	req := c.c.NewRequest(c.name, "PromotionSrv.AfterUpdatePromotion", in)
	out := new(AfterFuncErr)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *promotionSrvService) AfterDeletePromotion(ctx context.Context, in *Promotion, opts ...client.CallOption) (*AfterFuncErr, error) {
	req := c.c.NewRequest(c.name, "PromotionSrv.AfterDeletePromotion", in)
	out := new(AfterFuncErr)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for PromotionSrv service

type PromotionSrvHandler interface {
	GetPromotionById(context.Context, *SearchId, *Promotion) error
	GetPromotions(context.Context, *SearchParams, *Promotions) error
	CreatePromotion(context.Context, *Promotion, *Response) error
	UpdatePromotion(context.Context, *Promotion, *Response) error
	DeletePromotion(context.Context, *SearchId, *Response) error
	BeforeCreatePromotion(context.Context, *Promotion, *ValidationErr) error
	BeforeUpdatePromotion(context.Context, *Promotion, *ValidationErr) error
	BeforeDeletePromotion(context.Context, *Promotion, *ValidationErr) error
	AfterCreatePromotion(context.Context, *Promotion, *AfterFuncErr) error
	AfterUpdatePromotion(context.Context, *Promotion, *AfterFuncErr) error
	AfterDeletePromotion(context.Context, *Promotion, *AfterFuncErr) error
}

func RegisterPromotionSrvHandler(s server.Server, hdlr PromotionSrvHandler, opts ...server.HandlerOption) error {
	type promotionSrv interface {
		GetPromotionById(ctx context.Context, in *SearchId, out *Promotion) error
		GetPromotions(ctx context.Context, in *SearchParams, out *Promotions) error
		CreatePromotion(ctx context.Context, in *Promotion, out *Response) error
		UpdatePromotion(ctx context.Context, in *Promotion, out *Response) error
		DeletePromotion(ctx context.Context, in *SearchId, out *Response) error
		BeforeCreatePromotion(ctx context.Context, in *Promotion, out *ValidationErr) error
		BeforeUpdatePromotion(ctx context.Context, in *Promotion, out *ValidationErr) error
		BeforeDeletePromotion(ctx context.Context, in *Promotion, out *ValidationErr) error
		AfterCreatePromotion(ctx context.Context, in *Promotion, out *AfterFuncErr) error
		AfterUpdatePromotion(ctx context.Context, in *Promotion, out *AfterFuncErr) error
		AfterDeletePromotion(ctx context.Context, in *Promotion, out *AfterFuncErr) error
	}
	type PromotionSrv struct {
		promotionSrv
	}
	h := &promotionSrvHandler{hdlr}
	return s.Handle(s.NewHandler(&PromotionSrv{h}, opts...))
}

type promotionSrvHandler struct {
	PromotionSrvHandler
}

func (h *promotionSrvHandler) GetPromotionById(ctx context.Context, in *SearchId, out *Promotion) error {
	return h.PromotionSrvHandler.GetPromotionById(ctx, in, out)
}

func (h *promotionSrvHandler) GetPromotions(ctx context.Context, in *SearchParams, out *Promotions) error {
	return h.PromotionSrvHandler.GetPromotions(ctx, in, out)
}

func (h *promotionSrvHandler) CreatePromotion(ctx context.Context, in *Promotion, out *Response) error {
	return h.PromotionSrvHandler.CreatePromotion(ctx, in, out)
}

func (h *promotionSrvHandler) UpdatePromotion(ctx context.Context, in *Promotion, out *Response) error {
	return h.PromotionSrvHandler.UpdatePromotion(ctx, in, out)
}

func (h *promotionSrvHandler) DeletePromotion(ctx context.Context, in *SearchId, out *Response) error {
	return h.PromotionSrvHandler.DeletePromotion(ctx, in, out)
}

func (h *promotionSrvHandler) BeforeCreatePromotion(ctx context.Context, in *Promotion, out *ValidationErr) error {
	return h.PromotionSrvHandler.BeforeCreatePromotion(ctx, in, out)
}

func (h *promotionSrvHandler) BeforeUpdatePromotion(ctx context.Context, in *Promotion, out *ValidationErr) error {
	return h.PromotionSrvHandler.BeforeUpdatePromotion(ctx, in, out)
}

func (h *promotionSrvHandler) BeforeDeletePromotion(ctx context.Context, in *Promotion, out *ValidationErr) error {
	return h.PromotionSrvHandler.BeforeDeletePromotion(ctx, in, out)
}

func (h *promotionSrvHandler) AfterCreatePromotion(ctx context.Context, in *Promotion, out *AfterFuncErr) error {
	return h.PromotionSrvHandler.AfterCreatePromotion(ctx, in, out)
}

func (h *promotionSrvHandler) AfterUpdatePromotion(ctx context.Context, in *Promotion, out *AfterFuncErr) error {
	return h.PromotionSrvHandler.AfterUpdatePromotion(ctx, in, out)
}

func (h *promotionSrvHandler) AfterDeletePromotion(ctx context.Context, in *Promotion, out *AfterFuncErr) error {
	return h.PromotionSrvHandler.AfterDeletePromotion(ctx, in, out)
}
