grafeas-v1 0.1.0

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