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

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