// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.6
// 	protoc        v3.19.0
// source: interservice/notifications/service/server.proto

package service

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

var File_interservice_notifications_service_server_proto protoreflect.FileDescriptor

const file_interservice_notifications_service_server_proto_rawDesc = "" +
	"\n" +
	"/interservice/notifications/service/server.proto\x12*chef.automate.domain.notifications.service\x1a/interservice/notifications/service/events.proto\x1a.interservice/notifications/service/rules.proto\x1a/interservice/notifications/service/health.proto2\xa8\b\n" +
	"\rNotifications\x12q\n" +
	"\x06Notify\x121.chef.automate.domain.notifications.service.Event\x1a4.chef.automate.domain.notifications.service.Response\x12x\n" +
	"\aAddRule\x120.chef.automate.domain.notifications.service.Rule\x1a;.chef.automate.domain.notifications.service.RuleAddResponse\x12\x88\x01\n" +
	"\n" +
	"DeleteRule\x12:.chef.automate.domain.notifications.service.RuleIdentifier\x1a>.chef.automate.domain.notifications.service.RuleDeleteResponse\x12~\n" +
	"\n" +
	"UpdateRule\x120.chef.automate.domain.notifications.service.Rule\x1a>.chef.automate.domain.notifications.service.RuleUpdateResponse\x12\x82\x01\n" +
	"\aGetRule\x12:.chef.automate.domain.notifications.service.RuleIdentifier\x1a;.chef.automate.domain.notifications.service.RuleGetResponse\x12|\n" +
	"\tListRules\x121.chef.automate.domain.notifications.service.Empty\x1a<.chef.automate.domain.notifications.service.RuleListResponse\x12\x96\x01\n" +
	"\x0fValidateWebhook\x12@.chef.automate.domain.notifications.service.URLValidationRequest\x1aA.chef.automate.domain.notifications.service.URLValidationResponse\x12\x82\x01\n" +
	"\aVersion\x12:.chef.automate.domain.notifications.service.VersionRequest\x1a;.chef.automate.domain.notifications.service.VersionResponseBAZ?github.com/chef/automate/api/interservice/notifications/serviceb\x06proto3"

