grafeas-v1 0.16.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,939 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright 2024 Google LLC
4
- #
5
- # Licensed under the Apache License, Version 2.0 (the "License");
6
- # you may not use this file except in compliance with the License.
7
- # You may obtain a copy of the License at
8
- #
9
- # https://www.apache.org/licenses/LICENSE-2.0
10
- #
11
- # Unless required by applicable law or agreed to in writing, software
12
- # distributed under the License is distributed on an "AS IS" BASIS,
13
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
- # See the License for the specific language governing permissions and
15
- # limitations under the License.
16
-
17
- # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
-
19
- require "grafeas/v1/grafeas_pb"
20
-
21
- module Grafeas
22
- module V1
23
- module Grafeas
24
- module Rest
25
- ##
26
- # REST service stub for the Grafeas service.
27
- # Service stub contains baseline method implementations
28
- # including transcoding, making the REST call, and deserialing the response.
29
- #
30
- class ServiceStub
31
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
32
- # These require statements are intentionally placed here to initialize
33
- # the REST modules only when it's required.
34
- require "gapic/rest"
35
-
36
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
37
- endpoint_template: endpoint_template,
38
- universe_domain: universe_domain,
39
- credentials: credentials,
40
- numeric_enums: true,
41
- raise_faraday_errors: false
42
- end
43
-
44
- ##
45
- # The effective universe domain
46
- #
47
- # @return [String]
48
- #
49
- def universe_domain
50
- @client_stub.universe_domain
51
- end
52
-
53
- ##
54
- # The effective endpoint
55
- #
56
- # @return [String]
57
- #
58
- def endpoint
59
- @client_stub.endpoint
60
- end
61
-
62
- ##
63
- # Baseline implementation for the get_occurrence REST call
64
- #
65
- # @param request_pb [::Grafeas::V1::GetOccurrenceRequest]
66
- # A request object representing the call parameters. Required.
67
- # @param options [::Gapic::CallOptions]
68
- # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
69
- #
70
- # @yield [result, operation] Access the result along with the TransportOperation object
71
- # @yieldparam result [::Grafeas::V1::Occurrence]
72
- # @yieldparam operation [::Gapic::Rest::TransportOperation]
73
- #
74
- # @return [::Grafeas::V1::Occurrence]
75
- # A result object deserialized from the server's reply
76
- def get_occurrence request_pb, options = nil
77
- raise ::ArgumentError, "request must be provided" if request_pb.nil?
78
-
79
- verb, uri, query_string_params, body = ServiceStub.transcode_get_occurrence_request request_pb
80
- query_string_params = if query_string_params.any?
81
- query_string_params.to_h { |p| p.split "=", 2 }
82
- else
83
- {}
84
- end
85
-
86
- response = @client_stub.make_http_request(
87
- verb,
88
- uri: uri,
89
- body: body || "",
90
- params: query_string_params,
91
- options: options
92
- )
93
- operation = ::Gapic::Rest::TransportOperation.new response
94
- result = ::Grafeas::V1::Occurrence.decode_json response.body, ignore_unknown_fields: true
95
-
96
- yield result, operation if block_given?
97
- result
98
- end
99
-
100
- ##
101
- # Baseline implementation for the list_occurrences REST call
102
- #
103
- # @param request_pb [::Grafeas::V1::ListOccurrencesRequest]
104
- # A request object representing the call parameters. Required.
105
- # @param options [::Gapic::CallOptions]
106
- # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
107
- #
108
- # @yield [result, operation] Access the result along with the TransportOperation object
109
- # @yieldparam result [::Grafeas::V1::ListOccurrencesResponse]
110
- # @yieldparam operation [::Gapic::Rest::TransportOperation]
111
- #
112
- # @return [::Grafeas::V1::ListOccurrencesResponse]
113
- # A result object deserialized from the server's reply
114
- def list_occurrences request_pb, options = nil
115
- raise ::ArgumentError, "request must be provided" if request_pb.nil?
116
-
117
- verb, uri, query_string_params, body = ServiceStub.transcode_list_occurrences_request request_pb
118
- query_string_params = if query_string_params.any?
119
- query_string_params.to_h { |p| p.split "=", 2 }
120
- else
121
- {}
122
- end
123
-
124
- response = @client_stub.make_http_request(
125
- verb,
126
- uri: uri,
127
- body: body || "",
128
- params: query_string_params,
129
- options: options
130
- )
131
- operation = ::Gapic::Rest::TransportOperation.new response
132
- result = ::Grafeas::V1::ListOccurrencesResponse.decode_json response.body, ignore_unknown_fields: true
133
-
134
- yield result, operation if block_given?
135
- result
136
- end
137
-
138
- ##
139
- # Baseline implementation for the delete_occurrence REST call
140
- #
141
- # @param request_pb [::Grafeas::V1::DeleteOccurrenceRequest]
142
- # A request object representing the call parameters. Required.
143
- # @param options [::Gapic::CallOptions]
144
- # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
145
- #
146
- # @yield [result, operation] Access the result along with the TransportOperation object
147
- # @yieldparam result [::Google::Protobuf::Empty]
148
- # @yieldparam operation [::Gapic::Rest::TransportOperation]
149
- #
150
- # @return [::Google::Protobuf::Empty]
151
- # A result object deserialized from the server's reply
152
- def delete_occurrence request_pb, options = nil
153
- raise ::ArgumentError, "request must be provided" if request_pb.nil?
154
-
155
- verb, uri, query_string_params, body = ServiceStub.transcode_delete_occurrence_request request_pb
156
- query_string_params = if query_string_params.any?
157
- query_string_params.to_h { |p| p.split "=", 2 }
158
- else
159
- {}
160
- end
161
-
162
- response = @client_stub.make_http_request(
163
- verb,
164
- uri: uri,
165
- body: body || "",
166
- params: query_string_params,
167
- options: options
168
- )
169
- operation = ::Gapic::Rest::TransportOperation.new response
170
- result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
171
-
172
- yield result, operation if block_given?
173
- result
174
- end
175
-
176
- ##
177
- # Baseline implementation for the create_occurrence REST call
178
- #
179
- # @param request_pb [::Grafeas::V1::CreateOccurrenceRequest]
180
- # A request object representing the call parameters. Required.
181
- # @param options [::Gapic::CallOptions]
182
- # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
183
- #
184
- # @yield [result, operation] Access the result along with the TransportOperation object
185
- # @yieldparam result [::Grafeas::V1::Occurrence]
186
- # @yieldparam operation [::Gapic::Rest::TransportOperation]
187
- #
188
- # @return [::Grafeas::V1::Occurrence]
189
- # A result object deserialized from the server's reply
190
- def create_occurrence request_pb, options = nil
191
- raise ::ArgumentError, "request must be provided" if request_pb.nil?
192
-
193
- verb, uri, query_string_params, body = ServiceStub.transcode_create_occurrence_request request_pb
194
- query_string_params = if query_string_params.any?
195
- query_string_params.to_h { |p| p.split "=", 2 }
196
- else
197
- {}
198
- end
199
-
200
- response = @client_stub.make_http_request(
201
- verb,
202
- uri: uri,
203
- body: body || "",
204
- params: query_string_params,
205
- options: options
206
- )
207
- operation = ::Gapic::Rest::TransportOperation.new response
208
- result = ::Grafeas::V1::Occurrence.decode_json response.body, ignore_unknown_fields: true
209
-
210
- yield result, operation if block_given?
211
- result
212
- end
213
-
214
- ##
215
- # Baseline implementation for the batch_create_occurrences REST call
216
- #
217
- # @param request_pb [::Grafeas::V1::BatchCreateOccurrencesRequest]
218
- # A request object representing the call parameters. Required.
219
- # @param options [::Gapic::CallOptions]
220
- # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
221
- #
222
- # @yield [result, operation] Access the result along with the TransportOperation object
223
- # @yieldparam result [::Grafeas::V1::BatchCreateOccurrencesResponse]
224
- # @yieldparam operation [::Gapic::Rest::TransportOperation]
225
- #
226
- # @return [::Grafeas::V1::BatchCreateOccurrencesResponse]
227
- # A result object deserialized from the server's reply
228
- def batch_create_occurrences request_pb, options = nil
229
- raise ::ArgumentError, "request must be provided" if request_pb.nil?
230
-
231
- verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_occurrences_request request_pb
232
- query_string_params = if query_string_params.any?
233
- query_string_params.to_h { |p| p.split "=", 2 }
234
- else
235
- {}
236
- end
237
-
238
- response = @client_stub.make_http_request(
239
- verb,
240
- uri: uri,
241
- body: body || "",
242
- params: query_string_params,
243
- options: options
244
- )
245
- operation = ::Gapic::Rest::TransportOperation.new response
246
- result = ::Grafeas::V1::BatchCreateOccurrencesResponse.decode_json response.body, ignore_unknown_fields: true
247
-
248
- yield result, operation if block_given?
249
- result
250
- end
251
-
252
- ##
253
- # Baseline implementation for the update_occurrence REST call
254
- #
255
- # @param request_pb [::Grafeas::V1::UpdateOccurrenceRequest]
256
- # A request object representing the call parameters. Required.
257
- # @param options [::Gapic::CallOptions]
258
- # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
259
- #
260
- # @yield [result, operation] Access the result along with the TransportOperation object
261
- # @yieldparam result [::Grafeas::V1::Occurrence]
262
- # @yieldparam operation [::Gapic::Rest::TransportOperation]
263
- #
264
- # @return [::Grafeas::V1::Occurrence]
265
- # A result object deserialized from the server's reply
266
- def update_occurrence request_pb, options = nil
267
- raise ::ArgumentError, "request must be provided" if request_pb.nil?
268
-
269
- verb, uri, query_string_params, body = ServiceStub.transcode_update_occurrence_request request_pb
270
- query_string_params = if query_string_params.any?
271
- query_string_params.to_h { |p| p.split "=", 2 }
272
- else
273
- {}
274
- end
275
-
276
- response = @client_stub.make_http_request(
277
- verb,
278
- uri: uri,
279
- body: body || "",
280
- params: query_string_params,
281
- options: options
282
- )
283
- operation = ::Gapic::Rest::TransportOperation.new response
284
- result = ::Grafeas::V1::Occurrence.decode_json response.body, ignore_unknown_fields: true
285
-
286
- yield result, operation if block_given?
287
- result
288
- end
289
-
290
- ##
291
- # Baseline implementation for the get_occurrence_note REST call
292
- #
293
- # @param request_pb [::Grafeas::V1::GetOccurrenceNoteRequest]
294
- # A request object representing the call parameters. Required.
295
- # @param options [::Gapic::CallOptions]
296
- # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
297
- #
298
- # @yield [result, operation] Access the result along with the TransportOperation object
299
- # @yieldparam result [::Grafeas::V1::Note]
300
- # @yieldparam operation [::Gapic::Rest::TransportOperation]
301
- #
302
- # @return [::Grafeas::V1::Note]
303
- # A result object deserialized from the server's reply
304
- def get_occurrence_note request_pb, options = nil
305
- raise ::ArgumentError, "request must be provided" if request_pb.nil?
306
-
307
- verb, uri, query_string_params, body = ServiceStub.transcode_get_occurrence_note_request request_pb
308
- query_string_params = if query_string_params.any?
309
- query_string_params.to_h { |p| p.split "=", 2 }
310
- else
311
- {}
312
- end
313
-
314
- response = @client_stub.make_http_request(
315
- verb,
316
- uri: uri,
317
- body: body || "",
318
- params: query_string_params,
319
- options: options
320
- )
321
- operation = ::Gapic::Rest::TransportOperation.new response
322
- result = ::Grafeas::V1::Note.decode_json response.body, ignore_unknown_fields: true
323
-
324
- yield result, operation if block_given?
325
- result
326
- end
327
-
328
- ##
329
- # Baseline implementation for the get_note REST call
330
- #
331
- # @param request_pb [::Grafeas::V1::GetNoteRequest]
332
- # A request object representing the call parameters. Required.
333
- # @param options [::Gapic::CallOptions]
334
- # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
335
- #
336
- # @yield [result, operation] Access the result along with the TransportOperation object
337
- # @yieldparam result [::Grafeas::V1::Note]
338
- # @yieldparam operation [::Gapic::Rest::TransportOperation]
339
- #
340
- # @return [::Grafeas::V1::Note]
341
- # A result object deserialized from the server's reply
342
- def get_note request_pb, options = nil
343
- raise ::ArgumentError, "request must be provided" if request_pb.nil?
344
-
345
- verb, uri, query_string_params, body = ServiceStub.transcode_get_note_request request_pb
346
- query_string_params = if query_string_params.any?
347
- query_string_params.to_h { |p| p.split "=", 2 }
348
- else
349
- {}
350
- end
351
-
352
- response = @client_stub.make_http_request(
353
- verb,
354
- uri: uri,
355
- body: body || "",
356
- params: query_string_params,
357
- options: options
358
- )
359
- operation = ::Gapic::Rest::TransportOperation.new response
360
- result = ::Grafeas::V1::Note.decode_json response.body, ignore_unknown_fields: true
361
-
362
- yield result, operation if block_given?
363
- result
364
- end
365
-
366
- ##
367
- # Baseline implementation for the list_notes REST call
368
- #
369
- # @param request_pb [::Grafeas::V1::ListNotesRequest]
370
- # A request object representing the call parameters. Required.
371
- # @param options [::Gapic::CallOptions]
372
- # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
373
- #
374
- # @yield [result, operation] Access the result along with the TransportOperation object
375
- # @yieldparam result [::Grafeas::V1::ListNotesResponse]
376
- # @yieldparam operation [::Gapic::Rest::TransportOperation]
377
- #
378
- # @return [::Grafeas::V1::ListNotesResponse]
379
- # A result object deserialized from the server's reply
380
- def list_notes request_pb, options = nil
381
- raise ::ArgumentError, "request must be provided" if request_pb.nil?
382
-
383
- verb, uri, query_string_params, body = ServiceStub.transcode_list_notes_request request_pb
384
- query_string_params = if query_string_params.any?
385
- query_string_params.to_h { |p| p.split "=", 2 }
386
- else
387
- {}
388
- end
389
-
390
- response = @client_stub.make_http_request(
391
- verb,
392
- uri: uri,
393
- body: body || "",
394
- params: query_string_params,
395
- options: options
396
- )
397
- operation = ::Gapic::Rest::TransportOperation.new response
398
- result = ::Grafeas::V1::ListNotesResponse.decode_json response.body, ignore_unknown_fields: true
399
-
400
- yield result, operation if block_given?
401
- result
402
- end
403
-
404
- ##
405
- # Baseline implementation for the delete_note REST call
406
- #
407
- # @param request_pb [::Grafeas::V1::DeleteNoteRequest]
408
- # A request object representing the call parameters. Required.
409
- # @param options [::Gapic::CallOptions]
410
- # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
411
- #
412
- # @yield [result, operation] Access the result along with the TransportOperation object
413
- # @yieldparam result [::Google::Protobuf::Empty]
414
- # @yieldparam operation [::Gapic::Rest::TransportOperation]
415
- #
416
- # @return [::Google::Protobuf::Empty]
417
- # A result object deserialized from the server's reply
418
- def delete_note request_pb, options = nil
419
- raise ::ArgumentError, "request must be provided" if request_pb.nil?
420
-
421
- verb, uri, query_string_params, body = ServiceStub.transcode_delete_note_request request_pb
422
- query_string_params = if query_string_params.any?
423
- query_string_params.to_h { |p| p.split "=", 2 }
424
- else
425
- {}
426
- end
427
-
428
- response = @client_stub.make_http_request(
429
- verb,
430
- uri: uri,
431
- body: body || "",
432
- params: query_string_params,
433
- options: options
434
- )
435
- operation = ::Gapic::Rest::TransportOperation.new response
436
- result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
437
-
438
- yield result, operation if block_given?
439
- result
440
- end
441
-
442
- ##
443
- # Baseline implementation for the create_note REST call
444
- #
445
- # @param request_pb [::Grafeas::V1::CreateNoteRequest]
446
- # A request object representing the call parameters. Required.
447
- # @param options [::Gapic::CallOptions]
448
- # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
449
- #
450
- # @yield [result, operation] Access the result along with the TransportOperation object
451
- # @yieldparam result [::Grafeas::V1::Note]
452
- # @yieldparam operation [::Gapic::Rest::TransportOperation]
453
- #
454
- # @return [::Grafeas::V1::Note]
455
- # A result object deserialized from the server's reply
456
- def create_note request_pb, options = nil
457
- raise ::ArgumentError, "request must be provided" if request_pb.nil?
458
-
459
- verb, uri, query_string_params, body = ServiceStub.transcode_create_note_request request_pb
460
- query_string_params = if query_string_params.any?
461
- query_string_params.to_h { |p| p.split "=", 2 }
462
- else
463
- {}
464
- end
465
-
466
- response = @client_stub.make_http_request(
467
- verb,
468
- uri: uri,
469
- body: body || "",
470
- params: query_string_params,
471
- options: options
472
- )
473
- operation = ::Gapic::Rest::TransportOperation.new response
474
- result = ::Grafeas::V1::Note.decode_json response.body, ignore_unknown_fields: true
475
-
476
- yield result, operation if block_given?
477
- result
478
- end
479
-
480
- ##
481
- # Baseline implementation for the batch_create_notes REST call
482
- #
483
- # @param request_pb [::Grafeas::V1::BatchCreateNotesRequest]
484
- # A request object representing the call parameters. Required.
485
- # @param options [::Gapic::CallOptions]
486
- # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
487
- #
488
- # @yield [result, operation] Access the result along with the TransportOperation object
489
- # @yieldparam result [::Grafeas::V1::BatchCreateNotesResponse]
490
- # @yieldparam operation [::Gapic::Rest::TransportOperation]
491
- #
492
- # @return [::Grafeas::V1::BatchCreateNotesResponse]
493
- # A result object deserialized from the server's reply
494
- def batch_create_notes request_pb, options = nil
495
- raise ::ArgumentError, "request must be provided" if request_pb.nil?
496
-
497
- verb, uri, query_string_params, body = ServiceStub.transcode_batch_create_notes_request request_pb
498
- query_string_params = if query_string_params.any?
499
- query_string_params.to_h { |p| p.split "=", 2 }
500
- else
501
- {}
502
- end
503
-
504
- response = @client_stub.make_http_request(
505
- verb,
506
- uri: uri,
507
- body: body || "",
508
- params: query_string_params,
509
- options: options
510
- )
511
- operation = ::Gapic::Rest::TransportOperation.new response
512
- result = ::Grafeas::V1::BatchCreateNotesResponse.decode_json response.body, ignore_unknown_fields: true
513
-
514
- yield result, operation if block_given?
515
- result
516
- end
517
-
518
- ##
519
- # Baseline implementation for the update_note REST call
520
- #
521
- # @param request_pb [::Grafeas::V1::UpdateNoteRequest]
522
- # A request object representing the call parameters. Required.
523
- # @param options [::Gapic::CallOptions]
524
- # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
525
- #
526
- # @yield [result, operation] Access the result along with the TransportOperation object
527
- # @yieldparam result [::Grafeas::V1::Note]
528
- # @yieldparam operation [::Gapic::Rest::TransportOperation]
529
- #
530
- # @return [::Grafeas::V1::Note]
531
- # A result object deserialized from the server's reply
532
- def update_note request_pb, options = nil
533
- raise ::ArgumentError, "request must be provided" if request_pb.nil?
534
-
535
- verb, uri, query_string_params, body = ServiceStub.transcode_update_note_request request_pb
536
- query_string_params = if query_string_params.any?
537
- query_string_params.to_h { |p| p.split "=", 2 }
538
- else
539
- {}
540
- end
541
-
542
- response = @client_stub.make_http_request(
543
- verb,
544
- uri: uri,
545
- body: body || "",
546
- params: query_string_params,
547
- options: options
548
- )
549
- operation = ::Gapic::Rest::TransportOperation.new response
550
- result = ::Grafeas::V1::Note.decode_json response.body, ignore_unknown_fields: true
551
-
552
- yield result, operation if block_given?
553
- result
554
- end
555
-
556
- ##
557
- # Baseline implementation for the list_note_occurrences REST call
558
- #
559
- # @param request_pb [::Grafeas::V1::ListNoteOccurrencesRequest]
560
- # A request object representing the call parameters. Required.
561
- # @param options [::Gapic::CallOptions]
562
- # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
563
- #
564
- # @yield [result, operation] Access the result along with the TransportOperation object
565
- # @yieldparam result [::Grafeas::V1::ListNoteOccurrencesResponse]
566
- # @yieldparam operation [::Gapic::Rest::TransportOperation]
567
- #
568
- # @return [::Grafeas::V1::ListNoteOccurrencesResponse]
569
- # A result object deserialized from the server's reply
570
- def list_note_occurrences request_pb, options = nil
571
- raise ::ArgumentError, "request must be provided" if request_pb.nil?
572
-
573
- verb, uri, query_string_params, body = ServiceStub.transcode_list_note_occurrences_request request_pb
574
- query_string_params = if query_string_params.any?
575
- query_string_params.to_h { |p| p.split "=", 2 }
576
- else
577
- {}
578
- end
579
-
580
- response = @client_stub.make_http_request(
581
- verb,
582
- uri: uri,
583
- body: body || "",
584
- params: query_string_params,
585
- options: options
586
- )
587
- operation = ::Gapic::Rest::TransportOperation.new response
588
- result = ::Grafeas::V1::ListNoteOccurrencesResponse.decode_json response.body, ignore_unknown_fields: true
589
-
590
- yield result, operation if block_given?
591
- result
592
- end
593
-
594
- ##
595
- # @private
596
- #
597
- # GRPC transcoding helper method for the get_occurrence REST call
598
- #
599
- # @param request_pb [::Grafeas::V1::GetOccurrenceRequest]
600
- # A request object representing the call parameters. Required.
601
- # @return [Array(String, [String, nil], Hash{String => String})]
602
- # Uri, Body, Query string parameters
603
- def self.transcode_get_occurrence_request request_pb
604
- transcoder = Gapic::Rest::GrpcTranscoder.new
605
- .with_bindings(
606
- uri_method: :get,
607
- uri_template: "/v1/{name}",
608
- matches: [
609
- ["name", %r{^projects/[^/]+/occurrences/[^/]+/?$}, false]
610
- ]
611
- )
612
- .with_bindings(
613
- uri_method: :get,
614
- uri_template: "/v1/{name}",
615
- matches: [
616
- ["name", %r{^projects/[^/]+/locations/[^/]+/occurrences/[^/]+/?$}, false]
617
- ]
618
- )
619
- transcoder.transcode request_pb
620
- end
621
-
622
- ##
623
- # @private
624
- #
625
- # GRPC transcoding helper method for the list_occurrences REST call
626
- #
627
- # @param request_pb [::Grafeas::V1::ListOccurrencesRequest]
628
- # A request object representing the call parameters. Required.
629
- # @return [Array(String, [String, nil], Hash{String => String})]
630
- # Uri, Body, Query string parameters
631
- def self.transcode_list_occurrences_request request_pb
632
- transcoder = Gapic::Rest::GrpcTranscoder.new
633
- .with_bindings(
634
- uri_method: :get,
635
- uri_template: "/v1/{parent}/occurrences",
636
- matches: [
637
- ["parent", %r{^projects/[^/]+/?$}, false]
638
- ]
639
- )
640
- .with_bindings(
641
- uri_method: :get,
642
- uri_template: "/v1/{parent}/occurrences",
643
- matches: [
644
- ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
645
- ]
646
- )
647
- transcoder.transcode request_pb
648
- end
649
-
650
- ##
651
- # @private
652
- #
653
- # GRPC transcoding helper method for the delete_occurrence REST call
654
- #
655
- # @param request_pb [::Grafeas::V1::DeleteOccurrenceRequest]
656
- # A request object representing the call parameters. Required.
657
- # @return [Array(String, [String, nil], Hash{String => String})]
658
- # Uri, Body, Query string parameters
659
- def self.transcode_delete_occurrence_request request_pb
660
- transcoder = Gapic::Rest::GrpcTranscoder.new
661
- .with_bindings(
662
- uri_method: :delete,
663
- uri_template: "/v1/{name}",
664
- matches: [
665
- ["name", %r{^projects/[^/]+/occurrences/[^/]+/?$}, false]
666
- ]
667
- )
668
- transcoder.transcode request_pb
669
- end
670
-
671
- ##
672
- # @private
673
- #
674
- # GRPC transcoding helper method for the create_occurrence REST call
675
- #
676
- # @param request_pb [::Grafeas::V1::CreateOccurrenceRequest]
677
- # A request object representing the call parameters. Required.
678
- # @return [Array(String, [String, nil], Hash{String => String})]
679
- # Uri, Body, Query string parameters
680
- def self.transcode_create_occurrence_request request_pb
681
- transcoder = Gapic::Rest::GrpcTranscoder.new
682
- .with_bindings(
683
- uri_method: :post,
684
- uri_template: "/v1/{parent}/occurrences",
685
- body: "occurrence",
686
- matches: [
687
- ["parent", %r{^projects/[^/]+/?$}, false]
688
- ]
689
- )
690
- transcoder.transcode request_pb
691
- end
692
-
693
- ##
694
- # @private
695
- #
696
- # GRPC transcoding helper method for the batch_create_occurrences REST call
697
- #
698
- # @param request_pb [::Grafeas::V1::BatchCreateOccurrencesRequest]
699
- # A request object representing the call parameters. Required.
700
- # @return [Array(String, [String, nil], Hash{String => String})]
701
- # Uri, Body, Query string parameters
702
- def self.transcode_batch_create_occurrences_request request_pb
703
- transcoder = Gapic::Rest::GrpcTranscoder.new
704
- .with_bindings(
705
- uri_method: :post,
706
- uri_template: "/v1/{parent}/occurrences:batchCreate",
707
- body: "*",
708
- matches: [
709
- ["parent", %r{^projects/[^/]+/?$}, false]
710
- ]
711
- )
712
- transcoder.transcode request_pb
713
- end
714
-
715
- ##
716
- # @private
717
- #
718
- # GRPC transcoding helper method for the update_occurrence REST call
719
- #
720
- # @param request_pb [::Grafeas::V1::UpdateOccurrenceRequest]
721
- # A request object representing the call parameters. Required.
722
- # @return [Array(String, [String, nil], Hash{String => String})]
723
- # Uri, Body, Query string parameters
724
- def self.transcode_update_occurrence_request request_pb
725
- transcoder = Gapic::Rest::GrpcTranscoder.new
726
- .with_bindings(
727
- uri_method: :patch,
728
- uri_template: "/v1/{name}",
729
- body: "occurrence",
730
- matches: [
731
- ["name", %r{^projects/[^/]+/occurrences/[^/]+/?$}, false]
732
- ]
733
- )
734
- transcoder.transcode request_pb
735
- end
736
-
737
- ##
738
- # @private
739
- #
740
- # GRPC transcoding helper method for the get_occurrence_note REST call
741
- #
742
- # @param request_pb [::Grafeas::V1::GetOccurrenceNoteRequest]
743
- # A request object representing the call parameters. Required.
744
- # @return [Array(String, [String, nil], Hash{String => String})]
745
- # Uri, Body, Query string parameters
746
- def self.transcode_get_occurrence_note_request request_pb
747
- transcoder = Gapic::Rest::GrpcTranscoder.new
748
- .with_bindings(
749
- uri_method: :get,
750
- uri_template: "/v1/{name}/notes",
751
- matches: [
752
- ["name", %r{^projects/[^/]+/occurrences/[^/]+/?$}, false]
753
- ]
754
- )
755
- .with_bindings(
756
- uri_method: :get,
757
- uri_template: "/v1/{name}/notes",
758
- matches: [
759
- ["name", %r{^projects/[^/]+/locations/[^/]+/occurrences/[^/]+/?$}, false]
760
- ]
761
- )
762
- transcoder.transcode request_pb
763
- end
764
-
765
- ##
766
- # @private
767
- #
768
- # GRPC transcoding helper method for the get_note REST call
769
- #
770
- # @param request_pb [::Grafeas::V1::GetNoteRequest]
771
- # A request object representing the call parameters. Required.
772
- # @return [Array(String, [String, nil], Hash{String => String})]
773
- # Uri, Body, Query string parameters
774
- def self.transcode_get_note_request request_pb
775
- transcoder = Gapic::Rest::GrpcTranscoder.new
776
- .with_bindings(
777
- uri_method: :get,
778
- uri_template: "/v1/{name}",
779
- matches: [
780
- ["name", %r{^projects/[^/]+/notes/[^/]+/?$}, false]
781
- ]
782
- )
783
- .with_bindings(
784
- uri_method: :get,
785
- uri_template: "/v1/{name}",
786
- matches: [
787
- ["name", %r{^projects/[^/]+/locations/[^/]+/notes/[^/]+/?$}, false]
788
- ]
789
- )
790
- transcoder.transcode request_pb
791
- end
792
-
793
- ##
794
- # @private
795
- #
796
- # GRPC transcoding helper method for the list_notes REST call
797
- #
798
- # @param request_pb [::Grafeas::V1::ListNotesRequest]
799
- # A request object representing the call parameters. Required.
800
- # @return [Array(String, [String, nil], Hash{String => String})]
801
- # Uri, Body, Query string parameters
802
- def self.transcode_list_notes_request request_pb
803
- transcoder = Gapic::Rest::GrpcTranscoder.new
804
- .with_bindings(
805
- uri_method: :get,
806
- uri_template: "/v1/{parent}/notes",
807
- matches: [
808
- ["parent", %r{^projects/[^/]+/?$}, false]
809
- ]
810
- )
811
- .with_bindings(
812
- uri_method: :get,
813
- uri_template: "/v1/{parent}/notes",
814
- matches: [
815
- ["parent", %r{^projects/[^/]+/locations/[^/]+/?$}, false]
816
- ]
817
- )
818
- transcoder.transcode request_pb
819
- end
820
-
821
- ##
822
- # @private
823
- #
824
- # GRPC transcoding helper method for the delete_note REST call
825
- #
826
- # @param request_pb [::Grafeas::V1::DeleteNoteRequest]
827
- # A request object representing the call parameters. Required.
828
- # @return [Array(String, [String, nil], Hash{String => String})]
829
- # Uri, Body, Query string parameters
830
- def self.transcode_delete_note_request request_pb
831
- transcoder = Gapic::Rest::GrpcTranscoder.new
832
- .with_bindings(
833
- uri_method: :delete,
834
- uri_template: "/v1/{name}",
835
- matches: [
836
- ["name", %r{^projects/[^/]+/notes/[^/]+/?$}, false]
837
- ]
838
- )
839
- transcoder.transcode request_pb
840
- end
841
-
842
- ##
843
- # @private
844
- #
845
- # GRPC transcoding helper method for the create_note REST call
846
- #
847
- # @param request_pb [::Grafeas::V1::CreateNoteRequest]
848
- # A request object representing the call parameters. Required.
849
- # @return [Array(String, [String, nil], Hash{String => String})]
850
- # Uri, Body, Query string parameters
851
- def self.transcode_create_note_request request_pb
852
- transcoder = Gapic::Rest::GrpcTranscoder.new
853
- .with_bindings(
854
- uri_method: :post,
855
- uri_template: "/v1/{parent}/notes",
856
- body: "note",
857
- matches: [
858
- ["parent", %r{^projects/[^/]+/?$}, false]
859
- ]
860
- )
861
- transcoder.transcode request_pb
862
- end
863
-
864
- ##
865
- # @private
866
- #
867
- # GRPC transcoding helper method for the batch_create_notes REST call
868
- #
869
- # @param request_pb [::Grafeas::V1::BatchCreateNotesRequest]
870
- # A request object representing the call parameters. Required.
871
- # @return [Array(String, [String, nil], Hash{String => String})]
872
- # Uri, Body, Query string parameters
873
- def self.transcode_batch_create_notes_request request_pb
874
- transcoder = Gapic::Rest::GrpcTranscoder.new
875
- .with_bindings(
876
- uri_method: :post,
877
- uri_template: "/v1/{parent}/notes:batchCreate",
878
- body: "*",
879
- matches: [
880
- ["parent", %r{^projects/[^/]+/?$}, false]
881
- ]
882
- )
883
- transcoder.transcode request_pb
884
- end
885
-
886
- ##
887
- # @private
888
- #
889
- # GRPC transcoding helper method for the update_note REST call
890
- #
891
- # @param request_pb [::Grafeas::V1::UpdateNoteRequest]
892
- # A request object representing the call parameters. Required.
893
- # @return [Array(String, [String, nil], Hash{String => String})]
894
- # Uri, Body, Query string parameters
895
- def self.transcode_update_note_request request_pb
896
- transcoder = Gapic::Rest::GrpcTranscoder.new
897
- .with_bindings(
898
- uri_method: :patch,
899
- uri_template: "/v1/{name}",
900
- body: "note",
901
- matches: [
902
- ["name", %r{^projects/[^/]+/notes/[^/]+/?$}, false]
903
- ]
904
- )
905
- transcoder.transcode request_pb
906
- end
907
-
908
- ##
909
- # @private
910
- #
911
- # GRPC transcoding helper method for the list_note_occurrences REST call
912
- #
913
- # @param request_pb [::Grafeas::V1::ListNoteOccurrencesRequest]
914
- # A request object representing the call parameters. Required.
915
- # @return [Array(String, [String, nil], Hash{String => String})]
916
- # Uri, Body, Query string parameters
917
- def self.transcode_list_note_occurrences_request request_pb
918
- transcoder = Gapic::Rest::GrpcTranscoder.new
919
- .with_bindings(
920
- uri_method: :get,
921
- uri_template: "/v1/{name}/occurrences",
922
- matches: [
923
- ["name", %r{^projects/[^/]+/notes/[^/]+/?$}, false]
924
- ]
925
- )
926
- .with_bindings(
927
- uri_method: :get,
928
- uri_template: "/v1/{name}/occurrences",
929
- matches: [
930
- ["name", %r{^projects/[^/]+/locations/[^/]+/notes/[^/]+/?$}, false]
931
- ]
932
- )
933
- transcoder.transcode request_pb
934
- end
935
- end
936
- end
937
- end
938
- end
939
- end