// Code generated by protoc-gen-go-micro. DO NOT EDIT.
// protoc-gen-go-micro version: v3.10.4
// source: pkgdash.proto

package pkgdashpb

import (
	context "context"
	v31 "go.unistack.org/micro-client-http/v3"
	v3 "go.unistack.org/micro-server-http/v3"
	client "go.unistack.org/micro/v3/client"
	server "go.unistack.org/micro/v3/server"
	http "net/http"
)

var (
	PkgdashServerEndpoints = []v3.EndpointMetadata{
		{
			Name:   "Pkgdash.PackageLookup",
			Path:   "/v1/packages/{id}",
			Method: "GET",
			Body:   "",
			Stream: false,
		},
		{
			Name:   "Pkgdash.PackageCreate",
			Path:   "/v1/packages",
			Method: "POST",
			Body:   "*",
			Stream: false,
		},
		{
			Name:   "Pkgdash.PackageDelete",
			Path:   "/v1/packages/{id}",
			Method: "DELETE",
			Body:   "",
			Stream: false,
		},
		{
			Name:   "Pkgdash.PackageList",
			Path:   "/v1/packages",
			Method: "GET",
			Body:   "",
			Stream: false,
		},
		{
			Name:   "Pkgdash.HandlerList",
			Path:   "/v1/packages/{package}/handlers",
			Method: "GET",
			Body:   "",
			Stream: false,
		},
		{
			Name:   "Pkgdash.PackageModules",
			Path:   "/v1/packages/{package}/modules",
			Method: "GET",
			Body:   "",
			Stream: false,
		},
		{
			Name:   "Pkgdash.PackageUpdate",
			Path:   "/v1/packages/{id}",
			Method: "PUT",
			Body:   "*",
			Stream: false,
		},
		{
			Name:   "Pkgdash.CommentCreate",
			Path:   "/v1/packages/{package}/comments",
			Method: "POST",
			Body:   "*",
			Stream: false,
		},
		{
			Name:   "Pkgdash.CommentLookup",
			Path:   "/v1/comments/{id}",
			Method: "GET",
			Body:   "",
			Stream: false,
		},
		{
			Name:   "Pkgdash.CommentLookup",
			Path:   "/v1/comments/{package}/comments/{id}",
			Method: "GET",
			Body:   "",
			Stream: false,
		},
		{
			Name:   "Pkgdash.CommentList",
			Path:   "/v1/packages/{package}/comments",
			Method: "GET",
			Body:   "",
			Stream: false,
		},
		{
			Name:   "Pkgdash.CommentDelete",
			Path:   "/v1/packages/{package_id}/comments/{id}",
			Method: "DELETE",
			Body:   "",
			Stream: false,
		},
		{
			Name:   "Pkgdash.CommentDelete",
			Path:   "/v1/comments/{id}",
			Method: "DELETE",
			Body:   "",
			Stream: false,
		},
		{
			Name:   "Pkgdash.ModuleList",
			Path:   "/v1/modules",
			Method: "GET",
			Body:   "",
			Stream: false,
		},
	}
)

type pkgdashClient struct {
	c    client.Client
	name string
}

func NewPkgdashClient(name string, c client.Client) PkgdashClient {
	return &pkgdashClient{c: c, name: name}
}

func (c *pkgdashClient) PackageLookup(ctx context.Context, req *PackageLookupReq, opts ...client.CallOption) (*PackageLookupRsp, error) {
	errmap := make(map[string]interface{}, 1)
	errmap["default"] = &ErrorRsp{}
	opts = append(opts,
		v31.ErrorMap(errmap),
	)
	opts = append(opts,
		v31.Method(http.MethodGet),
		v31.Path("/v1/packages/{id}"),
	)
	rsp := &PackageLookupRsp{}
	err := c.c.Call(ctx, c.c.NewRequest(c.name, "Pkgdash.PackageLookup", req), rsp, opts...)
	if err != nil {
		return nil, err
	}
	return rsp, nil
}

