// Copyright IBM Corp. 2020, 2026

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc             (unknown)
// source: controller/servers/services/v1/upstream_message_service.proto

package services

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 (
	UpstreamMessageService_UpstreamMessage_FullMethodName = "/controller.servers.services.v1.UpstreamMessageService/UpstreamMessage"
)

// UpstreamMessageServiceClient is the client API for UpstreamMessageService 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 UpstreamMessageServiceClient interface {
	// sends an upstream message to the controller.
	UpstreamMessage(ctx context.Context, in *UpstreamMessageRequest, opts ...grpc.CallOption) (*UpstreamMessageResponse, error)
}

type upstreamMessageServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewUpstreamMessageServiceClient(cc grpc.ClientConnInterface) UpstreamMessageServiceClient {
	return &upstreamMessageServiceClient{cc}
}

func (c *upstreamMessageServiceClient) UpstreamMessage(ctx context.Context, in *UpstreamMessageRequest, opts ...grpc.CallOption) (*UpstreamMessageResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(UpstreamMessageResponse)
	err := c.cc.Invoke(ctx, UpstreamMessageService_UpstreamMessage_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// UpstreamMessageServiceServer is the server API for UpstreamMessageService service.
// All implementations must embed UnimplementedUpstreamMessageServiceServer
// for forward compatibility.
type UpstreamMessageServiceServer interface {
	// sends an upstream message to the controller.
	UpstreamMessage(context.Context, *UpstreamMessageRequest) (*UpstreamMessageResponse, error)
	mustEmbedUnimplementedUpstreamMessageServiceServer()
}

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

func (UnimplementedUpstreamMessageServiceServer) UpstreamMessage(context.Context, *UpstreamMessageRequest) (*UpstreamMessageResponse, error) {
	return nil, status.Error(codes.Unimplemented, "method UpstreamMessage not implemented")
}
func (UnimplementedUpstreamMessageServiceServer) mustEmbedUnimplementedUpstreamMessageServiceServer() {
}
func (UnimplementedUpstreamMessageServiceServer) testEmbeddedByValue() {}

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

func RegisterUpstreamMessageServiceServer(s grpc.ServiceRegistrar, srv UpstreamMessageServiceServer) {
	// If the following call panics, it indicates UnimplementedUpstreamMessageServiceServer 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(&UpstreamMessageService_ServiceDesc, srv)
}

func _UpstreamMessageService_UpstreamMessage_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(UpstreamMessageRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(UpstreamMessageServiceServer).UpstreamMessage(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: UpstreamMessageService_UpstreamMessage_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(UpstreamMessageServiceServer).UpstreamMessage(ctx, req.(*UpstreamMessageRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// UpstreamMessageService_ServiceDesc is the grpc.ServiceDesc for UpstreamMessageService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var UpstreamMessageService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "controller.servers.services.v1.UpstreamMessageService",
	HandlerType: (*UpstreamMessageServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "UpstreamMessage",
			Handler:    _UpstreamMessageService_UpstreamMessage_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "controller/servers/services/v1/upstream_message_service.proto",
}
