google-cloud-profiler-v2 0.3.0 → 0.8.0

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