func (c *pkgdashClient) PackageCreate(ctx context.Context, req *PackageCreateReq, opts ...client.CallOption) (*PackageCreateRsp, error) {
	errmap := make(map[string]interface{}, 1)
	errmap["default"] = &ErrorRsp{}
	opts = append(opts,
		v31.ErrorMap(errmap),
	)
	opts = append(opts,
		v31.Method(http.MethodPost),
		v31.Path("/v1/packages"),
		v31.Body("*"),
	)
	rsp := &PackageCreateRsp{}
	err := c.c.Call(ctx, c.c.NewRequest(c.name, "Pkgdash.PackageCreate", req), rsp, opts...)
	if err != nil {
		return nil, err
	}
	return rsp, nil
}

func (c *pkgdashClient) PackageDelete(ctx context.Context, req *PackageDeleteReq, opts ...client.CallOption) (*PackageDeleteRsp, error) {
	errmap := make(map[string]interface{}, 1)
	errmap["default"] = &ErrorRsp{}
	opts = append(opts,
		v31.ErrorMap(errmap),
	)
	opts = append(opts,
		v31.Method(http.MethodDelete),
		v31.Path("/v1/packages/{id}"),
	)
	rsp := &PackageDeleteRsp{}
	err := c.c.Call(ctx, c.c.NewRequest(c.name, "Pkgdash.PackageDelete", req), rsp, opts...)
	if err != nil {
		return nil, err
	}
	return rsp, nil
}

func (c *pkgdashClient) PackageList(ctx context.Context, req *PackageListReq, opts ...client.CallOption) (*PackageListRsp, error) {
	errmap := make(map[string]interface{}, 1)
	errmap["default"] = &ErrorRsp{}
	opts = append(opts,
		v31.ErrorMap(errmap),
	)
	opts = append(opts,
		v31.Method(http.MethodGet),
		v31.Path("/v1/packages"),
	)
	rsp := &PackageListRsp{}
	err := c.c.Call(ctx, c.c.NewRequest(c.name, "Pkgdash.PackageList", req), rsp, opts...)
	if err != nil {
		return nil, err
	}
	return rsp, nil
}

func (c *pkgdashClient) HandlerList(ctx context.Context, req *HandlerListReq, opts ...client.CallOption) (*HandlerListRsp, error) {
	errmap := make(map[string]interface{}, 1)
	errmap["default"] = &ErrorRsp{}
	opts = append(opts,
		v31.ErrorMap(errmap),
	)
	opts = append(opts,
		v31.Method(http.MethodGet),
		v31.Path("/v1/packages/{package}/handlers"),
	)
	rsp := &HandlerListRsp{}
	err := c.c.Call(ctx, c.c.NewRequest(c.name, "Pkgdash.HandlerList", req), rsp, opts...)
	if err != nil {
		return nil, err
	}
	return rsp, nil
}

func (c *pkgdashClient) PackageModules(ctx context.Context, req *PackageModulesReq, opts ...client.CallOption) (*PackageModulesRsp, error) {
	errmap := make(map[string]interface{}, 1)
	errmap["default"] = &ErrorRsp{}
	opts = append(opts,
		v31.ErrorMap(errmap),
	)
	opts = append(opts,
		v31.Method(http.MethodGet),
		v31.Path("/v1/packages/{package}/modules"),
	)
	rsp := &PackageModulesRsp{}
	err := c.c.Call(ctx, c.c.NewRequest(c.name, "Pkgdash.PackageModules", req), rsp, opts...)
	if err != nil {
		return nil, err
	}
	return rsp, nil
}

func (c *pkgdashClient) PackageUpdate(ctx context.Context, req *PackageUpdateReq, opts ...client.CallOption) (*PackageUpdateRsp, error) {
	errmap := make(map[string]interface{}, 1)
	errmap["default"] = &ErrorRsp{}
	opts = append(opts,
		v31.ErrorMap(errmap),
	)
	opts = append(opts,
		v31.Method(http.MethodPut),
		v31.Path("/v1/packages/{id}"),
		v31.Body("*"),
	)
	rsp := &PackageUpdateRsp{}
	err := c.c.Call(ctx, c.c.NewRequest(c.name, "Pkgdash.PackageUpdate", req), rsp, opts...)
	if err != nil {
		return nil, err
	}
	return rsp, nil
}

