google-cloud-cloud_controls_partner-v1beta 0.a → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +144 -8
  5. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_core/client.rb +1156 -0
  6. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_core/credentials.rb +47 -0
  7. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_core/paths.rb +149 -0
  8. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_core/rest/client.rb +1071 -0
  9. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_core/rest/service_stub.rb +541 -0
  10. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_core/rest.rb +52 -0
  11. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_core.rb +55 -0
  12. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_monitoring/client.rb +551 -0
  13. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_monitoring/credentials.rb +47 -0
  14. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_monitoring/paths.rb +77 -0
  15. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_monitoring/rest/client.rb +510 -0
  16. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_monitoring/rest/service_stub.rb +187 -0
  17. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_monitoring/rest.rb +52 -0
  18. data/lib/google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_monitoring.rb +55 -0
  19. data/lib/google/cloud/cloud_controls_partner/v1beta/rest.rb +38 -0
  20. data/lib/google/cloud/cloud_controls_partner/v1beta/version.rb +7 -2
  21. data/lib/google/cloud/cloud_controls_partner/v1beta.rb +46 -0
  22. data/lib/google/cloud/cloudcontrolspartner/v1beta/access_approval_requests_pb.rb +51 -0
  23. data/lib/google/cloud/cloudcontrolspartner/v1beta/completion_state_pb.rb +42 -0
  24. data/lib/google/cloud/cloudcontrolspartner/v1beta/core_pb.rb +55 -0
  25. data/lib/google/cloud/cloudcontrolspartner/v1beta/core_services_pb.rb +59 -0
  26. data/lib/google/cloud/cloudcontrolspartner/v1beta/customer_workloads_pb.rb +55 -0
  27. data/lib/google/cloud/cloudcontrolspartner/v1beta/customers_pb.rb +54 -0
  28. data/lib/google/cloud/cloudcontrolspartner/v1beta/ekm_connections_pb.rb +49 -0
  29. data/lib/google/cloud/cloudcontrolspartner/v1beta/monitoring_pb.rb +45 -0
  30. data/lib/google/cloud/cloudcontrolspartner/v1beta/monitoring_services_pb.rb +53 -0
  31. data/lib/google/cloud/cloudcontrolspartner/v1beta/partner_permissions_pb.rb +47 -0
  32. data/lib/google/cloud/cloudcontrolspartner/v1beta/partners_pb.rb +51 -0
  33. data/lib/google/cloud/cloudcontrolspartner/v1beta/violations_pb.rb +58 -0
  34. data/lib/google-cloud-cloud_controls_partner-v1beta.rb +21 -0
  35. data/proto_docs/README.md +4 -0
  36. data/proto_docs/google/api/client.rb +399 -0
  37. data/proto_docs/google/api/field_behavior.rb +85 -0
  38. data/proto_docs/google/api/launch_stage.rb +71 -0
  39. data/proto_docs/google/api/resource.rb +222 -0
  40. data/proto_docs/google/cloud/cloudcontrolspartner/v1beta/access_approval_requests.rb +143 -0
  41. data/proto_docs/google/cloud/cloudcontrolspartner/v1beta/completion_state.rb +44 -0
  42. data/proto_docs/google/cloud/cloudcontrolspartner/v1beta/core.rb +57 -0
  43. data/proto_docs/google/cloud/cloudcontrolspartner/v1beta/customer_workloads.rb +177 -0
  44. data/proto_docs/google/cloud/cloudcontrolspartner/v1beta/customers.rb +134 -0
  45. data/proto_docs/google/cloud/cloudcontrolspartner/v1beta/ekm_connections.rb +96 -0
  46. data/proto_docs/google/cloud/cloudcontrolspartner/v1beta/partner_permissions.rb +66 -0
  47. data/proto_docs/google/cloud/cloudcontrolspartner/v1beta/partners.rb +116 -0
  48. data/proto_docs/google/cloud/cloudcontrolspartner/v1beta/violations.rb +229 -0
  49. data/proto_docs/google/protobuf/duration.rb +98 -0
  50. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  51. data/proto_docs/google/type/interval.rb +45 -0
  52. metadata +94 -11
