// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             (unknown)
// source: saas/v1alpha1/apikey_service.proto

package saasv1alpha1

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.62.0 or later.
const _ = grpc.SupportPackageIsVersion8

const (
	ApiKeyService_CreateAPIKey_FullMethodName = "/saas.v1alpha1.ApiKeyService/CreateAPIKey"
	ApiKeyService_DeleteAPIKey_FullMethodName = "/saas.v1alpha1.ApiKeyService/DeleteAPIKey"
	ApiKeyService_ListApiKey_FullMethodName   = "/saas.v1alpha1.ApiKeyService/ListApiKey"
)

// ApiKeyServiceClient is the client API for ApiKeyService 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 ApiKeyServiceClient interface {
	CreateAPIKey(ctx context.Context, in *CreateApiKeyRequest, opts ...grpc.CallOption) (ApiKeyService_CreateAPIKeyClient, error)
	DeleteAPIKey(ctx context.Context, in *DeleteApiKeyRequest, opts ...grpc.CallOption) (*DeleteApiKeyResponse, error)
	ListApiKey(ctx context.Context, in *ListApiKeyRequest, opts ...grpc.CallOption) (*ListApiKeyResponse, error)
}

type apiKeyServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewApiKeyServiceClient(cc grpc.ClientConnInterface) ApiKeyServiceClient {
	return &apiKeyServiceClient{cc}
}

func (c *apiKeyServiceClient) CreateAPIKey(ctx context.Context, in *CreateApiKeyRequest, opts ...grpc.CallOption) (ApiKeyService_CreateAPIKeyClient, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &ApiKeyService_ServiceDesc.Streams[0], ApiKeyService_CreateAPIKey_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &apiKeyServiceCreateAPIKeyClient{ClientStream: 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 ApiKeyService_CreateAPIKeyClient interface {
	Recv() (*CreateApiKeyResponse, error)
	grpc.ClientStream
}

type apiKeyServiceCreateAPIKeyClient struct {
	grpc.ClientStream
}

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

func (c *apiKeyServiceClient) DeleteAPIKey(ctx context.Context, in *DeleteApiKeyRequest, opts ...grpc.CallOption) (*DeleteApiKeyResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(DeleteApiKeyResponse)
	err := c.cc.Invoke(ctx, ApiKeyService_DeleteAPIKey_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *apiKeyServiceClient) ListApiKey(ctx context.Context, in *ListApiKeyRequest, opts ...grpc.CallOption) (*ListApiKeyResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ListApiKeyResponse)
	err := c.cc.Invoke(ctx, ApiKeyService_ListApiKey_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// ApiKeyServiceServer is the server API for ApiKeyService service.
// All implementations should embed UnimplementedApiKeyServiceServer
// for forward compatibility.
type ApiKeyServiceServer interface {
	CreateAPIKey(*CreateApiKeyRequest, ApiKeyService_CreateAPIKeyServer) error
	DeleteAPIKey(context.Context, *DeleteApiKeyRequest) (*DeleteApiKeyResponse, error)
	ListApiKey(context.Context, *ListApiKeyRequest) (*ListApiKeyResponse, error)
}

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

func (UnimplementedApiKeyServiceServer) CreateAPIKey(*CreateApiKeyRequest, ApiKeyService_CreateAPIKeyServer) error {
	return status.Errorf(codes.Unimplemented, "method CreateAPIKey not implemented")
}
func (UnimplementedApiKeyServiceServer) DeleteAPIKey(context.Context, *DeleteApiKeyRequest) (*DeleteApiKeyResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method DeleteAPIKey not implemented")
}
func (UnimplementedApiKeyServiceServer) ListApiKey(context.Context, *ListApiKeyRequest) (*ListApiKeyResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ListApiKey not implemented")
}
func (UnimplementedApiKeyServiceServer) testEmbeddedByValue() {}

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

func RegisterApiKeyServiceServer(s grpc.ServiceRegistrar, srv ApiKeyServiceServer) {
	// If the following call pancis, it indicates UnimplementedApiKeyServiceServer 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(&ApiKeyService_ServiceDesc, srv)
}

func _ApiKeyService_CreateAPIKey_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(CreateApiKeyRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(ApiKeyServiceServer).CreateAPIKey(m, &apiKeyServiceCreateAPIKeyServer{ServerStream: stream})
}

type ApiKeyService_CreateAPIKeyServer interface {
	Send(*CreateApiKeyResponse) error
	grpc.ServerStream
}

type apiKeyServiceCreateAPIKeyServer struct {
	grpc.ServerStream
}

func (x *apiKeyServiceCreateAPIKeyServer) Send(m *CreateApiKeyResponse) error {
	return x.ServerStream.SendMsg(m)
}

func _ApiKeyService_DeleteAPIKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(DeleteApiKeyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ApiKeyServiceServer).DeleteAPIKey(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ApiKeyService_DeleteAPIKey_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ApiKeyServiceServer).DeleteAPIKey(ctx, req.(*DeleteApiKeyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _ApiKeyService_ListApiKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ListApiKeyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(ApiKeyServiceServer).ListApiKey(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: ApiKeyService_ListApiKey_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(ApiKeyServiceServer).ListApiKey(ctx, req.(*ListApiKeyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// ApiKeyService_ServiceDesc is the grpc.ServiceDesc for ApiKeyService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ApiKeyService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "saas.v1alpha1.ApiKeyService",
	HandlerType: (*ApiKeyServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "DeleteAPIKey",
			Handler:    _ApiKeyService_DeleteAPIKey_Handler,
		},
		{
			MethodName: "ListApiKey",
			Handler:    _ApiKeyService_ListApiKey_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "CreateAPIKey",
			Handler:       _ApiKeyService_CreateAPIKey_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "saas/v1alpha1/apikey_service.proto",
}
