cloud.google.com/go/aiplatform@v1.106.0/apiv1/aiplatformpb/genai_tuning_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/genai_tuning_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 emptypb "google.golang.org/protobuf/types/known/emptypb" 30 ) 31 32 // This is a compile-time assertion to ensure that this generated file 33 // is compatible with the grpc package it is being compiled against. 34 // Requires gRPC-Go v1.32.0 or later. 35 const _ = grpc.SupportPackageIsVersion7 36 37 const ( 38 GenAiTuningService_CreateTuningJob_FullMethodName = "/google.cloud.aiplatform.v1.GenAiTuningService/CreateTuningJob" 39 GenAiTuningService_GetTuningJob_FullMethodName = "/google.cloud.aiplatform.v1.GenAiTuningService/GetTuningJob" 40 GenAiTuningService_ListTuningJobs_FullMethodName = "/google.cloud.aiplatform.v1.GenAiTuningService/ListTuningJobs" 41 GenAiTuningService_CancelTuningJob_FullMethodName = "/google.cloud.aiplatform.v1.GenAiTuningService/CancelTuningJob" 42 GenAiTuningService_RebaseTunedModel_FullMethodName = "/google.cloud.aiplatform.v1.GenAiTuningService/RebaseTunedModel" 43 ) 44 45 // GenAiTuningServiceClient is the client API for GenAiTuningService service. 46 // 47 // 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. 48 type GenAiTuningServiceClient interface { 49 // Creates a TuningJob. A created TuningJob right away will be attempted to 50 // be run. 51 CreateTuningJob(ctx context.Context, in *CreateTuningJobRequest, opts ...grpc.CallOption) (*TuningJob, error) 52 // Gets a TuningJob. 53 GetTuningJob(ctx context.Context, in *GetTuningJobRequest, opts ...grpc.CallOption) (*TuningJob, error) 54 // Lists TuningJobs in a Location. 55 ListTuningJobs(ctx context.Context, in *ListTuningJobsRequest, opts ...grpc.CallOption) (*ListTuningJobsResponse, error) 56 // Cancels a TuningJob. 57 // Starts asynchronous cancellation on the TuningJob. The server makes a best 58 // effort to cancel the job, but success is not guaranteed. Clients can use 59 // [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1.GenAiTuningService.GetTuningJob] 60 // or other methods to check whether the cancellation succeeded or whether the 61 // job completed despite cancellation. On successful cancellation, the 62 // TuningJob is not deleted; instead it becomes a job with a 63 // [TuningJob.error][google.cloud.aiplatform.v1.TuningJob.error] value with a 64 // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to 65 // `Code.CANCELLED`, and 66 // [TuningJob.state][google.cloud.aiplatform.v1.TuningJob.state] is set to 67 // `CANCELLED`. 68 CancelTuningJob(ctx context.Context, in *CancelTuningJobRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) 69 // Rebase a TunedModel. 70 RebaseTunedModel(ctx context.Context, in *RebaseTunedModelRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) 71 } 72 73 type genAiTuningServiceClient struct { 74 cc grpc.ClientConnInterface 75 } 76 77 func NewGenAiTuningServiceClient(cc grpc.ClientConnInterface) GenAiTuningServiceClient { 78 return &genAiTuningServiceClient{cc} 79 } 80 81 func (c *genAiTuningServiceClient) CreateTuningJob(ctx context.Context, in *CreateTuningJobRequest, opts ...grpc.CallOption) (*TuningJob, error) { 82 out := new(TuningJob) 83 err := c.cc.Invoke(ctx, GenAiTuningService_CreateTuningJob_FullMethodName, in, out, opts...) 84 if err != nil { 85 return nil, err 86 } 87 return out, nil 88 } 89 90 func (c *genAiTuningServiceClient) GetTuningJob(ctx context.Context, in *GetTuningJobRequest, opts ...grpc.CallOption) (*TuningJob, error) { 91 out := new(TuningJob) 92 err := c.cc.Invoke(ctx, GenAiTuningService_GetTuningJob_FullMethodName, in, out, opts...) 93 if err != nil { 94 return nil, err 95 } 96 return out, nil 97 } 98 99 func (c *genAiTuningServiceClient) ListTuningJobs(ctx context.Context, in *ListTuningJobsRequest, opts ...grpc.CallOption) (*ListTuningJobsResponse, error) { 100 out := new(ListTuningJobsResponse) 101 err := c.cc.Invoke(ctx, GenAiTuningService_ListTuningJobs_FullMethodName, in, out, opts...) 102 if err != nil { 103 return nil, err 104 } 105 return out, nil 106 } 107 108 func (c *genAiTuningServiceClient) CancelTuningJob(ctx context.Context, in *CancelTuningJobRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) { 109 out := new(emptypb.Empty) 110 err := c.cc.Invoke(ctx, GenAiTuningService_CancelTuningJob_FullMethodName, in, out, opts...) 111 if err != nil { 112 return nil, err 113 } 114 return out, nil 115 } 116 117 func (c *genAiTuningServiceClient) RebaseTunedModel(ctx context.Context, in *RebaseTunedModelRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) { 118 out := new(longrunningpb.Operation) 119 err := c.cc.Invoke(ctx, GenAiTuningService_RebaseTunedModel_FullMethodName, in, out, opts...) 120 if err != nil { 121 return nil, err 122 } 123 return out, nil 124 } 125 126 // GenAiTuningServiceServer is the server API for GenAiTuningService service. 127 // All implementations should embed UnimplementedGenAiTuningServiceServer 128 // for forward compatibility 129 type GenAiTuningServiceServer interface { 130 // Creates a TuningJob. A created TuningJob right away will be attempted to 131 // be run. 132 CreateTuningJob(context.Context, *CreateTuningJobRequest) (*TuningJob, error) 133 // Gets a TuningJob. 134 GetTuningJob(context.Context, *GetTuningJobRequest) (*TuningJob, error) 135 // Lists TuningJobs in a Location. 136 ListTuningJobs(context.Context, *ListTuningJobsRequest) (*ListTuningJobsResponse, error) 137 // Cancels a TuningJob. 138 // Starts asynchronous cancellation on the TuningJob. The server makes a best 139 // effort to cancel the job, but success is not guaranteed. Clients can use 140 // [GenAiTuningService.GetTuningJob][google.cloud.aiplatform.v1.GenAiTuningService.GetTuningJob] 141 // or other methods to check whether the cancellation succeeded or whether the 142 // job completed despite cancellation. On successful cancellation, the 143 // TuningJob is not deleted; instead it becomes a job with a 144 // [TuningJob.error][google.cloud.aiplatform.v1.TuningJob.error] value with a 145 // [google.rpc.Status.code][google.rpc.Status.code] of 1, corresponding to 146 // `Code.CANCELLED`, and 147 // [TuningJob.state][google.cloud.aiplatform.v1.TuningJob.state] is set to 148 // `CANCELLED`. 149 CancelTuningJob(context.Context, *CancelTuningJobRequest) (*emptypb.Empty, error) 150 // Rebase a TunedModel. 151 RebaseTunedModel(context.Context, *RebaseTunedModelRequest) (*longrunningpb.Operation, error) 152 } 153 154 // UnimplementedGenAiTuningServiceServer should be embedded to have forward compatible implementations. 155 type UnimplementedGenAiTuningServiceServer struct { 156 } 157 158 func (UnimplementedGenAiTuningServiceServer) CreateTuningJob(context.Context, *CreateTuningJobRequest) (*TuningJob, error) { 159 return nil, status.Errorf(codes.Unimplemented, "method CreateTuningJob not implemented") 160 } 161 func (UnimplementedGenAiTuningServiceServer) GetTuningJob(context.Context, *GetTuningJobRequest) (*TuningJob, error) { 162 return nil, status.Errorf(codes.Unimplemented, "method GetTuningJob not implemented") 163 } 164 func (UnimplementedGenAiTuningServiceServer) ListTuningJobs(context.Context, *ListTuningJobsRequest) (*ListTuningJobsResponse, error) { 165 return nil, status.Errorf(codes.Unimplemented, "method ListTuningJobs not implemented") 166 } 167 func (UnimplementedGenAiTuningServiceServer) CancelTuningJob(context.Context, *CancelTuningJobRequest) (*emptypb.Empty, error) { 168 return nil, status.Errorf(codes.Unimplemented, "method CancelTuningJob not implemented") 169 } 170 func (UnimplementedGenAiTuningServiceServer) RebaseTunedModel(context.Context, *RebaseTunedModelRequest) (*longrunningpb.Operation, error) { 171 return nil, status.Errorf(codes.Unimplemented, "method RebaseTunedModel not implemented") 172 } 173 174 // UnsafeGenAiTuningServiceServer may be embedded to opt out of forward compatibility for this service. 175 // Use of this interface is not recommended, as added methods to GenAiTuningServiceServer will 176 // result in compilation errors. 177 type UnsafeGenAiTuningServiceServer interface { 178 mustEmbedUnimplementedGenAiTuningServiceServer() 179 } 180 181 func RegisterGenAiTuningServiceServer(s grpc.ServiceRegistrar, srv GenAiTuningServiceServer) { 182 s.RegisterService(&GenAiTuningService_ServiceDesc, srv) 183 } 184 185 func _GenAiTuningService_CreateTuningJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 186 in := new(CreateTuningJobRequest) 187 if err := dec(in); err != nil { 188 return nil, err 189 } 190 if interceptor == nil { 191 return srv.(GenAiTuningServiceServer).CreateTuningJob(ctx, in) 192 } 193 info := &grpc.UnaryServerInfo{ 194 Server: srv, 195 FullMethod: GenAiTuningService_CreateTuningJob_FullMethodName, 196 } 197 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 198 return srv.(GenAiTuningServiceServer).CreateTuningJob(ctx, req.(*CreateTuningJobRequest)) 199 } 200 return interceptor(ctx, in, info, handler) 201 } 202 203 func _GenAiTuningService_GetTuningJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 204 in := new(GetTuningJobRequest) 205 if err := dec(in); err != nil { 206 return nil, err 207 } 208 if interceptor == nil { 209 return srv.(GenAiTuningServiceServer).GetTuningJob(ctx, in) 210 } 211 info := &grpc.UnaryServerInfo{ 212 Server: srv, 213 FullMethod: GenAiTuningService_GetTuningJob_FullMethodName, 214 } 215 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 216 return srv.(GenAiTuningServiceServer).GetTuningJob(ctx, req.(*GetTuningJobRequest)) 217 } 218 return interceptor(ctx, in, info, handler) 219 } 220 221 func _GenAiTuningService_ListTuningJobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 222 in := new(ListTuningJobsRequest) 223 if err := dec(in); err != nil { 224 return nil, err 225 } 226 if interceptor == nil { 227 return srv.(GenAiTuningServiceServer).ListTuningJobs(ctx, in) 228 } 229 info := &grpc.UnaryServerInfo{ 230 Server: srv, 231 FullMethod: GenAiTuningService_ListTuningJobs_FullMethodName, 232 } 233 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 234 return srv.(GenAiTuningServiceServer).ListTuningJobs(ctx, req.(*ListTuningJobsRequest)) 235 } 236 return interceptor(ctx, in, info, handler) 237 } 238 239 func _GenAiTuningService_CancelTuningJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 240 in := new(CancelTuningJobRequest) 241 if err := dec(in); err != nil { 242 return nil, err 243 } 244 if interceptor == nil { 245 return srv.(GenAiTuningServiceServer).CancelTuningJob(ctx, in) 246 } 247 info := &grpc.UnaryServerInfo{ 248 Server: srv, 249 FullMethod: GenAiTuningService_CancelTuningJob_FullMethodName, 250 } 251 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 252 return srv.(GenAiTuningServiceServer).CancelTuningJob(ctx, req.(*CancelTuningJobRequest)) 253 } 254 return interceptor(ctx, in, info, handler) 255 } 256 257 func _GenAiTuningService_RebaseTunedModel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 258 in := new(RebaseTunedModelRequest) 259 if err := dec(in); err != nil { 260 return nil, err 261 } 262 if interceptor == nil { 263 return srv.(GenAiTuningServiceServer).RebaseTunedModel(ctx, in) 264 } 265 info := &grpc.UnaryServerInfo{ 266 Server: srv, 267 FullMethod: GenAiTuningService_RebaseTunedModel_FullMethodName, 268 } 269 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 270 return srv.(GenAiTuningServiceServer).RebaseTunedModel(ctx, req.(*RebaseTunedModelRequest)) 271 } 272 return interceptor(ctx, in, info, handler) 273 } 274 275 // GenAiTuningService_ServiceDesc is the grpc.ServiceDesc for GenAiTuningService service. 276 // It's only intended for direct use with grpc.RegisterService, 277 // and not to be introspected or modified (even as a copy) 278 var GenAiTuningService_ServiceDesc = grpc.ServiceDesc{ 279 ServiceName: "google.cloud.aiplatform.v1.GenAiTuningService", 280 HandlerType: (*GenAiTuningServiceServer)(nil), 281 Methods: []grpc.MethodDesc{ 282 { 283 MethodName: "CreateTuningJob", 284 Handler: _GenAiTuningService_CreateTuningJob_Handler, 285 }, 286 { 287 MethodName: "GetTuningJob", 288 Handler: _GenAiTuningService_GetTuningJob_Handler, 289 }, 290 { 291 MethodName: "ListTuningJobs", 292 Handler: _GenAiTuningService_ListTuningJobs_Handler, 293 }, 294 { 295 MethodName: "CancelTuningJob", 296 Handler: _GenAiTuningService_CancelTuningJob_Handler, 297 }, 298 { 299 MethodName: "RebaseTunedModel", 300 Handler: _GenAiTuningService_RebaseTunedModel_Handler, 301 }, 302 }, 303 Streams: []grpc.StreamDesc{}, 304 Metadata: "google/cloud/aiplatform/v1/genai_tuning_service.proto", 305 }