// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - 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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	ResponseBodyService_GetResponseBody_FullMethodName       = "/grpc.gateway.examples.internal.proto.examplepb.ResponseBodyService/GetResponseBody"
	ResponseBodyService_ListResponseBodies_FullMethodName    = "/grpc.gateway.examples.internal.proto.examplepb.ResponseBodyService/ListResponseBodies"
	ResponseBodyService_ListResponseStrings_FullMethodName   = "/grpc.gateway.examples.internal.proto.examplepb.ResponseBodyService/ListResponseStrings"
	ResponseBodyService_GetResponseBodyStream_FullMethodName = "/grpc.gateway.examples.internal.proto.examplepb.ResponseBodyService/GetResponseBodyStream"
)

// 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) (grpc.ServerStreamingClient[ResponseBodyOut], 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) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ResponseBodyOut)
	err := c.cc.Invoke(ctx, ResponseBodyService_GetResponseBody_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *responseBodyServiceClient) ListResponseBodies(ctx context.Context, in *ResponseBodyIn, opts ...grpc.CallOption) (*RepeatedResponseBodyOut, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(RepeatedResponseBodyOut)
	err := c.cc.Invoke(ctx, ResponseBodyService_ListResponseBodies_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *responseBodyServiceClient) ListResponseStrings(ctx context.Context, in *ResponseBodyIn, opts ...grpc.CallOption) (*RepeatedResponseStrings, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(RepeatedResponseStrings)
	err := c.cc.Invoke(ctx, ResponseBodyService_ListResponseStrings_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *responseBodyServiceClient) GetResponseBodyStream(ctx context.Context, in *ResponseBodyIn, opts ...grpc.CallOption) (grpc.ServerStreamingClient[ResponseBodyOut], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &ResponseBodyService_ServiceDesc.Streams[0], ResponseBodyService_GetResponseBodyStream_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[ResponseBodyIn, ResponseBodyOut]{ClientStream: 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
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ResponseBodyService_GetResponseBodyStreamClient = grpc.ServerStreamingClient[ResponseBodyOut]

// 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, grpc.ServerStreamingServer[ResponseBodyOut]) error
}

// UnimplementedResponseBodyServiceServer should 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 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, grpc.ServerStreamingServer[ResponseBodyOut]) error {
	return status.Errorf(codes.Unimplemented, "method GetResponseBodyStream not implemented")
}
func (UnimplementedResponseBodyServiceServer) testEmbeddedByValue() {}

// 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) {
	// If the following call pancis, it indicates UnimplementedResponseBodyServiceServer 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(&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: ResponseBodyService_GetResponseBody_FullMethodName,
	}
	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: ResponseBodyService_ListResponseBodies_FullMethodName,
	}
	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: ResponseBodyService_ListResponseStrings_FullMethodName,
	}
	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, &grpc.GenericServerStream[ResponseBodyIn, ResponseBodyOut]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type ResponseBodyService_GetResponseBodyStreamServer = grpc.ServerStreamingServer[ResponseBodyOut]

// 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",
}
