// Code generated by protoc-gen-go-grpc. DO NOT EDIT.

package grpc_wrappers_testing

import (
	context "context"
	_struct "github.com/golang/protobuf/ptypes/struct"
	wrappers "github.com/golang/protobuf/ptypes/wrappers"
	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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// ServiceClient is the client API for Service 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 ServiceClient interface {
	TestString(ctx context.Context, in *wrappers.StringValue, opts ...grpc.CallOption) (*wrappers.StringValue, error)
	TestInteger(ctx context.Context, in *wrappers.Int64Value, opts ...grpc.CallOption) (*wrappers.Int64Value, error)
	TestBoolean(ctx context.Context, in *wrappers.BoolValue, opts ...grpc.CallOption) (*wrappers.BoolValue, error)
	TestDouble(ctx context.Context, in *wrappers.DoubleValue, opts ...grpc.CallOption) (*wrappers.DoubleValue, error)
	TestValue(ctx context.Context, in *_struct.Value, opts ...grpc.CallOption) (*_struct.Value, error)
	TestStream(ctx context.Context, opts ...grpc.CallOption) (Service_TestStreamClient, error)
}

type serviceClient struct {
	cc grpc.ClientConnInterface
}

func NewServiceClient(cc grpc.ClientConnInterface) ServiceClient {
	return &serviceClient{cc}
}

func (c *serviceClient) TestString(ctx context.Context, in *wrappers.StringValue, opts ...grpc.CallOption) (*wrappers.StringValue, error) {
	out := new(wrappers.StringValue)
	err := c.cc.Invoke(ctx, "/grpc.wrappers.testing.Service/TestString", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *serviceClient) TestInteger(ctx context.Context, in *wrappers.Int64Value, opts ...grpc.CallOption) (*wrappers.Int64Value, error) {
	out := new(wrappers.Int64Value)
	err := c.cc.Invoke(ctx, "/grpc.wrappers.testing.Service/TestInteger", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *serviceClient) TestBoolean(ctx context.Context, in *wrappers.BoolValue, opts ...grpc.CallOption) (*wrappers.BoolValue, error) {
	out := new(wrappers.BoolValue)
	err := c.cc.Invoke(ctx, "/grpc.wrappers.testing.Service/TestBoolean", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *serviceClient) TestDouble(ctx context.Context, in *wrappers.DoubleValue, opts ...grpc.CallOption) (*wrappers.DoubleValue, error) {
	out := new(wrappers.DoubleValue)
	err := c.cc.Invoke(ctx, "/grpc.wrappers.testing.Service/TestDouble", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *serviceClient) TestValue(ctx context.Context, in *_struct.Value, opts ...grpc.CallOption) (*_struct.Value, error) {
	out := new(_struct.Value)
	err := c.cc.Invoke(ctx, "/grpc.wrappers.testing.Service/TestValue", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *serviceClient) TestStream(ctx context.Context, opts ...grpc.CallOption) (Service_TestStreamClient, error) {
	stream, err := c.cc.NewStream(ctx, &Service_ServiceDesc.Streams[0], "/grpc.wrappers.testing.Service/TestStream", opts...)
	if err != nil {
		return nil, err
	}
	x := &serviceTestStreamClient{stream}
	return x, nil
}

type Service_TestStreamClient interface {
	Send(*wrappers.StringValue) error
	CloseAndRecv() (*wrappers.StringValue, error)
	grpc.ClientStream
}

type serviceTestStreamClient struct {
	grpc.ClientStream
}

func (x *serviceTestStreamClient) Send(m *wrappers.StringValue) error {
	return x.ClientStream.SendMsg(m)
}

func (x *serviceTestStreamClient) CloseAndRecv() (*wrappers.StringValue, error) {
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	m := new(wrappers.StringValue)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// ServiceServer is the server API for Service service.
// All implementations must embed UnimplementedServiceServer
// for forward compatibility
type ServiceServer interface {
	TestString(context.Context, *wrappers.StringValue) (*wrappers.StringValue, error)
	TestInteger(context.Context, *wrappers.Int64Value) (*wrappers.Int64Value, error)
	TestBoolean(context.Context, *wrappers.BoolValue) (*wrappers.BoolValue, error)
	TestDouble(context.Context, *wrappers.DoubleValue) (*wrappers.DoubleValue, error)
	TestValue(context.Context, *_struct.Value) (*_struct.Value, error)
	TestStream(Service_TestStreamServer) error
	mustEmbedUnimplementedServiceServer()
}

// UnimplementedServiceServer must be embedded to have forward compatible implementations.
type UnimplementedServiceServer struct {
}

func (UnimplementedServiceServer) TestString(context.Context, *wrappers.StringValue) (*wrappers.StringValue, error) {
	return nil, status.Errorf(codes.Unimplemented, "method TestString not implemented")
}
func (UnimplementedServiceServer) TestInteger(context.Context, *wrappers.Int64Value) (*wrappers.Int64Value, error) {
	return nil, status.Errorf(codes.Unimplemented, "method TestInteger not implemented")
}
func (UnimplementedServiceServer) TestBoolean(context.Context, *wrappers.BoolValue) (*wrappers.BoolValue, error) {
	return nil, status.Errorf(codes.Unimplemented, "method TestBoolean not implemented")
}
func (UnimplementedServiceServer) TestDouble(context.Context, *wrappers.DoubleValue) (*wrappers.DoubleValue, error) {
	return nil, status.Errorf(codes.Unimplemented, "method TestDouble not implemented")
}
func (UnimplementedServiceServer) TestValue(context.Context, *_struct.Value) (*_struct.Value, error) {
	return nil, status.Errorf(codes.Unimplemented, "method TestValue not implemented")
}
func (UnimplementedServiceServer) TestStream(Service_TestStreamServer) error {
	return status.Errorf(codes.Unimplemented, "method TestStream not implemented")
}
func (UnimplementedServiceServer) mustEmbedUnimplementedServiceServer() {}

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

func RegisterServiceServer(s grpc.ServiceRegistrar, srv ServiceServer) {
	s.RegisterService(&Service_ServiceDesc, srv)
}

func _Service_TestString_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(wrappers.StringValue)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ServiceServer).TestString(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/grpc.wrappers.testing.Service/TestString",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ServiceServer).TestString(ctx, req.(*wrappers.StringValue))
	}
	return interceptor(ctx, in, info, handler)
}

func _Service_TestInteger_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(wrappers.Int64Value)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ServiceServer).TestInteger(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/grpc.wrappers.testing.Service/TestInteger",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ServiceServer).TestInteger(ctx, req.(*wrappers.Int64Value))
	}
	return interceptor(ctx, in, info, handler)
}

func _Service_TestBoolean_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(wrappers.BoolValue)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ServiceServer).TestBoolean(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/grpc.wrappers.testing.Service/TestBoolean",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ServiceServer).TestBoolean(ctx, req.(*wrappers.BoolValue))
	}
	return interceptor(ctx, in, info, handler)
}