var file_interservice_notifications_service_server_proto_goTypes = []any{
	(*Event)(nil),                 // 0: chef.automate.domain.notifications.service.Event
	(*Rule)(nil),                  // 1: chef.automate.domain.notifications.service.Rule
	(*RuleIdentifier)(nil),        // 2: chef.automate.domain.notifications.service.RuleIdentifier
	(*Empty)(nil),                 // 3: chef.automate.domain.notifications.service.Empty
	(*URLValidationRequest)(nil),  // 4: chef.automate.domain.notifications.service.URLValidationRequest
	(*VersionRequest)(nil),        // 5: chef.automate.domain.notifications.service.VersionRequest
	(*Response)(nil),              // 6: chef.automate.domain.notifications.service.Response
	(*RuleAddResponse)(nil),       // 7: chef.automate.domain.notifications.service.RuleAddResponse
	(*RuleDeleteResponse)(nil),    // 8: chef.automate.domain.notifications.service.RuleDeleteResponse
	(*RuleUpdateResponse)(nil),    // 9: chef.automate.domain.notifications.service.RuleUpdateResponse
	(*RuleGetResponse)(nil),       // 10: chef.automate.domain.notifications.service.RuleGetResponse
	(*RuleListResponse)(nil),      // 11: chef.automate.domain.notifications.service.RuleListResponse
	(*URLValidationResponse)(nil), // 12: chef.automate.domain.notifications.service.URLValidationResponse
	(*VersionResponse)(nil),       // 13: chef.automate.domain.notifications.service.VersionResponse
}
var file_interservice_notifications_service_server_proto_depIdxs = []int32{
	0,  // 0: chef.automate.domain.notifications.service.Notifications.Notify:input_type -> chef.automate.domain.notifications.service.Event
	1,  // 1: chef.automate.domain.notifications.service.Notifications.AddRule:input_type -> chef.automate.domain.notifications.service.Rule
	2,  // 2: chef.automate.domain.notifications.service.Notifications.DeleteRule:input_type -> chef.automate.domain.notifications.service.RuleIdentifier
	1,  // 3: chef.automate.domain.notifications.service.Notifications.UpdateRule:input_type -> chef.automate.domain.notifications.service.Rule
	2,  // 4: chef.automate.domain.notifications.service.Notifications.GetRule:input_type -> chef.automate.domain.notifications.service.RuleIdentifier
	3,  // 5: chef.automate.domain.notifications.service.Notifications.ListRules:input_type -> chef.automate.domain.notifications.service.Empty
	4,  // 6: chef.automate.domain.notifications.service.Notifications.ValidateWebhook:input_type -> chef.automate.domain.notifications.service.URLValidationRequest
	5,  // 7: chef.automate.domain.notifications.service.Notifications.Version:input_type -> chef.automate.domain.notifications.service.VersionRequest
	6,  // 8: chef.automate.domain.notifications.service.Notifications.Notify:output_type -> chef.automate.domain.notifications.service.Response
	7,  // 9: chef.automate.domain.notifications.service.Notifications.AddRule:output_type -> chef.automate.domain.notifications.service.RuleAddResponse
	8,  // 10: chef.automate.domain.notifications.service.Notifications.DeleteRule:output_type -> chef.automate.domain.notifications.service.RuleDeleteResponse
	9,  // 11: chef.automate.domain.notifications.service.Notifications.UpdateRule:output_type -> chef.automate.domain.notifications.service.RuleUpdateResponse
	10, // 12: chef.automate.domain.notifications.service.Notifications.GetRule:output_type -> chef.automate.domain.notifications.service.RuleGetResponse
	11, // 13: chef.automate.domain.notifications.service.Notifications.ListRules:output_type -> chef.automate.domain.notifications.service.RuleListResponse
	12, // 14: chef.automate.domain.notifications.service.Notifications.ValidateWebhook:output_type -> chef.automate.domain.notifications.service.URLValidationResponse
	13, // 15: chef.automate.domain.notifications.service.Notifications.Version:output_type -> chef.automate.domain.notifications.service.VersionResponse
	8,  // [8:16] is the sub-list for method output_type
	0,  // [0:8] is the sub-list for method input_type
	0,  // [0:0] is the sub-list for extension type_name
	0,  // [0:0] is the sub-list for extension extendee
	0,  // [0:0] is the sub-list for field type_name
}

func init() { file_interservice_notifications_service_server_proto_init() }
func file_interservice_notifications_service_server_proto_init() {
	if File_interservice_notifications_service_server_proto != nil {
		return
	}
	file_interservice_notifications_service_events_proto_init()
	file_interservice_notifications_service_rules_proto_init()
	file_interservice_notifications_service_health_proto_init()
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_interservice_notifications_service_server_proto_rawDesc), len(file_interservice_notifications_service_server_proto_rawDesc)),
			NumEnums:      0,
			NumMessages:   0,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_interservice_notifications_service_server_proto_goTypes,
		DependencyIndexes: file_interservice_notifications_service_server_proto_depIdxs,
	}.Build()
	File_interservice_notifications_service_server_proto = out.File
	file_interservice_notifications_service_server_proto_goTypes = nil
	file_interservice_notifications_service_server_proto_depIdxs = nil
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConnInterface

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion6

// NotificationsClient is the client API for Notifications service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type NotificationsClient interface {
	// Publish a notification
	Notify(ctx context.Context, in *Event, opts ...grpc.CallOption) (*Response, error)
	// Manage notification alerting rules
	AddRule(ctx context.Context, in *Rule, opts ...grpc.CallOption) (*RuleAddResponse, error)
	DeleteRule(ctx context.Context, in *RuleIdentifier, opts ...grpc.CallOption) (*RuleDeleteResponse, error)
	UpdateRule(ctx context.Context, in *Rule, opts ...grpc.CallOption) (*RuleUpdateResponse, error)
	GetRule(ctx context.Context, in *RuleIdentifier, opts ...grpc.CallOption) (*RuleGetResponse, error)
	ListRules(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*RuleListResponse, error)
	ValidateWebhook(ctx context.Context, in *URLValidationRequest, opts ...grpc.CallOption) (*URLValidationResponse, error)
	// Health checks and metadata
	Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error)
}