@@ -0,0 +1,510 @@
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 "google/cloud/cloudcontrolspartner/v1beta/monitoring_pb"
21
+ require "google/cloud/cloud_controls_partner/v1beta/cloud_controls_partner_monitoring/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module CloudControlsPartner
26
+ module V1beta
27
+ module CloudControlsPartnerMonitoring
28
+ module Rest
29
+ ##
30
+ # REST client for the CloudControlsPartnerMonitoring service.
31
+ #
32
+ # Service describing handlers for resources
33
+ #
34
+ class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "cloudcontrolspartner.$UNIVERSE_DOMAIN$"
37
+
38
+ include Paths
39
+
40
+ # @private
41
+ attr_reader :cloud_controls_partner_monitoring_stub
42
+
43
+ ##
44
+ # Configure the CloudControlsPartnerMonitoring Client class.
45
+ #
46
+ # See {::Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerMonitoring::Rest::Client::Configuration}
47
+ # for a description of the configuration fields.
48
+ #
49
+ # @example
50
+ #
51
+ # # Modify the configuration for all CloudControlsPartnerMonitoring clients
52
+ # ::Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerMonitoring::Rest::Client.configure do |config|
53
+ # config.timeout = 10.0
54
+ # end
55
+ #
56
+ # @yield [config] Configure the Client client.
57
+ # @yieldparam config [Client::Configuration]
58
+ #
59
+ # @return [Client::Configuration]
60
+ #
61
+ def self.configure
62
+ @configure ||= begin
63
+ namespace = ["Google", "Cloud", "CloudControlsPartner", "V1beta"]
64
+ parent_config = while namespace.any?
65
+ parent_name = namespace.join "::"
66
+ parent_const = const_get parent_name
67
+ break parent_const.configure if parent_const.respond_to? :configure
68
+ namespace.pop
69
+ end
70
+ default_config = Client::Configuration.new parent_config
71
+
72
+ default_config.rpcs.list_violations.timeout = 60.0
73
+ default_config.rpcs.list_violations.retry_policy = {
74
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
75
+ }
76
+
77
+ default_config.rpcs.get_violation.timeout = 60.0
78
+ default_config.rpcs.get_violation.retry_policy = {
79
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
80
+ }
81
+
82
+ default_config
83
+ end
84
+ yield @configure if block_given?
85
+ @configure
86
+ end
87
+
88
+ ##
89
+ # Configure the CloudControlsPartnerMonitoring Client instance.
90
+ #
91
+ # The configuration is set to the derived mode, meaning that values can be changed,
92
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
93
+ # should be made on {Client.configure}.
94
+ #
95
+ # See {::Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerMonitoring::Rest::Client::Configuration}
96
+ # for a description of the configuration fields.
97
+ #
98
+ # @yield [config] Configure the Client client.
99
+ # @yieldparam config [Client::Configuration]
100
+ #
101
+ # @return [Client::Configuration]
102
+ #
103
+ def configure
104
+ yield @config if block_given?
105
+ @config
106
+ end
107
+
108
+ ##
109
+ # The effective universe domain
110
+ #
111
+ # @return [String]
112
+ #
113
+ def universe_domain
114
+ @cloud_controls_partner_monitoring_stub.universe_domain
115
+ end
116
+
117
+ ##
118
+ # Create a new CloudControlsPartnerMonitoring REST client object.
119
+ #
120
+ # @example
121
+ #
122
+ # # Create a client using the default configuration
123
+ # client = ::Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerMonitoring::Rest::Client.new
124
+ #
125
+ # # Create a client using a custom configuration
126
+ # client = ::Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerMonitoring::Rest::Client.new do |config|
127
+ # config.timeout = 10.0
128
+ # end
129
+ #
130
+ # @yield [config] Configure the CloudControlsPartnerMonitoring client.
131
+ # @yieldparam config [Client::Configuration]
132
+ #
133
+ def initialize
134
+ # Create the configuration object
135
+ @config = Configuration.new Client.configure
136
+
137
+ # Yield the configuration if needed
138
+ yield @config if block_given?
139
+
140
+ # Create credentials
141
+ credentials = @config.credentials
142
+ # Use self-signed JWT if the endpoint is unchanged from default,
143
+ # but only if the default endpoint does not have a region prefix.
144
+ enable_self_signed_jwt = @config.endpoint.nil? ||
145
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
146
+ !@config.endpoint.split(".").first.include?("-"))
147
+ credentials ||= Credentials.default scope: @config.scope,
148
+ enable_self_signed_jwt: enable_self_signed_jwt
149
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
150
+ credentials = Credentials.new credentials, scope: @config.scope
151
+ end
152
+
153
+ @quota_project_id = @config.quota_project
154
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
155
+
156
+ @cloud_controls_partner_monitoring_stub = ::Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerMonitoring::Rest::ServiceStub.new(
157
+ endpoint: @config.endpoint,
158
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
159
+ universe_domain: @config.universe_domain,
160
+ credentials: credentials
161
+ )
162
+ end
163
+
164
+ # Service calls
165
+
166
+ ##
167
+ # Lists Violations for a workload
168
+ # Callers may also choose to read across multiple Customers or for a single
169
+ # customer as per
170
+ # [AIP-159](https://google.aip.dev/159) by using '-' (the hyphen or dash
171
+ # character) as a wildcard character instead of \\{customer} & \\{workload}.
172
+ # Format:
173
+ # `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
174
+ #
175
+ # @overload list_violations(request, options = nil)
176
+ # Pass arguments to `list_violations` via a request object, either of type
177
+ # {::Google::Cloud::CloudControlsPartner::V1beta::ListViolationsRequest} or an equivalent Hash.
178
+ #
179
+ # @param request [::Google::Cloud::CloudControlsPartner::V1beta::ListViolationsRequest, ::Hash]
180
+ # A request object representing the call parameters. Required. To specify no
181
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
182
+ # @param options [::Gapic::CallOptions, ::Hash]
183
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
184
+ #
185
+ # @overload list_violations(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, interval: nil)
186
+ # Pass arguments to `list_violations` via keyword arguments. Note that at
187
+ # least one keyword argument is required. To specify no parameters, or to keep all
188
+ # the default parameter values, pass an empty Hash as a request object (see above).
189
+ #
190
+ # @param parent [::String]
191
+ # Required. Parent resource
192
+ # Format
193
+ # organizations/\\{organization}/locations/\\{location}/customers/\\{customer}/workloads/\\{workload}
194
+ # @param page_size [::Integer]
195
+ # Optional. The maximum number of customers row to return. The service may
196
+ # return fewer than this value. If unspecified, at most 10 customers will be
197
+ # returned.
198
+ # @param page_token [::String]
199
+ # Optional. A page token, received from a previous `ListViolations` call.
200
+ # Provide this to retrieve the subsequent page.
201
+ # @param filter [::String]
202
+ # Optional. Filtering results
203
+ # @param order_by [::String]
204
+ # Optional. Hint for how to order the results
205
+ # @param interval [::Google::Type::Interval, ::Hash]
206
+ # Optional. Specifies the interval for retrieving violations.
207
+ # if unspecified, all violations will be returned.
208
+ # @yield [result, operation] Access the result along with the TransportOperation object
209
+ # @yieldparam result [::Google::Cloud::CloudControlsPartner::V1beta::ListViolationsResponse]
210
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
211
+ #
212
+ # @return [::Google::Cloud::CloudControlsPartner::V1beta::ListViolationsResponse]
213
+ #
214
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
215
+ #
216
+ # @example Basic example
217
+ # require "google/cloud/cloud_controls_partner/v1beta"
218
+ #
219
+ # # Create a client object. The client can be reused for multiple calls.
220
+ # client = Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerMonitoring::Rest::Client.new
221
+ #
222
+ # # Create a request. To set request fields, pass in keyword arguments.
223
+ # request = Google::Cloud::CloudControlsPartner::V1beta::ListViolationsRequest.new
224
+ #
225
+ # # Call the list_violations method.
226
+ # result = client.list_violations request
227
+ #
228
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
229
+ # # over elements, and API calls will be issued to fetch pages as needed.
230
+ # result.each do |item|
231
+ # # Each element is of type ::Google::Cloud::CloudControlsPartner::V1beta::Violation.
232
+ # p item
233
+ # end
234
+ #
235
+ def list_violations request, options = nil
236
+ raise ::ArgumentError, "request must be provided" if request.nil?
237
+
238
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudControlsPartner::V1beta::ListViolationsRequest
239
+
240
+ # Converts hash and nil to an options object
241
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
242
+
243
+ # Customize the options with defaults
244
+ call_metadata = @config.rpcs.list_violations.metadata.to_h
245
+
246
+ # Set x-goog-api-client and x-goog-user-project headers
247
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
248
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
249
+ gapic_version: ::Google::Cloud::CloudControlsPartner::V1beta::VERSION,
250
+ transports_version_send: [:rest]
251
+
252
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
253
+
254
+ options.apply_defaults timeout: @config.rpcs.list_violations.timeout,
255
+ metadata: call_metadata,
256
+ retry_policy: @config.rpcs.list_violations.retry_policy
257
+
258
+ options.apply_defaults timeout: @config.timeout,
259
+ metadata: @config.metadata,
260
+ retry_policy: @config.retry_policy
261
+
262
+ @cloud_controls_partner_monitoring_stub.list_violations request, options do |result, operation|
263
+ yield result, operation if block_given?
264
+ return result
265
+ end
266
+ rescue ::Gapic::Rest::Error => e
267
+ raise ::Google::Cloud::Error.from_error(e)
268
+ end
269
+
270
+ ##
271
+ # Gets details of a single Violation.
272
+ #
273
+ # @overload get_violation(request, options = nil)
274
+ # Pass arguments to `get_violation` via a request object, either of type
275
+ # {::Google::Cloud::CloudControlsPartner::V1beta::GetViolationRequest} or an equivalent Hash.
276
+ #
277
+ # @param request [::Google::Cloud::CloudControlsPartner::V1beta::GetViolationRequest, ::Hash]
278
+ # A request object representing the call parameters. Required. To specify no
279
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
280
+ # @param options [::Gapic::CallOptions, ::Hash]
281
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
282
+ #
283
+ # @overload get_violation(name: nil)
284
+ # Pass arguments to `get_violation` via keyword arguments. Note that at
285
+ # least one keyword argument is required. To specify no parameters, or to keep all
286
+ # the default parameter values, pass an empty Hash as a request object (see above).
287
+ #
288
+ # @param name [::String]
289
+ # Required. Format:
290
+ # organizations/\\{organization}/locations/\\{location}/customers/\\{customer}/workloads/\\{workload}/violations/\\{violation}
291
+ # @yield [result, operation] Access the result along with the TransportOperation object
292
+ # @yieldparam result [::Google::Cloud::CloudControlsPartner::V1beta::Violation]
293
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
294
+ #
295
+ # @return [::Google::Cloud::CloudControlsPartner::V1beta::Violation]
296
+ #
297
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
298
+ #
299
+ # @example Basic example
300
+ # require "google/cloud/cloud_controls_partner/v1beta"
301
+ #
302
+ # # Create a client object. The client can be reused for multiple calls.
303
+ # client = Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerMonitoring::Rest::Client.new
304
+ #
305
+ # # Create a request. To set request fields, pass in keyword arguments.
306
+ # request = Google::Cloud::CloudControlsPartner::V1beta::GetViolationRequest.new
307
+ #
308
+ # # Call the get_violation method.
309
+ # result = client.get_violation request
310
+ #
311
+ # # The returned object is of type Google::Cloud::CloudControlsPartner::V1beta::Violation.
312
+ # p result
313
+ #
314
+ def get_violation request, options = nil
315
+ raise ::ArgumentError, "request must be provided" if request.nil?
316
+
317
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudControlsPartner::V1beta::GetViolationRequest
318
+
319
+ # Converts hash and nil to an options object
320
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
321
+
322
+ # Customize the options with defaults
323
+ call_metadata = @config.rpcs.get_violation.metadata.to_h
324
+
325
+ # Set x-goog-api-client and x-goog-user-project headers
326
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
327
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
328
+ gapic_version: ::Google::Cloud::CloudControlsPartner::V1beta::VERSION,
329
+ transports_version_send: [:rest]
330
+
331
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
332
+
333
+ options.apply_defaults timeout: @config.rpcs.get_violation.timeout,
334
+ metadata: call_metadata,
335
+ retry_policy: @config.rpcs.get_violation.retry_policy
336
+
337
+ options.apply_defaults timeout: @config.timeout,
338
+ metadata: @config.metadata,
339
+ retry_policy: @config.retry_policy
340
+
341
+ @cloud_controls_partner_monitoring_stub.get_violation request, options do |result, operation|
342
+ yield result, operation if block_given?
343
+ return result
344
+ end
345
+ rescue ::Gapic::Rest::Error => e
346
+ raise ::Google::Cloud::Error.from_error(e)
347
+ end
348
+
349
+ ##
350
+ # Configuration class for the CloudControlsPartnerMonitoring REST API.
351
+ #
352
+ # This class represents the configuration for CloudControlsPartnerMonitoring REST,
353
+ # providing control over timeouts, retry behavior, logging, transport
354
+ # parameters, and other low-level controls. Certain parameters can also be
355
+ # applied individually to specific RPCs. See
356
+ # {::Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerMonitoring::Rest::Client::Configuration::Rpcs}
357
+ # for a list of RPCs that can be configured independently.
358
+ #
359
+ # Configuration can be applied globally to all clients, or to a single client
360
+ # on construction.
361
+ #
362
+ # @example
363
+ #
364
+ # # Modify the global config, setting the timeout for
365
+ # # list_violations to 20 seconds,
366
+ # # and all remaining timeouts to 10 seconds.
367
+ # ::Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerMonitoring::Rest::Client.configure do |config|
368
+ # config.timeout = 10.0
369
+ # config.rpcs.list_violations.timeout = 20.0
370
+ # end
371
+ #
372
+ # # Apply the above configuration only to a new client.
373
+ # client = ::Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerMonitoring::Rest::Client.new do |config|
374
+ # config.timeout = 10.0
375
+ # config.rpcs.list_violations.timeout = 20.0
376
+ # end
377
+ #
378
+ # @!attribute [rw] endpoint
379
+ # A custom service endpoint, as a hostname or hostname:port. The default is
380
+ # nil, indicating to use the default endpoint in the current universe domain.
381
+ # @return [::String,nil]
382
+ # @!attribute [rw] credentials
383
+ # Credentials to send with calls. You may provide any of the following types:
384
+ # * (`String`) The path to a service account key file in JSON format
385
+ # * (`Hash`) A service account key as a Hash
386
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
387
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
388
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
389
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
390
+ # * (`nil`) indicating no credentials
391
+ # @return [::Object]
392
+ # @!attribute [rw] scope
393
+ # The OAuth scopes
394
+ # @return [::Array<::String>]
395
+ # @!attribute [rw] lib_name
396
+ # The library name as recorded in instrumentation and logging
397
+ # @return [::String]
398
+ # @!attribute [rw] lib_version
399
+ # The library version as recorded in instrumentation and logging
400
+ # @return [::String]
401
+ # @!attribute [rw] timeout
402
+ # The call timeout in seconds.
403
+ # @return [::Numeric]
404
+ # @!attribute [rw] metadata
405
+ # Additional headers to be sent with the call.
406
+ # @return [::Hash{::Symbol=>::String}]
407
+ # @!attribute [rw] retry_policy
408
+ # The retry policy. The value is a hash with the following keys:
409
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
410
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
411
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
412
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
413
+ # trigger a retry.
414
+ # @return [::Hash]
415
+ # @!attribute [rw] quota_project
416
+ # A separate project against which to charge quota.
417
+ # @return [::String]
418
+ # @!attribute [rw] universe_domain
419
+ # The universe domain within which to make requests. This determines the
420
+ # default endpoint URL. The default value of nil uses the environment
421
+ # universe (usually the default "googleapis.com" universe).
422
+ # @return [::String,nil]
423
+ #
424
+ class Configuration
425
+ extend ::Gapic::Config
426
+
427
+ # @private
428
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
429
+ DEFAULT_ENDPOINT = "cloudcontrolspartner.googleapis.com"
430
+
431
+ config_attr :endpoint, nil, ::String, nil
432
+ config_attr :credentials, nil do |value|
433
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
434
+ allowed.any? { |klass| klass === value }
435
+ end
436
+ config_attr :scope, nil, ::String, ::Array, nil
437
+ config_attr :lib_name, nil, ::String, nil
438
+ config_attr :lib_version, nil, ::String, nil
439
+ config_attr :timeout, nil, ::Numeric, nil
440
+ config_attr :metadata, nil, ::Hash, nil
441
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
442
+ config_attr :quota_project, nil, ::String, nil
443
+ config_attr :universe_domain, nil, ::String, nil
444
+
445
+ # @private
446
+ def initialize parent_config = nil
447
+ @parent_config = parent_config unless parent_config.nil?
448
+
449
+ yield self if block_given?
450
+ end
451
+
452
+ ##
453
+ # Configurations for individual RPCs
454
+ # @return [Rpcs]
455
+ #
456
+ def rpcs
457
+ @rpcs ||= begin
458
+ parent_rpcs = nil
459
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
460
+ Rpcs.new parent_rpcs
461
+ end
462
+ end
463
+
464
+ ##
465
+ # Configuration RPC class for the CloudControlsPartnerMonitoring API.
466
+ #
467
+ # Includes fields providing the configuration for each RPC in this service.
468
+ # Each configuration object is of type `Gapic::Config::Method` and includes
469
+ # the following configuration fields:
470
+ #
471
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
472
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
473
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
474
+ # include the following keys:
475
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
476
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
477
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
478
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
479
+ # trigger a retry.
480
+ #
481
+ class Rpcs
482
+ ##
483
+ # RPC-specific configuration for `list_violations`
484
+ # @return [::Gapic::Config::Method]
485
+ #
486
+ attr_reader :list_violations
487
+ ##
488
+ # RPC-specific configuration for `get_violation`
489
+ # @return [::Gapic::Config::Method]
490
+ #
491
+ attr_reader :get_violation
492
+
493
+ # @private
494
+ def initialize parent_rpcs = nil
495
+ list_violations_config = parent_rpcs.list_violations if parent_rpcs.respond_to? :list_violations
496
+ @list_violations = ::Gapic::Config::Method.new list_violations_config
497
+ get_violation_config = parent_rpcs.get_violation if parent_rpcs.respond_to? :get_violation
498
+ @get_violation = ::Gapic::Config::Method.new get_violation_config
499
+
500
+ yield self if block_given?
501
+ end
502
+ end
503
+ end
504
+ end
505
+ end
506
+ end
507
+ end
508
+ end
509
+ end
510
+ end