func _Service_TestDouble_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(wrappers.DoubleValue)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ServiceServer).TestDouble(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/grpc.wrappers.testing.Service/TestDouble",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ServiceServer).TestDouble(ctx, req.(*wrappers.DoubleValue))
	}
	return interceptor(ctx, in, info, handler)
}

func _Service_TestValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(_struct.Value)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ServiceServer).TestValue(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/grpc.wrappers.testing.Service/TestValue",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ServiceServer).TestValue(ctx, req.(*_struct.Value))
	}
	return interceptor(ctx, in, info, handler)
}

func _Service_TestStream_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(ServiceServer).TestStream(&serviceTestStreamServer{stream})
}

type Service_TestStreamServer interface {
	SendAndClose(*wrappers.StringValue) error
	Recv() (*wrappers.StringValue, error)
	grpc.ServerStream
}

type serviceTestStreamServer struct {
	grpc.ServerStream
}

func (x *serviceTestStreamServer) SendAndClose(m *wrappers.StringValue) error {
	return x.ServerStream.SendMsg(m)
}

func (x *serviceTestStreamServer) Recv() (*wrappers.StringValue, error) {
	m := new(wrappers.StringValue)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// Service_ServiceDesc is the grpc.ServiceDesc for Service service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Service_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.wrappers.testing.Service",
	HandlerType: (*ServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "TestString",
			Handler:    _Service_TestString_Handler,
		},
		{
			MethodName: "TestInteger",
			Handler:    _Service_TestInteger_Handler,
		},
		{
			MethodName: "TestBoolean",
			Handler:    _Service_TestBoolean_Handler,
		},
		{
			MethodName: "TestDouble",
			Handler:    _Service_TestDouble_Handler,
		},
		{
			MethodName: "TestValue",
			Handler:    _Service_TestValue_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "TestStream",
			Handler:       _Service_TestStream_Handler,
			ClientStreams: true,
		},
	},
	Metadata: "test.proto",
}
