// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             v4.22.2
// source: proto/instance_group.proto

package proto

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

const (
	InstanceGroup_Init_FullMethodName        = "/proto.InstanceGroup/Init"
	InstanceGroup_Update_FullMethodName      = "/proto.InstanceGroup/Update"
	InstanceGroup_Increase_FullMethodName    = "/proto.InstanceGroup/Increase"
	InstanceGroup_Decrease_FullMethodName    = "/proto.InstanceGroup/Decrease"
	InstanceGroup_ConnectInfo_FullMethodName = "/proto.InstanceGroup/ConnectInfo"
	InstanceGroup_Shutdown_FullMethodName    = "/proto.InstanceGroup/Shutdown"
)

// InstanceGroupClient is the client API for InstanceGroup 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 InstanceGroupClient interface {
	Init(ctx context.Context, in *InitRequest, opts ...grpc.CallOption) (*InitResponse, error)
	Update(ctx context.Context, in *Empty, opts ...grpc.CallOption) (InstanceGroup_UpdateClient, error)
	Increase(ctx context.Context, in *IncreaseRequest, opts ...grpc.CallOption) (*IncreaseResponse, error)
	Decrease(ctx context.Context, in *DecreaseRequest, opts ...grpc.CallOption) (*DecreaseResponse, error)
	ConnectInfo(ctx context.Context, in *ConnectInfoRequest, opts ...grpc.CallOption) (*ConnectInfoResponse, error)
	Shutdown(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
}

type instanceGroupClient struct {
	cc grpc.ClientConnInterface
}

func NewInstanceGroupClient(cc grpc.ClientConnInterface) InstanceGroupClient {
	return &instanceGroupClient{cc}
}