type notificationsClient struct {
	cc grpc.ClientConnInterface
}

func NewNotificationsClient(cc grpc.ClientConnInterface) NotificationsClient {
	return &notificationsClient{cc}
}

func (c *notificationsClient) Notify(ctx context.Context, in *Event, opts ...grpc.CallOption) (*Response, error) {
	out := new(Response)
	err := c.cc.Invoke(ctx, "/chef.automate.domain.notifications.service.Notifications/Notify", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *notificationsClient) AddRule(ctx context.Context, in *Rule, opts ...grpc.CallOption) (*RuleAddResponse, error) {
	out := new(RuleAddResponse)
	err := c.cc.Invoke(ctx, "/chef.automate.domain.notifications.service.Notifications/AddRule", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *notificationsClient) DeleteRule(ctx context.Context, in *RuleIdentifier, opts ...grpc.CallOption) (*RuleDeleteResponse, error) {
	out := new(RuleDeleteResponse)
	err := c.cc.Invoke(ctx, "/chef.automate.domain.notifications.service.Notifications/DeleteRule", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *notificationsClient) UpdateRule(ctx context.Context, in *Rule, opts ...grpc.CallOption) (*RuleUpdateResponse, error) {
	out := new(RuleUpdateResponse)
	err := c.cc.Invoke(ctx, "/chef.automate.domain.notifications.service.Notifications/UpdateRule", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *notificationsClient) GetRule(ctx context.Context, in *RuleIdentifier, opts ...grpc.CallOption) (*RuleGetResponse, error) {
	out := new(RuleGetResponse)
	err := c.cc.Invoke(ctx, "/chef.automate.domain.notifications.service.Notifications/GetRule", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *notificationsClient) ListRules(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*RuleListResponse, error) {
	out := new(RuleListResponse)
	err := c.cc.Invoke(ctx, "/chef.automate.domain.notifications.service.Notifications/ListRules", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *notificationsClient) ValidateWebhook(ctx context.Context, in *URLValidationRequest, opts ...grpc.CallOption) (*URLValidationResponse, error) {
	out := new(URLValidationResponse)
	err := c.cc.Invoke(ctx, "/chef.automate.domain.notifications.service.Notifications/ValidateWebhook", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *notificationsClient) Version(ctx context.Context, in *VersionRequest, opts ...grpc.CallOption) (*VersionResponse, error) {
	out := new(VersionResponse)
	err := c.cc.Invoke(ctx, "/chef.automate.domain.notifications.service.Notifications/Version", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// NotificationsServer is the server API for Notifications service.
type NotificationsServer interface {
	// Publish a notification
	Notify(context.Context, *Event) (*Response, error)
	// Manage notification alerting rules
	AddRule(context.Context, *Rule) (*RuleAddResponse, error)
	DeleteRule(context.Context, *RuleIdentifier) (*RuleDeleteResponse, error)
	UpdateRule(context.Context, *Rule) (*RuleUpdateResponse, error)
	GetRule(context.Context, *RuleIdentifier) (*RuleGetResponse, error)
	ListRules(context.Context, *Empty) (*RuleListResponse, error)
	ValidateWebhook(context.Context, *URLValidationRequest) (*URLValidationResponse, error)
	// Health checks and metadata
	Version(context.Context, *VersionRequest) (*VersionResponse, error)
}

// UnimplementedNotificationsServer can be embedded to have forward compatible implementations.
type UnimplementedNotificationsServer struct {
}

func (*UnimplementedNotificationsServer) Notify(context.Context, *Event) (*Response, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Notify not implemented")
}
func (*UnimplementedNotificationsServer) AddRule(context.Context, *Rule) (*RuleAddResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method AddRule not implemented")
}
func (*UnimplementedNotificationsServer) DeleteRule(context.Context, *RuleIdentifier) (*RuleDeleteResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteRule not implemented")
}
func (*UnimplementedNotificationsServer) UpdateRule(context.Context, *Rule) (*RuleUpdateResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method UpdateRule not implemented")
}
func (*UnimplementedNotificationsServer) GetRule(context.Context, *RuleIdentifier) (*RuleGetResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetRule not implemented")
}
func (*UnimplementedNotificationsServer) ListRules(context.Context, *Empty) (*RuleListResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListRules not implemented")
}
func (*UnimplementedNotificationsServer) ValidateWebhook(context.Context, *URLValidationRequest) (*URLValidationResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ValidateWebhook not implemented")
}
func (*UnimplementedNotificationsServer) Version(context.Context, *VersionRequest) (*VersionResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Version not implemented")
}

func RegisterNotificationsServer(s *grpc.Server, srv NotificationsServer) {
	s.RegisterService(&_Notifications_serviceDesc, srv)
}

func _Notifications_Notify_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Event)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NotificationsServer).Notify(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/chef.automate.domain.notifications.service.Notifications/Notify",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NotificationsServer).Notify(ctx, req.(*Event))
	}
	return interceptor(ctx, in, info, handler)
}

func _Notifications_AddRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Rule)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NotificationsServer).AddRule(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/chef.automate.domain.notifications.service.Notifications/AddRule",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NotificationsServer).AddRule(ctx, req.(*Rule))
	}
	return interceptor(ctx, in, info, handler)
}

func _Notifications_DeleteRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RuleIdentifier)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NotificationsServer).DeleteRule(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/chef.automate.domain.notifications.service.Notifications/DeleteRule",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NotificationsServer).DeleteRule(ctx, req.(*RuleIdentifier))
	}
	return interceptor(ctx, in, info, handler)
}

