cloud.google.com/go/aiplatform@v1.106.0/apiv1/aiplatformpb/match_service_grpc.pb.go (about)

     1  // Copyright 2025 Google LLC
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //     http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
    16  // versions:
    17  // - protoc-gen-go-grpc v1.3.0
    18  // - protoc             v4.25.7
    19  // source: google/cloud/aiplatform/v1/match_service.proto
    20  
    21  package aiplatformpb
    22  
    23  import (
    24  	context "context"
    25  	grpc "google.golang.org/grpc"
    26  	codes "google.golang.org/grpc/codes"
    27  	status "google.golang.org/grpc/status"
    28  )
    29  
    30  // This is a compile-time assertion to ensure that this generated file
    31  // is compatible with the grpc package it is being compiled against.
    32  // Requires gRPC-Go v1.32.0 or later.
    33  const _ = grpc.SupportPackageIsVersion7
    34  
    35  const (
    36  	MatchService_FindNeighbors_FullMethodName       = "/google.cloud.aiplatform.v1.MatchService/FindNeighbors"
    37  	MatchService_ReadIndexDatapoints_FullMethodName = "/google.cloud.aiplatform.v1.MatchService/ReadIndexDatapoints"
    38  )
    39  
    40  // MatchServiceClient is the client API for MatchService service.
    41  //
    42  // 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.
    43  type MatchServiceClient interface {
    44  	// Finds the nearest neighbors of each vector within the request.
    45  	FindNeighbors(ctx context.Context, in *FindNeighborsRequest, opts ...grpc.CallOption) (*FindNeighborsResponse, error)
    46  	// Reads the datapoints/vectors of the given IDs.
    47  	// A maximum of 1000 datapoints can be retrieved in a batch.
    48  	ReadIndexDatapoints(ctx context.Context, in *ReadIndexDatapointsRequest, opts ...grpc.CallOption) (*ReadIndexDatapointsResponse, error)
    49  }
    50  
    51  type matchServiceClient struct {
    52  	cc grpc.ClientConnInterface
    53  }
    54  
    55  func NewMatchServiceClient(cc grpc.ClientConnInterface) MatchServiceClient {
    56  	return &matchServiceClient{cc}
    57  }
    58  
    59  func (c *matchServiceClient) FindNeighbors(ctx context.Context, in *FindNeighborsRequest, opts ...grpc.CallOption) (*FindNeighborsResponse, error) {
    60  	out := new(FindNeighborsResponse)
    61  	err := c.cc.Invoke(ctx, MatchService_FindNeighbors_FullMethodName, in, out, opts...)
    62  	if err != nil {
    63  		return nil, err
    64  	}
    65  	return out, nil
    66  }
    67  
    68  func (c *matchServiceClient) ReadIndexDatapoints(ctx context.Context, in *ReadIndexDatapointsRequest, opts ...grpc.CallOption) (*ReadIndexDatapointsResponse, error) {
    69  	out := new(ReadIndexDatapointsResponse)
    70  	err := c.cc.Invoke(ctx, MatchService_ReadIndexDatapoints_FullMethodName, in, out, opts...)
    71  	if err != nil {
    72  		return nil, err
    73  	}
    74  	return out, nil
    75  }
    76  
    77  // MatchServiceServer is the server API for MatchService service.
    78  // All implementations should embed UnimplementedMatchServiceServer
    79  // for forward compatibility
    80  type MatchServiceServer interface {
    81  	// Finds the nearest neighbors of each vector within the request.
    82  	FindNeighbors(context.Context, *FindNeighborsRequest) (*FindNeighborsResponse, error)
    83  	// Reads the datapoints/vectors of the given IDs.
    84  	// A maximum of 1000 datapoints can be retrieved in a batch.
    85  	ReadIndexDatapoints(context.Context, *ReadIndexDatapointsRequest) (*ReadIndexDatapointsResponse, error)
    86  }
    87  
    88  // UnimplementedMatchServiceServer should be embedded to have forward compatible implementations.
    89  type UnimplementedMatchServiceServer struct {
    90  }
    91  
    92  func (UnimplementedMatchServiceServer) FindNeighbors(context.Context, *FindNeighborsRequest) (*FindNeighborsResponse, error) {
    93  	return nil, status.Errorf(codes.Unimplemented, "method FindNeighbors not implemented")
    94  }
    95  func (UnimplementedMatchServiceServer) ReadIndexDatapoints(context.Context, *ReadIndexDatapointsRequest) (*ReadIndexDatapointsResponse, error) {
    96  	return nil, status.Errorf(codes.Unimplemented, "method ReadIndexDatapoints not implemented")
    97  }
    98  
    99  // UnsafeMatchServiceServer may be embedded to opt out of forward compatibility for this service.
   100  // Use of this interface is not recommended, as added methods to MatchServiceServer will
   101  // result in compilation errors.
   102  type UnsafeMatchServiceServer interface {
   103  	mustEmbedUnimplementedMatchServiceServer()
   104  }
   105  
   106  func RegisterMatchServiceServer(s grpc.ServiceRegistrar, srv MatchServiceServer) {
   107  	s.RegisterService(&MatchService_ServiceDesc, srv)
   108  }
   109  
   110  func _MatchService_FindNeighbors_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   111  	in := new(FindNeighborsRequest)
   112  	if err := dec(in); err != nil {
   113  		return nil, err
   114  	}
   115  	if interceptor == nil {
   116  		return srv.(MatchServiceServer).FindNeighbors(ctx, in)
   117  	}
   118  	info := &grpc.UnaryServerInfo{
   119  		Server:     srv,
   120  		FullMethod: MatchService_FindNeighbors_FullMethodName,
   121  	}
   122  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   123  		return srv.(MatchServiceServer).FindNeighbors(ctx, req.(*FindNeighborsRequest))
   124  	}
   125  	return interceptor(ctx, in, info, handler)
   126  }
   127  
   128  func _MatchService_ReadIndexDatapoints_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   129  	in := new(ReadIndexDatapointsRequest)
   130  	if err := dec(in); err != nil {
   131  		return nil, err
   132  	}
   133  	if interceptor == nil {
   134  		return srv.(MatchServiceServer).ReadIndexDatapoints(ctx, in)
   135  	}
   136  	info := &grpc.UnaryServerInfo{
   137  		Server:     srv,
   138  		FullMethod: MatchService_ReadIndexDatapoints_FullMethodName,
   139  	}
   140  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   141  		return srv.(MatchServiceServer).ReadIndexDatapoints(ctx, req.(*ReadIndexDatapointsRequest))
   142  	}
   143  	return interceptor(ctx, in, info, handler)
   144  }
   145  
   146  // MatchService_ServiceDesc is the grpc.ServiceDesc for MatchService service.
   147  // It's only intended for direct use with grpc.RegisterService,
   148  // and not to be introspected or modified (even as a copy)
   149  var MatchService_ServiceDesc = grpc.ServiceDesc{
   150  	ServiceName: "google.cloud.aiplatform.v1.MatchService",
   151  	HandlerType: (*MatchServiceServer)(nil),
   152  	Methods: []grpc.MethodDesc{
   153  		{
   154  			MethodName: "FindNeighbors",
   155  			Handler:    _MatchService_FindNeighbors_Handler,
   156  		},
   157  		{
   158  			MethodName: "ReadIndexDatapoints",
   159  			Handler:    _MatchService_ReadIndexDatapoints_Handler,
   160  		},
   161  	},
   162  	Streams:  []grpc.StreamDesc{},
   163  	Metadata: "google/cloud/aiplatform/v1/match_service.proto",
   164  }