grafeas-v1 0.15.0 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1616 @@
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 "google/cloud/errors"
20
+ require "grafeas/v1/grafeas_pb"
21
+ require "grafeas/v1/grafeas/rest/service_stub"
22
+
23
+ module Grafeas
24
+ module V1
25
+ module Grafeas
26
+ module Rest
27
+ ##
28
+ # REST client for the Grafeas service.
29
+ #
30
+ # [Grafeas](https://grafeas.io) API.
31
+ #
32
+ # Retrieves analysis results of Cloud components such as Docker container
33
+ # images.
34
+ #
35
+ # Analysis results are stored as a series of occurrences. An `Occurrence`
36
+ # contains information about a specific analysis instance on a resource. An
37
+ # occurrence refers to a `Note`. A note contains details describing the
38
+ # analysis and is generally stored in a separate project, called a `Provider`.
39
+ # Multiple occurrences can refer to the same note.
40
+ #
41
+ # For example, an SSL vulnerability could affect multiple images. In this case,
42
+ # there would be one note for the vulnerability and an occurrence for each
43
+ # image with the vulnerability referring to that note.
44
+ #
45
+ class Client
46
+ # @private
47
+ DEFAULT_ENDPOINT_TEMPLATE = nil
48
+
49
+ include Paths
50
+
51
+ # @private
52
+ attr_reader :grafeas_stub
53
+
54
+ ##
55
+ # Configure the Grafeas Client class.
56
+ #
57
+ # See {::Grafeas::V1::Grafeas::Rest::Client::Configuration}
58
+ # for a description of the configuration fields.
59
+ #
60
+ # @example
61
+ #
62
+ # # Modify the configuration for all Grafeas clients
63
+ # ::Grafeas::V1::Grafeas::Rest::Client.configure do |config|
64
+ # config.timeout = 10.0
65
+ # end
66
+ #
67
+ # @yield [config] Configure the Client client.
68
+ # @yieldparam config [Client::Configuration]
69
+ #
70
+ # @return [Client::Configuration]
71
+ #
72
+ def self.configure
73
+ @configure ||= begin
74
+ namespace = ["Grafeas", "V1"]
75
+ parent_config = while namespace.any?
76
+ parent_name = namespace.join "::"
77
+ parent_const = const_get parent_name
78
+ break parent_const.configure if parent_const.respond_to? :configure
79
+ namespace.pop
80
+ end
81
+ default_config = Client::Configuration.new parent_config
82
+
83
+ default_config.rpcs.get_occurrence.timeout = 30.0
84
+ default_config.rpcs.get_occurrence.retry_policy = {
85
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
86
+ }
87
+
88
+ default_config.rpcs.list_occurrences.timeout = 30.0
89
+ default_config.rpcs.list_occurrences.retry_policy = {
90
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
91
+ }
92
+
93
+ default_config.rpcs.delete_occurrence.timeout = 30.0
94
+ default_config.rpcs.delete_occurrence.retry_policy = {
95
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
96
+ }
97
+
98
+ default_config.rpcs.create_occurrence.timeout = 30.0
99
+
100
+ default_config.rpcs.batch_create_occurrences.timeout = 30.0
101
+
102
+ default_config.rpcs.update_occurrence.timeout = 30.0
103
+
104
+ default_config.rpcs.get_occurrence_note.timeout = 30.0
105
+ default_config.rpcs.get_occurrence_note.retry_policy = {
106
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
107
+ }
108
+
109
+ default_config.rpcs.get_note.timeout = 30.0
110
+ default_config.rpcs.get_note.retry_policy = {
111
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
112
+ }
113
+
114
+ default_config.rpcs.list_notes.timeout = 30.0
115
+ default_config.rpcs.list_notes.retry_policy = {
116
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
117
+ }
118
+
119
+ default_config.rpcs.delete_note.timeout = 30.0
120
+ default_config.rpcs.delete_note.retry_policy = {
121
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
122
+ }
123
+
124
+ default_config.rpcs.create_note.timeout = 30.0
125
+
126
+ default_config.rpcs.batch_create_notes.timeout = 30.0
127
+
128
+ default_config.rpcs.update_note.timeout = 30.0
129
+
130
+ default_config.rpcs.list_note_occurrences.timeout = 30.0
131
+ default_config.rpcs.list_note_occurrences.retry_policy = {
132
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
133
+ }
134
+
135
+ default_config
136
+ end
137
+ yield @configure if block_given?
138
+ @configure
139
+ end
140
+
141
+ ##
142
+ # Configure the Grafeas Client instance.
143
+ #
144
+ # The configuration is set to the derived mode, meaning that values can be changed,
145
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
146
+ # should be made on {Client.configure}.
147
+ #
148
+ # See {::Grafeas::V1::Grafeas::Rest::Client::Configuration}
149
+ # for a description of the configuration fields.
150
+ #
151
+ # @yield [config] Configure the Client client.
152
+ # @yieldparam config [Client::Configuration]
153
+ #
154
+ # @return [Client::Configuration]
155
+ #
156
+ def configure
157
+ yield @config if block_given?
158
+ @config
159
+ end
160
+
161
+ ##
162
+ # The effective universe domain
163
+ #
164
+ # @return [String]
165
+ #
166
+ def universe_domain
167
+ @grafeas_stub.universe_domain
168
+ end
169
+
170
+ ##
171
+ # Create a new Grafeas REST client object.
172
+ #
173
+ # @example
174
+ #
175
+ # # Create a client using the default configuration
176
+ # client = ::Grafeas::V1::Grafeas::Rest::Client.new
177
+ #
178
+ # # Create a client using a custom configuration
179
+ # client = ::Grafeas::V1::Grafeas::Rest::Client.new do |config|
180
+ # config.timeout = 10.0
181
+ # end
182
+ #
183
+ # @yield [config] Configure the Grafeas client.
184
+ # @yieldparam config [Client::Configuration]
185
+ #
186
+ def initialize
187
+ # Create the configuration object
188
+ @config = Configuration.new Client.configure
189
+
190
+ # Yield the configuration if needed
191
+ yield @config if block_given?
192
+
193
+ # Create credentials
194
+ credentials = @config.credentials
195
+
196
+ @quota_project_id = @config.quota_project
197
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
198
+
199
+ @grafeas_stub = ::Grafeas::V1::Grafeas::Rest::ServiceStub.new(
200
+ endpoint: @config.endpoint,
201
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
202
+ universe_domain: @config.universe_domain,
203
+ credentials: credentials
204
+ )
205
+ end
206
+
207
+ # Service calls
208
+
209
+ ##
210
+ # Gets the specified occurrence.
211
+ #
212
+ # @overload get_occurrence(request, options = nil)
213
+ # Pass arguments to `get_occurrence` via a request object, either of type
214
+ # {::Grafeas::V1::GetOccurrenceRequest} or an equivalent Hash.
215
+ #
216
+ # @param request [::Grafeas::V1::GetOccurrenceRequest, ::Hash]
217
+ # A request object representing the call parameters. Required. To specify no
218
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
219
+ # @param options [::Gapic::CallOptions, ::Hash]
220
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
221
+ #
222
+ # @overload get_occurrence(name: nil)
223
+ # Pass arguments to `get_occurrence` via keyword arguments. Note that at
224
+ # least one keyword argument is required. To specify no parameters, or to keep all
225
+ # the default parameter values, pass an empty Hash as a request object (see above).
226
+ #
227
+ # @param name [::String]
228
+ # The name of the occurrence in the form of
229
+ # `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
230
+ # @yield [result, operation] Access the result along with the TransportOperation object
231
+ # @yieldparam result [::Grafeas::V1::Occurrence]
232
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
233
+ #
234
+ # @return [::Grafeas::V1::Occurrence]
235
+ #
236
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
237
+ #
238
+ # @example Basic example
239
+ # require "grafeas/v1"
240
+ #
241
+ # # Create a client object. The client can be reused for multiple calls.
242
+ # client = Grafeas::V1::Grafeas::Rest::Client.new
243
+ #
244
+ # # Create a request. To set request fields, pass in keyword arguments.
245
+ # request = Grafeas::V1::GetOccurrenceRequest.new
246
+ #
247
+ # # Call the get_occurrence method.
248
+ # result = client.get_occurrence request
249
+ #
250
+ # # The returned object is of type Grafeas::V1::Occurrence.
251
+ # p result
252
+ #
253
+ def get_occurrence request, options = nil
254
+ raise ::ArgumentError, "request must be provided" if request.nil?
255
+
256
+ request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::GetOccurrenceRequest
257
+
258
+ # Converts hash and nil to an options object
259
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
260
+
261
+ # Customize the options with defaults
262
+ call_metadata = @config.rpcs.get_occurrence.metadata.to_h
263
+
264
+ # Set x-goog-api-client and x-goog-user-project headers
265
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
266
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
267
+ gapic_version: ::Grafeas::V1::VERSION,
268
+ transports_version_send: [:rest]
269
+
270
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
271
+
272
+ options.apply_defaults timeout: @config.rpcs.get_occurrence.timeout,
273
+ metadata: call_metadata,
274
+ retry_policy: @config.rpcs.get_occurrence.retry_policy
275
+
276
+ options.apply_defaults timeout: @config.timeout,
277
+ metadata: @config.metadata,
278
+ retry_policy: @config.retry_policy
279
+
280
+ @grafeas_stub.get_occurrence request, options do |result, operation|
281
+ yield result, operation if block_given?
282
+ return result
283
+ end
284
+ rescue ::Gapic::Rest::Error => e
285
+ raise ::Google::Cloud::Error.from_error(e)
286
+ end
287
+
288
+ ##
289
+ # Lists occurrences for the specified project.
290
+ #
291
+ # @overload list_occurrences(request, options = nil)
292
+ # Pass arguments to `list_occurrences` via a request object, either of type
293
+ # {::Grafeas::V1::ListOccurrencesRequest} or an equivalent Hash.
294
+ #
295
+ # @param request [::Grafeas::V1::ListOccurrencesRequest, ::Hash]
296
+ # A request object representing the call parameters. Required. To specify no
297
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
298
+ # @param options [::Gapic::CallOptions, ::Hash]
299
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
300
+ #
301
+ # @overload list_occurrences(parent: nil, filter: nil, page_size: nil, page_token: nil)
302
+ # Pass arguments to `list_occurrences` via keyword arguments. Note that at
303
+ # least one keyword argument is required. To specify no parameters, or to keep all
304
+ # the default parameter values, pass an empty Hash as a request object (see above).
305
+ #
306
+ # @param parent [::String]
307
+ # The name of the project to list occurrences for in the form of
308
+ # `projects/[PROJECT_ID]`.
309
+ # @param filter [::String]
310
+ # The filter expression.
311
+ # @param page_size [::Integer]
312
+ # Number of occurrences to return in the list. Must be positive. Max allowed
313
+ # page size is 1000. If not specified, page size defaults to 20.
314
+ # @param page_token [::String]
315
+ # Token to provide to skip to a particular spot in the list.
316
+ # @yield [result, operation] Access the result along with the TransportOperation object
317
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Grafeas::V1::Occurrence>]
318
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
319
+ #
320
+ # @return [::Gapic::Rest::PagedEnumerable<::Grafeas::V1::Occurrence>]
321
+ #
322
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
323
+ #
324
+ # @example Basic example
325
+ # require "grafeas/v1"
326
+ #
327
+ # # Create a client object. The client can be reused for multiple calls.
328
+ # client = Grafeas::V1::Grafeas::Rest::Client.new
329
+ #
330
+ # # Create a request. To set request fields, pass in keyword arguments.
331
+ # request = Grafeas::V1::ListOccurrencesRequest.new
332
+ #
333
+ # # Call the list_occurrences method.
334
+ # result = client.list_occurrences request
335
+ #
336
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
337
+ # # over elements, and API calls will be issued to fetch pages as needed.
338
+ # result.each do |item|
339
+ # # Each element is of type ::Grafeas::V1::Occurrence.
340
+ # p item
341
+ # end
342
+ #
343
+ def list_occurrences request, options = nil
344
+ raise ::ArgumentError, "request must be provided" if request.nil?
345
+
346
+ request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::ListOccurrencesRequest
347
+
348
+ # Converts hash and nil to an options object
349
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
350
+
351
+ # Customize the options with defaults
352
+ call_metadata = @config.rpcs.list_occurrences.metadata.to_h
353
+
354
+ # Set x-goog-api-client and x-goog-user-project headers
355
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
356
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
357
+ gapic_version: ::Grafeas::V1::VERSION,
358
+ transports_version_send: [:rest]
359
+
360
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
361
+
362
+ options.apply_defaults timeout: @config.rpcs.list_occurrences.timeout,
363
+ metadata: call_metadata,
364
+ retry_policy: @config.rpcs.list_occurrences.retry_policy
365
+
366
+ options.apply_defaults timeout: @config.timeout,
367
+ metadata: @config.metadata,
368
+ retry_policy: @config.retry_policy
369
+
370
+ @grafeas_stub.list_occurrences request, options do |result, operation|
371
+ result = ::Gapic::Rest::PagedEnumerable.new @grafeas_stub, :list_occurrences, "occurrences", request, result, options
372
+ yield result, operation if block_given?
373
+ return result
374
+ end
375
+ rescue ::Gapic::Rest::Error => e
376
+ raise ::Google::Cloud::Error.from_error(e)
377
+ end
378
+
379
+ ##
380
+ # Deletes the specified occurrence. For example, use this method to delete an
381
+ # occurrence when the occurrence is no longer applicable for the given
382
+ # resource.
383
+ #
384
+ # @overload delete_occurrence(request, options = nil)
385
+ # Pass arguments to `delete_occurrence` via a request object, either of type
386
+ # {::Grafeas::V1::DeleteOccurrenceRequest} or an equivalent Hash.
387
+ #
388
+ # @param request [::Grafeas::V1::DeleteOccurrenceRequest, ::Hash]
389
+ # A request object representing the call parameters. Required. To specify no
390
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
391
+ # @param options [::Gapic::CallOptions, ::Hash]
392
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
393
+ #
394
+ # @overload delete_occurrence(name: nil)
395
+ # Pass arguments to `delete_occurrence` via keyword arguments. Note that at
396
+ # least one keyword argument is required. To specify no parameters, or to keep all
397
+ # the default parameter values, pass an empty Hash as a request object (see above).
398
+ #
399
+ # @param name [::String]
400
+ # The name of the occurrence in the form of
401
+ # `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
402
+ # @yield [result, operation] Access the result along with the TransportOperation object
403
+ # @yieldparam result [::Google::Protobuf::Empty]
404
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
405
+ #
406
+ # @return [::Google::Protobuf::Empty]
407
+ #
408
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
409
+ #
410
+ # @example Basic example
411
+ # require "grafeas/v1"
412
+ #
413
+ # # Create a client object. The client can be reused for multiple calls.
414
+ # client = Grafeas::V1::Grafeas::Rest::Client.new
415
+ #
416
+ # # Create a request. To set request fields, pass in keyword arguments.
417
+ # request = Grafeas::V1::DeleteOccurrenceRequest.new
418
+ #
419
+ # # Call the delete_occurrence method.
420
+ # result = client.delete_occurrence request
421
+ #
422
+ # # The returned object is of type Google::Protobuf::Empty.
423
+ # p result
424
+ #
425
+ def delete_occurrence request, options = nil
426
+ raise ::ArgumentError, "request must be provided" if request.nil?
427
+
428
+ request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::DeleteOccurrenceRequest
429
+
430
+ # Converts hash and nil to an options object
431
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
432
+
433
+ # Customize the options with defaults
434
+ call_metadata = @config.rpcs.delete_occurrence.metadata.to_h
435
+
436
+ # Set x-goog-api-client and x-goog-user-project headers
437
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
438
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
439
+ gapic_version: ::Grafeas::V1::VERSION,
440
+ transports_version_send: [:rest]
441
+
442
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
443
+
444
+ options.apply_defaults timeout: @config.rpcs.delete_occurrence.timeout,
445
+ metadata: call_metadata,
446
+ retry_policy: @config.rpcs.delete_occurrence.retry_policy
447
+
448
+ options.apply_defaults timeout: @config.timeout,
449
+ metadata: @config.metadata,
450
+ retry_policy: @config.retry_policy
451
+
452
+ @grafeas_stub.delete_occurrence request, options do |result, operation|
453
+ yield result, operation if block_given?
454
+ return result
455
+ end
456
+ rescue ::Gapic::Rest::Error => e
457
+ raise ::Google::Cloud::Error.from_error(e)
458
+ end
459
+
460
+ ##
461
+ # Creates a new occurrence.
462
+ #
463
+ # @overload create_occurrence(request, options = nil)
464
+ # Pass arguments to `create_occurrence` via a request object, either of type
465
+ # {::Grafeas::V1::CreateOccurrenceRequest} or an equivalent Hash.
466
+ #
467
+ # @param request [::Grafeas::V1::CreateOccurrenceRequest, ::Hash]
468
+ # A request object representing the call parameters. Required. To specify no
469
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
470
+ # @param options [::Gapic::CallOptions, ::Hash]
471
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
472
+ #
473
+ # @overload create_occurrence(parent: nil, occurrence: nil)
474
+ # Pass arguments to `create_occurrence` via keyword arguments. Note that at
475
+ # least one keyword argument is required. To specify no parameters, or to keep all
476
+ # the default parameter values, pass an empty Hash as a request object (see above).
477
+ #
478
+ # @param parent [::String]
479
+ # The name of the project in the form of `projects/[PROJECT_ID]`, under which
480
+ # the occurrence is to be created.
481
+ # @param occurrence [::Grafeas::V1::Occurrence, ::Hash]
482
+ # The occurrence to create.
483
+ # @yield [result, operation] Access the result along with the TransportOperation object
484
+ # @yieldparam result [::Grafeas::V1::Occurrence]
485
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
486
+ #
487
+ # @return [::Grafeas::V1::Occurrence]
488
+ #
489
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
490
+ #
491
+ # @example Basic example
492
+ # require "grafeas/v1"
493
+ #
494
+ # # Create a client object. The client can be reused for multiple calls.
495
+ # client = Grafeas::V1::Grafeas::Rest::Client.new
496
+ #
497
+ # # Create a request. To set request fields, pass in keyword arguments.
498
+ # request = Grafeas::V1::CreateOccurrenceRequest.new
499
+ #
500
+ # # Call the create_occurrence method.
501
+ # result = client.create_occurrence request
502
+ #
503
+ # # The returned object is of type Grafeas::V1::Occurrence.
504
+ # p result
505
+ #
506
+ def create_occurrence request, options = nil
507
+ raise ::ArgumentError, "request must be provided" if request.nil?
508
+
509
+ request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::CreateOccurrenceRequest
510
+
511
+ # Converts hash and nil to an options object
512
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
513
+
514
+ # Customize the options with defaults
515
+ call_metadata = @config.rpcs.create_occurrence.metadata.to_h
516
+
517
+ # Set x-goog-api-client and x-goog-user-project headers
518
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
519
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
520
+ gapic_version: ::Grafeas::V1::VERSION,
521
+ transports_version_send: [:rest]
522
+
523
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
524
+
525
+ options.apply_defaults timeout: @config.rpcs.create_occurrence.timeout,
526
+ metadata: call_metadata,
527
+ retry_policy: @config.rpcs.create_occurrence.retry_policy
528
+
529
+ options.apply_defaults timeout: @config.timeout,
530
+ metadata: @config.metadata,
531
+ retry_policy: @config.retry_policy
532
+
533
+ @grafeas_stub.create_occurrence request, options do |result, operation|
534
+ yield result, operation if block_given?
535
+ return result
536
+ end
537
+ rescue ::Gapic::Rest::Error => e
538
+ raise ::Google::Cloud::Error.from_error(e)
539
+ end
540
+
541
+ ##
542
+ # Creates new occurrences in batch.
543
+ #
544
+ # @overload batch_create_occurrences(request, options = nil)
545
+ # Pass arguments to `batch_create_occurrences` via a request object, either of type
546
+ # {::Grafeas::V1::BatchCreateOccurrencesRequest} or an equivalent Hash.
547
+ #
548
+ # @param request [::Grafeas::V1::BatchCreateOccurrencesRequest, ::Hash]
549
+ # A request object representing the call parameters. Required. To specify no
550
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
551
+ # @param options [::Gapic::CallOptions, ::Hash]
552
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
553
+ #
554
+ # @overload batch_create_occurrences(parent: nil, occurrences: nil)
555
+ # Pass arguments to `batch_create_occurrences` via keyword arguments. Note that at
556
+ # least one keyword argument is required. To specify no parameters, or to keep all
557
+ # the default parameter values, pass an empty Hash as a request object (see above).
558
+ #
559
+ # @param parent [::String]
560
+ # The name of the project in the form of `projects/[PROJECT_ID]`, under which
561
+ # the occurrences are to be created.
562
+ # @param occurrences [::Array<::Grafeas::V1::Occurrence, ::Hash>]
563
+ # The occurrences to create. Max allowed length is 1000.
564
+ # @yield [result, operation] Access the result along with the TransportOperation object
565
+ # @yieldparam result [::Grafeas::V1::BatchCreateOccurrencesResponse]
566
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
567
+ #
568
+ # @return [::Grafeas::V1::BatchCreateOccurrencesResponse]
569
+ #
570
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
571
+ #
572
+ # @example Basic example
573
+ # require "grafeas/v1"
574
+ #
575
+ # # Create a client object. The client can be reused for multiple calls.
576
+ # client = Grafeas::V1::Grafeas::Rest::Client.new
577
+ #
578
+ # # Create a request. To set request fields, pass in keyword arguments.
579
+ # request = Grafeas::V1::BatchCreateOccurrencesRequest.new
580
+ #
581
+ # # Call the batch_create_occurrences method.
582
+ # result = client.batch_create_occurrences request
583
+ #
584
+ # # The returned object is of type Grafeas::V1::BatchCreateOccurrencesResponse.
585
+ # p result
586
+ #
587
+ def batch_create_occurrences request, options = nil
588
+ raise ::ArgumentError, "request must be provided" if request.nil?
589
+
590
+ request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::BatchCreateOccurrencesRequest
591
+
592
+ # Converts hash and nil to an options object
593
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
594
+
595
+ # Customize the options with defaults
596
+ call_metadata = @config.rpcs.batch_create_occurrences.metadata.to_h
597
+
598
+ # Set x-goog-api-client and x-goog-user-project headers
599
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
600
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
601
+ gapic_version: ::Grafeas::V1::VERSION,
602
+ transports_version_send: [:rest]
603
+
604
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
605
+
606
+ options.apply_defaults timeout: @config.rpcs.batch_create_occurrences.timeout,
607
+ metadata: call_metadata,
608
+ retry_policy: @config.rpcs.batch_create_occurrences.retry_policy
609
+
610
+ options.apply_defaults timeout: @config.timeout,
611
+ metadata: @config.metadata,
612
+ retry_policy: @config.retry_policy
613
+
614
+ @grafeas_stub.batch_create_occurrences request, options do |result, operation|
615
+ yield result, operation if block_given?
616
+ return result
617
+ end
618
+ rescue ::Gapic::Rest::Error => e
619
+ raise ::Google::Cloud::Error.from_error(e)
620
+ end
621
+
622
+ ##
623
+ # Updates the specified occurrence.
624
+ #
625
+ # @overload update_occurrence(request, options = nil)
626
+ # Pass arguments to `update_occurrence` via a request object, either of type
627
+ # {::Grafeas::V1::UpdateOccurrenceRequest} or an equivalent Hash.
628
+ #
629
+ # @param request [::Grafeas::V1::UpdateOccurrenceRequest, ::Hash]
630
+ # A request object representing the call parameters. Required. To specify no
631
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
632
+ # @param options [::Gapic::CallOptions, ::Hash]
633
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
634
+ #
635
+ # @overload update_occurrence(name: nil, occurrence: nil, update_mask: nil)
636
+ # Pass arguments to `update_occurrence` via keyword arguments. Note that at
637
+ # least one keyword argument is required. To specify no parameters, or to keep all
638
+ # the default parameter values, pass an empty Hash as a request object (see above).
639
+ #
640
+ # @param name [::String]
641
+ # The name of the occurrence in the form of
642
+ # `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
643
+ # @param occurrence [::Grafeas::V1::Occurrence, ::Hash]
644
+ # The updated occurrence.
645
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
646
+ # The fields to update.
647
+ # @yield [result, operation] Access the result along with the TransportOperation object
648
+ # @yieldparam result [::Grafeas::V1::Occurrence]
649
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
650
+ #
651
+ # @return [::Grafeas::V1::Occurrence]
652
+ #
653
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
654
+ #
655
+ # @example Basic example
656
+ # require "grafeas/v1"
657
+ #
658
+ # # Create a client object. The client can be reused for multiple calls.
659
+ # client = Grafeas::V1::Grafeas::Rest::Client.new
660
+ #
661
+ # # Create a request. To set request fields, pass in keyword arguments.
662
+ # request = Grafeas::V1::UpdateOccurrenceRequest.new
663
+ #
664
+ # # Call the update_occurrence method.
665
+ # result = client.update_occurrence request
666
+ #
667
+ # # The returned object is of type Grafeas::V1::Occurrence.
668
+ # p result
669
+ #
670
+ def update_occurrence request, options = nil
671
+ raise ::ArgumentError, "request must be provided" if request.nil?
672
+
673
+ request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::UpdateOccurrenceRequest
674
+
675
+ # Converts hash and nil to an options object
676
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
677
+
678
+ # Customize the options with defaults
679
+ call_metadata = @config.rpcs.update_occurrence.metadata.to_h
680
+
681
+ # Set x-goog-api-client and x-goog-user-project headers
682
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
683
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
684
+ gapic_version: ::Grafeas::V1::VERSION,
685
+ transports_version_send: [:rest]
686
+
687
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
688
+
689
+ options.apply_defaults timeout: @config.rpcs.update_occurrence.timeout,
690
+ metadata: call_metadata,
691
+ retry_policy: @config.rpcs.update_occurrence.retry_policy
692
+
693
+ options.apply_defaults timeout: @config.timeout,
694
+ metadata: @config.metadata,
695
+ retry_policy: @config.retry_policy
696
+
697
+ @grafeas_stub.update_occurrence request, options do |result, operation|
698
+ yield result, operation if block_given?
699
+ return result
700
+ end
701
+ rescue ::Gapic::Rest::Error => e
702
+ raise ::Google::Cloud::Error.from_error(e)
703
+ end
704
+
705
+ ##
706
+ # Gets the note attached to the specified occurrence. Consumer projects can
707
+ # use this method to get a note that belongs to a provider project.
708
+ #
709
+ # @overload get_occurrence_note(request, options = nil)
710
+ # Pass arguments to `get_occurrence_note` via a request object, either of type
711
+ # {::Grafeas::V1::GetOccurrenceNoteRequest} or an equivalent Hash.
712
+ #
713
+ # @param request [::Grafeas::V1::GetOccurrenceNoteRequest, ::Hash]
714
+ # A request object representing the call parameters. Required. To specify no
715
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
716
+ # @param options [::Gapic::CallOptions, ::Hash]
717
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
718
+ #
719
+ # @overload get_occurrence_note(name: nil)
720
+ # Pass arguments to `get_occurrence_note` via keyword arguments. Note that at
721
+ # least one keyword argument is required. To specify no parameters, or to keep all
722
+ # the default parameter values, pass an empty Hash as a request object (see above).
723
+ #
724
+ # @param name [::String]
725
+ # The name of the occurrence in the form of
726
+ # `projects/[PROJECT_ID]/occurrences/[OCCURRENCE_ID]`.
727
+ # @yield [result, operation] Access the result along with the TransportOperation object
728
+ # @yieldparam result [::Grafeas::V1::Note]
729
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
730
+ #
731
+ # @return [::Grafeas::V1::Note]
732
+ #
733
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
734
+ #
735
+ # @example Basic example
736
+ # require "grafeas/v1"
737
+ #
738
+ # # Create a client object. The client can be reused for multiple calls.
739
+ # client = Grafeas::V1::Grafeas::Rest::Client.new
740
+ #
741
+ # # Create a request. To set request fields, pass in keyword arguments.
742
+ # request = Grafeas::V1::GetOccurrenceNoteRequest.new
743
+ #
744
+ # # Call the get_occurrence_note method.
745
+ # result = client.get_occurrence_note request
746
+ #
747
+ # # The returned object is of type Grafeas::V1::Note.
748
+ # p result
749
+ #
750
+ def get_occurrence_note request, options = nil
751
+ raise ::ArgumentError, "request must be provided" if request.nil?
752
+
753
+ request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::GetOccurrenceNoteRequest
754
+
755
+ # Converts hash and nil to an options object
756
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
757
+
758
+ # Customize the options with defaults
759
+ call_metadata = @config.rpcs.get_occurrence_note.metadata.to_h
760
+
761
+ # Set x-goog-api-client and x-goog-user-project headers
762
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
763
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
764
+ gapic_version: ::Grafeas::V1::VERSION,
765
+ transports_version_send: [:rest]
766
+
767
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
768
+
769
+ options.apply_defaults timeout: @config.rpcs.get_occurrence_note.timeout,
770
+ metadata: call_metadata,
771
+ retry_policy: @config.rpcs.get_occurrence_note.retry_policy
772
+
773
+ options.apply_defaults timeout: @config.timeout,
774
+ metadata: @config.metadata,
775
+ retry_policy: @config.retry_policy
776
+
777
+ @grafeas_stub.get_occurrence_note request, options do |result, operation|
778
+ yield result, operation if block_given?
779
+ return result
780
+ end
781
+ rescue ::Gapic::Rest::Error => e
782
+ raise ::Google::Cloud::Error.from_error(e)
783
+ end
784
+
785
+ ##
786
+ # Gets the specified note.
787
+ #
788
+ # @overload get_note(request, options = nil)
789
+ # Pass arguments to `get_note` via a request object, either of type
790
+ # {::Grafeas::V1::GetNoteRequest} or an equivalent Hash.
791
+ #
792
+ # @param request [::Grafeas::V1::GetNoteRequest, ::Hash]
793
+ # A request object representing the call parameters. Required. To specify no
794
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
795
+ # @param options [::Gapic::CallOptions, ::Hash]
796
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
797
+ #
798
+ # @overload get_note(name: nil)
799
+ # Pass arguments to `get_note` via keyword arguments. Note that at
800
+ # least one keyword argument is required. To specify no parameters, or to keep all
801
+ # the default parameter values, pass an empty Hash as a request object (see above).
802
+ #
803
+ # @param name [::String]
804
+ # The name of the note in the form of
805
+ # `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
806
+ # @yield [result, operation] Access the result along with the TransportOperation object
807
+ # @yieldparam result [::Grafeas::V1::Note]
808
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
809
+ #
810
+ # @return [::Grafeas::V1::Note]
811
+ #
812
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
813
+ #
814
+ # @example Basic example
815
+ # require "grafeas/v1"
816
+ #
817
+ # # Create a client object. The client can be reused for multiple calls.
818
+ # client = Grafeas::V1::Grafeas::Rest::Client.new
819
+ #
820
+ # # Create a request. To set request fields, pass in keyword arguments.
821
+ # request = Grafeas::V1::GetNoteRequest.new
822
+ #
823
+ # # Call the get_note method.
824
+ # result = client.get_note request
825
+ #
826
+ # # The returned object is of type Grafeas::V1::Note.
827
+ # p result
828
+ #
829
+ def get_note request, options = nil
830
+ raise ::ArgumentError, "request must be provided" if request.nil?
831
+
832
+ request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::GetNoteRequest
833
+
834
+ # Converts hash and nil to an options object
835
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
836
+
837
+ # Customize the options with defaults
838
+ call_metadata = @config.rpcs.get_note.metadata.to_h
839
+
840
+ # Set x-goog-api-client and x-goog-user-project headers
841
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
842
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
843
+ gapic_version: ::Grafeas::V1::VERSION,
844
+ transports_version_send: [:rest]
845
+
846
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
847
+
848
+ options.apply_defaults timeout: @config.rpcs.get_note.timeout,
849
+ metadata: call_metadata,
850
+ retry_policy: @config.rpcs.get_note.retry_policy
851
+
852
+ options.apply_defaults timeout: @config.timeout,
853
+ metadata: @config.metadata,
854
+ retry_policy: @config.retry_policy
855
+
856
+ @grafeas_stub.get_note request, options do |result, operation|
857
+ yield result, operation if block_given?
858
+ return result
859
+ end
860
+ rescue ::Gapic::Rest::Error => e
861
+ raise ::Google::Cloud::Error.from_error(e)
862
+ end
863
+
864
+ ##
865
+ # Lists notes for the specified project.
866
+ #
867
+ # @overload list_notes(request, options = nil)
868
+ # Pass arguments to `list_notes` via a request object, either of type
869
+ # {::Grafeas::V1::ListNotesRequest} or an equivalent Hash.
870
+ #
871
+ # @param request [::Grafeas::V1::ListNotesRequest, ::Hash]
872
+ # A request object representing the call parameters. Required. To specify no
873
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
874
+ # @param options [::Gapic::CallOptions, ::Hash]
875
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
876
+ #
877
+ # @overload list_notes(parent: nil, filter: nil, page_size: nil, page_token: nil)
878
+ # Pass arguments to `list_notes` via keyword arguments. Note that at
879
+ # least one keyword argument is required. To specify no parameters, or to keep all
880
+ # the default parameter values, pass an empty Hash as a request object (see above).
881
+ #
882
+ # @param parent [::String]
883
+ # The name of the project to list notes for in the form of
884
+ # `projects/[PROJECT_ID]`.
885
+ # @param filter [::String]
886
+ # The filter expression.
887
+ # @param page_size [::Integer]
888
+ # Number of notes to return in the list. Must be positive. Max allowed page
889
+ # size is 1000. If not specified, page size defaults to 20.
890
+ # @param page_token [::String]
891
+ # Token to provide to skip to a particular spot in the list.
892
+ # @yield [result, operation] Access the result along with the TransportOperation object
893
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Grafeas::V1::Note>]
894
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
895
+ #
896
+ # @return [::Gapic::Rest::PagedEnumerable<::Grafeas::V1::Note>]
897
+ #
898
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
899
+ #
900
+ # @example Basic example
901
+ # require "grafeas/v1"
902
+ #
903
+ # # Create a client object. The client can be reused for multiple calls.
904
+ # client = Grafeas::V1::Grafeas::Rest::Client.new
905
+ #
906
+ # # Create a request. To set request fields, pass in keyword arguments.
907
+ # request = Grafeas::V1::ListNotesRequest.new
908
+ #
909
+ # # Call the list_notes method.
910
+ # result = client.list_notes request
911
+ #
912
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
913
+ # # over elements, and API calls will be issued to fetch pages as needed.
914
+ # result.each do |item|
915
+ # # Each element is of type ::Grafeas::V1::Note.
916
+ # p item
917
+ # end
918
+ #
919
+ def list_notes request, options = nil
920
+ raise ::ArgumentError, "request must be provided" if request.nil?
921
+
922
+ request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::ListNotesRequest
923
+
924
+ # Converts hash and nil to an options object
925
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
926
+
927
+ # Customize the options with defaults
928
+ call_metadata = @config.rpcs.list_notes.metadata.to_h
929
+
930
+ # Set x-goog-api-client and x-goog-user-project headers
931
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
932
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
933
+ gapic_version: ::Grafeas::V1::VERSION,
934
+ transports_version_send: [:rest]
935
+
936
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
937
+
938
+ options.apply_defaults timeout: @config.rpcs.list_notes.timeout,
939
+ metadata: call_metadata,
940
+ retry_policy: @config.rpcs.list_notes.retry_policy
941
+
942
+ options.apply_defaults timeout: @config.timeout,
943
+ metadata: @config.metadata,
944
+ retry_policy: @config.retry_policy
945
+
946
+ @grafeas_stub.list_notes request, options do |result, operation|
947
+ result = ::Gapic::Rest::PagedEnumerable.new @grafeas_stub, :list_notes, "notes", request, result, options
948
+ yield result, operation if block_given?
949
+ return result
950
+ end
951
+ rescue ::Gapic::Rest::Error => e
952
+ raise ::Google::Cloud::Error.from_error(e)
953
+ end
954
+
955
+ ##
956
+ # Deletes the specified note.
957
+ #
958
+ # @overload delete_note(request, options = nil)
959
+ # Pass arguments to `delete_note` via a request object, either of type
960
+ # {::Grafeas::V1::DeleteNoteRequest} or an equivalent Hash.
961
+ #
962
+ # @param request [::Grafeas::V1::DeleteNoteRequest, ::Hash]
963
+ # A request object representing the call parameters. Required. To specify no
964
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
965
+ # @param options [::Gapic::CallOptions, ::Hash]
966
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
967
+ #
968
+ # @overload delete_note(name: nil)
969
+ # Pass arguments to `delete_note` via keyword arguments. Note that at
970
+ # least one keyword argument is required. To specify no parameters, or to keep all
971
+ # the default parameter values, pass an empty Hash as a request object (see above).
972
+ #
973
+ # @param name [::String]
974
+ # The name of the note in the form of
975
+ # `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
976
+ # @yield [result, operation] Access the result along with the TransportOperation object
977
+ # @yieldparam result [::Google::Protobuf::Empty]
978
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
979
+ #
980
+ # @return [::Google::Protobuf::Empty]
981
+ #
982
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
983
+ #
984
+ # @example Basic example
985
+ # require "grafeas/v1"
986
+ #
987
+ # # Create a client object. The client can be reused for multiple calls.
988
+ # client = Grafeas::V1::Grafeas::Rest::Client.new
989
+ #
990
+ # # Create a request. To set request fields, pass in keyword arguments.
991
+ # request = Grafeas::V1::DeleteNoteRequest.new
992
+ #
993
+ # # Call the delete_note method.
994
+ # result = client.delete_note request
995
+ #
996
+ # # The returned object is of type Google::Protobuf::Empty.
997
+ # p result
998
+ #
999
+ def delete_note request, options = nil
1000
+ raise ::ArgumentError, "request must be provided" if request.nil?
1001
+
1002
+ request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::DeleteNoteRequest
1003
+
1004
+ # Converts hash and nil to an options object
1005
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1006
+
1007
+ # Customize the options with defaults
1008
+ call_metadata = @config.rpcs.delete_note.metadata.to_h
1009
+
1010
+ # Set x-goog-api-client and x-goog-user-project headers
1011
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1012
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1013
+ gapic_version: ::Grafeas::V1::VERSION,
1014
+ transports_version_send: [:rest]
1015
+
1016
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1017
+
1018
+ options.apply_defaults timeout: @config.rpcs.delete_note.timeout,
1019
+ metadata: call_metadata,
1020
+ retry_policy: @config.rpcs.delete_note.retry_policy
1021
+
1022
+ options.apply_defaults timeout: @config.timeout,
1023
+ metadata: @config.metadata,
1024
+ retry_policy: @config.retry_policy
1025
+
1026
+ @grafeas_stub.delete_note request, options do |result, operation|
1027
+ yield result, operation if block_given?
1028
+ return result
1029
+ end
1030
+ rescue ::Gapic::Rest::Error => e
1031
+ raise ::Google::Cloud::Error.from_error(e)
1032
+ end
1033
+
1034
+ ##
1035
+ # Creates a new note.
1036
+ #
1037
+ # @overload create_note(request, options = nil)
1038
+ # Pass arguments to `create_note` via a request object, either of type
1039
+ # {::Grafeas::V1::CreateNoteRequest} or an equivalent Hash.
1040
+ #
1041
+ # @param request [::Grafeas::V1::CreateNoteRequest, ::Hash]
1042
+ # A request object representing the call parameters. Required. To specify no
1043
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1044
+ # @param options [::Gapic::CallOptions, ::Hash]
1045
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1046
+ #
1047
+ # @overload create_note(parent: nil, note_id: nil, note: nil)
1048
+ # Pass arguments to `create_note` via keyword arguments. Note that at
1049
+ # least one keyword argument is required. To specify no parameters, or to keep all
1050
+ # the default parameter values, pass an empty Hash as a request object (see above).
1051
+ #
1052
+ # @param parent [::String]
1053
+ # The name of the project in the form of `projects/[PROJECT_ID]`, under which
1054
+ # the note is to be created.
1055
+ # @param note_id [::String]
1056
+ # The ID to use for this note.
1057
+ # @param note [::Grafeas::V1::Note, ::Hash]
1058
+ # The note to create.
1059
+ # @yield [result, operation] Access the result along with the TransportOperation object
1060
+ # @yieldparam result [::Grafeas::V1::Note]
1061
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1062
+ #
1063
+ # @return [::Grafeas::V1::Note]
1064
+ #
1065
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1066
+ #
1067
+ # @example Basic example
1068
+ # require "grafeas/v1"
1069
+ #
1070
+ # # Create a client object. The client can be reused for multiple calls.
1071
+ # client = Grafeas::V1::Grafeas::Rest::Client.new
1072
+ #
1073
+ # # Create a request. To set request fields, pass in keyword arguments.
1074
+ # request = Grafeas::V1::CreateNoteRequest.new
1075
+ #
1076
+ # # Call the create_note method.
1077
+ # result = client.create_note request
1078
+ #
1079
+ # # The returned object is of type Grafeas::V1::Note.
1080
+ # p result
1081
+ #
1082
+ def create_note request, options = nil
1083
+ raise ::ArgumentError, "request must be provided" if request.nil?
1084
+
1085
+ request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::CreateNoteRequest
1086
+
1087
+ # Converts hash and nil to an options object
1088
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1089
+
1090
+ # Customize the options with defaults
1091
+ call_metadata = @config.rpcs.create_note.metadata.to_h
1092
+
1093
+ # Set x-goog-api-client and x-goog-user-project headers
1094
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1095
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1096
+ gapic_version: ::Grafeas::V1::VERSION,
1097
+ transports_version_send: [:rest]
1098
+
1099
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1100
+
1101
+ options.apply_defaults timeout: @config.rpcs.create_note.timeout,
1102
+ metadata: call_metadata,
1103
+ retry_policy: @config.rpcs.create_note.retry_policy
1104
+
1105
+ options.apply_defaults timeout: @config.timeout,
1106
+ metadata: @config.metadata,
1107
+ retry_policy: @config.retry_policy
1108
+
1109
+ @grafeas_stub.create_note request, options do |result, operation|
1110
+ yield result, operation if block_given?
1111
+ return result
1112
+ end
1113
+ rescue ::Gapic::Rest::Error => e
1114
+ raise ::Google::Cloud::Error.from_error(e)
1115
+ end
1116
+
1117
+ ##
1118
+ # Creates new notes in batch.
1119
+ #
1120
+ # @overload batch_create_notes(request, options = nil)
1121
+ # Pass arguments to `batch_create_notes` via a request object, either of type
1122
+ # {::Grafeas::V1::BatchCreateNotesRequest} or an equivalent Hash.
1123
+ #
1124
+ # @param request [::Grafeas::V1::BatchCreateNotesRequest, ::Hash]
1125
+ # A request object representing the call parameters. Required. To specify no
1126
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1127
+ # @param options [::Gapic::CallOptions, ::Hash]
1128
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1129
+ #
1130
+ # @overload batch_create_notes(parent: nil, notes: nil)
1131
+ # Pass arguments to `batch_create_notes` via keyword arguments. Note that at
1132
+ # least one keyword argument is required. To specify no parameters, or to keep all
1133
+ # the default parameter values, pass an empty Hash as a request object (see above).
1134
+ #
1135
+ # @param parent [::String]
1136
+ # The name of the project in the form of `projects/[PROJECT_ID]`, under which
1137
+ # the notes are to be created.
1138
+ # @param notes [::Hash{::String => ::Grafeas::V1::Note, ::Hash}]
1139
+ # The notes to create. Max allowed length is 1000.
1140
+ # @yield [result, operation] Access the result along with the TransportOperation object
1141
+ # @yieldparam result [::Grafeas::V1::BatchCreateNotesResponse]
1142
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1143
+ #
1144
+ # @return [::Grafeas::V1::BatchCreateNotesResponse]
1145
+ #
1146
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1147
+ #
1148
+ # @example Basic example
1149
+ # require "grafeas/v1"
1150
+ #
1151
+ # # Create a client object. The client can be reused for multiple calls.
1152
+ # client = Grafeas::V1::Grafeas::Rest::Client.new
1153
+ #
1154
+ # # Create a request. To set request fields, pass in keyword arguments.
1155
+ # request = Grafeas::V1::BatchCreateNotesRequest.new
1156
+ #
1157
+ # # Call the batch_create_notes method.
1158
+ # result = client.batch_create_notes request
1159
+ #
1160
+ # # The returned object is of type Grafeas::V1::BatchCreateNotesResponse.
1161
+ # p result
1162
+ #
1163
+ def batch_create_notes request, options = nil
1164
+ raise ::ArgumentError, "request must be provided" if request.nil?
1165
+
1166
+ request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::BatchCreateNotesRequest
1167
+
1168
+ # Converts hash and nil to an options object
1169
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1170
+
1171
+ # Customize the options with defaults
1172
+ call_metadata = @config.rpcs.batch_create_notes.metadata.to_h
1173
+
1174
+ # Set x-goog-api-client and x-goog-user-project headers
1175
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1176
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1177
+ gapic_version: ::Grafeas::V1::VERSION,
1178
+ transports_version_send: [:rest]
1179
+
1180
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1181
+
1182
+ options.apply_defaults timeout: @config.rpcs.batch_create_notes.timeout,
1183
+ metadata: call_metadata,
1184
+ retry_policy: @config.rpcs.batch_create_notes.retry_policy
1185
+
1186
+ options.apply_defaults timeout: @config.timeout,
1187
+ metadata: @config.metadata,
1188
+ retry_policy: @config.retry_policy
1189
+
1190
+ @grafeas_stub.batch_create_notes request, options do |result, operation|
1191
+ yield result, operation if block_given?
1192
+ return result
1193
+ end
1194
+ rescue ::Gapic::Rest::Error => e
1195
+ raise ::Google::Cloud::Error.from_error(e)
1196
+ end
1197
+
1198
+ ##
1199
+ # Updates the specified note.
1200
+ #
1201
+ # @overload update_note(request, options = nil)
1202
+ # Pass arguments to `update_note` via a request object, either of type
1203
+ # {::Grafeas::V1::UpdateNoteRequest} or an equivalent Hash.
1204
+ #
1205
+ # @param request [::Grafeas::V1::UpdateNoteRequest, ::Hash]
1206
+ # A request object representing the call parameters. Required. To specify no
1207
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1208
+ # @param options [::Gapic::CallOptions, ::Hash]
1209
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1210
+ #
1211
+ # @overload update_note(name: nil, note: nil, update_mask: nil)
1212
+ # Pass arguments to `update_note` via keyword arguments. Note that at
1213
+ # least one keyword argument is required. To specify no parameters, or to keep all
1214
+ # the default parameter values, pass an empty Hash as a request object (see above).
1215
+ #
1216
+ # @param name [::String]
1217
+ # The name of the note in the form of
1218
+ # `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
1219
+ # @param note [::Grafeas::V1::Note, ::Hash]
1220
+ # The updated note.
1221
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1222
+ # The fields to update.
1223
+ # @yield [result, operation] Access the result along with the TransportOperation object
1224
+ # @yieldparam result [::Grafeas::V1::Note]
1225
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1226
+ #
1227
+ # @return [::Grafeas::V1::Note]
1228
+ #
1229
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1230
+ #
1231
+ # @example Basic example
1232
+ # require "grafeas/v1"
1233
+ #
1234
+ # # Create a client object. The client can be reused for multiple calls.
1235
+ # client = Grafeas::V1::Grafeas::Rest::Client.new
1236
+ #
1237
+ # # Create a request. To set request fields, pass in keyword arguments.
1238
+ # request = Grafeas::V1::UpdateNoteRequest.new
1239
+ #
1240
+ # # Call the update_note method.
1241
+ # result = client.update_note request
1242
+ #
1243
+ # # The returned object is of type Grafeas::V1::Note.
1244
+ # p result
1245
+ #
1246
+ def update_note request, options = nil
1247
+ raise ::ArgumentError, "request must be provided" if request.nil?
1248
+
1249
+ request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::UpdateNoteRequest
1250
+
1251
+ # Converts hash and nil to an options object
1252
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1253
+
1254
+ # Customize the options with defaults
1255
+ call_metadata = @config.rpcs.update_note.metadata.to_h
1256
+
1257
+ # Set x-goog-api-client and x-goog-user-project headers
1258
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1259
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1260
+ gapic_version: ::Grafeas::V1::VERSION,
1261
+ transports_version_send: [:rest]
1262
+
1263
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1264
+
1265
+ options.apply_defaults timeout: @config.rpcs.update_note.timeout,
1266
+ metadata: call_metadata,
1267
+ retry_policy: @config.rpcs.update_note.retry_policy
1268
+
1269
+ options.apply_defaults timeout: @config.timeout,
1270
+ metadata: @config.metadata,
1271
+ retry_policy: @config.retry_policy
1272
+
1273
+ @grafeas_stub.update_note request, options do |result, operation|
1274
+ yield result, operation if block_given?
1275
+ return result
1276
+ end
1277
+ rescue ::Gapic::Rest::Error => e
1278
+ raise ::Google::Cloud::Error.from_error(e)
1279
+ end
1280
+
1281
+ ##
1282
+ # Lists occurrences referencing the specified note. Provider projects can use
1283
+ # this method to get all occurrences across consumer projects referencing the
1284
+ # specified note.
1285
+ #
1286
+ # @overload list_note_occurrences(request, options = nil)
1287
+ # Pass arguments to `list_note_occurrences` via a request object, either of type
1288
+ # {::Grafeas::V1::ListNoteOccurrencesRequest} or an equivalent Hash.
1289
+ #
1290
+ # @param request [::Grafeas::V1::ListNoteOccurrencesRequest, ::Hash]
1291
+ # A request object representing the call parameters. Required. To specify no
1292
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1293
+ # @param options [::Gapic::CallOptions, ::Hash]
1294
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1295
+ #
1296
+ # @overload list_note_occurrences(name: nil, filter: nil, page_size: nil, page_token: nil)
1297
+ # Pass arguments to `list_note_occurrences` via keyword arguments. Note that at
1298
+ # least one keyword argument is required. To specify no parameters, or to keep all
1299
+ # the default parameter values, pass an empty Hash as a request object (see above).
1300
+ #
1301
+ # @param name [::String]
1302
+ # The name of the note to list occurrences for in the form of
1303
+ # `projects/[PROVIDER_ID]/notes/[NOTE_ID]`.
1304
+ # @param filter [::String]
1305
+ # The filter expression.
1306
+ # @param page_size [::Integer]
1307
+ # Number of occurrences to return in the list.
1308
+ # @param page_token [::String]
1309
+ # Token to provide to skip to a particular spot in the list.
1310
+ # @yield [result, operation] Access the result along with the TransportOperation object
1311
+ # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Grafeas::V1::Occurrence>]
1312
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1313
+ #
1314
+ # @return [::Gapic::Rest::PagedEnumerable<::Grafeas::V1::Occurrence>]
1315
+ #
1316
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1317
+ #
1318
+ # @example Basic example
1319
+ # require "grafeas/v1"
1320
+ #
1321
+ # # Create a client object. The client can be reused for multiple calls.
1322
+ # client = Grafeas::V1::Grafeas::Rest::Client.new
1323
+ #
1324
+ # # Create a request. To set request fields, pass in keyword arguments.
1325
+ # request = Grafeas::V1::ListNoteOccurrencesRequest.new
1326
+ #
1327
+ # # Call the list_note_occurrences method.
1328
+ # result = client.list_note_occurrences request
1329
+ #
1330
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
1331
+ # # over elements, and API calls will be issued to fetch pages as needed.
1332
+ # result.each do |item|
1333
+ # # Each element is of type ::Grafeas::V1::Occurrence.
1334
+ # p item
1335
+ # end
1336
+ #
1337
+ def list_note_occurrences request, options = nil
1338
+ raise ::ArgumentError, "request must be provided" if request.nil?
1339
+
1340
+ request = ::Gapic::Protobuf.coerce request, to: ::Grafeas::V1::ListNoteOccurrencesRequest
1341
+
1342
+ # Converts hash and nil to an options object
1343
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1344
+
1345
+ # Customize the options with defaults
1346
+ call_metadata = @config.rpcs.list_note_occurrences.metadata.to_h
1347
+
1348
+ # Set x-goog-api-client and x-goog-user-project headers
1349
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1350
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1351
+ gapic_version: ::Grafeas::V1::VERSION,
1352
+ transports_version_send: [:rest]
1353
+
1354
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1355
+
1356
+ options.apply_defaults timeout: @config.rpcs.list_note_occurrences.timeout,
1357
+ metadata: call_metadata,
1358
+ retry_policy: @config.rpcs.list_note_occurrences.retry_policy
1359
+
1360
+ options.apply_defaults timeout: @config.timeout,
1361
+ metadata: @config.metadata,
1362
+ retry_policy: @config.retry_policy
1363
+
1364
+ @grafeas_stub.list_note_occurrences request, options do |result, operation|
1365
+ result = ::Gapic::Rest::PagedEnumerable.new @grafeas_stub, :list_note_occurrences, "occurrences", request, result, options
1366
+ yield result, operation if block_given?
1367
+ return result
1368
+ end
1369
+ rescue ::Gapic::Rest::Error => e
1370
+ raise ::Google::Cloud::Error.from_error(e)
1371
+ end
1372
+
1373
+ ##
1374
+ # Configuration class for the Grafeas REST API.
1375
+ #
1376
+ # This class represents the configuration for Grafeas REST,
1377
+ # providing control over timeouts, retry behavior, logging, transport
1378
+ # parameters, and other low-level controls. Certain parameters can also be
1379
+ # applied individually to specific RPCs. See
1380
+ # {::Grafeas::V1::Grafeas::Rest::Client::Configuration::Rpcs}
1381
+ # for a list of RPCs that can be configured independently.
1382
+ #
1383
+ # Configuration can be applied globally to all clients, or to a single client
1384
+ # on construction.
1385
+ #
1386
+ # @example
1387
+ #
1388
+ # # Modify the global config, setting the timeout for
1389
+ # # get_occurrence to 20 seconds,
1390
+ # # and all remaining timeouts to 10 seconds.
1391
+ # ::Grafeas::V1::Grafeas::Rest::Client.configure do |config|
1392
+ # config.timeout = 10.0
1393
+ # config.rpcs.get_occurrence.timeout = 20.0
1394
+ # end
1395
+ #
1396
+ # # Apply the above configuration only to a new client.
1397
+ # client = ::Grafeas::V1::Grafeas::Rest::Client.new do |config|
1398
+ # config.timeout = 10.0
1399
+ # config.rpcs.get_occurrence.timeout = 20.0
1400
+ # end
1401
+ #
1402
+ # @!attribute [rw] endpoint
1403
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1404
+ # nil, indicating to use the default endpoint in the current universe domain.
1405
+ # @return [::String,nil]
1406
+ # @!attribute [rw] credentials
1407
+ # Credentials to send with calls. You may provide any of the following types:
1408
+ # * (`String`) The path to a service account key file in JSON format
1409
+ # * (`Hash`) A service account key as a Hash
1410
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1411
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1412
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1413
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1414
+ # * (`nil`) indicating no credentials
1415
+ # @return [::Object]
1416
+ # @!attribute [rw] scope
1417
+ # The OAuth scopes
1418
+ # @return [::Array<::String>]
1419
+ # @!attribute [rw] lib_name
1420
+ # The library name as recorded in instrumentation and logging
1421
+ # @return [::String]
1422
+ # @!attribute [rw] lib_version
1423
+ # The library version as recorded in instrumentation and logging
1424
+ # @return [::String]
1425
+ # @!attribute [rw] timeout
1426
+ # The call timeout in seconds.
1427
+ # @return [::Numeric]
1428
+ # @!attribute [rw] metadata
1429
+ # Additional headers to be sent with the call.
1430
+ # @return [::Hash{::Symbol=>::String}]
1431
+ # @!attribute [rw] retry_policy
1432
+ # The retry policy. The value is a hash with the following keys:
1433
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1434
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1435
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1436
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1437
+ # trigger a retry.
1438
+ # @return [::Hash]
1439
+ # @!attribute [rw] quota_project
1440
+ # A separate project against which to charge quota.
1441
+ # @return [::String]
1442
+ # @!attribute [rw] universe_domain
1443
+ # The universe domain within which to make requests. This determines the
1444
+ # default endpoint URL. The default value of nil uses the environment
1445
+ # universe (usually the default "googleapis.com" universe).
1446
+ # @return [::String,nil]
1447
+ #
1448
+ class Configuration
1449
+ extend ::Gapic::Config
1450
+
1451
+ # @private
1452
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1453
+ DEFAULT_ENDPOINT = nil
1454
+
1455
+ config_attr :endpoint, nil, ::String, nil
1456
+ config_attr :credentials, nil do |value|
1457
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1458
+ allowed.any? { |klass| klass === value }
1459
+ end
1460
+ config_attr :scope, nil, ::String, ::Array, nil
1461
+ config_attr :lib_name, nil, ::String, nil
1462
+ config_attr :lib_version, nil, ::String, nil
1463
+ config_attr :timeout, nil, ::Numeric, nil
1464
+ config_attr :metadata, nil, ::Hash, nil
1465
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1466
+ config_attr :quota_project, nil, ::String, nil
1467
+ config_attr :universe_domain, nil, ::String, nil
1468
+
1469
+ # @private
1470
+ def initialize parent_config = nil
1471
+ @parent_config = parent_config unless parent_config.nil?
1472
+
1473
+ yield self if block_given?
1474
+ end
1475
+
1476
+ ##
1477
+ # Configurations for individual RPCs
1478
+ # @return [Rpcs]
1479
+ #
1480
+ def rpcs
1481
+ @rpcs ||= begin
1482
+ parent_rpcs = nil
1483
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1484
+ Rpcs.new parent_rpcs
1485
+ end
1486
+ end
1487
+
1488
+ ##
1489
+ # Configuration RPC class for the Grafeas API.
1490
+ #
1491
+ # Includes fields providing the configuration for each RPC in this service.
1492
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1493
+ # the following configuration fields:
1494
+ #
1495
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1496
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1497
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1498
+ # include the following keys:
1499
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1500
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1501
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1502
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1503
+ # trigger a retry.
1504
+ #
1505
+ class Rpcs
1506
+ ##
1507
+ # RPC-specific configuration for `get_occurrence`
1508
+ # @return [::Gapic::Config::Method]
1509
+ #
1510
+ attr_reader :get_occurrence
1511
+ ##
1512
+ # RPC-specific configuration for `list_occurrences`
1513
+ # @return [::Gapic::Config::Method]
1514
+ #
1515
+ attr_reader :list_occurrences
1516
+ ##
1517
+ # RPC-specific configuration for `delete_occurrence`
1518
+ # @return [::Gapic::Config::Method]
1519
+ #
1520
+ attr_reader :delete_occurrence
1521
+ ##
1522
+ # RPC-specific configuration for `create_occurrence`
1523
+ # @return [::Gapic::Config::Method]
1524
+ #
1525
+ attr_reader :create_occurrence
1526
+ ##
1527
+ # RPC-specific configuration for `batch_create_occurrences`
1528
+ # @return [::Gapic::Config::Method]
1529
+ #
1530
+ attr_reader :batch_create_occurrences
1531
+ ##
1532
+ # RPC-specific configuration for `update_occurrence`
1533
+ # @return [::Gapic::Config::Method]
1534
+ #
1535
+ attr_reader :update_occurrence
1536
+ ##
1537
+ # RPC-specific configuration for `get_occurrence_note`
1538
+ # @return [::Gapic::Config::Method]
1539
+ #
1540
+ attr_reader :get_occurrence_note
1541
+ ##
1542
+ # RPC-specific configuration for `get_note`
1543
+ # @return [::Gapic::Config::Method]
1544
+ #
1545
+ attr_reader :get_note
1546
+ ##
1547
+ # RPC-specific configuration for `list_notes`
1548
+ # @return [::Gapic::Config::Method]
1549
+ #
1550
+ attr_reader :list_notes
1551
+ ##
1552
+ # RPC-specific configuration for `delete_note`
1553
+ # @return [::Gapic::Config::Method]
1554
+ #
1555
+ attr_reader :delete_note
1556
+ ##
1557
+ # RPC-specific configuration for `create_note`
1558
+ # @return [::Gapic::Config::Method]
1559
+ #
1560
+ attr_reader :create_note
1561
+ ##
1562
+ # RPC-specific configuration for `batch_create_notes`
1563
+ # @return [::Gapic::Config::Method]
1564
+ #
1565
+ attr_reader :batch_create_notes
1566
+ ##
1567
+ # RPC-specific configuration for `update_note`
1568
+ # @return [::Gapic::Config::Method]
1569
+ #
1570
+ attr_reader :update_note
1571
+ ##
1572
+ # RPC-specific configuration for `list_note_occurrences`
1573
+ # @return [::Gapic::Config::Method]
1574
+ #
1575
+ attr_reader :list_note_occurrences
1576
+
1577
+ # @private
1578
+ def initialize parent_rpcs = nil
1579
+ get_occurrence_config = parent_rpcs.get_occurrence if parent_rpcs.respond_to? :get_occurrence
1580
+ @get_occurrence = ::Gapic::Config::Method.new get_occurrence_config
1581
+ list_occurrences_config = parent_rpcs.list_occurrences if parent_rpcs.respond_to? :list_occurrences
1582
+ @list_occurrences = ::Gapic::Config::Method.new list_occurrences_config
1583
+ delete_occurrence_config = parent_rpcs.delete_occurrence if parent_rpcs.respond_to? :delete_occurrence
1584
+ @delete_occurrence = ::Gapic::Config::Method.new delete_occurrence_config
1585
+ create_occurrence_config = parent_rpcs.create_occurrence if parent_rpcs.respond_to? :create_occurrence
1586
+ @create_occurrence = ::Gapic::Config::Method.new create_occurrence_config
1587
+ batch_create_occurrences_config = parent_rpcs.batch_create_occurrences if parent_rpcs.respond_to? :batch_create_occurrences
1588
+ @batch_create_occurrences = ::Gapic::Config::Method.new batch_create_occurrences_config
1589
+ update_occurrence_config = parent_rpcs.update_occurrence if parent_rpcs.respond_to? :update_occurrence
1590
+ @update_occurrence = ::Gapic::Config::Method.new update_occurrence_config
1591
+ get_occurrence_note_config = parent_rpcs.get_occurrence_note if parent_rpcs.respond_to? :get_occurrence_note
1592
+ @get_occurrence_note = ::Gapic::Config::Method.new get_occurrence_note_config
1593
+ get_note_config = parent_rpcs.get_note if parent_rpcs.respond_to? :get_note
1594
+ @get_note = ::Gapic::Config::Method.new get_note_config
1595
+ list_notes_config = parent_rpcs.list_notes if parent_rpcs.respond_to? :list_notes
1596
+ @list_notes = ::Gapic::Config::Method.new list_notes_config
1597
+ delete_note_config = parent_rpcs.delete_note if parent_rpcs.respond_to? :delete_note
1598
+ @delete_note = ::Gapic::Config::Method.new delete_note_config
1599
+ create_note_config = parent_rpcs.create_note if parent_rpcs.respond_to? :create_note
1600
+ @create_note = ::Gapic::Config::Method.new create_note_config
1601
+ batch_create_notes_config = parent_rpcs.batch_create_notes if parent_rpcs.respond_to? :batch_create_notes
1602
+ @batch_create_notes = ::Gapic::Config::Method.new batch_create_notes_config
1603
+ update_note_config = parent_rpcs.update_note if parent_rpcs.respond_to? :update_note
1604
+ @update_note = ::Gapic::Config::Method.new update_note_config
1605
+ list_note_occurrences_config = parent_rpcs.list_note_occurrences if parent_rpcs.respond_to? :list_note_occurrences
1606
+ @list_note_occurrences = ::Gapic::Config::Method.new list_note_occurrences_config
1607
+
1608
+ yield self if block_given?
1609
+ end
1610
+ end
1611
+ end
1612
+ end
1613
+ end
1614
+ end
1615
+ end
1616
+ end