// 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/lockbox/v1/payload_service.proto

package lockbox

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 (
	PayloadService_Get_FullMethodName   = "/yandex.cloud.lockbox.v1.PayloadService/Get"
	PayloadService_GetEx_FullMethodName = "/yandex.cloud.lockbox.v1.PayloadService/GetEx"
)

// PayloadServiceClient is the client API for PayloadService 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.
//
// Set of methods to access payload of secrets.
type PayloadServiceClient interface {
	// Returns the payload of the specified secret.
	//
	// To get the list of all available secrets, make a [SecretService.List] request.
	Get(ctx context.Context, in *GetPayloadRequest, opts ...grpc.CallOption) (*Payload, error)
	GetEx(ctx context.Context, in *GetExRequest, opts ...grpc.CallOption) (*GetExResponse, error)
}

type payloadServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewPayloadServiceClient(cc grpc.ClientConnInterface) PayloadServiceClient {
	return &payloadServiceClient{cc}
}

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

func (c *payloadServiceClient) GetEx(ctx context.Context, in *GetExRequest, opts ...grpc.CallOption) (*GetExResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(GetExResponse)
	err := c.cc.Invoke(ctx, PayloadService_GetEx_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// PayloadServiceServer is the server API for PayloadService service.
// All implementations should embed UnimplementedPayloadServiceServer
// for forward compatibility.
//
// Set of methods to access payload of secrets.
type PayloadServiceServer interface {
	// Returns the payload of the specified secret.
	//
	// To get the list of all available secrets, make a [SecretService.List] request.
	Get(context.Context, *GetPayloadRequest) (*Payload, error)
	GetEx(context.Context, *GetExRequest) (*GetExResponse, error)
}

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

func (UnimplementedPayloadServiceServer) Get(context.Context, *GetPayloadRequest) (*Payload, error) {
	return nil, status.Error(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedPayloadServiceServer) GetEx(context.Context, *GetExRequest) (*GetExResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method GetEx not implemented")
}
func (UnimplementedPayloadServiceServer) testEmbeddedByValue() {}

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

func RegisterPayloadServiceServer(s grpc.ServiceRegistrar, srv PayloadServiceServer) {
	// If the following call panics, it indicates UnimplementedPayloadServiceServer 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(&PayloadService_ServiceDesc, srv)
}

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

func _PayloadService_GetEx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetExRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(PayloadServiceServer).GetEx(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: PayloadService_GetEx_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(PayloadServiceServer).GetEx(ctx, req.(*GetExRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// PayloadService_ServiceDesc is the grpc.ServiceDesc for PayloadService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var PayloadService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.lockbox.v1.PayloadService",
	HandlerType: (*PayloadServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _PayloadService_Get_Handler,
		},
		{
			MethodName: "GetEx",
			Handler:    _PayloadService_GetEx_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/lockbox/v1/payload_service.proto",
}
