// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc             v3.21.12
// source: yandex/cloud/clouddesktop/v1/desktop_image_service.proto

package clouddesktop

import (
	context "context"
	operation "github.com/yandex-cloud/go-genproto/yandex/cloud/operation"
	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 (
	DesktopImageService_List_FullMethodName            = "/yandex.cloud.clouddesktop.v1.api.DesktopImageService/List"
	DesktopImageService_Get_FullMethodName             = "/yandex.cloud.clouddesktop.v1.api.DesktopImageService/Get"
	DesktopImageService_Copy_FullMethodName            = "/yandex.cloud.clouddesktop.v1.api.DesktopImageService/Copy"
	DesktopImageService_Update_FullMethodName          = "/yandex.cloud.clouddesktop.v1.api.DesktopImageService/Update"
	DesktopImageService_CopyFromDesktop_FullMethodName = "/yandex.cloud.clouddesktop.v1.api.DesktopImageService/CopyFromDesktop"
	DesktopImageService_Delete_FullMethodName          = "/yandex.cloud.clouddesktop.v1.api.DesktopImageService/Delete"
)

// DesktopImageServiceClient is the client API for DesktopImageService 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.
//
// A service for managing desktop images.
type DesktopImageServiceClient interface {
	// Lists desktop images in the specified folder.
	List(ctx context.Context, in *ListDesktopImagesRequest, opts ...grpc.CallOption) (*ListDesktopImagesResponse, error)
	// Returns the specified desktop image.
	Get(ctx context.Context, in *GetDesktopImageRequest, opts ...grpc.CallOption) (*DesktopImage, error)
	// Copies the specified image to desktop image.
	Copy(ctx context.Context, in *CopyDesktopImageRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Updates desktop image properties.
	Update(ctx context.Context, in *UpdateDesktopImageRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Copies the specified desktop image from the specified desktop.
	CopyFromDesktop(ctx context.Context, in *CopyFromDesktopRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Deletes the specified desktop image.
	Delete(ctx context.Context, in *DeleteDesktopImageRequest, opts ...grpc.CallOption) (*operation.Operation, error)
}

type desktopImageServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewDesktopImageServiceClient(cc grpc.ClientConnInterface) DesktopImageServiceClient {
	return &desktopImageServiceClient{cc}
}

func (c *desktopImageServiceClient) List(ctx context.Context, in *ListDesktopImagesRequest, opts ...grpc.CallOption) (*ListDesktopImagesResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListDesktopImagesResponse)
	err := c.cc.Invoke(ctx, DesktopImageService_List_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *desktopImageServiceClient) Get(ctx context.Context, in *GetDesktopImageRequest, opts ...grpc.CallOption) (*DesktopImage, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(DesktopImage)
	err := c.cc.Invoke(ctx, DesktopImageService_Get_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *desktopImageServiceClient) Copy(ctx context.Context, in *CopyDesktopImageRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, DesktopImageService_Copy_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *desktopImageServiceClient) Update(ctx context.Context, in *UpdateDesktopImageRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, DesktopImageService_Update_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *desktopImageServiceClient) CopyFromDesktop(ctx context.Context, in *CopyFromDesktopRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, DesktopImageService_CopyFromDesktop_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *desktopImageServiceClient) Delete(ctx context.Context, in *DeleteDesktopImageRequest, opts ...grpc.CallOption) (*operation.Operation, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(operation.Operation)
	err := c.cc.Invoke(ctx, DesktopImageService_Delete_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// DesktopImageServiceServer is the server API for DesktopImageService service.
// All implementations should embed UnimplementedDesktopImageServiceServer
// for forward compatibility.
//
// A service for managing desktop images.
type DesktopImageServiceServer interface {
	// Lists desktop images in the specified folder.
	List(context.Context, *ListDesktopImagesRequest) (*ListDesktopImagesResponse, error)
	// Returns the specified desktop image.
	Get(context.Context, *GetDesktopImageRequest) (*DesktopImage, error)
	// Copies the specified image to desktop image.
	Copy(context.Context, *CopyDesktopImageRequest) (*operation.Operation, error)
	// Updates desktop image properties.
	Update(context.Context, *UpdateDesktopImageRequest) (*operation.Operation, error)
	// Copies the specified desktop image from the specified desktop.
	CopyFromDesktop(context.Context, *CopyFromDesktopRequest) (*operation.Operation, error)
	// Deletes the specified desktop image.
	Delete(context.Context, *DeleteDesktopImageRequest) (*operation.Operation, error)
}

// UnimplementedDesktopImageServiceServer 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 UnimplementedDesktopImageServiceServer struct{}

func (UnimplementedDesktopImageServiceServer) List(context.Context, *ListDesktopImagesRequest) (*ListDesktopImagesResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedDesktopImageServiceServer) Get(context.Context, *GetDesktopImageRequest) (*DesktopImage, error) {
	return nil, status.Error(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedDesktopImageServiceServer) Copy(context.Context, *CopyDesktopImageRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Copy not implemented")
}
func (UnimplementedDesktopImageServiceServer) Update(context.Context, *UpdateDesktopImageRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Update not implemented")
}
func (UnimplementedDesktopImageServiceServer) CopyFromDesktop(context.Context, *CopyFromDesktopRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method CopyFromDesktop not implemented")
}
func (UnimplementedDesktopImageServiceServer) Delete(context.Context, *DeleteDesktopImageRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedDesktopImageServiceServer) testEmbeddedByValue() {}

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

func RegisterDesktopImageServiceServer(s grpc.ServiceRegistrar, srv DesktopImageServiceServer) {
	// If the following call panics, it indicates UnimplementedDesktopImageServiceServer 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(&DesktopImageService_ServiceDesc, srv)
}

func _DesktopImageService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListDesktopImagesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DesktopImageServiceServer).List(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: DesktopImageService_List_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DesktopImageServiceServer).List(ctx, req.(*ListDesktopImagesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _DesktopImageService_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetDesktopImageRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DesktopImageServiceServer).Get(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: DesktopImageService_Get_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DesktopImageServiceServer).Get(ctx, req.(*GetDesktopImageRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _DesktopImageService_Copy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CopyDesktopImageRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DesktopImageServiceServer).Copy(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: DesktopImageService_Copy_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DesktopImageServiceServer).Copy(ctx, req.(*CopyDesktopImageRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _DesktopImageService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UpdateDesktopImageRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DesktopImageServiceServer).Update(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: DesktopImageService_Update_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DesktopImageServiceServer).Update(ctx, req.(*UpdateDesktopImageRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _DesktopImageService_CopyFromDesktop_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CopyFromDesktopRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DesktopImageServiceServer).CopyFromDesktop(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: DesktopImageService_CopyFromDesktop_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DesktopImageServiceServer).CopyFromDesktop(ctx, req.(*CopyFromDesktopRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _DesktopImageService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteDesktopImageRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(DesktopImageServiceServer).Delete(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: DesktopImageService_Delete_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(DesktopImageServiceServer).Delete(ctx, req.(*DeleteDesktopImageRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// DesktopImageService_ServiceDesc is the grpc.ServiceDesc for DesktopImageService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var DesktopImageService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.clouddesktop.v1.api.DesktopImageService",
	HandlerType: (*DesktopImageServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "List",
			Handler:    _DesktopImageService_List_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _DesktopImageService_Get_Handler,
		},
		{
			MethodName: "Copy",
			Handler:    _DesktopImageService_Copy_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _DesktopImageService_Update_Handler,
		},
		{
			MethodName: "CopyFromDesktop",
			Handler:    _DesktopImageService_CopyFromDesktop_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _DesktopImageService_Delete_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/clouddesktop/v1/desktop_image_service.proto",
}