func _Notifications_UpdateRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Rule)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NotificationsServer).UpdateRule(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/chef.automate.domain.notifications.service.Notifications/UpdateRule",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NotificationsServer).UpdateRule(ctx, req.(*Rule))
	}
	return interceptor(ctx, in, info, handler)
}

func _Notifications_GetRule_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RuleIdentifier)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NotificationsServer).GetRule(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/chef.automate.domain.notifications.service.Notifications/GetRule",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NotificationsServer).GetRule(ctx, req.(*RuleIdentifier))
	}
	return interceptor(ctx, in, info, handler)
}

func _Notifications_ListRules_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NotificationsServer).ListRules(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/chef.automate.domain.notifications.service.Notifications/ListRules",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NotificationsServer).ListRules(ctx, req.(*Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _Notifications_ValidateWebhook_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(URLValidationRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NotificationsServer).ValidateWebhook(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/chef.automate.domain.notifications.service.Notifications/ValidateWebhook",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NotificationsServer).ValidateWebhook(ctx, req.(*URLValidationRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _Notifications_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(VersionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(NotificationsServer).Version(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/chef.automate.domain.notifications.service.Notifications/Version",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(NotificationsServer).Version(ctx, req.(*VersionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _Notifications_serviceDesc = grpc.ServiceDesc{
	ServiceName: "chef.automate.domain.notifications.service.Notifications",
	HandlerType: (*NotificationsServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Notify",
			Handler:    _Notifications_Notify_Handler,
		},
		{
			MethodName: "AddRule",
			Handler:    _Notifications_AddRule_Handler,
		},
		{
			MethodName: "DeleteRule",
			Handler:    _Notifications_DeleteRule_Handler,
		},
		{
			MethodName: "UpdateRule",
			Handler:    _Notifications_UpdateRule_Handler,
		},
		{
			MethodName: "GetRule",
			Handler:    _Notifications_GetRule_Handler,
		},
		{
			MethodName: "ListRules",
			Handler:    _Notifications_ListRules_Handler,
		},
		{
			MethodName: "ValidateWebhook",
			Handler:    _Notifications_ValidateWebhook_Handler,
		},
		{
			MethodName: "Version",
			Handler:    _Notifications_Version_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "interservice/notifications/service/server.proto",
}
