// Copyright 2025 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc             v4.25.7
// source: google/cloud/aiplatform/v1/feature_online_store_service.proto

package aiplatformpb

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

const (
	FeatureOnlineStoreService_FetchFeatureValues_FullMethodName    = "/google.cloud.aiplatform.v1.FeatureOnlineStoreService/FetchFeatureValues"
	FeatureOnlineStoreService_SearchNearestEntities_FullMethodName = "/google.cloud.aiplatform.v1.FeatureOnlineStoreService/SearchNearestEntities"
)

// FeatureOnlineStoreServiceClient is the client API for FeatureOnlineStoreService 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 FeatureOnlineStoreServiceClient interface {
	// Fetch feature values under a FeatureView.
	FetchFeatureValues(ctx context.Context, in *FetchFeatureValuesRequest, opts ...grpc.CallOption) (*FetchFeatureValuesResponse, error)
	// Search the nearest entities under a FeatureView.
	// Search only works for indexable feature view; if a feature view isn't
	// indexable, returns Invalid argument response.
	SearchNearestEntities(ctx context.Context, in *SearchNearestEntitiesRequest, opts ...grpc.CallOption) (*SearchNearestEntitiesResponse, error)
}

type featureOnlineStoreServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewFeatureOnlineStoreServiceClient(cc grpc.ClientConnInterface) FeatureOnlineStoreServiceClient {
	return &featureOnlineStoreServiceClient{cc}
}

func (c *featureOnlineStoreServiceClient) FetchFeatureValues(ctx context.Context, in *FetchFeatureValuesRequest, opts ...grpc.CallOption) (*FetchFeatureValuesResponse, error) {
	out := new(FetchFeatureValuesResponse)
	err := c.cc.Invoke(ctx, FeatureOnlineStoreService_FetchFeatureValues_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *featureOnlineStoreServiceClient) SearchNearestEntities(ctx context.Context, in *SearchNearestEntitiesRequest, opts ...grpc.CallOption) (*SearchNearestEntitiesResponse, error) {
	out := new(SearchNearestEntitiesResponse)
	err := c.cc.Invoke(ctx, FeatureOnlineStoreService_SearchNearestEntities_FullMethodName, in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// FeatureOnlineStoreServiceServer is the server API for FeatureOnlineStoreService service.
// All implementations should embed UnimplementedFeatureOnlineStoreServiceServer
// for forward compatibility
type FeatureOnlineStoreServiceServer interface {
	// Fetch feature values under a FeatureView.
	FetchFeatureValues(context.Context, *FetchFeatureValuesRequest) (*FetchFeatureValuesResponse, error)
	// Search the nearest entities under a FeatureView.
	// Search only works for indexable feature view; if a feature view isn't
	// indexable, returns Invalid argument response.
	SearchNearestEntities(context.Context, *SearchNearestEntitiesRequest) (*SearchNearestEntitiesResponse, error)
}

// UnimplementedFeatureOnlineStoreServiceServer should be embedded to have forward compatible implementations.
type UnimplementedFeatureOnlineStoreServiceServer struct {
}

func (UnimplementedFeatureOnlineStoreServiceServer) FetchFeatureValues(context.Context, *FetchFeatureValuesRequest) (*FetchFeatureValuesResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method FetchFeatureValues not implemented")
}
func (UnimplementedFeatureOnlineStoreServiceServer) SearchNearestEntities(context.Context, *SearchNearestEntitiesRequest) (*SearchNearestEntitiesResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method SearchNearestEntities not implemented")
}

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

func RegisterFeatureOnlineStoreServiceServer(s grpc.ServiceRegistrar, srv FeatureOnlineStoreServiceServer) {
	s.RegisterService(&FeatureOnlineStoreService_ServiceDesc, srv)
}

func _FeatureOnlineStoreService_FetchFeatureValues_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(FetchFeatureValuesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(FeatureOnlineStoreServiceServer).FetchFeatureValues(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: FeatureOnlineStoreService_FetchFeatureValues_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(FeatureOnlineStoreServiceServer).FetchFeatureValues(ctx, req.(*FetchFeatureValuesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _FeatureOnlineStoreService_SearchNearestEntities_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SearchNearestEntitiesRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(FeatureOnlineStoreServiceServer).SearchNearestEntities(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: FeatureOnlineStoreService_SearchNearestEntities_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(FeatureOnlineStoreServiceServer).SearchNearestEntities(ctx, req.(*SearchNearestEntitiesRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// FeatureOnlineStoreService_ServiceDesc is the grpc.ServiceDesc for FeatureOnlineStoreService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var FeatureOnlineStoreService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "google.cloud.aiplatform.v1.FeatureOnlineStoreService",
	HandlerType: (*FeatureOnlineStoreServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "FetchFeatureValues",
			Handler:    _FeatureOnlineStoreService_FetchFeatureValues_Handler,
		},
		{
			MethodName: "SearchNearestEntities",
			Handler:    _FeatureOnlineStoreService_SearchNearestEntities_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "google/cloud/aiplatform/v1/feature_online_store_service.proto",
}