func (c *instanceGroupClient) Init(ctx context.Context, in *InitRequest, opts ...grpc.CallOption) (*InitResponse, error) {
	out := new(InitResponse)
	err := c.cc.Invoke(ctx, InstanceGroup_Init_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *instanceGroupClient) Update(ctx context.Context, in *Empty, opts ...grpc.CallOption) (InstanceGroup_UpdateClient, error) {
	stream, err := c.cc.NewStream(ctx, &InstanceGroup_ServiceDesc.Streams[0], InstanceGroup_Update_FullMethodName, opts...)
	if err != nil {
		return nil, err
	}
	x := &instanceGroupUpdateClient{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 InstanceGroup_UpdateClient interface {
	Recv() (*UpdateResponse, error)
	grpc.ClientStream
}

type instanceGroupUpdateClient struct {
	grpc.ClientStream
}

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

func (c *instanceGroupClient) Increase(ctx context.Context, in *IncreaseRequest, opts ...grpc.CallOption) (*IncreaseResponse, error) {
	out := new(IncreaseResponse)
	err := c.cc.Invoke(ctx, InstanceGroup_Increase_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *instanceGroupClient) Decrease(ctx context.Context, in *DecreaseRequest, opts ...grpc.CallOption) (*DecreaseResponse, error) {
	out := new(DecreaseResponse)
	err := c.cc.Invoke(ctx, InstanceGroup_Decrease_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *instanceGroupClient) ConnectInfo(ctx context.Context, in *ConnectInfoRequest, opts ...grpc.CallOption) (*ConnectInfoResponse, error) {
	out := new(ConnectInfoResponse)
	err := c.cc.Invoke(ctx, InstanceGroup_ConnectInfo_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *instanceGroupClient) Shutdown(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) {
	out := new(Empty)
	err := c.cc.Invoke(ctx, InstanceGroup_Shutdown_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// InstanceGroupServer is the server API for InstanceGroup service.
// All implementations must embed UnimplementedInstanceGroupServer
// for forward compatibility
type InstanceGroupServer interface {
	Init(context.Context, *InitRequest) (*InitResponse, error)
	Update(*Empty, InstanceGroup_UpdateServer) error
	Increase(context.Context, *IncreaseRequest) (*IncreaseResponse, error)
	Decrease(context.Context, *DecreaseRequest) (*DecreaseResponse, error)
	ConnectInfo(context.Context, *ConnectInfoRequest) (*ConnectInfoResponse, error)
	Shutdown(context.Context, *Empty) (*Empty, error)
	mustEmbedUnimplementedInstanceGroupServer()
}

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

func (UnimplementedInstanceGroupServer) Init(context.Context, *InitRequest) (*InitResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Init not implemented")
}
func (UnimplementedInstanceGroupServer) Update(*Empty, InstanceGroup_UpdateServer) error {
	return status.Errorf(codes.Unimplemented, "method Update not implemented")
}
func (UnimplementedInstanceGroupServer) Increase(context.Context, *IncreaseRequest) (*IncreaseResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Increase not implemented")
}
func (UnimplementedInstanceGroupServer) Decrease(context.Context, *DecreaseRequest) (*DecreaseResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Decrease not implemented")
}
func (UnimplementedInstanceGroupServer) ConnectInfo(context.Context, *ConnectInfoRequest) (*ConnectInfoResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ConnectInfo not implemented")
}
func (UnimplementedInstanceGroupServer) Shutdown(context.Context, *Empty) (*Empty, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Shutdown not implemented")
}
func (UnimplementedInstanceGroupServer) mustEmbedUnimplementedInstanceGroupServer() {}

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

func RegisterInstanceGroupServer(s grpc.ServiceRegistrar, srv InstanceGroupServer) {
	s.RegisterService(&InstanceGroup_ServiceDesc, srv)
}

func _InstanceGroup_Init_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(InitRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(InstanceGroupServer).Init(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: InstanceGroup_Init_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(InstanceGroupServer).Init(ctx, req.(*InitRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _InstanceGroup_Update_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(Empty)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(InstanceGroupServer).Update(m, &instanceGroupUpdateServer{stream})
}

type InstanceGroup_UpdateServer interface {
	Send(*UpdateResponse) error
	grpc.ServerStream
}

type instanceGroupUpdateServer struct {
	grpc.ServerStream
}

func (x *instanceGroupUpdateServer) Send(m *UpdateResponse) error {
	return x.ServerStream.SendMsg(m)
}

func _InstanceGroup_Increase_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IncreaseRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(InstanceGroupServer).Increase(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: InstanceGroup_Increase_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(InstanceGroupServer).Increase(ctx, req.(*IncreaseRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _InstanceGroup_Decrease_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DecreaseRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(InstanceGroupServer).Decrease(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: InstanceGroup_Decrease_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(InstanceGroupServer).Decrease(ctx, req.(*DecreaseRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _InstanceGroup_ConnectInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ConnectInfoRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(InstanceGroupServer).ConnectInfo(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: InstanceGroup_ConnectInfo_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(InstanceGroupServer).ConnectInfo(ctx, req.(*ConnectInfoRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _InstanceGroup_Shutdown_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(InstanceGroupServer).Shutdown(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: InstanceGroup_Shutdown_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(InstanceGroupServer).Shutdown(ctx, req.(*Empty))
	}
	return interceptor(ctx, in, info, handler)
}

// InstanceGroup_ServiceDesc is the grpc.ServiceDesc for InstanceGroup service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var InstanceGroup_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.InstanceGroup",
	HandlerType: (*InstanceGroupServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Init",
			Handler:    _InstanceGroup_Init_Handler,
		},
		{
			MethodName: "Increase",
			Handler:    _InstanceGroup_Increase_Handler,
		},
		{
			MethodName: "Decrease",
			Handler:    _InstanceGroup_Decrease_Handler,
		},
		{
			MethodName: "ConnectInfo",
			Handler:    _InstanceGroup_ConnectInfo_Handler,
		},
		{
			MethodName: "Shutdown",
			Handler:    _InstanceGroup_Shutdown_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Update",
			Handler:       _InstanceGroup_Update_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "proto/instance_group.proto",
}
