// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.0
// - protoc             v3.21.12
// source: agentapi.proto

package agentapi

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 (
	UI_ApplyProToken_FullMethodName        = "/agentapi.UI/ApplyProToken"
	UI_ApplyLandscapeConfig_FullMethodName = "/agentapi.UI/ApplyLandscapeConfig"
	UI_Ping_FullMethodName                 = "/agentapi.UI/Ping"
	UI_GetConfigSources_FullMethodName     = "/agentapi.UI/GetConfigSources"
	UI_NotifyPurchase_FullMethodName       = "/agentapi.UI/NotifyPurchase"
)

// UIClient is the client API for UI 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 UIClient interface {
	ApplyProToken(ctx context.Context, in *ProAttachInfo, opts ...grpc.CallOption) (*SubscriptionInfo, error)
	ApplyLandscapeConfig(ctx context.Context, in *LandscapeConfig, opts ...grpc.CallOption) (*LandscapeSource, error)
	Ping(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error)
	GetConfigSources(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ConfigSources, error)
	NotifyPurchase(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SubscriptionInfo, error)
}

type uIClient struct {
	cc grpc.ClientConnInterface
}

func NewUIClient(cc grpc.ClientConnInterface) UIClient {
	return &uIClient{cc}
}

func (c *uIClient) ApplyProToken(ctx context.Context, in *ProAttachInfo, opts ...grpc.CallOption) (*SubscriptionInfo, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubscriptionInfo)
	err := c.cc.Invoke(ctx, UI_ApplyProToken_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *uIClient) ApplyLandscapeConfig(ctx context.Context, in *LandscapeConfig, opts ...grpc.CallOption) (*LandscapeSource, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(LandscapeSource)
	err := c.cc.Invoke(ctx, UI_ApplyLandscapeConfig_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *uIClient) Ping(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Empty, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Empty)
	err := c.cc.Invoke(ctx, UI_Ping_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *uIClient) GetConfigSources(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*ConfigSources, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ConfigSources)
	err := c.cc.Invoke(ctx, UI_GetConfigSources_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *uIClient) NotifyPurchase(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*SubscriptionInfo, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SubscriptionInfo)
	err := c.cc.Invoke(ctx, UI_NotifyPurchase_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// UIServer is the server API for UI service.
// All implementations must embed UnimplementedUIServer
// for forward compatibility.
type UIServer interface {
	ApplyProToken(context.Context, *ProAttachInfo) (*SubscriptionInfo, error)
	ApplyLandscapeConfig(context.Context, *LandscapeConfig) (*LandscapeSource, error)
	Ping(context.Context, *Empty) (*Empty, error)
	GetConfigSources(context.Context, *Empty) (*ConfigSources, error)
	NotifyPurchase(context.Context, *Empty) (*SubscriptionInfo, error)
	mustEmbedUnimplementedUIServer()
}

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

func (UnimplementedUIServer) ApplyProToken(context.Context, *ProAttachInfo) (*SubscriptionInfo, error) {
	return nil, status.Error(codes.Unimplemented, "method ApplyProToken not implemented")
}
func (UnimplementedUIServer) ApplyLandscapeConfig(context.Context, *LandscapeConfig) (*LandscapeSource, error) {
	return nil, status.Error(codes.Unimplemented, "method ApplyLandscapeConfig not implemented")
}
func (UnimplementedUIServer) Ping(context.Context, *Empty) (*Empty, error) {
	return nil, status.Error(codes.Unimplemented, "method Ping not implemented")
}
func (UnimplementedUIServer) GetConfigSources(context.Context, *Empty) (*ConfigSources, error) {
	return nil, status.Error(codes.Unimplemented, "method GetConfigSources not implemented")
}
func (UnimplementedUIServer) NotifyPurchase(context.Context, *Empty) (*SubscriptionInfo, error) {
	return nil, status.Error(codes.Unimplemented, "method NotifyPurchase not implemented")
}
func (UnimplementedUIServer) mustEmbedUnimplementedUIServer() {}
func (UnimplementedUIServer) testEmbeddedByValue()            {}

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

func RegisterUIServer(s grpc.ServiceRegistrar, srv UIServer) {
	// If the following call panics, it indicates UnimplementedUIServer 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(&UI_ServiceDesc, srv)
}

func _UI_ApplyProToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ProAttachInfo)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UIServer).ApplyProToken(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: UI_ApplyProToken_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UIServer).ApplyProToken(ctx, req.(*ProAttachInfo))
	}
	return interceptor(ctx, in, info, handler)
}

func _UI_ApplyLandscapeConfig_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(LandscapeConfig)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UIServer).ApplyLandscapeConfig(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: UI_ApplyLandscapeConfig_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UIServer).ApplyLandscapeConfig(ctx, req.(*LandscapeConfig))
	}
	return interceptor(ctx, in, info, handler)
}

func _UI_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UIServer).Ping(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: UI_Ping_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UIServer).Ping(ctx, req.(*Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _UI_GetConfigSources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UIServer).GetConfigSources(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: UI_GetConfigSources_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UIServer).GetConfigSources(ctx, req.(*Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _UI_NotifyPurchase_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UIServer).NotifyPurchase(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: UI_NotifyPurchase_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UIServer).NotifyPurchase(ctx, req.(*Empty))
	}
	return interceptor(ctx, in, info, handler)
}

