// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v3.21.12
// source: yandex/cloud/cloudapps/workload/v1/cloud_application_service.proto

package workload

import (
	context "context"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	emptypb "google.golang.org/protobuf/types/known/emptypb"
)

// 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 (
	CloudApplicationService_Get_FullMethodName               = "/yandex.cloud.cloudapps.workload.v1.CloudApplicationService/Get"
	CloudApplicationService_ResolveByWorkload_FullMethodName = "/yandex.cloud.cloudapps.workload.v1.CloudApplicationService/ResolveByWorkload"
)

// CloudApplicationServiceClient is the client API for CloudApplicationService 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.
//
// Cloud Application Service to be used by Workload software inside Cloud Application installations
type CloudApplicationServiceClient interface {
	// Get Current Application
	Get(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*CloudApplication, error)
	// Resolve Cloud Application by workload
	ResolveByWorkload(ctx context.Context, in *ResolveByWorkloadRequest, opts ...grpc.CallOption) (*ResolveByWorkloadResponse, error)
}

type cloudApplicationServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewCloudApplicationServiceClient(cc grpc.ClientConnInterface) CloudApplicationServiceClient {
	return &cloudApplicationServiceClient{cc}
}

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

func (c *cloudApplicationServiceClient) ResolveByWorkload(ctx context.Context, in *ResolveByWorkloadRequest, opts ...grpc.CallOption) (*ResolveByWorkloadResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ResolveByWorkloadResponse)
	err := c.cc.Invoke(ctx, CloudApplicationService_ResolveByWorkload_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// CloudApplicationServiceServer is the server API for CloudApplicationService service.
// All implementations should embed UnimplementedCloudApplicationServiceServer
// for forward compatibility.
//
// Cloud Application Service to be used by Workload software inside Cloud Application installations
type CloudApplicationServiceServer interface {
	// Get Current Application
	Get(context.Context, *emptypb.Empty) (*CloudApplication, error)
	// Resolve Cloud Application by workload
	ResolveByWorkload(context.Context, *ResolveByWorkloadRequest) (*ResolveByWorkloadResponse, error)
}

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

func (UnimplementedCloudApplicationServiceServer) Get(context.Context, *emptypb.Empty) (*CloudApplication, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Get not implemented")
}
func (UnimplementedCloudApplicationServiceServer) ResolveByWorkload(context.Context, *ResolveByWorkloadRequest) (*ResolveByWorkloadResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ResolveByWorkload not implemented")
}
func (UnimplementedCloudApplicationServiceServer) testEmbeddedByValue() {}

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

func RegisterCloudApplicationServiceServer(s grpc.ServiceRegistrar, srv CloudApplicationServiceServer) {
	// If the following call pancis, it indicates UnimplementedCloudApplicationServiceServer 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(&CloudApplicationService_ServiceDesc, srv)
}

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

func _CloudApplicationService_ResolveByWorkload_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ResolveByWorkloadRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(CloudApplicationServiceServer).ResolveByWorkload(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: CloudApplicationService_ResolveByWorkload_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(CloudApplicationServiceServer).ResolveByWorkload(ctx, req.(*ResolveByWorkloadRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// CloudApplicationService_ServiceDesc is the grpc.ServiceDesc for CloudApplicationService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var CloudApplicationService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.cloudapps.workload.v1.CloudApplicationService",
	HandlerType: (*CloudApplicationServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Get",
			Handler:    _CloudApplicationService_Get_Handler,
		},
		{
			MethodName: "ResolveByWorkload",
			Handler:    _CloudApplicationService_ResolveByWorkload_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/cloudapps/workload/v1/cloud_application_service.proto",
}
