//
//Сервис управления настройками Ntp-сервера

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

package deviceapis_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 (
	NtpService_EditNtp_FullMethodName = "/deviceapis.device.v1.NtpService/EditNtp"
	NtpService_GetNtp_FullMethodName  = "/deviceapis.device.v1.NtpService/GetNtp"
)

// NtpServiceClient is the client API for NtpService 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 NtpServiceClient interface {
	// Метод редактирования настроек NTP
	EditNtp(ctx context.Context, in *EditNtpRequest, opts ...grpc.CallOption) (*EditNtpResponse, error)
	// Метод получения настроек NTP
	GetNtp(ctx context.Context, in *GetNtpRequest, opts ...grpc.CallOption) (*GetNtpResponse, error)
}

type ntpServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewNtpServiceClient(cc grpc.ClientConnInterface) NtpServiceClient {
	return &ntpServiceClient{cc}
}

func (c *ntpServiceClient) EditNtp(ctx context.Context, in *EditNtpRequest, opts ...grpc.CallOption) (*EditNtpResponse, error) {
	out := new(EditNtpResponse)
	err := c.cc.Invoke(ctx, NtpService_EditNtp_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *ntpServiceClient) GetNtp(ctx context.Context, in *GetNtpRequest, opts ...grpc.CallOption) (*GetNtpResponse, error) {
	out := new(GetNtpResponse)
	err := c.cc.Invoke(ctx, NtpService_GetNtp_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// NtpServiceServer is the server API for NtpService service.
// All implementations should embed UnimplementedNtpServiceServer
// for forward compatibility
type NtpServiceServer interface {
	// Метод редактирования настроек NTP
	EditNtp(context.Context, *EditNtpRequest) (*EditNtpResponse, error)
	// Метод получения настроек NTP
	GetNtp(context.Context, *GetNtpRequest) (*GetNtpResponse, error)
}

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

func (UnimplementedNtpServiceServer) EditNtp(context.Context, *EditNtpRequest) (*EditNtpResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method EditNtp not implemented")
}
func (UnimplementedNtpServiceServer) GetNtp(context.Context, *GetNtpRequest) (*GetNtpResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetNtp not implemented")
}

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

func RegisterNtpServiceServer(s grpc.ServiceRegistrar, srv NtpServiceServer) {
	s.RegisterService(&NtpService_ServiceDesc, srv)
}

func _NtpService_EditNtp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(EditNtpRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NtpServiceServer).EditNtp(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: NtpService_EditNtp_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NtpServiceServer).EditNtp(ctx, req.(*EditNtpRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _NtpService_GetNtp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetNtpRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NtpServiceServer).GetNtp(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: NtpService_GetNtp_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NtpServiceServer).GetNtp(ctx, req.(*GetNtpRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// NtpService_ServiceDesc is the grpc.ServiceDesc for NtpService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var NtpService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "deviceapis.device.v1.NtpService",
	HandlerType: (*NtpServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "EditNtp",
			Handler:    _NtpService_EditNtp_Handler,
		},
		{
			MethodName: "GetNtp",
			Handler:    _NtpService_GetNtp_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "deviceapis/device/v1/deviceapis_device_ntp_v1.proto",
}
