// Code generated by protoc-gen-go. DO NOT EDIT.
// source: api/permissionservice/permissionservice.proto

package permissionservice

import (
	context "context"
	fmt "fmt"
	proto "github.com/golang/protobuf/proto"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	math "math"
	noteservice "permissionservice/api/noteservice"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package

type Request struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *Request) Reset()         { *m = Request{} }
func (m *Request) String() string { return proto.CompactTextString(m) }
func (*Request) ProtoMessage()    {}
func (*Request) Descriptor() ([]byte, []int) {
	return fileDescriptor_0df56f18f32b3b9a, []int{0}
}

func (m *Request) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_Request.Unmarshal(m, b)
}
func (m *Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_Request.Marshal(b, m, deterministic)
}
func (m *Request) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Request.Merge(m, src)
}
func (m *Request) XXX_Size() int {
	return xxx_messageInfo_Request.Size(m)
}
func (m *Request) XXX_DiscardUnknown() {
	xxx_messageInfo_Request.DiscardUnknown(m)
}

var xxx_messageInfo_Request proto.InternalMessageInfo

type ShareRequest struct {
	NoteId               string       `protobuf:"bytes,1,opt,name=noteId,proto3" json:"noteId,omitempty"`
	Email                string       `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
	Permissions          *Permissions `protobuf:"bytes,3,opt,name=permissions,proto3" json:"permissions,omitempty"`
	XXX_NoUnkeyedLiteral struct{}     `json:"-"`
	XXX_unrecognized     []byte       `json:"-"`
	XXX_sizecache        int32        `json:"-"`
}

func (m *ShareRequest) Reset()         { *m = ShareRequest{} }
func (m *ShareRequest) String() string { return proto.CompactTextString(m) }
func (*ShareRequest) ProtoMessage()    {}
func (*ShareRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_0df56f18f32b3b9a, []int{1}
}

func (m *ShareRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ShareRequest.Unmarshal(m, b)
}
func (m *ShareRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ShareRequest.Marshal(b, m, deterministic)
}
func (m *ShareRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ShareRequest.Merge(m, src)
}
func (m *ShareRequest) XXX_Size() int {
	return xxx_messageInfo_ShareRequest.Size(m)
}
func (m *ShareRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_ShareRequest.DiscardUnknown(m)
}

var xxx_messageInfo_ShareRequest proto.InternalMessageInfo

func (m *ShareRequest) GetNoteId() string {
	if m != nil {
		return m.NoteId
	}
	return ""
}

func (m *ShareRequest) GetEmail() string {
	if m != nil {
		return m.Email
	}
	return ""
}

func (m *ShareRequest) GetPermissions() *Permissions {
	if m != nil {
		return m.Permissions
	}
	return nil
}

type Permissions struct {
	Read                 bool     `protobuf:"varint,1,opt,name=read,proto3" json:"read,omitempty"`
	Write                bool     `protobuf:"varint,2,opt,name=write,proto3" json:"write,omitempty"`
	Delete               bool     `protobuf:"varint,3,opt,name=delete,proto3" json:"delete,omitempty"`
	Share                bool     `protobuf:"varint,4,opt,name=share,proto3" json:"share,omitempty"`
	Owner                bool     `protobuf:"varint,5,opt,name=owner,proto3" json:"owner,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *Permissions) Reset()         { *m = Permissions{} }
func (m *Permissions) String() string { return proto.CompactTextString(m) }
func (*Permissions) ProtoMessage()    {}
func (*Permissions) Descriptor() ([]byte, []int) {
	return fileDescriptor_0df56f18f32b3b9a, []int{2}
}

func (m *Permissions) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_Permissions.Unmarshal(m, b)
}
func (m *Permissions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_Permissions.Marshal(b, m, deterministic)
}
func (m *Permissions) XXX_Merge(src proto.Message) {
	xxx_messageInfo_Permissions.Merge(m, src)
}
func (m *Permissions) XXX_Size() int {
	return xxx_messageInfo_Permissions.Size(m)
}
func (m *Permissions) XXX_DiscardUnknown() {
	xxx_messageInfo_Permissions.DiscardUnknown(m)
}

var xxx_messageInfo_Permissions proto.InternalMessageInfo

func (m *Permissions) GetRead() bool {
	if m != nil {
		return m.Read
	}
	return false
}

func (m *Permissions) GetWrite() bool {
	if m != nil {
		return m.Write
	}
	return false
}

func (m *Permissions) GetDelete() bool {
	if m != nil {
		return m.Delete
	}
	return false
}

func (m *Permissions) GetShare() bool {
	if m != nil {
		return m.Share
	}
	return false
}

func (m *Permissions) GetOwner() bool {
	if m != nil {
		return m.Owner
	}
	return false
}

