cloud.google.com/go/aiplatform@v1.106.0/apiv1/aiplatformpb/gen_ai_cache_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/gen_ai_cache_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 emptypb "google.golang.org/protobuf/types/known/emptypb" 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 GenAiCacheService_CreateCachedContent_FullMethodName = "/google.cloud.aiplatform.v1.GenAiCacheService/CreateCachedContent" 38 GenAiCacheService_GetCachedContent_FullMethodName = "/google.cloud.aiplatform.v1.GenAiCacheService/GetCachedContent" 39 GenAiCacheService_UpdateCachedContent_FullMethodName = "/google.cloud.aiplatform.v1.GenAiCacheService/UpdateCachedContent" 40 GenAiCacheService_DeleteCachedContent_FullMethodName = "/google.cloud.aiplatform.v1.GenAiCacheService/DeleteCachedContent" 41 GenAiCacheService_ListCachedContents_FullMethodName = "/google.cloud.aiplatform.v1.GenAiCacheService/ListCachedContents" 42 ) 43 44 // GenAiCacheServiceClient is the client API for GenAiCacheService service. 45 // 46 // 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. 47 type GenAiCacheServiceClient interface { 48 // Creates cached content, this call will initialize the cached content in the 49 // data storage, and users need to pay for the cache data storage. 50 CreateCachedContent(ctx context.Context, in *CreateCachedContentRequest, opts ...grpc.CallOption) (*CachedContent, error) 51 // Gets cached content configurations 52 GetCachedContent(ctx context.Context, in *GetCachedContentRequest, opts ...grpc.CallOption) (*CachedContent, error) 53 // Updates cached content configurations 54 UpdateCachedContent(ctx context.Context, in *UpdateCachedContentRequest, opts ...grpc.CallOption) (*CachedContent, error) 55 // Deletes cached content 56 DeleteCachedContent(ctx context.Context, in *DeleteCachedContentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) 57 // Lists cached contents in a project 58 ListCachedContents(ctx context.Context, in *ListCachedContentsRequest, opts ...grpc.CallOption) (*ListCachedContentsResponse, error) 59 } 60 61 type genAiCacheServiceClient struct { 62 cc grpc.ClientConnInterface 63 } 64 65 func NewGenAiCacheServiceClient(cc grpc.ClientConnInterface) GenAiCacheServiceClient { 66 return &genAiCacheServiceClient{cc} 67 } 68 69 func (c *genAiCacheServiceClient) CreateCachedContent(ctx context.Context, in *CreateCachedContentRequest, opts ...grpc.CallOption) (*CachedContent, error) { 70 out := new(CachedContent) 71 err := c.cc.Invoke(ctx, GenAiCacheService_CreateCachedContent_FullMethodName, in, out, opts...) 72 if err != nil { 73 return nil, err 74 } 75 return out, nil 76 } 77 78 func (c *genAiCacheServiceClient) GetCachedContent(ctx context.Context, in *GetCachedContentRequest, opts ...grpc.CallOption) (*CachedContent, error) { 79 out := new(CachedContent) 80 err := c.cc.Invoke(ctx, GenAiCacheService_GetCachedContent_FullMethodName, in, out, opts...) 81 if err != nil { 82 return nil, err 83 } 84 return out, nil 85 } 86 87 func (c *genAiCacheServiceClient) UpdateCachedContent(ctx context.Context, in *UpdateCachedContentRequest, opts ...grpc.CallOption) (*CachedContent, error) { 88 out := new(CachedContent) 89 err := c.cc.Invoke(ctx, GenAiCacheService_UpdateCachedContent_FullMethodName, in, out, opts...) 90 if err != nil { 91 return nil, err 92 } 93 return out, nil 94 } 95 96 func (c *genAiCacheServiceClient) DeleteCachedContent(ctx context.Context, in *DeleteCachedContentRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { 97 out := new(emptypb.Empty) 98 err := c.cc.Invoke(ctx, GenAiCacheService_DeleteCachedContent_FullMethodName, in, out, opts...) 99 if err != nil { 100 return nil, err 101 } 102 return out, nil 103 } 104 105 func (c *genAiCacheServiceClient) ListCachedContents(ctx context.Context, in *ListCachedContentsRequest, opts ...grpc.CallOption) (*ListCachedContentsResponse, error) { 106 out := new(ListCachedContentsResponse) 107 err := c.cc.Invoke(ctx, GenAiCacheService_ListCachedContents_FullMethodName, in, out, opts...) 108 if err != nil { 109 return nil, err 110 } 111 return out, nil 112 } 113 114 // GenAiCacheServiceServer is the server API for GenAiCacheService service. 115 // All implementations should embed UnimplementedGenAiCacheServiceServer 116 // for forward compatibility 117 type GenAiCacheServiceServer interface { 118 // Creates cached content, this call will initialize the cached content in the 119 // data storage, and users need to pay for the cache data storage. 120 CreateCachedContent(context.Context, *CreateCachedContentRequest) (*CachedContent, error) 121 // Gets cached content configurations 122 GetCachedContent(context.Context, *GetCachedContentRequest) (*CachedContent, error) 123 // Updates cached content configurations 124 UpdateCachedContent(context.Context, *UpdateCachedContentRequest) (*CachedContent, error) 125 // Deletes cached content 126 DeleteCachedContent(context.Context, *DeleteCachedContentRequest) (*emptypb.Empty, error) 127 // Lists cached contents in a project 128 ListCachedContents(context.Context, *ListCachedContentsRequest) (*ListCachedContentsResponse, error) 129 } 130 131 // UnimplementedGenAiCacheServiceServer should be embedded to have forward compatible implementations. 132 type UnimplementedGenAiCacheServiceServer struct { 133 } 134 135 func (UnimplementedGenAiCacheServiceServer) CreateCachedContent(context.Context, *CreateCachedContentRequest) (*CachedContent, error) { 136 return nil, status.Errorf(codes.Unimplemented, "method CreateCachedContent not implemented") 137 } 138 func (UnimplementedGenAiCacheServiceServer) GetCachedContent(context.Context, *GetCachedContentRequest) (*CachedContent, error) { 139 return nil, status.Errorf(codes.Unimplemented, "method GetCachedContent not implemented") 140 } 141 func (UnimplementedGenAiCacheServiceServer) UpdateCachedContent(context.Context, *UpdateCachedContentRequest) (*CachedContent, error) { 142 return nil, status.Errorf(codes.Unimplemented, "method UpdateCachedContent not implemented") 143 } 144 func (UnimplementedGenAiCacheServiceServer) DeleteCachedContent(context.Context, *DeleteCachedContentRequest) (*emptypb.Empty, error) { 145 return nil, status.Errorf(codes.Unimplemented, "method DeleteCachedContent not implemented") 146 } 147 func (UnimplementedGenAiCacheServiceServer) ListCachedContents(context.Context, *ListCachedContentsRequest) (*ListCachedContentsResponse, error) { 148 return nil, status.Errorf(codes.Unimplemented, "method ListCachedContents not implemented") 149 } 150 151 // UnsafeGenAiCacheServiceServer may be embedded to opt out of forward compatibility for this service. 152 // Use of this interface is not recommended, as added methods to GenAiCacheServiceServer will 153 // result in compilation errors. 154 type UnsafeGenAiCacheServiceServer interface { 155 mustEmbedUnimplementedGenAiCacheServiceServer() 156 } 157 158 func RegisterGenAiCacheServiceServer(s grpc.ServiceRegistrar, srv GenAiCacheServiceServer) { 159 s.RegisterService(&GenAiCacheService_ServiceDesc, srv) 160 } 161 162 func _GenAiCacheService_CreateCachedContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 163 in := new(CreateCachedContentRequest) 164 if err := dec(in); err != nil { 165 return nil, err 166 } 167 if interceptor == nil { 168 return srv.(GenAiCacheServiceServer).CreateCachedContent(ctx, in) 169 } 170 info := &grpc.UnaryServerInfo{ 171 Server: srv, 172 FullMethod: GenAiCacheService_CreateCachedContent_FullMethodName, 173 } 174 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 175 return srv.(GenAiCacheServiceServer).CreateCachedContent(ctx, req.(*CreateCachedContentRequest)) 176 } 177 return interceptor(ctx, in, info, handler) 178 } 179 180 func _GenAiCacheService_GetCachedContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 181 in := new(GetCachedContentRequest) 182 if err := dec(in); err != nil { 183 return nil, err 184 } 185 if interceptor == nil { 186 return srv.(GenAiCacheServiceServer).GetCachedContent(ctx, in) 187 } 188 info := &grpc.UnaryServerInfo{ 189 Server: srv, 190 FullMethod: GenAiCacheService_GetCachedContent_FullMethodName, 191 } 192 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 193 return srv.(GenAiCacheServiceServer).GetCachedContent(ctx, req.(*GetCachedContentRequest)) 194 } 195 return interceptor(ctx, in, info, handler) 196 } 197 198 func _GenAiCacheService_UpdateCachedContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 199 in := new(UpdateCachedContentRequest) 200 if err := dec(in); err != nil { 201 return nil, err 202 } 203 if interceptor == nil { 204 return srv.(GenAiCacheServiceServer).UpdateCachedContent(ctx, in) 205 } 206 info := &grpc.UnaryServerInfo{ 207 Server: srv, 208 FullMethod: GenAiCacheService_UpdateCachedContent_FullMethodName, 209 } 210 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 211 return srv.(GenAiCacheServiceServer).UpdateCachedContent(ctx, req.(*UpdateCachedContentRequest)) 212 } 213 return interceptor(ctx, in, info, handler) 214 } 215 216 func _GenAiCacheService_DeleteCachedContent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 217 in := new(DeleteCachedContentRequest) 218 if err := dec(in); err != nil { 219 return nil, err 220 } 221 if interceptor == nil { 222 return srv.(GenAiCacheServiceServer).DeleteCachedContent(ctx, in) 223 } 224 info := &grpc.UnaryServerInfo{ 225 Server: srv, 226 FullMethod: GenAiCacheService_DeleteCachedContent_FullMethodName, 227 } 228 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 229 return srv.(GenAiCacheServiceServer).DeleteCachedContent(ctx, req.(*DeleteCachedContentRequest)) 230 } 231 return interceptor(ctx, in, info, handler) 232 } 233 234 func _GenAiCacheService_ListCachedContents_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 235 in := new(ListCachedContentsRequest) 236 if err := dec(in); err != nil { 237 return nil, err 238 } 239 if interceptor == nil { 240 return srv.(GenAiCacheServiceServer).ListCachedContents(ctx, in) 241 } 242 info := &grpc.UnaryServerInfo{ 243 Server: srv, 244 FullMethod: GenAiCacheService_ListCachedContents_FullMethodName, 245 } 246 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 247 return srv.(GenAiCacheServiceServer).ListCachedContents(ctx, req.(*ListCachedContentsRequest)) 248 } 249 return interceptor(ctx, in, info, handler) 250 } 251 252 // GenAiCacheService_ServiceDesc is the grpc.ServiceDesc for GenAiCacheService service. 253 // It's only intended for direct use with grpc.RegisterService, 254 // and not to be introspected or modified (even as a copy) 255 var GenAiCacheService_ServiceDesc = grpc.ServiceDesc{ 256 ServiceName: "google.cloud.aiplatform.v1.GenAiCacheService", 257 HandlerType: (*GenAiCacheServiceServer)(nil), 258 Methods: []grpc.MethodDesc{ 259 { 260 MethodName: "CreateCachedContent", 261 Handler: _GenAiCacheService_CreateCachedContent_Handler, 262 }, 263 { 264 MethodName: "GetCachedContent", 265 Handler: _GenAiCacheService_GetCachedContent_Handler, 266 }, 267 { 268 MethodName: "UpdateCachedContent", 269 Handler: _GenAiCacheService_UpdateCachedContent_Handler, 270 }, 271 { 272 MethodName: "DeleteCachedContent", 273 Handler: _GenAiCacheService_DeleteCachedContent_Handler, 274 }, 275 { 276 MethodName: "ListCachedContents", 277 Handler: _GenAiCacheService_ListCachedContents_Handler, 278 }, 279 }, 280 Streams: []grpc.StreamDesc{}, 281 Metadata: "google/cloud/aiplatform/v1/gen_ai_cache_service.proto", 282 }