//
//Сервис реализует функционал управления SIP-трубками

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             v4.23.1
// source: keyapis/device/v1/keyapis_device_sip_phone_v1.proto

package keyapis_device_v1

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 (
	SipPhoneService_GetSipPhone_FullMethodName          = "/keyapis.device.v1.SipPhoneService/GetSipPhone"
	SipPhoneService_GetSipPhoneList_FullMethodName      = "/keyapis.device.v1.SipPhoneService/GetSipPhoneList"
	SipPhoneService_GetSipPhoneCount_FullMethodName     = "/keyapis.device.v1.SipPhoneService/GetSipPhoneCount"
	SipPhoneService_PostSipPhoneGetList_FullMethodName  = "/keyapis.device.v1.SipPhoneService/PostSipPhoneGetList"
	SipPhoneService_PostSipPhoneGetCount_FullMethodName = "/keyapis.device.v1.SipPhoneService/PostSipPhoneGetCount"
)

// SipPhoneServiceClient is the client API for SipPhoneService 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 SipPhoneServiceClient interface {
	// Метод получения SIP-трубки по идентификатору.
	// Метод доступен для: admin, service, bti, ltp_first
	GetSipPhone(ctx context.Context, in *GetSipPhoneRequest, opts ...grpc.CallOption) (*GetSipPhoneResponse, error)
	// Метод получения списка SIP-трубок.
	// Метод доступен для: admin, service, bti, ltp_first
	GetSipPhoneList(ctx context.Context, in *GetSipPhoneListRequest, opts ...grpc.CallOption) (SipPhoneService_GetSipPhoneListClient, error)
	// Метод получения количества SIP-трубок.
	// Метод доступен для: admin, service, bti, ltp_first
	GetSipPhoneCount(ctx context.Context, in *GetSipPhoneCountRequest, opts ...grpc.CallOption) (*GetSipPhoneCountResponse, error)
	// Метод получения списка SIP-трубок.
	// Метод доступен для: admin, service, bti, ltp_first
	PostSipPhoneGetList(ctx context.Context, in *PostSipPhoneGetListRequest, opts ...grpc.CallOption) (*PostSipPhoneGetListResponse, error)
	// Метод получения количества SIP-трубок.
	// Метод доступен для: admin, service, bti, ltp_first
	PostSipPhoneGetCount(ctx context.Context, in *PostSipPhoneGetCountRequest, opts ...grpc.CallOption) (*PostSipPhoneGetCountResponse, error)
}

type sipPhoneServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewSipPhoneServiceClient(cc grpc.ClientConnInterface) SipPhoneServiceClient {
	return &sipPhoneServiceClient{cc}
}

