google-cloud-profiler-v2 0.3.0 → 0.10.1

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 (27) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +72 -101
  3. data/README.md +5 -5
  4. data/lib/google/cloud/profiler/v2/export_service/client.rb +446 -0
  5. data/lib/google/cloud/profiler/v2/export_service/credentials.rb +53 -0
  6. data/lib/google/cloud/profiler/v2/export_service/paths.rb +47 -0
  7. data/lib/google/cloud/profiler/v2/export_service/rest/client.rb +413 -0
  8. data/lib/google/cloud/profiler/v2/export_service/rest/service_stub.rb +128 -0
  9. data/lib/google/cloud/profiler/v2/export_service/rest.rb +53 -0
  10. data/lib/google/cloud/profiler/v2/export_service.rb +56 -0
  11. data/lib/google/cloud/profiler/v2/profiler_service/client.rb +79 -23
  12. data/lib/google/cloud/profiler/v2/profiler_service/paths.rb +64 -0
  13. data/lib/google/cloud/profiler/v2/profiler_service/rest/client.rb +622 -0
  14. data/lib/google/cloud/profiler/v2/profiler_service/rest/service_stub.rb +249 -0
  15. data/lib/google/cloud/profiler/v2/profiler_service/rest.rb +56 -0
  16. data/lib/google/cloud/profiler/v2/profiler_service.rb +10 -4
  17. data/lib/google/cloud/profiler/v2/rest.rb +38 -0
  18. data/lib/google/cloud/profiler/v2/version.rb +1 -1
  19. data/lib/google/cloud/profiler/v2.rb +8 -2
  20. data/lib/google/devtools/cloudprofiler/v2/profiler_pb.rb +33 -38
  21. data/lib/google/devtools/cloudprofiler/v2/profiler_services_pb.rb +39 -6
  22. data/proto_docs/google/api/client.rb +399 -0
  23. data/proto_docs/google/api/field_behavior.rb +85 -0
  24. data/proto_docs/google/api/launch_stage.rb +71 -0
  25. data/proto_docs/google/devtools/cloudprofiler/v2/profiler.rb +52 -7
  26. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  27. metadata +23 -119
