// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             (unknown)
// source: api/v1/storage_service.proto

package apiv1

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 (
	StorageService_CreateStorage_FullMethodName = "/memos.api.v1.StorageService/CreateStorage"
	StorageService_GetStorage_FullMethodName    = "/memos.api.v1.StorageService/GetStorage"
	StorageService_ListStorages_FullMethodName  = "/memos.api.v1.StorageService/ListStorages"
	StorageService_UpdateStorage_FullMethodName = "/memos.api.v1.StorageService/UpdateStorage"
	StorageService_DeleteStorage_FullMethodName = "/memos.api.v1.StorageService/DeleteStorage"
)

// StorageServiceClient is the client API for StorageService 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 StorageServiceClient interface {
	// CreateStorage creates a new storage.
	CreateStorage(ctx context.Context, in *CreateStorageRequest, opts ...grpc.CallOption) (*CreateStorageResponse, error)
	// GetStorage returns a storage by id.
	GetStorage(ctx context.Context, in *GetStorageRequest, opts ...grpc.CallOption) (*GetStorageResponse, error)
	// ListStorages returns a list of storages.
	ListStorages(ctx context.Context, in *ListStoragesRequest, opts ...grpc.CallOption) (*ListStoragesResponse, error)
	// UpdateStorage updates a storage.
	UpdateStorage(ctx context.Context, in *UpdateStorageRequest, opts ...grpc.CallOption) (*UpdateStorageResponse, error)
	// DeleteStorage deletes a storage by id.
	DeleteStorage(ctx context.Context, in *DeleteStorageRequest, opts ...grpc.CallOption) (*DeleteStorageResponse, error)
}

type storageServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewStorageServiceClient(cc grpc.ClientConnInterface) StorageServiceClient {
	return &storageServiceClient{cc}
}

func (c *storageServiceClient) CreateStorage(ctx context.Context, in *CreateStorageRequest, opts ...grpc.CallOption) (*CreateStorageResponse, error) {
	out := new(CreateStorageResponse)
	err := c.cc.Invoke(ctx, StorageService_CreateStorage_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *storageServiceClient) GetStorage(ctx context.Context, in *GetStorageRequest, opts ...grpc.CallOption) (*GetStorageResponse, error) {
	out := new(GetStorageResponse)
	err := c.cc.Invoke(ctx, StorageService_GetStorage_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *storageServiceClient) ListStorages(ctx context.Context, in *ListStoragesRequest, opts ...grpc.CallOption) (*ListStoragesResponse, error) {
	out := new(ListStoragesResponse)
	err := c.cc.Invoke(ctx, StorageService_ListStorages_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *storageServiceClient) UpdateStorage(ctx context.Context, in *UpdateStorageRequest, opts ...grpc.CallOption) (*UpdateStorageResponse, error) {
	out := new(UpdateStorageResponse)
	err := c.cc.Invoke(ctx, StorageService_UpdateStorage_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *storageServiceClient) DeleteStorage(ctx context.Context, in *DeleteStorageRequest, opts ...grpc.CallOption) (*DeleteStorageResponse, error) {
	out := new(DeleteStorageResponse)
	err := c.cc.Invoke(ctx, StorageService_DeleteStorage_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// StorageServiceServer is the server API for StorageService service.
// All implementations must embed UnimplementedStorageServiceServer
// for forward compatibility
type StorageServiceServer interface {
	// CreateStorage creates a new storage.
	CreateStorage(context.Context, *CreateStorageRequest) (*CreateStorageResponse, error)
	// GetStorage returns a storage by id.
	GetStorage(context.Context, *GetStorageRequest) (*GetStorageResponse, error)
	// ListStorages returns a list of storages.
	ListStorages(context.Context, *ListStoragesRequest) (*ListStoragesResponse, error)
	// UpdateStorage updates a storage.
	UpdateStorage(context.Context, *UpdateStorageRequest) (*UpdateStorageResponse, error)
	// DeleteStorage deletes a storage by id.
	DeleteStorage(context.Context, *DeleteStorageRequest) (*DeleteStorageResponse, error)
	mustEmbedUnimplementedStorageServiceServer()
}

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

func (UnimplementedStorageServiceServer) CreateStorage(context.Context, *CreateStorageRequest) (*CreateStorageResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method CreateStorage not implemented")
}
func (UnimplementedStorageServiceServer) GetStorage(context.Context, *GetStorageRequest) (*GetStorageResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetStorage not implemented")
}
func (UnimplementedStorageServiceServer) ListStorages(context.Context, *ListStoragesRequest) (*ListStoragesResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListStorages not implemented")
}
func (UnimplementedStorageServiceServer) UpdateStorage(context.Context, *UpdateStorageRequest) (*UpdateStorageResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UpdateStorage not implemented")
}
func (UnimplementedStorageServiceServer) DeleteStorage(context.Context, *DeleteStorageRequest) (*DeleteStorageResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteStorage not implemented")
}
func (UnimplementedStorageServiceServer) mustEmbedUnimplementedStorageServiceServer() {}

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

func RegisterStorageServiceServer(s grpc.ServiceRegistrar, srv StorageServiceServer) {
	s.RegisterService(&StorageService_ServiceDesc, srv)
}

func _StorageService_CreateStorage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateStorageRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(StorageServiceServer).CreateStorage(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: StorageService_CreateStorage_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(StorageServiceServer).CreateStorage(ctx, req.(*CreateStorageRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _StorageService_GetStorage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetStorageRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(StorageServiceServer).GetStorage(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: StorageService_GetStorage_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(StorageServiceServer).GetStorage(ctx, req.(*GetStorageRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _StorageService_ListStorages_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListStoragesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(StorageServiceServer).ListStorages(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: StorageService_ListStorages_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(StorageServiceServer).ListStorages(ctx, req.(*ListStoragesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _StorageService_UpdateStorage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UpdateStorageRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(StorageServiceServer).UpdateStorage(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: StorageService_UpdateStorage_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(StorageServiceServer).UpdateStorage(ctx, req.(*UpdateStorageRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _StorageService_DeleteStorage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteStorageRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(StorageServiceServer).DeleteStorage(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: StorageService_DeleteStorage_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(StorageServiceServer).DeleteStorage(ctx, req.(*DeleteStorageRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// StorageService_ServiceDesc is the grpc.ServiceDesc for StorageService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var StorageService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "memos.api.v1.StorageService",
	HandlerType: (*StorageServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateStorage",
			Handler:    _StorageService_CreateStorage_Handler,
		},
		{
			MethodName: "GetStorage",
			Handler:    _StorageService_GetStorage_Handler,
		},
		{
			MethodName: "ListStorages",
			Handler:    _StorageService_ListStorages_Handler,
		},
		{
			MethodName: "UpdateStorage",
			Handler:    _StorageService_UpdateStorage_Handler,
		},
		{
			MethodName: "DeleteStorage",
			Handler:    _StorageService_DeleteStorage_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/v1/storage_service.proto",
}
