// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: ocis/services/thumbnails/v0/thumbnails.proto

package v0

import (
	fmt "fmt"
	_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
	_ "github.com/owncloud/ocis/v2/protogen/gen/ocis/messages/thumbnails/v0"
	proto "google.golang.org/protobuf/proto"
	math "math"
)

import (
	context "context"
	api "go-micro.dev/v4/api"
	client "go-micro.dev/v4/client"
	server "go-micro.dev/v4/server"
)

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

// 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 ThumbnailService service

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

// Client API for ThumbnailService service

type ThumbnailService interface {
	// Generates the thumbnail and returns it.
	GetThumbnail(ctx context.Context, in *GetThumbnailRequest, opts ...client.CallOption) (*GetThumbnailResponse, error)
}

type thumbnailService struct {
	c    client.Client
	name string
}

func NewThumbnailService(name string, c client.Client) ThumbnailService {
	return &thumbnailService{
		c:    c,
		name: name,
	}
}

func (c *thumbnailService) GetThumbnail(ctx context.Context, in *GetThumbnailRequest, opts ...client.CallOption) (*GetThumbnailResponse, error) {
	req := c.c.NewRequest(c.name, "ThumbnailService.GetThumbnail", in)
	out := new(GetThumbnailResponse)
	err := c.c.Call(ctx, req, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// Server API for ThumbnailService service

type ThumbnailServiceHandler interface {
	// Generates the thumbnail and returns it.
	GetThumbnail(context.Context, *GetThumbnailRequest, *GetThumbnailResponse) error
}

func RegisterThumbnailServiceHandler(s server.Server, hdlr ThumbnailServiceHandler, opts ...server.HandlerOption) error {
	type thumbnailService interface {
		GetThumbnail(ctx context.Context, in *GetThumbnailRequest, out *GetThumbnailResponse) error
	}
	type ThumbnailService struct {
		thumbnailService
	}
	h := &thumbnailServiceHandler{hdlr}
	return s.Handle(s.NewHandler(&ThumbnailService{h}, opts...))
}

type thumbnailServiceHandler struct {
	ThumbnailServiceHandler
}

func (h *thumbnailServiceHandler) GetThumbnail(ctx context.Context, in *GetThumbnailRequest, out *GetThumbnailResponse) error {
	return h.ThumbnailServiceHandler.GetThumbnail(ctx, in, out)
}