@@ -0,0 +1,622 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2023 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/devtools/cloudprofiler/v2/profiler_pb"
21
+ require "google/cloud/profiler/v2/profiler_service/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Profiler
26
+ module V2
27
+ module ProfilerService
28
+ module Rest
29
+ ##
30
+ # REST client for the ProfilerService service.
31
+ #
32
+ # Manage the collection of continuous profiling data provided by profiling
33
+ # agents running in the cloud or by an offline provider of profiling data.
34
+ #
35
+ # __The APIs listed in this service are intended for use within our profiler
36
+ # agents only.__
37
+ #
38
+ class Client
39
+ # @private
40
+ API_VERSION = ""
41
+
42
+ # @private
43
+ DEFAULT_ENDPOINT_TEMPLATE = "cloudprofiler.$UNIVERSE_DOMAIN$"
44
+
45
+ include Paths
46
+
47
+ # @private
48
+ attr_reader :profiler_service_stub
49
+
50
+ ##
51
+ # Configure the ProfilerService Client class.
52
+ #
53
+ # See {::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client::Configuration}
54
+ # for a description of the configuration fields.
55
+ #
56
+ # @example
57
+ #
58
+ # # Modify the configuration for all ProfilerService clients
59
+ # ::Google::Cloud::Profiler::V2::ProfilerService::Rest::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 = ["Google", "Cloud", "Profiler", "V2"]
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.timeout = 60.0
80
+ default_config.retry_policy = {
81
+ initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
82
+ }
83
+
84
+ default_config.rpcs.create_profile.timeout = 3610.0
85
+
86
+ default_config.rpcs.create_offline_profile.timeout = 30.0
87
+
88
+ default_config.rpcs.update_profile.timeout = 30.0
89
+
90
+ default_config
91
+ end
92
+ yield @configure if block_given?
93
+ @configure
94
+ end
95
+
96
+ ##
97
+ # Configure the ProfilerService Client instance.
98
+ #
99
+ # The configuration is set to the derived mode, meaning that values can be changed,
100
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
101
+ # should be made on {Client.configure}.
102
+ #
103
+ # See {::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client::Configuration}
104
+ # for a description of the configuration fields.
105
+ #
106
+ # @yield [config] Configure the Client client.
107
+ # @yieldparam config [Client::Configuration]
108
+ #
109
+ # @return [Client::Configuration]
110
+ #
111
+ def configure
112
+ yield @config if block_given?
113
+ @config
114
+ end
115
+
116
+ ##
117
+ # The effective universe domain
118
+ #
119
+ # @return [String]
120
+ #
121
+ def universe_domain
122
+ @profiler_service_stub.universe_domain
123
+ end
124
+
125
+ ##
126
+ # Create a new ProfilerService REST client object.
127
+ #
128
+ # @example
129
+ #
130
+ # # Create a client using the default configuration
131
+ # client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new
132
+ #
133
+ # # Create a client using a custom configuration
134
+ # client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new do |config|
135
+ # config.timeout = 10.0
136
+ # end
137
+ #
138
+ # @yield [config] Configure the ProfilerService client.
139
+ # @yieldparam config [Client::Configuration]
140
+ #
141
+ def initialize
142
+ # Create the configuration object
143
+ @config = Configuration.new Client.configure
144
+
145
+ # Yield the configuration if needed
146
+ yield @config if block_given?
147
+
148
+ # Create credentials
149
+ credentials = @config.credentials
150
+ # Use self-signed JWT if the endpoint is unchanged from default,
151
+ # but only if the default endpoint does not have a region prefix.
152
+ enable_self_signed_jwt = @config.endpoint.nil? ||
153
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
154
+ !@config.endpoint.split(".").first.include?("-"))
155
+ credentials ||= Credentials.default scope: @config.scope,
156
+ enable_self_signed_jwt: enable_self_signed_jwt
157
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
158
+ credentials = Credentials.new credentials, scope: @config.scope
159
+ end
160
+
161
+ @quota_project_id = @config.quota_project
162
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
163
+
164
+ @profiler_service_stub = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::ServiceStub.new(
165
+ endpoint: @config.endpoint,
166
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
167
+ universe_domain: @config.universe_domain,
168
+ credentials: credentials
169
+ )
170
+ end
171
+
172
+ # Service calls
173
+
174
+ ##
175
+ # CreateProfile creates a new profile resource in the online mode.
176
+ #
177
+ # _Direct use of this API is discouraged, please use a [supported
178
+ # profiler
179
+ # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent)
180
+ # instead for profile collection._
181
+ #
182
+ # The server ensures that the new profiles are created at a constant rate per
183
+ # deployment, so the creation request may hang for some time until the next
184
+ # profile session is available.
185
+ #
186
+ # The request may fail with ABORTED error if the creation is not available
187
+ # within ~1m, the response will indicate the duration of the backoff the
188
+ # client should take before attempting creating a profile again. The backoff
189
+ # duration is returned in google.rpc.RetryInfo extension on the response
190
+ # status. To a gRPC client, the extension will be return as a
191
+ # binary-serialized proto in the trailing metadata item named
192
+ # "google.rpc.retryinfo-bin".
193
+ #
194
+ # @overload create_profile(request, options = nil)
195
+ # Pass arguments to `create_profile` via a request object, either of type
196
+ # {::Google::Cloud::Profiler::V2::CreateProfileRequest} or an equivalent Hash.
197
+ #
198
+ # @param request [::Google::Cloud::Profiler::V2::CreateProfileRequest, ::Hash]
199
+ # A request object representing the call parameters. Required. To specify no
200
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
201
+ # @param options [::Gapic::CallOptions, ::Hash]
202
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
203
+ #
204
+ # @overload create_profile(parent: nil, deployment: nil, profile_type: nil)
205
+ # Pass arguments to `create_profile` via keyword arguments. Note that at
206
+ # least one keyword argument is required. To specify no parameters, or to keep all
207
+ # the default parameter values, pass an empty Hash as a request object (see above).
208
+ #
209
+ # @param parent [::String]
210
+ # Parent project to create the profile in.
211
+ # @param deployment [::Google::Cloud::Profiler::V2::Deployment, ::Hash]
212
+ # Deployment details.
213
+ # @param profile_type [::Array<::Google::Cloud::Profiler::V2::ProfileType>]
214
+ # One or more profile types that the agent is capable of providing.
215
+ # @yield [result, operation] Access the result along with the TransportOperation object
216
+ # @yieldparam result [::Google::Cloud::Profiler::V2::Profile]
217
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
218
+ #
219
+ # @return [::Google::Cloud::Profiler::V2::Profile]
220
+ #
221
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
222
+ #
223
+ # @example Basic example
224
+ # require "google/cloud/profiler/v2"
225
+ #
226
+ # # Create a client object. The client can be reused for multiple calls.
227
+ # client = Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new
228
+ #
229
+ # # Create a request. To set request fields, pass in keyword arguments.
230
+ # request = Google::Cloud::Profiler::V2::CreateProfileRequest.new
231
+ #
232
+ # # Call the create_profile method.
233
+ # result = client.create_profile request
234
+ #
235
+ # # The returned object is of type Google::Cloud::Profiler::V2::Profile.
236
+ # p result
237
+ #
238
+ def create_profile request, options = nil
239
+ raise ::ArgumentError, "request must be provided" if request.nil?
240
+
241
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::CreateProfileRequest
242
+
243
+ # Converts hash and nil to an options object
244
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
245
+
246
+ # Customize the options with defaults
247
+ call_metadata = @config.rpcs.create_profile.metadata.to_h
248
+
249
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
250
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
251
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
252
+ gapic_version: ::Google::Cloud::Profiler::V2::VERSION,
253
+ transports_version_send: [:rest]
254
+
255
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
256
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
257
+
258
+ options.apply_defaults timeout: @config.rpcs.create_profile.timeout,
259
+ metadata: call_metadata,
260
+ retry_policy: @config.rpcs.create_profile.retry_policy
261
+
262
+ options.apply_defaults timeout: @config.timeout,
263
+ metadata: @config.metadata,
264
+ retry_policy: @config.retry_policy
265
+
266
+ @profiler_service_stub.create_profile request, options do |result, operation|
267
+ yield result, operation if block_given?
268
+ return result
269
+ end
270
+ rescue ::Gapic::Rest::Error => e
271
+ raise ::Google::Cloud::Error.from_error(e)
272
+ end
273
+
274
+ ##
275
+ # CreateOfflineProfile creates a new profile resource in the offline
276
+ # mode. The client provides the profile to create along with the profile
277
+ # bytes, the server records it.
278
+ #
279
+ # _Direct use of this API is discouraged, please use a [supported
280
+ # profiler
281
+ # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent)
282
+ # instead for profile collection._
283
+ #
284
+ # @overload create_offline_profile(request, options = nil)
285
+ # Pass arguments to `create_offline_profile` via a request object, either of type
286
+ # {::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest} or an equivalent Hash.
287
+ #
288
+ # @param request [::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest, ::Hash]
289
+ # A request object representing the call parameters. Required. To specify no
290
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
291
+ # @param options [::Gapic::CallOptions, ::Hash]
292
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
293
+ #
294
+ # @overload create_offline_profile(parent: nil, profile: nil)
295
+ # Pass arguments to `create_offline_profile` via keyword arguments. Note that at
296
+ # least one keyword argument is required. To specify no parameters, or to keep all
297
+ # the default parameter values, pass an empty Hash as a request object (see above).
298
+ #
299
+ # @param parent [::String]
300
+ # Parent project to create the profile in.
301
+ # @param profile [::Google::Cloud::Profiler::V2::Profile, ::Hash]
302
+ # Contents of the profile to create.
303
+ # @yield [result, operation] Access the result along with the TransportOperation object
304
+ # @yieldparam result [::Google::Cloud::Profiler::V2::Profile]
305
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
306
+ #
307
+ # @return [::Google::Cloud::Profiler::V2::Profile]
308
+ #
309
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
310
+ #
311
+ # @example Basic example
312
+ # require "google/cloud/profiler/v2"
313
+ #
314
+ # # Create a client object. The client can be reused for multiple calls.
315
+ # client = Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new
316
+ #
317
+ # # Create a request. To set request fields, pass in keyword arguments.
318
+ # request = Google::Cloud::Profiler::V2::CreateOfflineProfileRequest.new
319
+ #
320
+ # # Call the create_offline_profile method.
321
+ # result = client.create_offline_profile request
322
+ #
323
+ # # The returned object is of type Google::Cloud::Profiler::V2::Profile.
324
+ # p result
325
+ #
326
+ def create_offline_profile request, options = nil
327
+ raise ::ArgumentError, "request must be provided" if request.nil?
328
+
329
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::CreateOfflineProfileRequest
330
+
331
+ # Converts hash and nil to an options object
332
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
333
+
334
+ # Customize the options with defaults
335
+ call_metadata = @config.rpcs.create_offline_profile.metadata.to_h
336
+
337
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
338
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
339
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
340
+ gapic_version: ::Google::Cloud::Profiler::V2::VERSION,
341
+ transports_version_send: [:rest]
342
+
343
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
344
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
345
+
346
+ options.apply_defaults timeout: @config.rpcs.create_offline_profile.timeout,
347
+ metadata: call_metadata,
348
+ retry_policy: @config.rpcs.create_offline_profile.retry_policy
349
+
350
+ options.apply_defaults timeout: @config.timeout,
351
+ metadata: @config.metadata,
352
+ retry_policy: @config.retry_policy
353
+
354
+ @profiler_service_stub.create_offline_profile request, options do |result, operation|
355
+ yield result, operation if block_given?
356
+ return result
357
+ end
358
+ rescue ::Gapic::Rest::Error => e
359
+ raise ::Google::Cloud::Error.from_error(e)
360
+ end
361
+
362
+ ##
363
+ # UpdateProfile updates the profile bytes and labels on the profile resource
364
+ # created in the online mode. Updating the bytes for profiles created in the
365
+ # offline mode is currently not supported: the profile content must be
366
+ # provided at the time of the profile creation.
367
+ #
368
+ # _Direct use of this API is discouraged, please use a [supported
369
+ # profiler
370
+ # agent](https://cloud.google.com/profiler/docs/about-profiler#profiling_agent)
371
+ # instead for profile collection._
372
+ #
373
+ # @overload update_profile(request, options = nil)
374
+ # Pass arguments to `update_profile` via a request object, either of type
375
+ # {::Google::Cloud::Profiler::V2::UpdateProfileRequest} or an equivalent Hash.
376
+ #
377
+ # @param request [::Google::Cloud::Profiler::V2::UpdateProfileRequest, ::Hash]
378
+ # A request object representing the call parameters. Required. To specify no
379
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
380
+ # @param options [::Gapic::CallOptions, ::Hash]
381
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
382
+ #
383
+ # @overload update_profile(profile: nil, update_mask: nil)
384
+ # Pass arguments to `update_profile` via keyword arguments. Note that at
385
+ # least one keyword argument is required. To specify no parameters, or to keep all
386
+ # the default parameter values, pass an empty Hash as a request object (see above).
387
+ #
388
+ # @param profile [::Google::Cloud::Profiler::V2::Profile, ::Hash]
389
+ # Profile to update.
390
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
391
+ # Field mask used to specify the fields to be overwritten. Currently only
392
+ # profile_bytes and labels fields are supported by UpdateProfile, so only
393
+ # those fields can be specified in the mask. When no mask is provided, all
394
+ # fields are overwritten.
395
+ # @yield [result, operation] Access the result along with the TransportOperation object
396
+ # @yieldparam result [::Google::Cloud::Profiler::V2::Profile]
397
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
398
+ #
399
+ # @return [::Google::Cloud::Profiler::V2::Profile]
400
+ #
401
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
402
+ #
403
+ # @example Basic example
404
+ # require "google/cloud/profiler/v2"
405
+ #
406
+ # # Create a client object. The client can be reused for multiple calls.
407
+ # client = Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new
408
+ #
409
+ # # Create a request. To set request fields, pass in keyword arguments.
410
+ # request = Google::Cloud::Profiler::V2::UpdateProfileRequest.new
411
+ #
412
+ # # Call the update_profile method.
413
+ # result = client.update_profile request
414
+ #
415
+ # # The returned object is of type Google::Cloud::Profiler::V2::Profile.
416
+ # p result
417
+ #
418
+ def update_profile request, options = nil
419
+ raise ::ArgumentError, "request must be provided" if request.nil?
420
+
421
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Profiler::V2::UpdateProfileRequest
422
+
423
+ # Converts hash and nil to an options object
424
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
425
+
426
+ # Customize the options with defaults
427
+ call_metadata = @config.rpcs.update_profile.metadata.to_h
428
+
429
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
430
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
431
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
432
+ gapic_version: ::Google::Cloud::Profiler::V2::VERSION,
433
+ transports_version_send: [:rest]
434
+
435
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
436
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
437
+
438
+ options.apply_defaults timeout: @config.rpcs.update_profile.timeout,
439
+ metadata: call_metadata,
440
+ retry_policy: @config.rpcs.update_profile.retry_policy
441
+
442
+ options.apply_defaults timeout: @config.timeout,
443
+ metadata: @config.metadata,
444
+ retry_policy: @config.retry_policy
445
+
446
+ @profiler_service_stub.update_profile request, options do |result, operation|
447
+ yield result, operation if block_given?
448
+ return result
449
+ end
450
+ rescue ::Gapic::Rest::Error => e
451
+ raise ::Google::Cloud::Error.from_error(e)
452
+ end
453
+
454
+ ##
455
+ # Configuration class for the ProfilerService REST API.
456
+ #
457
+ # This class represents the configuration for ProfilerService REST,
458
+ # providing control over timeouts, retry behavior, logging, transport
459
+ # parameters, and other low-level controls. Certain parameters can also be
460
+ # applied individually to specific RPCs. See
461
+ # {::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client::Configuration::Rpcs}
462
+ # for a list of RPCs that can be configured independently.
463
+ #
464
+ # Configuration can be applied globally to all clients, or to a single client
465
+ # on construction.
466
+ #
467
+ # @example
468
+ #
469
+ # # Modify the global config, setting the timeout for
470
+ # # create_profile to 20 seconds,
471
+ # # and all remaining timeouts to 10 seconds.
472
+ # ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.configure do |config|
473
+ # config.timeout = 10.0
474
+ # config.rpcs.create_profile.timeout = 20.0
475
+ # end
476
+ #
477
+ # # Apply the above configuration only to a new client.
478
+ # client = ::Google::Cloud::Profiler::V2::ProfilerService::Rest::Client.new do |config|
479
+ # config.timeout = 10.0
480
+ # config.rpcs.create_profile.timeout = 20.0
481
+ # end
482
+ #
483
+ # @!attribute [rw] endpoint
484
+ # A custom service endpoint, as a hostname or hostname:port. The default is
485
+ # nil, indicating to use the default endpoint in the current universe domain.
486
+ # @return [::String,nil]
487
+ # @!attribute [rw] credentials
488
+ # Credentials to send with calls. You may provide any of the following types:
489
+ # * (`String`) The path to a service account key file in JSON format
490
+ # * (`Hash`) A service account key as a Hash
491
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
492
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
493
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
494
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
495
+ # * (`nil`) indicating no credentials
496
+ # @return [::Object]
497
+ # @!attribute [rw] scope
498
+ # The OAuth scopes
499
+ # @return [::Array<::String>]
500
+ # @!attribute [rw] lib_name
501
+ # The library name as recorded in instrumentation and logging
502
+ # @return [::String]
503
+ # @!attribute [rw] lib_version
504
+ # The library version as recorded in instrumentation and logging
505
+ # @return [::String]
506
+ # @!attribute [rw] timeout
507
+ # The call timeout in seconds.
508
+ # @return [::Numeric]
509
+ # @!attribute [rw] metadata
510
+ # Additional headers to be sent with the call.
511
+ # @return [::Hash{::Symbol=>::String}]
512
+ # @!attribute [rw] retry_policy
513
+ # The retry policy. The value is a hash with the following keys:
514
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
515
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
516
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
517
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
518
+ # trigger a retry.
519
+ # @return [::Hash]
520
+ # @!attribute [rw] quota_project
521
+ # A separate project against which to charge quota.
522
+ # @return [::String]
523
+ # @!attribute [rw] universe_domain
524
+ # The universe domain within which to make requests. This determines the
525
+ # default endpoint URL. The default value of nil uses the environment
526
+ # universe (usually the default "googleapis.com" universe).
527
+ # @return [::String,nil]
528
+ #
529
+ class Configuration
530
+ extend ::Gapic::Config
531
+
532
+ # @private
533
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
534
+ DEFAULT_ENDPOINT = "cloudprofiler.googleapis.com"
535
+
536
+ config_attr :endpoint, nil, ::String, nil
537
+ config_attr :credentials, nil do |value|
538
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
539
+ allowed.any? { |klass| klass === value }
540
+ end
541
+ config_attr :scope, nil, ::String, ::Array, nil
542
+ config_attr :lib_name, nil, ::String, nil
543
+ config_attr :lib_version, nil, ::String, nil
544
+ config_attr :timeout, nil, ::Numeric, nil
545
+ config_attr :metadata, nil, ::Hash, nil
546
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
547
+ config_attr :quota_project, nil, ::String, nil
548
+ config_attr :universe_domain, nil, ::String, nil
549
+
550
+ # @private
551
+ def initialize parent_config = nil
552
+ @parent_config = parent_config unless parent_config.nil?
553
+
554
+ yield self if block_given?
555
+ end
556
+
557
+ ##
558
+ # Configurations for individual RPCs
559
+ # @return [Rpcs]
560
+ #
561
+ def rpcs
562
+ @rpcs ||= begin
563
+ parent_rpcs = nil
564
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
565
+ Rpcs.new parent_rpcs
566
+ end
567
+ end
568
+
569
+ ##
570
+ # Configuration RPC class for the ProfilerService API.
571
+ #
572
+ # Includes fields providing the configuration for each RPC in this service.
573
+ # Each configuration object is of type `Gapic::Config::Method` and includes
574
+ # the following configuration fields:
575
+ #
576
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
577
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
578
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
579
+ # include the following keys:
580
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
581
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
582
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
583
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
584
+ # trigger a retry.
585
+ #
586
+ class Rpcs
587
+ ##
588
+ # RPC-specific configuration for `create_profile`
589
+ # @return [::Gapic::Config::Method]
590
+ #
591
+ attr_reader :create_profile
592
+ ##
593
+ # RPC-specific configuration for `create_offline_profile`
594
+ # @return [::Gapic::Config::Method]
595
+ #
596
+ attr_reader :create_offline_profile
597
+ ##
598
+ # RPC-specific configuration for `update_profile`
599
+ # @return [::Gapic::Config::Method]
600
+ #
601
+ attr_reader :update_profile
602
+
603
+ # @private
604
+ def initialize parent_rpcs = nil
605
+ create_profile_config = parent_rpcs.create_profile if parent_rpcs.respond_to? :create_profile
606
+ @create_profile = ::Gapic::Config::Method.new create_profile_config
607
+ create_offline_profile_config = parent_rpcs.create_offline_profile if parent_rpcs.respond_to? :create_offline_profile
608
+ @create_offline_profile = ::Gapic::Config::Method.new create_offline_profile_config
609
+ update_profile_config = parent_rpcs.update_profile if parent_rpcs.respond_to? :update_profile
610
+ @update_profile = ::Gapic::Config::Method.new update_profile_config
611
+
612
+ yield self if block_given?
613
+ end
614
+ end
615
+ end
616
+ end
617
+ end
618
+ end
619
+ end
620
+ end
621
+ end
622
+ end