cloud.google.com/go/aiplatform@v1.106.0/apiv1beta1/aiplatformpb/index_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/v1beta1/index_service.proto
    20  
    21  package aiplatformpb
    22  
    23  import (
    24  	longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb"
    25  	context "context"
    26  	grpc "google.golang.org/grpc"
    27  	codes "google.golang.org/grpc/codes"
    28  	status "google.golang.org/grpc/status"
    29  )
    30  
    31  // This is a compile-time assertion to ensure that this generated file
    32  // is compatible with the grpc package it is being compiled against.
    33  // Requires gRPC-Go v1.32.0 or later.
    34  const _ = grpc.SupportPackageIsVersion7
    35  
    36  const (
    37  	IndexService_CreateIndex_FullMethodName      = "/google.cloud.aiplatform.v1beta1.IndexService/CreateIndex"
    38  	IndexService_GetIndex_FullMethodName         = "/google.cloud.aiplatform.v1beta1.IndexService/GetIndex"
    39  	IndexService_ImportIndex_FullMethodName      = "/google.cloud.aiplatform.v1beta1.IndexService/ImportIndex"
    40  	IndexService_ListIndexes_FullMethodName      = "/google.cloud.aiplatform.v1beta1.IndexService/ListIndexes"
    41  	IndexService_UpdateIndex_FullMethodName      = "/google.cloud.aiplatform.v1beta1.IndexService/UpdateIndex"
    42  	IndexService_DeleteIndex_FullMethodName      = "/google.cloud.aiplatform.v1beta1.IndexService/DeleteIndex"
    43  	IndexService_UpsertDatapoints_FullMethodName = "/google.cloud.aiplatform.v1beta1.IndexService/UpsertDatapoints"
    44  	IndexService_RemoveDatapoints_FullMethodName = "/google.cloud.aiplatform.v1beta1.IndexService/RemoveDatapoints"
    45  )
    46  
    47  // IndexServiceClient is the client API for IndexService service.
    48  //
    49  // 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.
    50  type IndexServiceClient interface {
    51  	// Creates an Index.
    52  	CreateIndex(ctx context.Context, in *CreateIndexRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error)
    53  	// Gets an Index.
    54  	GetIndex(ctx context.Context, in *GetIndexRequest, opts ...grpc.CallOption) (*Index, error)
    55  	// Imports an Index from an external source (e.g., BigQuery).
    56  	ImportIndex(ctx context.Context, in *ImportIndexRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error)
    57  	// Lists Indexes in a Location.
    58  	ListIndexes(ctx context.Context, in *ListIndexesRequest, opts ...grpc.CallOption) (*ListIndexesResponse, error)
    59  	// Updates an Index.
    60  	UpdateIndex(ctx context.Context, in *UpdateIndexRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error)
    61  	// Deletes an Index.
    62  	// An Index can only be deleted when all its
    63  	// [DeployedIndexes][google.cloud.aiplatform.v1beta1.Index.deployed_indexes]
    64  	// had been undeployed.
    65  	DeleteIndex(ctx context.Context, in *DeleteIndexRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error)
    66  	// Add/update Datapoints into an Index.
    67  	UpsertDatapoints(ctx context.Context, in *UpsertDatapointsRequest, opts ...grpc.CallOption) (*UpsertDatapointsResponse, error)
    68  	// Remove Datapoints from an Index.
    69  	RemoveDatapoints(ctx context.Context, in *RemoveDatapointsRequest, opts ...grpc.CallOption) (*RemoveDatapointsResponse, error)
    70  }
    71  
    72  type indexServiceClient struct {
    73  	cc grpc.ClientConnInterface
    74  }
    75  
    76  func NewIndexServiceClient(cc grpc.ClientConnInterface) IndexServiceClient {
    77  	return &indexServiceClient{cc}
    78  }
    79  
    80  func (c *indexServiceClient) CreateIndex(ctx context.Context, in *CreateIndexRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) {
    81  	out := new(longrunningpb.Operation)
    82  	err := c.cc.Invoke(ctx, IndexService_CreateIndex_FullMethodName, in, out, opts...)
    83  	if err != nil {
    84  		return nil, err
    85  	}
    86  	return out, nil
    87  }
    88  
    89  func (c *indexServiceClient) GetIndex(ctx context.Context, in *GetIndexRequest, opts ...grpc.CallOption) (*Index, error) {
    90  	out := new(Index)
    91  	err := c.cc.Invoke(ctx, IndexService_GetIndex_FullMethodName, in, out, opts...)
    92  	if err != nil {
    93  		return nil, err
    94  	}
    95  	return out, nil
    96  }
    97  
    98  func (c *indexServiceClient) ImportIndex(ctx context.Context, in *ImportIndexRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) {
    99  	out := new(longrunningpb.Operation)
   100  	err := c.cc.Invoke(ctx, IndexService_ImportIndex_FullMethodName, in, out, opts...)
   101  	if err != nil {
   102  		return nil, err
   103  	}
   104  	return out, nil
   105  }
   106  
   107  func (c *indexServiceClient) ListIndexes(ctx context.Context, in *ListIndexesRequest, opts ...grpc.CallOption) (*ListIndexesResponse, error) {
   108  	out := new(ListIndexesResponse)
   109  	err := c.cc.Invoke(ctx, IndexService_ListIndexes_FullMethodName, in, out, opts...)
   110  	if err != nil {
   111  		return nil, err
   112  	}
   113  	return out, nil
   114  }
   115  
   116  func (c *indexServiceClient) UpdateIndex(ctx context.Context, in *UpdateIndexRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) {
   117  	out := new(longrunningpb.Operation)
   118  	err := c.cc.Invoke(ctx, IndexService_UpdateIndex_FullMethodName, in, out, opts...)
   119  	if err != nil {
   120  		return nil, err
   121  	}
   122  	return out, nil
   123  }
   124  
   125  func (c *indexServiceClient) DeleteIndex(ctx context.Context, in *DeleteIndexRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) {
   126  	out := new(longrunningpb.Operation)
   127  	err := c.cc.Invoke(ctx, IndexService_DeleteIndex_FullMethodName, in, out, opts...)
   128  	if err != nil {
   129  		return nil, err
   130  	}
   131  	return out, nil
   132  }
   133  
   134  func (c *indexServiceClient) UpsertDatapoints(ctx context.Context, in *UpsertDatapointsRequest, opts ...grpc.CallOption) (*UpsertDatapointsResponse, error) {
   135  	out := new(UpsertDatapointsResponse)
   136  	err := c.cc.Invoke(ctx, IndexService_UpsertDatapoints_FullMethodName, in, out, opts...)
   137  	if err != nil {
   138  		return nil, err
   139  	}
   140  	return out, nil
   141  }
   142  
   143  func (c *indexServiceClient) RemoveDatapoints(ctx context.Context, in *RemoveDatapointsRequest, opts ...grpc.CallOption) (*RemoveDatapointsResponse, error) {
   144  	out := new(RemoveDatapointsResponse)
   145  	err := c.cc.Invoke(ctx, IndexService_RemoveDatapoints_FullMethodName, in, out, opts...)
   146  	if err != nil {
   147  		return nil, err
   148  	}
   149  	return out, nil
   150  }
   151  
   152  // IndexServiceServer is the server API for IndexService service.
   153  // All implementations should embed UnimplementedIndexServiceServer
   154  // for forward compatibility
   155  type IndexServiceServer interface {
   156  	// Creates an Index.
   157  	CreateIndex(context.Context, *CreateIndexRequest) (*longrunningpb.Operation, error)
   158  	// Gets an Index.
   159  	GetIndex(context.Context, *GetIndexRequest) (*Index, error)
   160  	// Imports an Index from an external source (e.g., BigQuery).
   161  	ImportIndex(context.Context, *ImportIndexRequest) (*longrunningpb.Operation, error)
   162  	// Lists Indexes in a Location.
   163  	ListIndexes(context.Context, *ListIndexesRequest) (*ListIndexesResponse, error)
   164  	// Updates an Index.
   165  	UpdateIndex(context.Context, *UpdateIndexRequest) (*longrunningpb.Operation, error)
   166  	// Deletes an Index.
   167  	// An Index can only be deleted when all its
   168  	// [DeployedIndexes][google.cloud.aiplatform.v1beta1.Index.deployed_indexes]
   169  	// had been undeployed.
   170  	DeleteIndex(context.Context, *DeleteIndexRequest) (*longrunningpb.Operation, error)
   171  	// Add/update Datapoints into an Index.
   172  	UpsertDatapoints(context.Context, *UpsertDatapointsRequest) (*UpsertDatapointsResponse, error)
   173  	// Remove Datapoints from an Index.
   174  	RemoveDatapoints(context.Context, *RemoveDatapointsRequest) (*RemoveDatapointsResponse, error)
   175  }
   176  
   177  // UnimplementedIndexServiceServer should be embedded to have forward compatible implementations.
   178  type UnimplementedIndexServiceServer struct {
   179  }
   180  
   181  func (UnimplementedIndexServiceServer) CreateIndex(context.Context, *CreateIndexRequest) (*longrunningpb.Operation, error) {
   182  	return nil, status.Errorf(codes.Unimplemented, "method CreateIndex not implemented")
   183  }
   184  func (UnimplementedIndexServiceServer) GetIndex(context.Context, *GetIndexRequest) (*Index, error) {
   185  	return nil, status.Errorf(codes.Unimplemented, "method GetIndex not implemented")
   186  }
   187  func (UnimplementedIndexServiceServer) ImportIndex(context.Context, *ImportIndexRequest) (*longrunningpb.Operation, error) {
   188  	return nil, status.Errorf(codes.Unimplemented, "method ImportIndex not implemented")
   189  }
   190  func (UnimplementedIndexServiceServer) ListIndexes(context.Context, *ListIndexesRequest) (*ListIndexesResponse, error) {
   191  	return nil, status.Errorf(codes.Unimplemented, "method ListIndexes not implemented")
   192  }
   193  func (UnimplementedIndexServiceServer) UpdateIndex(context.Context, *UpdateIndexRequest) (*longrunningpb.Operation, error) {
   194  	return nil, status.Errorf(codes.Unimplemented, "method UpdateIndex not implemented")
   195  }
   196  func (UnimplementedIndexServiceServer) DeleteIndex(context.Context, *DeleteIndexRequest) (*longrunningpb.Operation, error) {
   197  	return nil, status.Errorf(codes.Unimplemented, "method DeleteIndex not implemented")
   198  }
   199  func (UnimplementedIndexServiceServer) UpsertDatapoints(context.Context, *UpsertDatapointsRequest) (*UpsertDatapointsResponse, error) {
   200  	return nil, status.Errorf(codes.Unimplemented, "method UpsertDatapoints not implemented")
   201  }
   202  func (UnimplementedIndexServiceServer) RemoveDatapoints(context.Context, *RemoveDatapointsRequest) (*RemoveDatapointsResponse, error) {
   203  	return nil, status.Errorf(codes.Unimplemented, "method RemoveDatapoints not implemented")
   204  }
   205  
   206  // UnsafeIndexServiceServer may be embedded to opt out of forward compatibility for this service.
   207  // Use of this interface is not recommended, as added methods to IndexServiceServer will
   208  // result in compilation errors.
   209  type UnsafeIndexServiceServer interface {
   210  	mustEmbedUnimplementedIndexServiceServer()
   211  }
   212  
   213  func RegisterIndexServiceServer(s grpc.ServiceRegistrar, srv IndexServiceServer) {
   214  	s.RegisterService(&IndexService_ServiceDesc, srv)
   215  }
   216  
   217  func _IndexService_CreateIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   218  	in := new(CreateIndexRequest)
   219  	if err := dec(in); err != nil {
   220  		return nil, err
   221  	}
   222  	if interceptor == nil {
   223  		return srv.(IndexServiceServer).CreateIndex(ctx, in)
   224  	}
   225  	info := &grpc.UnaryServerInfo{
   226  		Server:     srv,
   227  		FullMethod: IndexService_CreateIndex_FullMethodName,
   228  	}
   229  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   230  		return srv.(IndexServiceServer).CreateIndex(ctx, req.(*CreateIndexRequest))
   231  	}
   232  	return interceptor(ctx, in, info, handler)
   233  }
   234  
   235  func _IndexService_GetIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   236  	in := new(GetIndexRequest)
   237  	if err := dec(in); err != nil {
   238  		return nil, err
   239  	}
   240  	if interceptor == nil {
   241  		return srv.(IndexServiceServer).GetIndex(ctx, in)
   242  	}
   243  	info := &grpc.UnaryServerInfo{
   244  		Server:     srv,
   245  		FullMethod: IndexService_GetIndex_FullMethodName,
   246  	}
   247  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   248  		return srv.(IndexServiceServer).GetIndex(ctx, req.(*GetIndexRequest))
   249  	}
   250  	return interceptor(ctx, in, info, handler)
   251  }
   252  
   253  func _IndexService_ImportIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   254  	in := new(ImportIndexRequest)
   255  	if err := dec(in); err != nil {
   256  		return nil, err
   257  	}
   258  	if interceptor == nil {
   259  		return srv.(IndexServiceServer).ImportIndex(ctx, in)
   260  	}
   261  	info := &grpc.UnaryServerInfo{
   262  		Server:     srv,
   263  		FullMethod: IndexService_ImportIndex_FullMethodName,
   264  	}
   265  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   266  		return srv.(IndexServiceServer).ImportIndex(ctx, req.(*ImportIndexRequest))
   267  	}
   268  	return interceptor(ctx, in, info, handler)
   269  }
   270  
   271  func _IndexService_ListIndexes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   272  	in := new(ListIndexesRequest)
   273  	if err := dec(in); err != nil {
   274  		return nil, err
   275  	}
   276  	if interceptor == nil {
   277  		return srv.(IndexServiceServer).ListIndexes(ctx, in)
   278  	}
   279  	info := &grpc.UnaryServerInfo{
   280  		Server:     srv,
   281  		FullMethod: IndexService_ListIndexes_FullMethodName,
   282  	}
   283  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   284  		return srv.(IndexServiceServer).ListIndexes(ctx, req.(*ListIndexesRequest))
   285  	}
   286  	return interceptor(ctx, in, info, handler)
   287  }
   288  
   289  func _IndexService_UpdateIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   290  	in := new(UpdateIndexRequest)
   291  	if err := dec(in); err != nil {
   292  		return nil, err
   293  	}
   294  	if interceptor == nil {
   295  		return srv.(IndexServiceServer).UpdateIndex(ctx, in)
   296  	}
   297  	info := &grpc.UnaryServerInfo{
   298  		Server:     srv,
   299  		FullMethod: IndexService_UpdateIndex_FullMethodName,
   300  	}
   301  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   302  		return srv.(IndexServiceServer).UpdateIndex(ctx, req.(*UpdateIndexRequest))
   303  	}
   304  	return interceptor(ctx, in, info, handler)
   305  }
   306  
   307  func _IndexService_DeleteIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   308  	in := new(DeleteIndexRequest)
   309  	if err := dec(in); err != nil {
   310  		return nil, err
   311  	}
   312  	if interceptor == nil {
   313  		return srv.(IndexServiceServer).DeleteIndex(ctx, in)
   314  	}
   315  	info := &grpc.UnaryServerInfo{
   316  		Server:     srv,
   317  		FullMethod: IndexService_DeleteIndex_FullMethodName,
   318  	}
   319  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   320  		return srv.(IndexServiceServer).DeleteIndex(ctx, req.(*DeleteIndexRequest))
   321  	}
   322  	return interceptor(ctx, in, info, handler)
   323  }
   324  
   325  func _IndexService_UpsertDatapoints_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   326  	in := new(UpsertDatapointsRequest)
   327  	if err := dec(in); err != nil {
   328  		return nil, err
   329  	}
   330  	if interceptor == nil {
   331  		return srv.(IndexServiceServer).UpsertDatapoints(ctx, in)
   332  	}
   333  	info := &grpc.UnaryServerInfo{
   334  		Server:     srv,
   335  		FullMethod: IndexService_UpsertDatapoints_FullMethodName,
   336  	}
   337  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   338  		return srv.(IndexServiceServer).UpsertDatapoints(ctx, req.(*UpsertDatapointsRequest))
   339  	}
   340  	return interceptor(ctx, in, info, handler)
   341  }
   342  
   343  func _IndexService_RemoveDatapoints_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
   344  	in := new(RemoveDatapointsRequest)
   345  	if err := dec(in); err != nil {
   346  		return nil, err
   347  	}
   348  	if interceptor == nil {
   349  		return srv.(IndexServiceServer).RemoveDatapoints(ctx, in)
   350  	}
   351  	info := &grpc.UnaryServerInfo{
   352  		Server:     srv,
   353  		FullMethod: IndexService_RemoveDatapoints_FullMethodName,
   354  	}
   355  	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
   356  		return srv.(IndexServiceServer).RemoveDatapoints(ctx, req.(*RemoveDatapointsRequest))
   357  	}
   358  	return interceptor(ctx, in, info, handler)
   359  }
   360  
   361  // IndexService_ServiceDesc is the grpc.ServiceDesc for IndexService service.
   362  // It's only intended for direct use with grpc.RegisterService,
   363  // and not to be introspected or modified (even as a copy)
   364  var IndexService_ServiceDesc = grpc.ServiceDesc{
   365  	ServiceName: "google.cloud.aiplatform.v1beta1.IndexService",
   366  	HandlerType: (*IndexServiceServer)(nil),
   367  	Methods: []grpc.MethodDesc{
   368  		{
   369  			MethodName: "CreateIndex",
   370  			Handler:    _IndexService_CreateIndex_Handler,
   371  		},
   372  		{
   373  			MethodName: "GetIndex",
   374  			Handler:    _IndexService_GetIndex_Handler,
   375  		},
   376  		{
   377  			MethodName: "ImportIndex",
   378  			Handler:    _IndexService_ImportIndex_Handler,
   379  		},
   380  		{
   381  			MethodName: "ListIndexes",
   382  			Handler:    _IndexService_ListIndexes_Handler,
   383  		},
   384  		{
   385  			MethodName: "UpdateIndex",
   386  			Handler:    _IndexService_UpdateIndex_Handler,
   387  		},
   388  		{
   389  			MethodName: "DeleteIndex",
   390  			Handler:    _IndexService_DeleteIndex_Handler,
   391  		},
   392  		{
   393  			MethodName: "UpsertDatapoints",
   394  			Handler:    _IndexService_UpsertDatapoints_Handler,
   395  		},
   396  		{
   397  			MethodName: "RemoveDatapoints",
   398  			Handler:    _IndexService_RemoveDatapoints_Handler,
   399  		},
   400  	},
   401  	Streams:  []grpc.StreamDesc{},
   402  	Metadata: "google/cloud/aiplatform/v1beta1/index_service.proto",
   403  }