func init() {
	proto.RegisterType((*Request)(nil), "permissionservice.Request")
	proto.RegisterType((*ShareRequest)(nil), "permissionservice.ShareRequest")
	proto.RegisterType((*Permissions)(nil), "permissionservice.Permissions")
}

func init() {
	proto.RegisterFile("api/permissionservice/permissionservice.proto", fileDescriptor_0df56f18f32b3b9a)
}

var fileDescriptor_0df56f18f32b3b9a = []byte{
	// 335 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xa4, 0x52, 0x5d, 0x4b, 0xc3, 0x30,
	0x14, 0x75, 0xee, 0xc3, 0xf6, 0x56, 0x94, 0x05, 0x91, 0xda, 0x07, 0x75, 0x7d, 0xf2, 0xc5, 0x2a,
	0xf3, 0x0f, 0x08, 0xea, 0x83, 0x0a, 0x4e, 0x33, 0xfc, 0x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 0xee,
	0x4a, 0xae, 0xc0, 0x7b, 0x41, 0xf5, 0xa0, 0x53, 0x23, 0xd1, 0x8a, 0x5b, 0xea, 0xa8, 0xa2, 0x83,
	0xc4, 0x4d, 0x56, 0xeb, 0x29, 0xca, 0x52, 0xeb, 0xe2, 0x0d, 0xf2, 0x04, 0xbb, 0x2c, 0xcb, 0x46,
	0xe2, 0xb9, 0xcc, 0x98, 0x42, 0x5d, 0x24, 0x83, 0x86, 0x7e, 0x54, 0x99, 0x33, 0x55, 0x59, 0xaf,
	0x65, 0x79, 0x03, 0x60, 0x6f, 0x34, 0x6e, 0xd1, 0x2f, 0xe9, 0xb5, 0x29, 0xac, 0x65, 0x73, 0x07,
	0xbe, 0xc9, 0xc4, 0xb8, 0x1c, 0xad, 0xb8, 0xcf, 0xfd, 0x0f, 0xd1, 0x1f, 0x01, 0x54, 0x5e, 0xf7,
	0xb0, 0x23, 0xe7, 0xa9, 0x9c, 0x08, 0x9e, 0xe2, 0xff, 0x02, 0x3b, 0x6f, 0xa5, 0x3d, 0xf3, 0x39,
	0x2f, 0xbe, 0x03, 0x00, 0x00, 0xff, 0xff, 0x49, 0xe0, 0x13, 0x53, 0x03, 0x03, 0x00, 0x00,
}

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

// 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.SupportPackageIsVersion4

// PermissionServiceClient is the client API for PermissionService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type PermissionServiceClient interface {
	GetNotes(ctx context.Context, in *Request, opts ...grpc.CallOption) (*noteservice.NoteResponse, error)
	AddOrUpdateNote(ctx context.Context, in *noteservice.NoteOperationRequest, opts ...grpc.CallOption) (*noteservice.NoteResponse, error)
	DeleteNote(ctx context.Context, in *noteservice.DeleteRequest, opts ...grpc.CallOption) (*noteservice.NoteResponse, error)
	ShareNote(ctx context.Context, in *ShareRequest, opts ...grpc.CallOption) (*Request, error)
	SubscribeNotes(ctx context.Context, in *Request, opts ...grpc.CallOption) (PermissionService_SubscribeNotesClient, error)
}

type permissionServiceClient struct {
	cc *grpc.ClientConn
}

func NewPermissionServiceClient(cc *grpc.ClientConn) PermissionServiceClient {
	return &permissionServiceClient{cc}
}

