// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v3.20.1
// source: pulumi/callback.proto

package pulumirpc

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

// CallbacksClient is the client API for Callbacks 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 CallbacksClient interface {
	// Invoke invokes a given callback, identified by its token.
	Invoke(ctx context.Context, in *CallbackInvokeRequest, opts ...grpc.CallOption) (*CallbackInvokeResponse, error)
}

type callbacksClient struct {
	cc grpc.ClientConnInterface
}

func NewCallbacksClient(cc grpc.ClientConnInterface) CallbacksClient {
	return &callbacksClient{cc}
}

func (c *callbacksClient) Invoke(ctx context.Context, in *CallbackInvokeRequest, opts ...grpc.CallOption) (*CallbackInvokeResponse, error) {
	out := new(CallbackInvokeResponse)
	err := c.cc.Invoke(ctx, "/pulumirpc.Callbacks/Invoke", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// CallbacksServer is the server API for Callbacks service.
// All implementations must embed UnimplementedCallbacksServer
// for forward compatibility
type CallbacksServer interface {
	// Invoke invokes a given callback, identified by its token.
	Invoke(context.Context, *CallbackInvokeRequest) (*CallbackInvokeResponse, error)
	mustEmbedUnimplementedCallbacksServer()
}

// UnimplementedCallbacksServer must be embedded to have forward compatible implementations.
type UnimplementedCallbacksServer struct {
}

func (UnimplementedCallbacksServer) Invoke(context.Context, *CallbackInvokeRequest) (*CallbackInvokeResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Invoke not implemented")
}
func (UnimplementedCallbacksServer) mustEmbedUnimplementedCallbacksServer() {}

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

func RegisterCallbacksServer(s grpc.ServiceRegistrar, srv CallbacksServer) {
	s.RegisterService(&Callbacks_ServiceDesc, srv)
}

func _Callbacks_Invoke_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CallbackInvokeRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CallbacksServer).Invoke(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/pulumirpc.Callbacks/Invoke",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CallbacksServer).Invoke(ctx, req.(*CallbackInvokeRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// Callbacks_ServiceDesc is the grpc.ServiceDesc for Callbacks service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Callbacks_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "pulumirpc.Callbacks",
	HandlerType: (*CallbacksServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Invoke",
			Handler:    _Callbacks_Invoke_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "pulumi/callback.proto",
}