//
//Сервис управления обновлениями

// 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_update_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 (
	UpdateService_PostUpdateDownload_FullMethodName = "/deviceapis.device.v1.UpdateService/PostUpdateDownload"
	UpdateService_PostUpdateApply_FullMethodName    = "/deviceapis.device.v1.UpdateService/PostUpdateApply"
)

// UpdateServiceClient is the client API for UpdateService 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 UpdateServiceClient interface {
	// Скачать прошивку для обновления
	PostUpdateDownload(ctx context.Context, in *PostUpdateDownloadRequest, opts ...grpc.CallOption) (*PostUpdateDownloadResponse, error)
	// Запустить обновление домофона
	PostUpdateApply(ctx context.Context, in *PostUpdateApplyRequest, opts ...grpc.CallOption) (*PostUpdateApplyResponse, error)
}

type updateServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewUpdateServiceClient(cc grpc.ClientConnInterface) UpdateServiceClient {
	return &updateServiceClient{cc}
}

func (c *updateServiceClient) PostUpdateDownload(ctx context.Context, in *PostUpdateDownloadRequest, opts ...grpc.CallOption) (*PostUpdateDownloadResponse, error) {
	out := new(PostUpdateDownloadResponse)
	err := c.cc.Invoke(ctx, UpdateService_PostUpdateDownload_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *updateServiceClient) PostUpdateApply(ctx context.Context, in *PostUpdateApplyRequest, opts ...grpc.CallOption) (*PostUpdateApplyResponse, error) {
	out := new(PostUpdateApplyResponse)
	err := c.cc.Invoke(ctx, UpdateService_PostUpdateApply_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// UpdateServiceServer is the server API for UpdateService service.
// All implementations should embed UnimplementedUpdateServiceServer
// for forward compatibility
type UpdateServiceServer interface {
	// Скачать прошивку для обновления
	PostUpdateDownload(context.Context, *PostUpdateDownloadRequest) (*PostUpdateDownloadResponse, error)
	// Запустить обновление домофона
	PostUpdateApply(context.Context, *PostUpdateApplyRequest) (*PostUpdateApplyResponse, error)
}

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

func (UnimplementedUpdateServiceServer) PostUpdateDownload(context.Context, *PostUpdateDownloadRequest) (*PostUpdateDownloadResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PostUpdateDownload not implemented")
}
func (UnimplementedUpdateServiceServer) PostUpdateApply(context.Context, *PostUpdateApplyRequest) (*PostUpdateApplyResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PostUpdateApply not implemented")
}

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

func RegisterUpdateServiceServer(s grpc.ServiceRegistrar, srv UpdateServiceServer) {
	s.RegisterService(&UpdateService_ServiceDesc, srv)
}

func _UpdateService_PostUpdateDownload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PostUpdateDownloadRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UpdateServiceServer).PostUpdateDownload(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: UpdateService_PostUpdateDownload_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UpdateServiceServer).PostUpdateDownload(ctx, req.(*PostUpdateDownloadRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _UpdateService_PostUpdateApply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PostUpdateApplyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UpdateServiceServer).PostUpdateApply(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: UpdateService_PostUpdateApply_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UpdateServiceServer).PostUpdateApply(ctx, req.(*PostUpdateApplyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// UpdateService_ServiceDesc is the grpc.ServiceDesc for UpdateService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var UpdateService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "deviceapis.device.v1.UpdateService",
	HandlerType: (*UpdateServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "PostUpdateDownload",
			Handler:    _UpdateService_PostUpdateDownload_Handler,
		},
		{
			MethodName: "PostUpdateApply",
			Handler:    _UpdateService_PostUpdateApply_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "deviceapis/device/v1/deviceapis_device_update_v1.proto",
}