func (c *pkgdashClient) CommentCreate(ctx context.Context, req *CommentCreateReq, opts ...client.CallOption) (*CommentCreateRsp, error) {
	errmap := make(map[string]interface{}, 1)
	errmap["default"] = &ErrorRsp{}
	opts = append(opts,
		v31.ErrorMap(errmap),
	)
	opts = append(opts,
		v31.Method(http.MethodPost),
		v31.Path("/v1/packages/{package}/comments"),
		v31.Body("*"),
	)
	rsp := &CommentCreateRsp{}
	err := c.c.Call(ctx, c.c.NewRequest(c.name, "Pkgdash.CommentCreate", req), rsp, opts...)
	if err != nil {
		return nil, err
	}
	return rsp, nil
}

func (c *pkgdashClient) CommentLookup(ctx context.Context, req *CommentLookupReq, opts ...client.CallOption) (*CommentLookupRsp, error) {
	errmap := make(map[string]interface{}, 1)
	errmap["default"] = &ErrorRsp{}
	opts = append(opts,
		v31.ErrorMap(errmap),
	)
	opts = append(opts,
		v31.Method(http.MethodGet),
		v31.Path("/v1/comments/{id}"),
	)
	rsp := &CommentLookupRsp{}
	err := c.c.Call(ctx, c.c.NewRequest(c.name, "Pkgdash.CommentLookup", req), rsp, opts...)
	if err != nil {
		return nil, err
	}
	return rsp, nil
}

func (c *pkgdashClient) CommentList(ctx context.Context, req *CommentListReq, opts ...client.CallOption) (*CommentListRsp, error) {
	errmap := make(map[string]interface{}, 1)
	errmap["default"] = &ErrorRsp{}
	opts = append(opts,
		v31.ErrorMap(errmap),
	)
	opts = append(opts,
		v31.Method(http.MethodGet),
		v31.Path("/v1/packages/{package}/comments"),
	)
	rsp := &CommentListRsp{}
	err := c.c.Call(ctx, c.c.NewRequest(c.name, "Pkgdash.CommentList", req), rsp, opts...)
	if err != nil {
		return nil, err
	}
	return rsp, nil
}

func (c *pkgdashClient) CommentDelete(ctx context.Context, req *CommentDeleteReq, opts ...client.CallOption) (*CommentDeleteRsp, error) {
	errmap := make(map[string]interface{}, 1)
	errmap["default"] = &ErrorRsp{}
	opts = append(opts,
		v31.ErrorMap(errmap),
	)
	opts = append(opts,
		v31.Method(http.MethodDelete),
		v31.Path("/v1/packages/{package_id}/comments/{id}"),
	)
	rsp := &CommentDeleteRsp{}
	err := c.c.Call(ctx, c.c.NewRequest(c.name, "Pkgdash.CommentDelete", req), rsp, opts...)
	if err != nil {
		return nil, err
	}
	return rsp, nil
}

func (c *pkgdashClient) ModuleList(ctx context.Context, req *ModuleListReq, opts ...client.CallOption) (*ModuleListRsp, error) {
	errmap := make(map[string]interface{}, 1)
	errmap["default"] = &ErrorRsp{}
	opts = append(opts,
		v31.ErrorMap(errmap),
	)
	opts = append(opts,
		v31.Method(http.MethodGet),
		v31.Path("/v1/modules"),
	)
	rsp := &ModuleListRsp{}
	err := c.c.Call(ctx, c.c.NewRequest(c.name, "Pkgdash.ModuleList", req), rsp, opts...)
	if err != nil {
		return nil, err
	}
	return rsp, nil
}

type pkgdashServer struct {
	PkgdashServer
}

func (h *pkgdashServer) PackageLookup(ctx context.Context, req *PackageLookupReq, rsp *PackageLookupRsp) error {
	return h.PkgdashServer.PackageLookup(ctx, req, rsp)
}

