//
//Сервис реализует функционал управления шаблонами уведомлений

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             v4.23.1
// source: keyapis/multiapp/v1/keyapis_multiapp_notification_template_v1.proto

package keyapis_multiapp_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 (
	NotificationTemplateService_PostNotificationTemplate_FullMethodName             = "/keyapis.multiapp.v1.NotificationTemplateService/PostNotificationTemplate"
	NotificationTemplateService_GetNotificationTemplate_FullMethodName              = "/keyapis.multiapp.v1.NotificationTemplateService/GetNotificationTemplate"
	NotificationTemplateService_DeleteNotificationTemplate_FullMethodName           = "/keyapis.multiapp.v1.NotificationTemplateService/DeleteNotificationTemplate"
	NotificationTemplateService_GetNotificationTemplateList_FullMethodName          = "/keyapis.multiapp.v1.NotificationTemplateService/GetNotificationTemplateList"
	NotificationTemplateService_GetNotificationTemplateCount_FullMethodName         = "/keyapis.multiapp.v1.NotificationTemplateService/GetNotificationTemplateCount"
	NotificationTemplateService_PutNotificationTemplatePartnerAttach_FullMethodName = "/keyapis.multiapp.v1.NotificationTemplateService/PutNotificationTemplatePartnerAttach"
	NotificationTemplateService_PutNotificationTemplatePartnerDetach_FullMethodName = "/keyapis.multiapp.v1.NotificationTemplateService/PutNotificationTemplatePartnerDetach"
)

// NotificationTemplateServiceClient is the client API for NotificationTemplateService 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 NotificationTemplateServiceClient interface {
	// Метод сохранения шаблона уведомления.
	// Поддерживает создание и обновление.
	// Поддерживает mustache теги в переменных template_header и template_text.
	// Сценарий использования метода: https://confluence.rt.ru/pages/viewpage.action?pageId=774989444.
	// Метод доступен для: admin, manager, service
	PostNotificationTemplate(ctx context.Context, in *PostNotificationTemplateRequest, opts ...grpc.CallOption) (*PostNotificationTemplateResponse, error)
	// Метод получения шаблона уведомления.
	// Метод доступен для: admin, manager, service, partner.
	// Роль partner определяется по наличию заголовка X-API-KEY вместо Authorization.
	// Роли partner доступны только связанные с ней шаблоны
	GetNotificationTemplate(ctx context.Context, in *GetNotificationTemplateRequest, opts ...grpc.CallOption) (*GetNotificationTemplateResponse, error)
	// Метод удаления шаблона уведомления.
	// Устанавливает текущую дату и время в параметр deleted_at.
	// Метод доступен для: admin, manager, service
	DeleteNotificationTemplate(ctx context.Context, in *DeleteNotificationTemplateRequest, opts ...grpc.CallOption) (*DeleteNotificationTemplateResponse, error)
	// Метод получения списка шаблонов уведомлений.
	// Метод доступен для: admin, manager, service, partner.
	// Роль partner определяется по наличию заголовка X-API-KEY вместо Authorization.
	// Если метод вызван ролью partner в фильтре поле partner_ids принудительно замещается его идентификатором
	GetNotificationTemplateList(ctx context.Context, in *GetNotificationTemplateListRequest, opts ...grpc.CallOption) (NotificationTemplateService_GetNotificationTemplateListClient, error)
	// Метод получения количества шаблонов уведомлений.
	// Метод доступен для: admin, manager, service, partner.
	// Роль partner определяется по наличию заголовка X-API-KEY вместо Authorization.
	// Если метод вызван ролью partner в фильтре поле partner_ids принудительно замещается его идентификатором
	GetNotificationTemplateCount(ctx context.Context, in *GetNotificationTemplateCountRequest, opts ...grpc.CallOption) (*GetNotificationTemplateCountResponse, error)
	// Метод создания связи шаблона уведомления и партнера.
	// Метод доступен для: admin, manager, service
	PutNotificationTemplatePartnerAttach(ctx context.Context, in *PutNotificationTemplatePartnerAttachRequest, opts ...grpc.CallOption) (*PutNotificationTemplatePartnerAttachResponse, error)
	// Метод удаления связи шаблона уведомления и партнера.
	// Метод доступен для: admin, manager, service
	PutNotificationTemplatePartnerDetach(ctx context.Context, in *PutNotificationTemplatePartnerDetachRequest, opts ...grpc.CallOption) (*PutNotificationTemplatePartnerDetachResponse, error)
}

type notificationTemplateServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewNotificationTemplateServiceClient(cc grpc.ClientConnInterface) NotificationTemplateServiceClient {
	return &notificationTemplateServiceClient{cc}
}

func (c *notificationTemplateServiceClient) PostNotificationTemplate(ctx context.Context, in *PostNotificationTemplateRequest, opts ...grpc.CallOption) (*PostNotificationTemplateResponse, error) {
	out := new(PostNotificationTemplateResponse)
	err := c.cc.Invoke(ctx, NotificationTemplateService_PostNotificationTemplate_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *notificationTemplateServiceClient) GetNotificationTemplate(ctx context.Context, in *GetNotificationTemplateRequest, opts ...grpc.CallOption) (*GetNotificationTemplateResponse, error) {
	out := new(GetNotificationTemplateResponse)
	err := c.cc.Invoke(ctx, NotificationTemplateService_GetNotificationTemplate_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *notificationTemplateServiceClient) DeleteNotificationTemplate(ctx context.Context, in *DeleteNotificationTemplateRequest, opts ...grpc.CallOption) (*DeleteNotificationTemplateResponse, error) {
	out := new(DeleteNotificationTemplateResponse)
	err := c.cc.Invoke(ctx, NotificationTemplateService_DeleteNotificationTemplate_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *notificationTemplateServiceClient) GetNotificationTemplateList(ctx context.Context, in *GetNotificationTemplateListRequest, opts ...grpc.CallOption) (NotificationTemplateService_GetNotificationTemplateListClient, error) {
	stream, err := c.cc.NewStream(ctx, &NotificationTemplateService_ServiceDesc.Streams[0], NotificationTemplateService_GetNotificationTemplateList_FullMethodName, opts...)
	if err != nil {
		return nil, err
	}
	x := &notificationTemplateServiceGetNotificationTemplateListClient{stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

type NotificationTemplateService_GetNotificationTemplateListClient interface {
	Recv() (*GetNotificationTemplateListResponse, error)
	grpc.ClientStream
}

type notificationTemplateServiceGetNotificationTemplateListClient struct {
	grpc.ClientStream
}

func (x *notificationTemplateServiceGetNotificationTemplateListClient) Recv() (*GetNotificationTemplateListResponse, error) {
	m := new(GetNotificationTemplateListResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

func (c *notificationTemplateServiceClient) GetNotificationTemplateCount(ctx context.Context, in *GetNotificationTemplateCountRequest, opts ...grpc.CallOption) (*GetNotificationTemplateCountResponse, error) {
	out := new(GetNotificationTemplateCountResponse)
	err := c.cc.Invoke(ctx, NotificationTemplateService_GetNotificationTemplateCount_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *notificationTemplateServiceClient) PutNotificationTemplatePartnerAttach(ctx context.Context, in *PutNotificationTemplatePartnerAttachRequest, opts ...grpc.CallOption) (*PutNotificationTemplatePartnerAttachResponse, error) {
	out := new(PutNotificationTemplatePartnerAttachResponse)
	err := c.cc.Invoke(ctx, NotificationTemplateService_PutNotificationTemplatePartnerAttach_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *notificationTemplateServiceClient) PutNotificationTemplatePartnerDetach(ctx context.Context, in *PutNotificationTemplatePartnerDetachRequest, opts ...grpc.CallOption) (*PutNotificationTemplatePartnerDetachResponse, error) {
	out := new(PutNotificationTemplatePartnerDetachResponse)
	err := c.cc.Invoke(ctx, NotificationTemplateService_PutNotificationTemplatePartnerDetach_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// NotificationTemplateServiceServer is the server API for NotificationTemplateService service.
// All implementations should embed UnimplementedNotificationTemplateServiceServer
// for forward compatibility
type NotificationTemplateServiceServer interface {
	// Метод сохранения шаблона уведомления.
	// Поддерживает создание и обновление.
	// Поддерживает mustache теги в переменных template_header и template_text.
	// Сценарий использования метода: https://confluence.rt.ru/pages/viewpage.action?pageId=774989444.
	// Метод доступен для: admin, manager, service
	PostNotificationTemplate(context.Context, *PostNotificationTemplateRequest) (*PostNotificationTemplateResponse, error)
	// Метод получения шаблона уведомления.
	// Метод доступен для: admin, manager, service, partner.
	// Роль partner определяется по наличию заголовка X-API-KEY вместо Authorization.
	// Роли partner доступны только связанные с ней шаблоны
	GetNotificationTemplate(context.Context, *GetNotificationTemplateRequest) (*GetNotificationTemplateResponse, error)
	// Метод удаления шаблона уведомления.
	// Устанавливает текущую дату и время в параметр deleted_at.
	// Метод доступен для: admin, manager, service
	DeleteNotificationTemplate(context.Context, *DeleteNotificationTemplateRequest) (*DeleteNotificationTemplateResponse, error)
	// Метод получения списка шаблонов уведомлений.
	// Метод доступен для: admin, manager, service, partner.
	// Роль partner определяется по наличию заголовка X-API-KEY вместо Authorization.
	// Если метод вызван ролью partner в фильтре поле partner_ids принудительно замещается его идентификатором
	GetNotificationTemplateList(*GetNotificationTemplateListRequest, NotificationTemplateService_GetNotificationTemplateListServer) error
	// Метод получения количества шаблонов уведомлений.
	// Метод доступен для: admin, manager, service, partner.
	// Роль partner определяется по наличию заголовка X-API-KEY вместо Authorization.
	// Если метод вызван ролью partner в фильтре поле partner_ids принудительно замещается его идентификатором
	GetNotificationTemplateCount(context.Context, *GetNotificationTemplateCountRequest) (*GetNotificationTemplateCountResponse, error)
	// Метод создания связи шаблона уведомления и партнера.
	// Метод доступен для: admin, manager, service
	PutNotificationTemplatePartnerAttach(context.Context, *PutNotificationTemplatePartnerAttachRequest) (*PutNotificationTemplatePartnerAttachResponse, error)
	// Метод удаления связи шаблона уведомления и партнера.
	// Метод доступен для: admin, manager, service
	PutNotificationTemplatePartnerDetach(context.Context, *PutNotificationTemplatePartnerDetachRequest) (*PutNotificationTemplatePartnerDetachResponse, error)
}

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

func (UnimplementedNotificationTemplateServiceServer) PostNotificationTemplate(context.Context, *PostNotificationTemplateRequest) (*PostNotificationTemplateResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PostNotificationTemplate not implemented")
}
func (UnimplementedNotificationTemplateServiceServer) GetNotificationTemplate(context.Context, *GetNotificationTemplateRequest) (*GetNotificationTemplateResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetNotificationTemplate not implemented")
}
func (UnimplementedNotificationTemplateServiceServer) DeleteNotificationTemplate(context.Context, *DeleteNotificationTemplateRequest) (*DeleteNotificationTemplateResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteNotificationTemplate not implemented")
}
func (UnimplementedNotificationTemplateServiceServer) GetNotificationTemplateList(*GetNotificationTemplateListRequest, NotificationTemplateService_GetNotificationTemplateListServer) error {
	return status.Errorf(codes.Unimplemented, "method GetNotificationTemplateList not implemented")
}
func (UnimplementedNotificationTemplateServiceServer) GetNotificationTemplateCount(context.Context, *GetNotificationTemplateCountRequest) (*GetNotificationTemplateCountResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetNotificationTemplateCount not implemented")
}
func (UnimplementedNotificationTemplateServiceServer) PutNotificationTemplatePartnerAttach(context.Context, *PutNotificationTemplatePartnerAttachRequest) (*PutNotificationTemplatePartnerAttachResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PutNotificationTemplatePartnerAttach not implemented")
}
func (UnimplementedNotificationTemplateServiceServer) PutNotificationTemplatePartnerDetach(context.Context, *PutNotificationTemplatePartnerDetachRequest) (*PutNotificationTemplatePartnerDetachResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method PutNotificationTemplatePartnerDetach not implemented")
}

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

func RegisterNotificationTemplateServiceServer(s grpc.ServiceRegistrar, srv NotificationTemplateServiceServer) {
	s.RegisterService(&NotificationTemplateService_ServiceDesc, srv)
}

func _NotificationTemplateService_PostNotificationTemplate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PostNotificationTemplateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NotificationTemplateServiceServer).PostNotificationTemplate(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: NotificationTemplateService_PostNotificationTemplate_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NotificationTemplateServiceServer).PostNotificationTemplate(ctx, req.(*PostNotificationTemplateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _NotificationTemplateService_GetNotificationTemplate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetNotificationTemplateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NotificationTemplateServiceServer).GetNotificationTemplate(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: NotificationTemplateService_GetNotificationTemplate_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NotificationTemplateServiceServer).GetNotificationTemplate(ctx, req.(*GetNotificationTemplateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _NotificationTemplateService_DeleteNotificationTemplate_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteNotificationTemplateRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NotificationTemplateServiceServer).DeleteNotificationTemplate(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: NotificationTemplateService_DeleteNotificationTemplate_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NotificationTemplateServiceServer).DeleteNotificationTemplate(ctx, req.(*DeleteNotificationTemplateRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _NotificationTemplateService_GetNotificationTemplateList_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(GetNotificationTemplateListRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(NotificationTemplateServiceServer).GetNotificationTemplateList(m, &notificationTemplateServiceGetNotificationTemplateListServer{stream})
}

type NotificationTemplateService_GetNotificationTemplateListServer interface {
	Send(*GetNotificationTemplateListResponse) error
	grpc.ServerStream
}

type notificationTemplateServiceGetNotificationTemplateListServer struct {
	grpc.ServerStream
}

func (x *notificationTemplateServiceGetNotificationTemplateListServer) Send(m *GetNotificationTemplateListResponse) error {
	return x.ServerStream.SendMsg(m)
}

func _NotificationTemplateService_GetNotificationTemplateCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetNotificationTemplateCountRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NotificationTemplateServiceServer).GetNotificationTemplateCount(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: NotificationTemplateService_GetNotificationTemplateCount_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NotificationTemplateServiceServer).GetNotificationTemplateCount(ctx, req.(*GetNotificationTemplateCountRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _NotificationTemplateService_PutNotificationTemplatePartnerAttach_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PutNotificationTemplatePartnerAttachRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NotificationTemplateServiceServer).PutNotificationTemplatePartnerAttach(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: NotificationTemplateService_PutNotificationTemplatePartnerAttach_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NotificationTemplateServiceServer).PutNotificationTemplatePartnerAttach(ctx, req.(*PutNotificationTemplatePartnerAttachRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _NotificationTemplateService_PutNotificationTemplatePartnerDetach_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(PutNotificationTemplatePartnerDetachRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NotificationTemplateServiceServer).PutNotificationTemplatePartnerDetach(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: NotificationTemplateService_PutNotificationTemplatePartnerDetach_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NotificationTemplateServiceServer).PutNotificationTemplatePartnerDetach(ctx, req.(*PutNotificationTemplatePartnerDetachRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// NotificationTemplateService_ServiceDesc is the grpc.ServiceDesc for NotificationTemplateService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var NotificationTemplateService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "keyapis.multiapp.v1.NotificationTemplateService",
	HandlerType: (*NotificationTemplateServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "PostNotificationTemplate",
			Handler:    _NotificationTemplateService_PostNotificationTemplate_Handler,
		},
		{
			MethodName: "GetNotificationTemplate",
			Handler:    _NotificationTemplateService_GetNotificationTemplate_Handler,
		},
		{
			MethodName: "DeleteNotificationTemplate",
			Handler:    _NotificationTemplateService_DeleteNotificationTemplate_Handler,
		},
		{
			MethodName: "GetNotificationTemplateCount",
			Handler:    _NotificationTemplateService_GetNotificationTemplateCount_Handler,
		},
		{
			MethodName: "PutNotificationTemplatePartnerAttach",
			Handler:    _NotificationTemplateService_PutNotificationTemplatePartnerAttach_Handler,
		},
		{
			MethodName: "PutNotificationTemplatePartnerDetach",
			Handler:    _NotificationTemplateService_PutNotificationTemplatePartnerDetach_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "GetNotificationTemplateList",
			Handler:       _NotificationTemplateService_GetNotificationTemplateList_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "keyapis/multiapp/v1/keyapis_multiapp_notification_template_v1.proto",
}