// UI_ServiceDesc is the grpc.ServiceDesc for UI service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var UI_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "agentapi.UI",
	HandlerType: (*UIServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ApplyProToken",
			Handler:    _UI_ApplyProToken_Handler,
		},
		{
			MethodName: "ApplyLandscapeConfig",
			Handler:    _UI_ApplyLandscapeConfig_Handler,
		},
		{
			MethodName: "Ping",
			Handler:    _UI_Ping_Handler,
		},
		{
			MethodName: "GetConfigSources",
			Handler:    _UI_GetConfigSources_Handler,
		},
		{
			MethodName: "NotifyPurchase",
			Handler:    _UI_NotifyPurchase_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "agentapi.proto",
}

const (
	WSLInstance_Connected_FullMethodName               = "/agentapi.WSLInstance/Connected"
	WSLInstance_ProAttachmentCommands_FullMethodName   = "/agentapi.WSLInstance/ProAttachmentCommands"
	WSLInstance_LandscapeConfigCommands_FullMethodName = "/agentapi.WSLInstance/LandscapeConfigCommands"
)

// WSLInstanceClient is the client API for WSLInstance 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 WSLInstanceClient interface {
	Connected(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[DistroInfo, Empty], error)
	// Reverse unary calls
	ProAttachmentCommands(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[MSG, ProAttachCmd], error)
	LandscapeConfigCommands(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[MSG, LandscapeConfigCmd], error)
}

type wSLInstanceClient struct {
	cc grpc.ClientConnInterface
}

func NewWSLInstanceClient(cc grpc.ClientConnInterface) WSLInstanceClient {
	return &wSLInstanceClient{cc}
}

func (c *wSLInstanceClient) Connected(ctx context.Context, opts ...grpc.CallOption) (grpc.ClientStreamingClient[DistroInfo, Empty], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &WSLInstance_ServiceDesc.Streams[0], WSLInstance_Connected_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[DistroInfo, Empty]{ClientStream: stream}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type WSLInstance_ConnectedClient = grpc.ClientStreamingClient[DistroInfo, Empty]

func (c *wSLInstanceClient) ProAttachmentCommands(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[MSG, ProAttachCmd], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &WSLInstance_ServiceDesc.Streams[1], WSLInstance_ProAttachmentCommands_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[MSG, ProAttachCmd]{ClientStream: stream}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type WSLInstance_ProAttachmentCommandsClient = grpc.BidiStreamingClient[MSG, ProAttachCmd]

func (c *wSLInstanceClient) LandscapeConfigCommands(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[MSG, LandscapeConfigCmd], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &WSLInstance_ServiceDesc.Streams[2], WSLInstance_LandscapeConfigCommands_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[MSG, LandscapeConfigCmd]{ClientStream: stream}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type WSLInstance_LandscapeConfigCommandsClient = grpc.BidiStreamingClient[MSG, LandscapeConfigCmd]

// WSLInstanceServer is the server API for WSLInstance service.
// All implementations must embed UnimplementedWSLInstanceServer
// for forward compatibility.
type WSLInstanceServer interface {
	Connected(grpc.ClientStreamingServer[DistroInfo, Empty]) error
	// Reverse unary calls
	ProAttachmentCommands(grpc.BidiStreamingServer[MSG, ProAttachCmd]) error
	LandscapeConfigCommands(grpc.BidiStreamingServer[MSG, LandscapeConfigCmd]) error
	mustEmbedUnimplementedWSLInstanceServer()
}

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

func (UnimplementedWSLInstanceServer) Connected(grpc.ClientStreamingServer[DistroInfo, Empty]) error {
	return status.Error(codes.Unimplemented, "method Connected not implemented")
}
func (UnimplementedWSLInstanceServer) ProAttachmentCommands(grpc.BidiStreamingServer[MSG, ProAttachCmd]) error {
	return status.Error(codes.Unimplemented, "method ProAttachmentCommands not implemented")
}
func (UnimplementedWSLInstanceServer) LandscapeConfigCommands(grpc.BidiStreamingServer[MSG, LandscapeConfigCmd]) error {
	return status.Error(codes.Unimplemented, "method LandscapeConfigCommands not implemented")
}
func (UnimplementedWSLInstanceServer) mustEmbedUnimplementedWSLInstanceServer() {}
func (UnimplementedWSLInstanceServer) testEmbeddedByValue()                     {}

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

func RegisterWSLInstanceServer(s grpc.ServiceRegistrar, srv WSLInstanceServer) {
	// If the following call panics, it indicates UnimplementedWSLInstanceServer 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(&WSLInstance_ServiceDesc, srv)
}

func _WSLInstance_Connected_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(WSLInstanceServer).Connected(&grpc.GenericServerStream[DistroInfo, Empty]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type WSLInstance_ConnectedServer = grpc.ClientStreamingServer[DistroInfo, Empty]

func _WSLInstance_ProAttachmentCommands_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(WSLInstanceServer).ProAttachmentCommands(&grpc.GenericServerStream[MSG, ProAttachCmd]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type WSLInstance_ProAttachmentCommandsServer = grpc.BidiStreamingServer[MSG, ProAttachCmd]

func _WSLInstance_LandscapeConfigCommands_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(WSLInstanceServer).LandscapeConfigCommands(&grpc.GenericServerStream[MSG, LandscapeConfigCmd]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type WSLInstance_LandscapeConfigCommandsServer = grpc.BidiStreamingServer[MSG, LandscapeConfigCmd]

// WSLInstance_ServiceDesc is the grpc.ServiceDesc for WSLInstance service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var WSLInstance_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "agentapi.WSLInstance",
	HandlerType: (*WSLInstanceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Connected",
			Handler:       _WSLInstance_Connected_Handler,
			ClientStreams: true,
		},
		{
			StreamName:    "ProAttachmentCommands",
			Handler:       _WSLInstance_ProAttachmentCommands_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "LandscapeConfigCommands",
			Handler:       _WSLInstance_LandscapeConfigCommands_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "agentapi.proto",
}
