| 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/batch/v1/batch.proto |
| 20 |
|
| 21 |
package batchpb |
| 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 |
BatchService_CreateJob_FullMethodName = "/google.cloud.batch.v1.BatchService/CreateJob" |
| 38 |
BatchService_GetJob_FullMethodName = "/google.cloud.batch.v1.BatchService/GetJob" |
| 39 |
BatchService_DeleteJob_FullMethodName = "/google.cloud.batch.v1.BatchService/DeleteJob" |
| 40 |
BatchService_CancelJob_FullMethodName = "/google.cloud.batch.v1.BatchService/CancelJob" |
| 41 |
BatchService_ListJobs_FullMethodName = "/google.cloud.batch.v1.BatchService/ListJobs" |
| 42 |
BatchService_GetTask_FullMethodName = "/google.cloud.batch.v1.BatchService/GetTask" |
| 43 |
BatchService_ListTasks_FullMethodName = "/google.cloud.batch.v1.BatchService/ListTasks" |
| 44 |
) |
| 45 |
|
| 46 |
// BatchServiceClient is the client API for BatchService service. |
| 47 |
// |
| 48 |
// 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. |
| 49 |
type BatchServiceClient interface { |
| 50 |
// Create a Job. |
| 51 |
CreateJob(ctx context.Context, in *CreateJobRequest, opts ...grpc.CallOption) (*Job, error) |
| 52 |
// Get a Job specified by its resource name. |
| 53 |
GetJob(ctx context.Context, in *GetJobRequest, opts ...grpc.CallOption) (*Job, error) |
| 54 |
// Delete a Job. |
| 55 |
DeleteJob(ctx context.Context, in *DeleteJobRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) |
| 56 |
// Cancel a Job. |
| 57 |
CancelJob(ctx context.Context, in *CancelJobRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) |
| 58 |
// List all Jobs for a project within a region. |
| 59 |
ListJobs(ctx context.Context, in *ListJobsRequest, opts ...grpc.CallOption) (*ListJobsResponse, error) |
| 60 |
// Return a single Task. |
| 61 |
GetTask(ctx context.Context, in *GetTaskRequest, opts ...grpc.CallOption) (*Task, error) |
| 62 |
// List Tasks associated with a job. |
| 63 |
ListTasks(ctx context.Context, in *ListTasksRequest, opts ...grpc.CallOption) (*ListTasksResponse, error) |
| 64 |
} |
| 65 |
|
| 66 |
type batchServiceClient struct { |
| 67 |
cc grpc.ClientConnInterface |
| 68 |
} |
| 69 |
|
| 70 |
func NewBatchServiceClient(cc grpc.ClientConnInterface) BatchServiceClient { |
| 71 |
return &batchServiceClient{cc} |
| 72 |
} |
| 73 |
|
| 74 |
func (c *batchServiceClient) CreateJob(ctx context.Context, in *CreateJobRequest, opts ...grpc.CallOption) (*Job, error) { |
| 75 |
out := new(Job) |
| 76 |
err := c.cc.Invoke(ctx, BatchService_CreateJob_FullMethodName, in, out, opts...) |
| 77 |
if err != nil { |
| 78 |
return nil, err |
| 79 |
} |
| 80 |
return out, nil |
| 81 |
} |
| 82 |
|
| 83 |
func (c *batchServiceClient) GetJob(ctx context.Context, in *GetJobRequest, opts ...grpc.CallOption) (*Job, error) { |
| 84 |
out := new(Job) |
| 85 |
err := c.cc.Invoke(ctx, BatchService_GetJob_FullMethodName, in, out, opts...) |
| 86 |
if err != nil { |
| 87 |
return nil, err |
| 88 |
} |
| 89 |
return out, nil |
| 90 |
} |
| 91 |
|
| 92 |
func (c *batchServiceClient) DeleteJob(ctx context.Context, in *DeleteJobRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) { |
| 93 |
out := new(longrunningpb.Operation) |
| 94 |
err := c.cc.Invoke(ctx, BatchService_DeleteJob_FullMethodName, in, out, opts...) |
| 95 |
if err != nil { |
| 96 |
return nil, err |
| 97 |
} |
| 98 |
return out, nil |
| 99 |
} |
| 100 |
|
| 101 |
func (c *batchServiceClient) CancelJob(ctx context.Context, in *CancelJobRequest, opts ...grpc.CallOption) (*longrunningpb.Operation, error) { |
| 102 |
out := new(longrunningpb.Operation) |
| 103 |
err := c.cc.Invoke(ctx, BatchService_CancelJob_FullMethodName, in, out, opts...) |
| 104 |
if err != nil { |
| 105 |
return nil, err |
| 106 |
} |
| 107 |
return out, nil |
| 108 |
} |
| 109 |
|
| 110 |
func (c *batchServiceClient) ListJobs(ctx context.Context, in *ListJobsRequest, opts ...grpc.CallOption) (*ListJobsResponse, error) { |
| 111 |
out := new(ListJobsResponse) |
| 112 |
err := c.cc.Invoke(ctx, BatchService_ListJobs_FullMethodName, in, out, opts...) |
| 113 |
if err != nil { |
| 114 |
return nil, err |
| 115 |
} |
| 116 |
return out, nil |
| 117 |
} |
| 118 |
|
| 119 |
func (c *batchServiceClient) GetTask(ctx context.Context, in *GetTaskRequest, opts ...grpc.CallOption) (*Task, error) { |
| 120 |
out := new(Task) |
| 121 |
err := c.cc.Invoke(ctx, BatchService_GetTask_FullMethodName, in, out, opts...) |
| 122 |
if err != nil { |
| 123 |
return nil, err |
| 124 |
} |
| 125 |
return out, nil |
| 126 |
} |
| 127 |
|
| 128 |
func (c *batchServiceClient) ListTasks(ctx context.Context, in *ListTasksRequest, opts ...grpc.CallOption) (*ListTasksResponse, error) { |
| 129 |
out := new(ListTasksResponse) |
| 130 |
err := c.cc.Invoke(ctx, BatchService_ListTasks_FullMethodName, in, out, opts...) |
| 131 |
if err != nil { |
| 132 |
return nil, err |
| 133 |
} |
| 134 |
return out, nil |
| 135 |
} |
| 136 |
|
| 137 |
// BatchServiceServer is the server API for BatchService service. |
| 138 |
// All implementations should embed UnimplementedBatchServiceServer |
| 139 |
// for forward compatibility |
| 140 |
type BatchServiceServer interface { |
| 141 |
// Create a Job. |
| 142 |
CreateJob(context.Context, *CreateJobRequest) (*Job, error) |
| 143 |
// Get a Job specified by its resource name. |
| 144 |
GetJob(context.Context, *GetJobRequest) (*Job, error) |
| 145 |
// Delete a Job. |
| 146 |
DeleteJob(context.Context, *DeleteJobRequest) (*longrunningpb.Operation, error) |
| 147 |
// Cancel a Job. |
| 148 |
CancelJob(context.Context, *CancelJobRequest) (*longrunningpb.Operation, error) |
| 149 |
// List all Jobs for a project within a region. |
| 150 |
ListJobs(context.Context, *ListJobsRequest) (*ListJobsResponse, error) |
| 151 |
// Return a single Task. |
| 152 |
GetTask(context.Context, *GetTaskRequest) (*Task, error) |
| 153 |
// List Tasks associated with a job. |
| 154 |
ListTasks(context.Context, *ListTasksRequest) (*ListTasksResponse, error) |
| 155 |
} |
| 156 |
|
| 157 |
// UnimplementedBatchServiceServer should be embedded to have forward compatible implementations. |
| 158 |
type UnimplementedBatchServiceServer struct { |
| 159 |
} |
| 160 |
|
| 161 |
func (UnimplementedBatchServiceServer) CreateJob(context.Context, *CreateJobRequest) (*Job, error) { |
| 162 |
return nil, status.Errorf(codes.Unimplemented, "method CreateJob not implemented") |
| 163 |
} |
| 164 |
func (UnimplementedBatchServiceServer) GetJob(context.Context, *GetJobRequest) (*Job, error) { |
| 165 |
return nil, status.Errorf(codes.Unimplemented, "method GetJob not implemented") |
| 166 |
} |
| 167 |
func (UnimplementedBatchServiceServer) DeleteJob(context.Context, *DeleteJobRequest) (*longrunningpb.Operation, error) { |
| 168 |
return nil, status.Errorf(codes.Unimplemented, "method DeleteJob not implemented") |
| 169 |
} |
| 170 |
func (UnimplementedBatchServiceServer) CancelJob(context.Context, *CancelJobRequest) (*longrunningpb.Operation, error) { |
| 171 |
return nil, status.Errorf(codes.Unimplemented, "method CancelJob not implemented") |
| 172 |
} |
| 173 |
func (UnimplementedBatchServiceServer) ListJobs(context.Context, *ListJobsRequest) (*ListJobsResponse, error) { |
| 174 |
return nil, status.Errorf(codes.Unimplemented, "method ListJobs not implemented") |
| 175 |
} |
| 176 |
func (UnimplementedBatchServiceServer) GetTask(context.Context, *GetTaskRequest) (*Task, error) { |
| 177 |
return nil, status.Errorf(codes.Unimplemented, "method GetTask not implemented") |
| 178 |
} |
| 179 |
func (UnimplementedBatchServiceServer) ListTasks(context.Context, *ListTasksRequest) (*ListTasksResponse, error) { |
| 180 |
return nil, status.Errorf(codes.Unimplemented, "method ListTasks not implemented") |
| 181 |
} |
| 182 |
|
| 183 |
// UnsafeBatchServiceServer may be embedded to opt out of forward compatibility for this service. |
| 184 |
// Use of this interface is not recommended, as added methods to BatchServiceServer will |
| 185 |
// result in compilation errors. |
| 186 |
type UnsafeBatchServiceServer interface { |
| 187 |
mustEmbedUnimplementedBatchServiceServer() |
| 188 |
} |
| 189 |
|
| 190 |
func RegisterBatchServiceServer(s grpc.ServiceRegistrar, srv BatchServiceServer) { |
| 191 |
s.RegisterService(&BatchService_ServiceDesc, srv) |
| 192 |
} |
| 193 |
|
| 194 |
func _BatchService_CreateJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 195 |
in := new(CreateJobRequest) |
| 196 |
if err := dec(in); err != nil { |
| 197 |
return nil, err |
| 198 |
} |
| 199 |
if interceptor == nil { |
| 200 |
return srv.(BatchServiceServer).CreateJob(ctx, in) |
| 201 |
} |
| 202 |
info := &grpc.UnaryServerInfo{ |
| 203 |
Server: srv, |
| 204 |
FullMethod: BatchService_CreateJob_FullMethodName, |
| 205 |
} |
| 206 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 207 |
return srv.(BatchServiceServer).CreateJob(ctx, req.(*CreateJobRequest)) |
| 208 |
} |
| 209 |
return interceptor(ctx, in, info, handler) |
| 210 |
} |
| 211 |
|
| 212 |
func _BatchService_GetJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 213 |
in := new(GetJobRequest) |
| 214 |
if err := dec(in); err != nil { |
| 215 |
return nil, err |
| 216 |
} |
| 217 |
if interceptor == nil { |
| 218 |
return srv.(BatchServiceServer).GetJob(ctx, in) |
| 219 |
} |
| 220 |
info := &grpc.UnaryServerInfo{ |
| 221 |
Server: srv, |
| 222 |
FullMethod: BatchService_GetJob_FullMethodName, |
| 223 |
} |
| 224 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 225 |
return srv.(BatchServiceServer).GetJob(ctx, req.(*GetJobRequest)) |
| 226 |
} |
| 227 |
return interceptor(ctx, in, info, handler) |
| 228 |
} |
| 229 |
|
| 230 |
func _BatchService_DeleteJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 231 |
in := new(DeleteJobRequest) |
| 232 |
if err := dec(in); err != nil { |
| 233 |
return nil, err |
| 234 |
} |
| 235 |
if interceptor == nil { |
| 236 |
return srv.(BatchServiceServer).DeleteJob(ctx, in) |
| 237 |
} |
| 238 |
info := &grpc.UnaryServerInfo{ |
| 239 |
Server: srv, |
| 240 |
FullMethod: BatchService_DeleteJob_FullMethodName, |
| 241 |
} |
| 242 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 243 |
return srv.(BatchServiceServer).DeleteJob(ctx, req.(*DeleteJobRequest)) |
| 244 |
} |
| 245 |
return interceptor(ctx, in, info, handler) |
| 246 |
} |
| 247 |
|
| 248 |
func _BatchService_CancelJob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 249 |
in := new(CancelJobRequest) |
| 250 |
if err := dec(in); err != nil { |
| 251 |
return nil, err |
| 252 |
} |
| 253 |
if interceptor == nil { |
| 254 |
return srv.(BatchServiceServer).CancelJob(ctx, in) |
| 255 |
} |
| 256 |
info := &grpc.UnaryServerInfo{ |
| 257 |
Server: srv, |
| 258 |
FullMethod: BatchService_CancelJob_FullMethodName, |
| 259 |
} |
| 260 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 261 |
return srv.(BatchServiceServer).CancelJob(ctx, req.(*CancelJobRequest)) |
| 262 |
} |
| 263 |
return interceptor(ctx, in, info, handler) |
| 264 |
} |
| 265 |
|
| 266 |
func _BatchService_ListJobs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 267 |
in := new(ListJobsRequest) |
| 268 |
if err := dec(in); err != nil { |
| 269 |
return nil, err |
| 270 |
} |
| 271 |
if interceptor == nil { |
| 272 |
return srv.(BatchServiceServer).ListJobs(ctx, in) |
| 273 |
} |
| 274 |
info := &grpc.UnaryServerInfo{ |
| 275 |
Server: srv, |
| 276 |
FullMethod: BatchService_ListJobs_FullMethodName, |
| 277 |
} |
| 278 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 279 |
return srv.(BatchServiceServer).ListJobs(ctx, req.(*ListJobsRequest)) |
| 280 |
} |
| 281 |
return interceptor(ctx, in, info, handler) |
| 282 |
} |
| 283 |
|
| 284 |
func _BatchService_GetTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 285 |
in := new(GetTaskRequest) |
| 286 |
if err := dec(in); err != nil { |
| 287 |
return nil, err |
| 288 |
} |
| 289 |
if interceptor == nil { |
| 290 |
return srv.(BatchServiceServer).GetTask(ctx, in) |
| 291 |
} |
| 292 |
info := &grpc.UnaryServerInfo{ |
| 293 |
Server: srv, |
| 294 |
FullMethod: BatchService_GetTask_FullMethodName, |
| 295 |
} |
| 296 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 297 |
return srv.(BatchServiceServer).GetTask(ctx, req.(*GetTaskRequest)) |
| 298 |
} |
| 299 |
return interceptor(ctx, in, info, handler) |
| 300 |
} |
| 301 |
|
| 302 |
func _BatchService_ListTasks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| 303 |
in := new(ListTasksRequest) |
| 304 |
if err := dec(in); err != nil { |
| 305 |
return nil, err |
| 306 |
} |
| 307 |
if interceptor == nil { |
| 308 |
return srv.(BatchServiceServer).ListTasks(ctx, in) |
| 309 |
} |
| 310 |
info := &grpc.UnaryServerInfo{ |
| 311 |
Server: srv, |
| 312 |
FullMethod: BatchService_ListTasks_FullMethodName, |
| 313 |
} |
| 314 |
handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| 315 |
return srv.(BatchServiceServer).ListTasks(ctx, req.(*ListTasksRequest)) |
| 316 |
} |
| 317 |
return interceptor(ctx, in, info, handler) |
| 318 |
} |
| 319 |
|
| 320 |
// BatchService_ServiceDesc is the grpc.ServiceDesc for BatchService service. |
| 321 |
// It's only intended for direct use with grpc.RegisterService, |
| 322 |
// and not to be introspected or modified (even as a copy) |
| 323 |
var BatchService_ServiceDesc = grpc.ServiceDesc{ |
| 324 |
ServiceName: "google.cloud.batch.v1.BatchService", |
| 325 |
HandlerType: (*BatchServiceServer)(nil), |
| 326 |
Methods: []grpc.MethodDesc{ |
| 327 |
{ |
| 328 |
MethodName: "CreateJob", |
| 329 |
Handler: _BatchService_CreateJob_Handler, |
| 330 |
}, |
| 331 |
{ |
| 332 |
MethodName: "GetJob", |
| 333 |
Handler: _BatchService_GetJob_Handler, |
| 334 |
}, |
| 335 |
{ |
| 336 |
MethodName: "DeleteJob", |
| 337 |
Handler: _BatchService_DeleteJob_Handler, |
| 338 |
}, |
| 339 |
{ |
| 340 |
MethodName: "CancelJob", |
| 341 |
Handler: _BatchService_CancelJob_Handler, |
| 342 |
}, |
| 343 |
{ |
| 344 |
MethodName: "ListJobs", |
| 345 |
Handler: _BatchService_ListJobs_Handler, |
| 346 |
}, |
| 347 |
{ |
| 348 |
MethodName: "GetTask", |
| 349 |
Handler: _BatchService_GetTask_Handler, |
| 350 |
}, |
| 351 |
{ |
| 352 |
MethodName: "ListTasks", |
| 353 |
Handler: _BatchService_ListTasks_Handler, |
| 354 |
}, |
| 355 |
}, |
| 356 |
Streams: []grpc.StreamDesc{}, |
| 357 |
Metadata: "google/cloud/batch/v1/batch.proto", |
| 358 |
} |