func (c *permissionServiceClient) GetNotes(ctx context.Context, in *Request, opts ...grpc.CallOption) (*noteservice.NoteResponse, error) {
	out := new(noteservice.NoteResponse)
	err := c.cc.Invoke(ctx, "/permissionservice.PermissionService/getNotes", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *permissionServiceClient) AddOrUpdateNote(ctx context.Context, in *noteservice.NoteOperationRequest, opts ...grpc.CallOption) (*noteservice.NoteResponse, error) {
	out := new(noteservice.NoteResponse)
	err := c.cc.Invoke(ctx, "/permissionservice.PermissionService/addOrUpdateNote", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *permissionServiceClient) DeleteNote(ctx context.Context, in *noteservice.DeleteRequest, opts ...grpc.CallOption) (*noteservice.NoteResponse, error) {
	out := new(noteservice.NoteResponse)
	err := c.cc.Invoke(ctx, "/permissionservice.PermissionService/deleteNote", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *permissionServiceClient) ShareNote(ctx context.Context, in *ShareRequest, opts ...grpc.CallOption) (*Request, error) {
	out := new(Request)
	err := c.cc.Invoke(ctx, "/permissionservice.PermissionService/shareNote", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *permissionServiceClient) SubscribeNotes(ctx context.Context, in *Request, opts ...grpc.CallOption) (PermissionService_SubscribeNotesClient, error) {
	stream, err := c.cc.NewStream(ctx, &_PermissionService_serviceDesc.Streams[0], "/permissionservice.PermissionService/subscribeNotes", opts...)
	if err != nil {
		return nil, err
	}
	x := &permissionServiceSubscribeNotesClient{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 PermissionService_SubscribeNotesClient interface {
	Recv() (*noteservice.NoteResponse, error)
	grpc.ClientStream
}

type permissionServiceSubscribeNotesClient struct {
	grpc.ClientStream
}

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

// PermissionServiceServer is the server API for PermissionService service.
type PermissionServiceServer interface {
	GetNotes(context.Context, *Request) (*noteservice.NoteResponse, error)
	AddOrUpdateNote(context.Context, *noteservice.NoteOperationRequest) (*noteservice.NoteResponse, error)
	DeleteNote(context.Context, *noteservice.DeleteRequest) (*noteservice.NoteResponse, error)
	ShareNote(context.Context, *ShareRequest) (*Request, error)
	SubscribeNotes(*Request, PermissionService_SubscribeNotesServer) error
}

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

func (*UnimplementedPermissionServiceServer) GetNotes(ctx context.Context, req *Request) (*noteservice.NoteResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetNotes not implemented")
}
func (*UnimplementedPermissionServiceServer) AddOrUpdateNote(ctx context.Context, req *noteservice.NoteOperationRequest) (*noteservice.NoteResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method AddOrUpdateNote not implemented")
}
func (*UnimplementedPermissionServiceServer) DeleteNote(ctx context.Context, req *noteservice.DeleteRequest) (*noteservice.NoteResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteNote not implemented")
}
func (*UnimplementedPermissionServiceServer) ShareNote(ctx context.Context, req *ShareRequest) (*Request, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ShareNote not implemented")
}
func (*UnimplementedPermissionServiceServer) SubscribeNotes(req *Request, srv PermissionService_SubscribeNotesServer) error {
	return status.Errorf(codes.Unimplemented, "method SubscribeNotes not implemented")
}

func RegisterPermissionServiceServer(s *grpc.Server, srv PermissionServiceServer) {
	s.RegisterService(&_PermissionService_serviceDesc, srv)
}

func _PermissionService_GetNotes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Request)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PermissionServiceServer).GetNotes(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/permissionservice.PermissionService/GetNotes",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PermissionServiceServer).GetNotes(ctx, req.(*Request))
	}
	return interceptor(ctx, in, info, handler)
}

func _PermissionService_AddOrUpdateNote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(noteservice.NoteOperationRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PermissionServiceServer).AddOrUpdateNote(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/permissionservice.PermissionService/AddOrUpdateNote",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PermissionServiceServer).AddOrUpdateNote(ctx, req.(*noteservice.NoteOperationRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PermissionService_DeleteNote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(noteservice.DeleteRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PermissionServiceServer).DeleteNote(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/permissionservice.PermissionService/DeleteNote",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PermissionServiceServer).DeleteNote(ctx, req.(*noteservice.DeleteRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PermissionService_ShareNote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ShareRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PermissionServiceServer).ShareNote(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/permissionservice.PermissionService/ShareNote",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PermissionServiceServer).ShareNote(ctx, req.(*ShareRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _PermissionService_SubscribeNotes_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(Request)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(PermissionServiceServer).SubscribeNotes(m, &permissionServiceSubscribeNotesServer{stream})
}

type PermissionService_SubscribeNotesServer interface {
	Send(*noteservice.NoteResponse) error
	grpc.ServerStream
}

type permissionServiceSubscribeNotesServer struct {
	grpc.ServerStream
}

func (x *permissionServiceSubscribeNotesServer) Send(m *noteservice.NoteResponse) error {
	return x.ServerStream.SendMsg(m)
}

var _PermissionService_serviceDesc = grpc.ServiceDesc{
	ServiceName: "permissionservice.PermissionService",
	HandlerType: (*PermissionServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "getNotes",
			Handler:    _PermissionService_GetNotes_Handler,
		},
		{
			MethodName: "addOrUpdateNote",
			Handler:    _PermissionService_AddOrUpdateNote_Handler,
		},
		{
			MethodName: "deleteNote",
			Handler:    _PermissionService_DeleteNote_Handler,
		},
		{
			MethodName: "shareNote",
			Handler:    _PermissionService_ShareNote_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "subscribeNotes",
			Handler:       _PermissionService_SubscribeNotes_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "api/permissionservice/permissionservice.proto",
}
