// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v6.30.1
// source: survey.proto

package survey

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
)

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	Survey_Create_FullMethodName = "/survey.Survey/Create"
	Survey_Get_FullMethodName    = "/survey.Survey/Get"
	Survey_Update_FullMethodName = "/survey.Survey/Update"
	Survey_Delete_FullMethodName = "/survey.Survey/Delete"
	Survey_Fetch_FullMethodName  = "/survey.Survey/Fetch"
)

// SurveyClient is the client API for Survey service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
//
// 问卷服务 - 问卷管理
type SurveyClient interface {
	Create(ctx context.Context, in *SurveyItem, opts ...grpc.CallOption) (*StatusReply, error)
	Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*SurveyItem, error)
	Update(ctx context.Context, in *SurveyItem, opts ...grpc.CallOption) (*StatusReply, error)
	Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
	Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListSurveyReply, error)
}

type surveyClient struct {
	cc grpc.ClientConnInterface
}

func NewSurveyClient(cc grpc.ClientConnInterface) SurveyClient {
	return &surveyClient{cc}
}

func (c *surveyClient) Create(ctx context.Context, in *SurveyItem, opts ...grpc.CallOption) (*StatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(StatusReply)
	err := c.cc.Invoke(ctx, Survey_Create_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *surveyClient) Get(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*SurveyItem, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SurveyItem)
	err := c.cc.Invoke(ctx, Survey_Get_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *surveyClient) Update(ctx context.Context, in *SurveyItem, opts ...grpc.CallOption) (*StatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(StatusReply)
	err := c.cc.Invoke(ctx, Survey_Update_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *surveyClient) Delete(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(StatusReply)
	err := c.cc.Invoke(ctx, Survey_Delete_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *surveyClient) Fetch(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListSurveyReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListSurveyReply)
	err := c.cc.Invoke(ctx, Survey_Fetch_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// SurveyServer is the server API for Survey service.
// All implementations must embed UnimplementedSurveyServer
// for forward compatibility.
//
// 问卷服务 - 问卷管理
type SurveyServer interface {
	Create(context.Context, *SurveyItem) (*StatusReply, error)
	Get(context.Context, *IdentRequest) (*SurveyItem, error)
	Update(context.Context, *SurveyItem) (*StatusReply, error)
	Delete(context.Context, *IdentRequest) (*StatusReply, error)
	Fetch(context.Context, *FetchRequest) (*ListSurveyReply, error)
	mustEmbedUnimplementedSurveyServer()
}

// UnimplementedSurveyServer must be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedSurveyServer struct{}

func (UnimplementedSurveyServer) Create(context.Context, *SurveyItem) (*StatusReply, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedSurveyServer) Get(context.Context, *IdentRequest) (*SurveyItem, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedSurveyServer) Update(context.Context, *SurveyItem) (*StatusReply, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
}
func (UnimplementedSurveyServer) Delete(context.Context, *IdentRequest) (*StatusReply, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedSurveyServer) Fetch(context.Context, *FetchRequest) (*ListSurveyReply, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Fetch not implemented")
}
func (UnimplementedSurveyServer) mustEmbedUnimplementedSurveyServer() {}
func (UnimplementedSurveyServer) testEmbeddedByValue()                {}

// UnsafeSurveyServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to SurveyServer will
// result in compilation errors.
type UnsafeSurveyServer interface {
	mustEmbedUnimplementedSurveyServer()
}

func RegisterSurveyServer(s grpc.ServiceRegistrar, srv SurveyServer) {
	// If the following call pancis, it indicates UnimplementedSurveyServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&Survey_ServiceDesc, srv)
}

func _Survey_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SurveyItem)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SurveyServer).Create(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Survey_Create_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SurveyServer).Create(ctx, req.(*SurveyItem))
	}
	return interceptor(ctx, in, info, handler)
}

func _Survey_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IdentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SurveyServer).Get(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Survey_Get_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SurveyServer).Get(ctx, req.(*IdentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Survey_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SurveyItem)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SurveyServer).Update(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Survey_Update_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SurveyServer).Update(ctx, req.(*SurveyItem))
	}
	return interceptor(ctx, in, info, handler)
}

func _Survey_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IdentRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SurveyServer).Delete(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Survey_Delete_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SurveyServer).Delete(ctx, req.(*IdentRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Survey_Fetch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(FetchRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SurveyServer).Fetch(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: Survey_Fetch_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SurveyServer).Fetch(ctx, req.(*FetchRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Survey_ServiceDesc is the grpc.ServiceDesc for Survey service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Survey_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "survey.Survey",
	HandlerType: (*SurveyServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _Survey_Create_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _Survey_Get_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _Survey_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _Survey_Delete_Handler,
		},
		{
			MethodName: "Fetch",
			Handler:    _Survey_Fetch_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "survey.proto",
}