// 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/organizationmanager/v1/idp/synchronization_session_service.proto

package idp

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 (
	SynchronizationSessionService_OpenSession_FullMethodName           = "/yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService/OpenSession"
	SynchronizationSessionService_CloseSession_FullMethodName          = "/yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService/CloseSession"
	SynchronizationSessionService_ReportSessionProgress_FullMethodName = "/yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService/ReportSessionProgress"
	SynchronizationSessionService_Heartbeat_FullMethodName             = "/yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService/Heartbeat"
	SynchronizationSessionService_GetSession_FullMethodName            = "/yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService/GetSession"
	SynchronizationSessionService_ListSessions_FullMethodName          = "/yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService/ListSessions"
)

// SynchronizationSessionServiceClient is the client API for SynchronizationSessionService 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 set of methods for managing synchronization sessions.
type SynchronizationSessionServiceClient interface {
	// Opens a new synchronization session.
	OpenSession(ctx context.Context, in *OpenSessionRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Closes a synchronization session.
	CloseSession(ctx context.Context, in *CloseSessionRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Reports progress for a synchronization session.
	ReportSessionProgress(ctx context.Context, in *ReportSessionProgressRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Sends a heartbeat for a synchronization session.
	Heartbeat(ctx context.Context, in *HeartbeatRequest, opts ...grpc.CallOption) (*operation.Operation, error)
	// Returns the specified synchronization session.
	GetSession(ctx context.Context, in *GetSessionRequest, opts ...grpc.CallOption) (*GetSessionResponse, error)
	// Lists synchronization sessions for a subject container.
	ListSessions(ctx context.Context, in *ListSessionsRequest, opts ...grpc.CallOption) (*ListSessionsResponse, error)
}

type synchronizationSessionServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewSynchronizationSessionServiceClient(cc grpc.ClientConnInterface) SynchronizationSessionServiceClient {
	return &synchronizationSessionServiceClient{cc}
}

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

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

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

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

func (c *synchronizationSessionServiceClient) GetSession(ctx context.Context, in *GetSessionRequest, opts ...grpc.CallOption) (*GetSessionResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(GetSessionResponse)
	err := c.cc.Invoke(ctx, SynchronizationSessionService_GetSession_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *synchronizationSessionServiceClient) ListSessions(ctx context.Context, in *ListSessionsRequest, opts ...grpc.CallOption) (*ListSessionsResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListSessionsResponse)
	err := c.cc.Invoke(ctx, SynchronizationSessionService_ListSessions_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// SynchronizationSessionServiceServer is the server API for SynchronizationSessionService service.
// All implementations should embed UnimplementedSynchronizationSessionServiceServer
// for forward compatibility.
//
// A set of methods for managing synchronization sessions.
type SynchronizationSessionServiceServer interface {
	// Opens a new synchronization session.
	OpenSession(context.Context, *OpenSessionRequest) (*operation.Operation, error)
	// Closes a synchronization session.
	CloseSession(context.Context, *CloseSessionRequest) (*operation.Operation, error)
	// Reports progress for a synchronization session.
	ReportSessionProgress(context.Context, *ReportSessionProgressRequest) (*operation.Operation, error)
	// Sends a heartbeat for a synchronization session.
	Heartbeat(context.Context, *HeartbeatRequest) (*operation.Operation, error)
	// Returns the specified synchronization session.
	GetSession(context.Context, *GetSessionRequest) (*GetSessionResponse, error)
	// Lists synchronization sessions for a subject container.
	ListSessions(context.Context, *ListSessionsRequest) (*ListSessionsResponse, error)
}

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

func (UnimplementedSynchronizationSessionServiceServer) OpenSession(context.Context, *OpenSessionRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method OpenSession not implemented")
}
func (UnimplementedSynchronizationSessionServiceServer) CloseSession(context.Context, *CloseSessionRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method CloseSession not implemented")
}
func (UnimplementedSynchronizationSessionServiceServer) ReportSessionProgress(context.Context, *ReportSessionProgressRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method ReportSessionProgress not implemented")
}
func (UnimplementedSynchronizationSessionServiceServer) Heartbeat(context.Context, *HeartbeatRequest) (*operation.Operation, error) {
	return nil, status.Error(codes.Unimplemented, "method Heartbeat not implemented")
}
func (UnimplementedSynchronizationSessionServiceServer) GetSession(context.Context, *GetSessionRequest) (*GetSessionResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method GetSession not implemented")
}
func (UnimplementedSynchronizationSessionServiceServer) ListSessions(context.Context, *ListSessionsRequest) (*ListSessionsResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method ListSessions not implemented")
}
func (UnimplementedSynchronizationSessionServiceServer) testEmbeddedByValue() {}

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

func RegisterSynchronizationSessionServiceServer(s grpc.ServiceRegistrar, srv SynchronizationSessionServiceServer) {
	// If the following call panics, it indicates UnimplementedSynchronizationSessionServiceServer 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(&SynchronizationSessionService_ServiceDesc, srv)
}

func _SynchronizationSessionService_OpenSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(OpenSessionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SynchronizationSessionServiceServer).OpenSession(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: SynchronizationSessionService_OpenSession_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SynchronizationSessionServiceServer).OpenSession(ctx, req.(*OpenSessionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _SynchronizationSessionService_CloseSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CloseSessionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SynchronizationSessionServiceServer).CloseSession(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: SynchronizationSessionService_CloseSession_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SynchronizationSessionServiceServer).CloseSession(ctx, req.(*CloseSessionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _SynchronizationSessionService_ReportSessionProgress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ReportSessionProgressRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SynchronizationSessionServiceServer).ReportSessionProgress(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: SynchronizationSessionService_ReportSessionProgress_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SynchronizationSessionServiceServer).ReportSessionProgress(ctx, req.(*ReportSessionProgressRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _SynchronizationSessionService_Heartbeat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(HeartbeatRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SynchronizationSessionServiceServer).Heartbeat(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: SynchronizationSessionService_Heartbeat_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SynchronizationSessionServiceServer).Heartbeat(ctx, req.(*HeartbeatRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _SynchronizationSessionService_GetSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetSessionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SynchronizationSessionServiceServer).GetSession(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: SynchronizationSessionService_GetSession_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SynchronizationSessionServiceServer).GetSession(ctx, req.(*GetSessionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _SynchronizationSessionService_ListSessions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListSessionsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(SynchronizationSessionServiceServer).ListSessions(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: SynchronizationSessionService_ListSessions_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(SynchronizationSessionServiceServer).ListSessions(ctx, req.(*ListSessionsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// SynchronizationSessionService_ServiceDesc is the grpc.ServiceDesc for SynchronizationSessionService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var SynchronizationSessionService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.organizationmanager.v1.idp.SynchronizationSessionService",
	HandlerType: (*SynchronizationSessionServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "OpenSession",
			Handler:    _SynchronizationSessionService_OpenSession_Handler,
		},
		{
			MethodName: "CloseSession",
			Handler:    _SynchronizationSessionService_CloseSession_Handler,
		},
		{
			MethodName: "ReportSessionProgress",
			Handler:    _SynchronizationSessionService_ReportSessionProgress_Handler,
		},
		{
			MethodName: "Heartbeat",
			Handler:    _SynchronizationSessionService_Heartbeat_Handler,
		},
		{
			MethodName: "GetSession",
			Handler:    _SynchronizationSessionService_GetSession_Handler,
		},
		{
			MethodName: "ListSessions",
			Handler:    _SynchronizationSessionService_ListSessions_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/organizationmanager/v1/idp/synchronization_session_service.proto",
}
