// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc             v4.22.2
// source: token-provider.proto

package proto

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

// TokenProviderClient is the client API for TokenProvider 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 TokenProviderClient interface {
	GetToken(ctx context.Context, in *TokenRequest, opts ...grpc.CallOption) (*TokenResponse, error)
}

type tokenProviderClient struct {
	cc grpc.ClientConnInterface
}

func NewTokenProviderClient(cc grpc.ClientConnInterface) TokenProviderClient {
	return &tokenProviderClient{cc}
}

func (c *tokenProviderClient) GetToken(ctx context.Context, in *TokenRequest, opts ...grpc.CallOption) (*TokenResponse, error) {
	out := new(TokenResponse)
	err := c.cc.Invoke(ctx, "/proto.TokenProvider/GetToken", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// TokenProviderServer is the server API for TokenProvider service.
// All implementations must embed UnimplementedTokenProviderServer
// for forward compatibility
type TokenProviderServer interface {
	GetToken(context.Context, *TokenRequest) (*TokenResponse, error)
	mustEmbedUnimplementedTokenProviderServer()
}

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

func (UnimplementedTokenProviderServer) GetToken(context.Context, *TokenRequest) (*TokenResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetToken not implemented")
}
func (UnimplementedTokenProviderServer) mustEmbedUnimplementedTokenProviderServer() {}

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

func RegisterTokenProviderServer(s grpc.ServiceRegistrar, srv TokenProviderServer) {
	s.RegisterService(&TokenProvider_ServiceDesc, srv)
}

func _TokenProvider_GetToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(TokenRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TokenProviderServer).GetToken(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/proto.TokenProvider/GetToken",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TokenProviderServer).GetToken(ctx, req.(*TokenRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// TokenProvider_ServiceDesc is the grpc.ServiceDesc for TokenProvider service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var TokenProvider_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "proto.TokenProvider",
	HandlerType: (*TokenProviderServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetToken",
			Handler:    _TokenProvider_GetToken_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "token-provider.proto",
}