func (h *pkgdashServer) PackageCreate(ctx context.Context, req *PackageCreateReq, rsp *PackageCreateRsp) error {
	return h.PkgdashServer.PackageCreate(ctx, req, rsp)
}

func (h *pkgdashServer) PackageDelete(ctx context.Context, req *PackageDeleteReq, rsp *PackageDeleteRsp) error {
	return h.PkgdashServer.PackageDelete(ctx, req, rsp)
}

func (h *pkgdashServer) PackageList(ctx context.Context, req *PackageListReq, rsp *PackageListRsp) error {
	return h.PkgdashServer.PackageList(ctx, req, rsp)
}

func (h *pkgdashServer) HandlerList(ctx context.Context, req *HandlerListReq, rsp *HandlerListRsp) error {
	return h.PkgdashServer.HandlerList(ctx, req, rsp)
}

func (h *pkgdashServer) PackageModules(ctx context.Context, req *PackageModulesReq, rsp *PackageModulesRsp) error {
	return h.PkgdashServer.PackageModules(ctx, req, rsp)
}

func (h *pkgdashServer) PackageUpdate(ctx context.Context, req *PackageUpdateReq, rsp *PackageUpdateRsp) error {
	return h.PkgdashServer.PackageUpdate(ctx, req, rsp)
}

func (h *pkgdashServer) CommentCreate(ctx context.Context, req *CommentCreateReq, rsp *CommentCreateRsp) error {
	return h.PkgdashServer.CommentCreate(ctx, req, rsp)
}

func (h *pkgdashServer) CommentLookup(ctx context.Context, req *CommentLookupReq, rsp *CommentLookupRsp) error {
	return h.PkgdashServer.CommentLookup(ctx, req, rsp)
}

func (h *pkgdashServer) CommentList(ctx context.Context, req *CommentListReq, rsp *CommentListRsp) error {
	return h.PkgdashServer.CommentList(ctx, req, rsp)
}

func (h *pkgdashServer) CommentDelete(ctx context.Context, req *CommentDeleteReq, rsp *CommentDeleteRsp) error {
	return h.PkgdashServer.CommentDelete(ctx, req, rsp)
}

func (h *pkgdashServer) ModuleList(ctx context.Context, req *ModuleListReq, rsp *ModuleListRsp) error {
	return h.PkgdashServer.ModuleList(ctx, req, rsp)
}

func RegisterPkgdashServer(s server.Server, sh PkgdashServer, opts ...server.HandlerOption) error {
	type pkgdash interface {
		PackageLookup(ctx context.Context, req *PackageLookupReq, rsp *PackageLookupRsp) error
		PackageCreate(ctx context.Context, req *PackageCreateReq, rsp *PackageCreateRsp) error
		PackageDelete(ctx context.Context, req *PackageDeleteReq, rsp *PackageDeleteRsp) error
		PackageList(ctx context.Context, req *PackageListReq, rsp *PackageListRsp) error
		HandlerList(ctx context.Context, req *HandlerListReq, rsp *HandlerListRsp) error
		PackageModules(ctx context.Context, req *PackageModulesReq, rsp *PackageModulesRsp) error
		PackageUpdate(ctx context.Context, req *PackageUpdateReq, rsp *PackageUpdateRsp) error
		CommentCreate(ctx context.Context, req *CommentCreateReq, rsp *CommentCreateRsp) error
		CommentLookup(ctx context.Context, req *CommentLookupReq, rsp *CommentLookupRsp) error
		CommentList(ctx context.Context, req *CommentListReq, rsp *CommentListRsp) error
		CommentDelete(ctx context.Context, req *CommentDeleteReq, rsp *CommentDeleteRsp) error
		ModuleList(ctx context.Context, req *ModuleListReq, rsp *ModuleListRsp) error
	}
	type Pkgdash struct {
		pkgdash
	}
	h := &pkgdashServer{sh}
	var nopts []server.HandlerOption
	nopts = append(nopts, v3.HandlerEndpoints(PkgdashServerEndpoints))
	return s.Handle(s.NewHandler(&Pkgdash{h}, append(nopts, opts...)...))
}
