// 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/ai/assistants/v1/threads/thread_service.proto

package threads

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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	ThreadService_Create_FullMethodName = "/yandex.cloud.ai.assistants.v1.threads.ThreadService/Create"
	ThreadService_Get_FullMethodName    = "/yandex.cloud.ai.assistants.v1.threads.ThreadService/Get"
	ThreadService_Update_FullMethodName = "/yandex.cloud.ai.assistants.v1.threads.ThreadService/Update"
	ThreadService_Delete_FullMethodName = "/yandex.cloud.ai.assistants.v1.threads.ThreadService/Delete"
	ThreadService_List_FullMethodName   = "/yandex.cloud.ai.assistants.v1.threads.ThreadService/List"
)

// ThreadServiceClient is the client API for ThreadService 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.
//
// ThreadService provides operations for managing threads.
type ThreadServiceClient interface {
	// Create a new thread.
	Create(ctx context.Context, in *CreateThreadRequest, opts ...grpc.CallOption) (*Thread, error)
	// Retrieve details of a specific thread by its ID.
	Get(ctx context.Context, in *GetThreadRequest, opts ...grpc.CallOption) (*Thread, error)
	// Update an existing thread.
	Update(ctx context.Context, in *UpdateThreadRequest, opts ...grpc.CallOption) (*Thread, error)
	// Delete a thread by its ID.
	Delete(ctx context.Context, in *DeleteThreadRequest, opts ...grpc.CallOption) (*DeleteThreadResponse, error)
	// List threads in a specific folder.
	List(ctx context.Context, in *ListThreadsRequest, opts ...grpc.CallOption) (*ListThreadsResponse, error)
}

type threadServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewThreadServiceClient(cc grpc.ClientConnInterface) ThreadServiceClient {
	return &threadServiceClient{cc}
}

func (c *threadServiceClient) Create(ctx context.Context, in *CreateThreadRequest, opts ...grpc.CallOption) (*Thread, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Thread)
	err := c.cc.Invoke(ctx, ThreadService_Create_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

func (c *threadServiceClient) Update(ctx context.Context, in *UpdateThreadRequest, opts ...grpc.CallOption) (*Thread, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Thread)
	err := c.cc.Invoke(ctx, ThreadService_Update_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *threadServiceClient) Delete(ctx context.Context, in *DeleteThreadRequest, opts ...grpc.CallOption) (*DeleteThreadResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(DeleteThreadResponse)
	err := c.cc.Invoke(ctx, ThreadService_Delete_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

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

// ThreadServiceServer is the server API for ThreadService service.
// All implementations should embed UnimplementedThreadServiceServer
// for forward compatibility.
//
// ThreadService provides operations for managing threads.
type ThreadServiceServer interface {
	// Create a new thread.
	Create(context.Context, *CreateThreadRequest) (*Thread, error)
	// Retrieve details of a specific thread by its ID.
	Get(context.Context, *GetThreadRequest) (*Thread, error)
	// Update an existing thread.
	Update(context.Context, *UpdateThreadRequest) (*Thread, error)
	// Delete a thread by its ID.
	Delete(context.Context, *DeleteThreadRequest) (*DeleteThreadResponse, error)
	// List threads in a specific folder.
	List(context.Context, *ListThreadsRequest) (*ListThreadsResponse, error)
}

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

func (UnimplementedThreadServiceServer) Create(context.Context, *CreateThreadRequest) (*Thread, error) {
	return nil, status.Error(codes.Unimplemented, "method Create not implemented")
}
func (UnimplementedThreadServiceServer) Get(context.Context, *GetThreadRequest) (*Thread, error) {
	return nil, status.Error(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedThreadServiceServer) Update(context.Context, *UpdateThreadRequest) (*Thread, error) {
	return nil, status.Error(codes.Unimplemented, "method Update not implemented")
}
func (UnimplementedThreadServiceServer) Delete(context.Context, *DeleteThreadRequest) (*DeleteThreadResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method Delete not implemented")
}
func (UnimplementedThreadServiceServer) List(context.Context, *ListThreadsRequest) (*ListThreadsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedThreadServiceServer) testEmbeddedByValue() {}

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

func RegisterThreadServiceServer(s grpc.ServiceRegistrar, srv ThreadServiceServer) {
	// If the following call panics, it indicates UnimplementedThreadServiceServer 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(&ThreadService_ServiceDesc, srv)
}

func _ThreadService_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CreateThreadRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ThreadServiceServer).Create(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ThreadService_Create_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ThreadServiceServer).Create(ctx, req.(*CreateThreadRequest))
	}
	return interceptor(ctx, in, info, handler)
}

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

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

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

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

// ThreadService_ServiceDesc is the grpc.ServiceDesc for ThreadService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ThreadService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.ai.assistants.v1.threads.ThreadService",
	HandlerType: (*ThreadServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Create",
			Handler:    _ThreadService_Create_Handler,
		},
		{
			MethodName: "Get",
			Handler:    _ThreadService_Get_Handler,
		},
		{
			MethodName: "Update",
			Handler:    _ThreadService_Update_Handler,
		},
		{
			MethodName: "Delete",
			Handler:    _ThreadService_Delete_Handler,
		},
		{
			MethodName: "List",
			Handler:    _ThreadService_List_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/ai/assistants/v1/threads/thread_service.proto",
}