func (c *sipPhoneServiceClient) GetSipPhone(ctx context.Context, in *GetSipPhoneRequest, opts ...grpc.CallOption) (*GetSipPhoneResponse, error) {
	out := new(GetSipPhoneResponse)
	err := c.cc.Invoke(ctx, SipPhoneService_GetSipPhone_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *sipPhoneServiceClient) GetSipPhoneList(ctx context.Context, in *GetSipPhoneListRequest, opts ...grpc.CallOption) (SipPhoneService_GetSipPhoneListClient, error) {
	stream, err := c.cc.NewStream(ctx, &SipPhoneService_ServiceDesc.Streams[0], SipPhoneService_GetSipPhoneList_FullMethodName, opts...)
	if err != nil {
		return nil, err
	}
	x := &sipPhoneServiceGetSipPhoneListClient{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 SipPhoneService_GetSipPhoneListClient interface {
	Recv() (*GetSipPhoneListResponse, error)
	grpc.ClientStream
}

type sipPhoneServiceGetSipPhoneListClient struct {
	grpc.ClientStream
}

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

func (c *sipPhoneServiceClient) GetSipPhoneCount(ctx context.Context, in *GetSipPhoneCountRequest, opts ...grpc.CallOption) (*GetSipPhoneCountResponse, error) {
	out := new(GetSipPhoneCountResponse)
	err := c.cc.Invoke(ctx, SipPhoneService_GetSipPhoneCount_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *sipPhoneServiceClient) PostSipPhoneGetList(ctx context.Context, in *PostSipPhoneGetListRequest, opts ...grpc.CallOption) (*PostSipPhoneGetListResponse, error) {
	out := new(PostSipPhoneGetListResponse)
	err := c.cc.Invoke(ctx, SipPhoneService_PostSipPhoneGetList_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *sipPhoneServiceClient) PostSipPhoneGetCount(ctx context.Context, in *PostSipPhoneGetCountRequest, opts ...grpc.CallOption) (*PostSipPhoneGetCountResponse, error) {
	out := new(PostSipPhoneGetCountResponse)
	err := c.cc.Invoke(ctx, SipPhoneService_PostSipPhoneGetCount_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// SipPhoneServiceServer is the server API for SipPhoneService service.
// All implementations should embed UnimplementedSipPhoneServiceServer
// for forward compatibility
type SipPhoneServiceServer interface {
	// Метод получения SIP-трубки по идентификатору.
	// Метод доступен для: admin, service, bti, ltp_first
	GetSipPhone(context.Context, *GetSipPhoneRequest) (*GetSipPhoneResponse, error)
	// Метод получения списка SIP-трубок.
	// Метод доступен для: admin, service, bti, ltp_first
	GetSipPhoneList(*GetSipPhoneListRequest, SipPhoneService_GetSipPhoneListServer) error
	// Метод получения количества SIP-трубок.
	// Метод доступен для: admin, service, bti, ltp_first
	GetSipPhoneCount(context.Context, *GetSipPhoneCountRequest) (*GetSipPhoneCountResponse, error)
	// Метод получения списка SIP-трубок.
	// Метод доступен для: admin, service, bti, ltp_first
	PostSipPhoneGetList(context.Context, *PostSipPhoneGetListRequest) (*PostSipPhoneGetListResponse, error)
	// Метод получения количества SIP-трубок.
	// Метод доступен для: admin, service, bti, ltp_first
	PostSipPhoneGetCount(context.Context, *PostSipPhoneGetCountRequest) (*PostSipPhoneGetCountResponse, error)
}

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

func (UnimplementedSipPhoneServiceServer) GetSipPhone(context.Context, *GetSipPhoneRequest) (*GetSipPhoneResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetSipPhone not implemented")
}
func (UnimplementedSipPhoneServiceServer) GetSipPhoneList(*GetSipPhoneListRequest, SipPhoneService_GetSipPhoneListServer) error {
	return status.Errorf(codes.Unimplemented, "method GetSipPhoneList not implemented")
}
func (UnimplementedSipPhoneServiceServer) GetSipPhoneCount(context.Context, *GetSipPhoneCountRequest) (*GetSipPhoneCountResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetSipPhoneCount not implemented")
}
func (UnimplementedSipPhoneServiceServer) PostSipPhoneGetList(context.Context, *PostSipPhoneGetListRequest) (*PostSipPhoneGetListResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PostSipPhoneGetList not implemented")
}
func (UnimplementedSipPhoneServiceServer) PostSipPhoneGetCount(context.Context, *PostSipPhoneGetCountRequest) (*PostSipPhoneGetCountResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PostSipPhoneGetCount not implemented")
}

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

func RegisterSipPhoneServiceServer(s grpc.ServiceRegistrar, srv SipPhoneServiceServer) {
	s.RegisterService(&SipPhoneService_ServiceDesc, srv)
}

func _SipPhoneService_GetSipPhone_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetSipPhoneRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SipPhoneServiceServer).GetSipPhone(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: SipPhoneService_GetSipPhone_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SipPhoneServiceServer).GetSipPhone(ctx, req.(*GetSipPhoneRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _SipPhoneService_GetSipPhoneList_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(GetSipPhoneListRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(SipPhoneServiceServer).GetSipPhoneList(m, &sipPhoneServiceGetSipPhoneListServer{stream})
}

type SipPhoneService_GetSipPhoneListServer interface {
	Send(*GetSipPhoneListResponse) error
	grpc.ServerStream
}

type sipPhoneServiceGetSipPhoneListServer struct {
	grpc.ServerStream
}

func (x *sipPhoneServiceGetSipPhoneListServer) Send(m *GetSipPhoneListResponse) error {
	return x.ServerStream.SendMsg(m)
}

func _SipPhoneService_GetSipPhoneCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetSipPhoneCountRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SipPhoneServiceServer).GetSipPhoneCount(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: SipPhoneService_GetSipPhoneCount_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SipPhoneServiceServer).GetSipPhoneCount(ctx, req.(*GetSipPhoneCountRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _SipPhoneService_PostSipPhoneGetList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PostSipPhoneGetListRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SipPhoneServiceServer).PostSipPhoneGetList(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: SipPhoneService_PostSipPhoneGetList_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SipPhoneServiceServer).PostSipPhoneGetList(ctx, req.(*PostSipPhoneGetListRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _SipPhoneService_PostSipPhoneGetCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PostSipPhoneGetCountRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SipPhoneServiceServer).PostSipPhoneGetCount(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: SipPhoneService_PostSipPhoneGetCount_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SipPhoneServiceServer).PostSipPhoneGetCount(ctx, req.(*PostSipPhoneGetCountRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// SipPhoneService_ServiceDesc is the grpc.ServiceDesc for SipPhoneService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var SipPhoneService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "keyapis.device.v1.SipPhoneService",
	HandlerType: (*SipPhoneServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetSipPhone",
			Handler:    _SipPhoneService_GetSipPhone_Handler,
		},
		{
			MethodName: "GetSipPhoneCount",
			Handler:    _SipPhoneService_GetSipPhoneCount_Handler,
		},
		{
			MethodName: "PostSipPhoneGetList",
			Handler:    _SipPhoneService_PostSipPhoneGetList_Handler,
		},
		{
			MethodName: "PostSipPhoneGetCount",
			Handler:    _SipPhoneService_PostSipPhoneGetCount_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetSipPhoneList",
			Handler:       _SipPhoneService_GetSipPhoneList_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "keyapis/device/v1/keyapis_device_sip_phone_v1.proto",
}
