// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             (unknown)
// source: examples/internal/proto/examplepb/response_body_service.proto

package examplepb

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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7

// ResponseBodyServiceClient is the client API for ResponseBodyService 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 ResponseBodyServiceClient interface {
	GetResponseBody(ctx context.Context, in *ResponseBodyIn, opts ...grpc.CallOption) (*ResponseBodyOut, error)
	ListResponseBodies(ctx context.Context, in *ResponseBodyIn, opts ...grpc.CallOption) (*RepeatedResponseBodyOut, error)
	ListResponseStrings(ctx context.Context, in *ResponseBodyIn, opts ...grpc.CallOption) (*RepeatedResponseStrings, error)
	GetResponseBodyStream(ctx context.Context, in *ResponseBodyIn, opts ...grpc.CallOption) (ResponseBodyService_GetResponseBodyStreamClient, error)
}

type responseBodyServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewResponseBodyServiceClient(cc grpc.ClientConnInterface) ResponseBodyServiceClient {
	return &responseBodyServiceClient{cc}
}

func (c *responseBodyServiceClient) GetResponseBody(ctx context.Context, in *ResponseBodyIn, opts ...grpc.CallOption) (*ResponseBodyOut, error) {
	out := new(ResponseBodyOut)
	err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.proto.examplepb.ResponseBodyService/GetResponseBody", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *responseBodyServiceClient) ListResponseBodies(ctx context.Context, in *ResponseBodyIn, opts ...grpc.CallOption) (*RepeatedResponseBodyOut, error) {
	out := new(RepeatedResponseBodyOut)
	err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.proto.examplepb.ResponseBodyService/ListResponseBodies", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *responseBodyServiceClient) ListResponseStrings(ctx context.Context, in *ResponseBodyIn, opts ...grpc.CallOption) (*RepeatedResponseStrings, error) {
	out := new(RepeatedResponseStrings)
	err := c.cc.Invoke(ctx, "/grpc.gateway.examples.internal.proto.examplepb.ResponseBodyService/ListResponseStrings", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *responseBodyServiceClient) GetResponseBodyStream(ctx context.Context, in *ResponseBodyIn, opts ...grpc.CallOption) (ResponseBodyService_GetResponseBodyStreamClient, error) {
	stream, err := c.cc.NewStream(ctx, &ResponseBodyService_ServiceDesc.Streams[0], "/grpc.gateway.examples.internal.proto.examplepb.ResponseBodyService/GetResponseBodyStream", opts...)
	if err != nil {
		return nil, err
	}
	x := &responseBodyServiceGetResponseBodyStreamClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type ResponseBodyService_GetResponseBodyStreamClient interface {
	Recv() (*ResponseBodyOut, error)
	grpc.ClientStream
}

type responseBodyServiceGetResponseBodyStreamClient struct {
	grpc.ClientStream
}

func (x *responseBodyServiceGetResponseBodyStreamClient) Recv() (*ResponseBodyOut, error) {
	m := new(ResponseBodyOut)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// ResponseBodyServiceServer is the server API for ResponseBodyService service.
// All implementations should embed UnimplementedResponseBodyServiceServer
// for forward compatibility
type ResponseBodyServiceServer interface {
	GetResponseBody(context.Context, *ResponseBodyIn) (*ResponseBodyOut, error)
	ListResponseBodies(context.Context, *ResponseBodyIn) (*RepeatedResponseBodyOut, error)
	ListResponseStrings(context.Context, *ResponseBodyIn) (*RepeatedResponseStrings, error)
	GetResponseBodyStream(*ResponseBodyIn, ResponseBodyService_GetResponseBodyStreamServer) error
}

// UnimplementedResponseBodyServiceServer should be embedded to have forward compatible implementations.
type UnimplementedResponseBodyServiceServer struct {
}

func (UnimplementedResponseBodyServiceServer) GetResponseBody(context.Context, *ResponseBodyIn) (*ResponseBodyOut, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetResponseBody not implemented")
}
func (UnimplementedResponseBodyServiceServer) ListResponseBodies(context.Context, *ResponseBodyIn) (*RepeatedResponseBodyOut, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListResponseBodies not implemented")
}
func (UnimplementedResponseBodyServiceServer) ListResponseStrings(context.Context, *ResponseBodyIn) (*RepeatedResponseStrings, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListResponseStrings not implemented")
}
func (UnimplementedResponseBodyServiceServer) GetResponseBodyStream(*ResponseBodyIn, ResponseBodyService_GetResponseBodyStreamServer) error {
	return status.Errorf(codes.Unimplemented, "method GetResponseBodyStream not implemented")
}

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

func RegisterResponseBodyServiceServer(s grpc.ServiceRegistrar, srv ResponseBodyServiceServer) {
	s.RegisterService(&ResponseBodyService_ServiceDesc, srv)
}

func _ResponseBodyService_GetResponseBody_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ResponseBodyIn)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ResponseBodyServiceServer).GetResponseBody(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/grpc.gateway.examples.internal.proto.examplepb.ResponseBodyService/GetResponseBody",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ResponseBodyServiceServer).GetResponseBody(ctx, req.(*ResponseBodyIn))
	}
	return interceptor(ctx, in, info, handler)
}

func _ResponseBodyService_ListResponseBodies_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ResponseBodyIn)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ResponseBodyServiceServer).ListResponseBodies(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/grpc.gateway.examples.internal.proto.examplepb.ResponseBodyService/ListResponseBodies",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ResponseBodyServiceServer).ListResponseBodies(ctx, req.(*ResponseBodyIn))
	}
	return interceptor(ctx, in, info, handler)
}

func _ResponseBodyService_ListResponseStrings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ResponseBodyIn)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ResponseBodyServiceServer).ListResponseStrings(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/grpc.gateway.examples.internal.proto.examplepb.ResponseBodyService/ListResponseStrings",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ResponseBodyServiceServer).ListResponseStrings(ctx, req.(*ResponseBodyIn))
	}
	return interceptor(ctx, in, info, handler)
}

func _ResponseBodyService_GetResponseBodyStream_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(ResponseBodyIn)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(ResponseBodyServiceServer).GetResponseBodyStream(m, &responseBodyServiceGetResponseBodyStreamServer{stream})
}

type ResponseBodyService_GetResponseBodyStreamServer interface {
	Send(*ResponseBodyOut) error
	grpc.ServerStream
}

type responseBodyServiceGetResponseBodyStreamServer struct {
	grpc.ServerStream
}

func (x *responseBodyServiceGetResponseBodyStreamServer) Send(m *ResponseBodyOut) error {
	return x.ServerStream.SendMsg(m)
}

// ResponseBodyService_ServiceDesc is the grpc.ServiceDesc for ResponseBodyService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ResponseBodyService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpc.gateway.examples.internal.proto.examplepb.ResponseBodyService",
	HandlerType: (*ResponseBodyServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetResponseBody",
			Handler:    _ResponseBodyService_GetResponseBody_Handler,
		},
		{
			MethodName: "ListResponseBodies",
			Handler:    _ResponseBodyService_ListResponseBodies_Handler,
		},
		{
			MethodName: "ListResponseStrings",
			Handler:    _ResponseBodyService_ListResponseStrings_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetResponseBodyStream",
			Handler:       _ResponseBodyService_GetResponseBodyStream_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "examples/internal/proto/examplepb/response_body_service.proto",
}
