google-analytics-data-v1beta 0.14.0 → 0.25.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 (33) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/README.md +37 -33
  4. data/lib/google/analytics/data/v1beta/analytics_data/client.rb +60 -17
  5. data/lib/google/analytics/data/v1beta/analytics_data/credentials.rb +1 -1
  6. data/lib/google/analytics/data/v1beta/analytics_data/operations.rb +52 -11
  7. data/lib/google/analytics/data/v1beta/analytics_data/paths.rb +1 -1
  8. data/lib/google/analytics/data/v1beta/analytics_data/rest/client.rb +40 -14
  9. data/lib/google/analytics/data/v1beta/analytics_data/rest/operations.rb +66 -34
  10. data/lib/google/analytics/data/v1beta/analytics_data/rest/service_stub.rb +103 -69
  11. data/lib/google/analytics/data/v1beta/analytics_data/rest.rb +1 -1
  12. data/lib/google/analytics/data/v1beta/analytics_data.rb +1 -1
  13. data/lib/google/analytics/data/v1beta/analytics_data_api_pb.rb +3 -26
  14. data/lib/google/analytics/data/v1beta/analytics_data_api_services_pb.rb +1 -1
  15. data/lib/google/analytics/data/v1beta/data_pb.rb +6 -24
  16. data/lib/google/analytics/data/v1beta/rest.rb +1 -1
  17. data/lib/google/analytics/data/v1beta/version.rb +1 -1
  18. data/lib/google/analytics/data/v1beta.rb +1 -1
  19. data/lib/google-analytics-data-v1beta.rb +1 -1
  20. data/proto_docs/README.md +1 -1
  21. data/proto_docs/google/analytics/data/v1beta/analytics_data_api.rb +1 -1
  22. data/proto_docs/google/analytics/data/v1beta/data.rb +115 -1
  23. data/proto_docs/google/api/client.rb +179 -26
  24. data/proto_docs/google/api/field_behavior.rb +1 -1
  25. data/proto_docs/google/api/launch_stage.rb +1 -1
  26. data/proto_docs/google/api/resource.rb +1 -1
  27. data/proto_docs/google/longrunning/operations.rb +23 -1
  28. data/proto_docs/google/protobuf/any.rb +1 -1
  29. data/proto_docs/google/protobuf/duration.rb +1 -1
  30. data/proto_docs/google/protobuf/empty.rb +1 -1
  31. data/proto_docs/google/protobuf/timestamp.rb +8 -7
  32. data/proto_docs/google/rpc/status.rb +1 -1
  33. metadata +15 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8ef576e347f3d530bb2ac67a9c5bdae88cf3200436599cb43b7e460a678e9dfa
4
- data.tar.gz: 353c27184997952629510a79516eb942db1118b967581c96e328d97e5ff600bf
3
+ metadata.gz: 5c943b442153dbf30ee6fe4b08ca024382a4bc6b7f750515085a283fbf9e16bd
4
+ data.tar.gz: 6cc10777a7154d93bf83b0dee7ec7f10bc6237c48a7570a8221177f75de639b8
5
5
  SHA512:
6
- metadata.gz: 11efcf074e943437b9dfed215fe50463bbc4101f1a8f48cd40f85599d127ceedf2eb1b73e948206eae3d46e7155423267d710a4820b0735f61570a21bddd0837
7
- data.tar.gz: 8e51711acaaa3bd981b78e9fc22ea510190c6723430a71f98f9aaa6e353b535189b8ff5b9a735a914c70a5b79108f8c6404b885a1ce57b49409a4cc56f83d730
6
+ metadata.gz: 220f2ac6c0d18369c74d2b8bc7a287fd09690994a73b8b5523b0491b2b535bbefdbd81975ceb0b535db1f8968622720e991ab6ebe9ac2fe52cecb1b62d10ead6
7
+ data.tar.gz: 4a4cbdd1383da531ef5a6144456baa8838a79c4dc6a73971a6167a03346127cae1e6be8426a1cd8de80a62e8e1491d8abcef050ce2839051df0c9ed379733250
data/.yardopts CHANGED
@@ -1,5 +1,5 @@
1
1
  --no-private
2
- --title="Google Analytics Data V1beta API"
2
+ --title="Google Analytics Data V1BETA API"
3
3
  --exclude _pb\.rb$
4
4
  --markup markdown
5
5
  --markup-provider redcarpet
data/README.md CHANGED
@@ -1,13 +1,12 @@
1
- # Ruby Client for the Google Analytics Data V1beta API
1
+ # Ruby Client for the Google Analytics Data V1BETA API
2
2
 
3
3
  Accesses report data in Google Analytics. Warning: Creating multiple Customer Applications, Accounts, or Projects to simulate or act as a single Customer Application, Account, or Project (respectively) or to circumvent Service-specific usage limits or quotas is a direct violation of Google Cloud Platform Terms of Service as well as Google APIs Terms of Service. These actions can result in immediate termination of your GCP project(s) without any warning.
4
4
 
5
- The Google Analytics Data API provides programmatic methods to access report data in Google Analytics 4 (GA4) properties. Google Analytics 4 helps you understand how people use your web, iOS, or Android app.
6
5
 
7
6
  https://github.com/googleapis/google-cloud-ruby
8
7
 
9
8
  This gem is a _versioned_ client. It provides basic client classes for a
10
- specific version of the Google Analytics Data V1beta API. Most users should consider using
9
+ specific version of the Google Analytics Data V1BETA API. Most users should consider using
11
10
  the main client gem,
12
11
  [google-analytics-data](https://rubygems.org/gems/google-analytics-data).
13
12
  See the section below titled *Which client should I use?* for more information.
@@ -40,50 +39,55 @@ response = client.run_report request
40
39
  View the [Client Library Documentation](https://rubydoc.info/gems/google-analytics-data-v1beta)
41
40
  for class and method documentation.
42
41
 
43
- See also the [Product Documentation](https://developers.google.com/analytics/devguides/reporting/data/v1)
44
- for general usage information.
45
-
46
- ## Enabling Logging
47
-
48
- To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
49
- The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
50
- or a [`Google::Cloud::Logging::Logger`](https://cloud.google.com/ruby/docs/reference/google-cloud-logging/latest)
51
- that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
52
- and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
53
-
54
- Configuring a Ruby stdlib logger:
42
+ ## Debug Logging
43
+
44
+ This library comes with opt-in Debug Logging that can help you troubleshoot
45
+ your application's integration with the API. When logging is activated, key
46
+ events such as requests and responses, along with data payloads and metadata
47
+ such as headers and client configuration, are logged to the standard error
48
+ stream.
49
+
50
+ **WARNING:** Client Library Debug Logging includes your data payloads in
51
+ plaintext, which could include sensitive data such as PII for yourself or your
52
+ customers, private keys, or other security data that could be compromising if
53
+ leaked. Always practice good data hygiene with your application logs, and follow
54
+ the principle of least access. Google also recommends that Client Library Debug
55
+ Logging be enabled only temporarily during active debugging, and not used
56
+ permanently in production.
57
+
58
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
59
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
60
+ list of client library gem names. This will select the default logging behavior,
61
+ which writes logs to the standard error stream. On a local workstation, this may
62
+ result in logs appearing on the console. When running on a Google Cloud hosting
63
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
64
+ results in logs appearing alongside your application logs in the
65
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
66
+
67
+ You can customize logging by modifying the `logger` configuration when
68
+ constructing a client object. For example:
55
69
 
56
70
  ```ruby
71
+ require "google/analytics/data/v1beta"
57
72
  require "logger"
58
73
 
59
- module MyLogger
60
- LOGGER = Logger.new $stderr, level: Logger::WARN
61
- def logger
62
- LOGGER
63
- end
64
- end
65
-
66
- # Define a gRPC module-level logger method before grpc/logconfig.rb loads.
67
- module GRPC
68
- extend MyLogger
74
+ client = ::Google::Analytics::Data::V1beta::AnalyticsData::Client.new do |config|
75
+ config.logger = Logger.new "my-app.log"
69
76
  end
70
77
  ```
71
78
 
72
-
73
79
  ## Google Cloud Samples
74
80
 
75
81
  To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
76
82
 
77
83
  ## Supported Ruby Versions
78
84
 
79
- This library is supported on Ruby 2.7+.
85
+ This library is supported on Ruby 3.2+.
80
86
 
81
- Google provides official support for Ruby versions that are actively supported
82
- by Ruby Core—that is, Ruby versions that are either in normal maintenance or
83
- in security maintenance, and not end of life. Older versions of Ruby _may_
84
- still work, but are unsupported and not recommended. See
85
- https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby
86
- support schedule.
87
+ Google provides official support for Ruby versions as described in the
88
+ [Supported Ruby versions](https://docs.cloud.google.com/ruby/getting-started/supported-ruby-versions)
89
+ policy. Older versions of Ruby _may_ still work, but are unsupported and not
90
+ recommended.
87
91
 
88
92
  ## Which client should I use?
89
93
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2021 Google LLC
3
+ # Copyright 2026 Google LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -183,8 +183,19 @@ module Google
183
183
  universe_domain: @config.universe_domain,
184
184
  channel_args: @config.channel_args,
185
185
  interceptors: @config.interceptors,
186
- channel_pool_config: @config.channel_pool
186
+ channel_pool_config: @config.channel_pool,
187
+ logger: @config.logger
187
188
  )
189
+
190
+ @analytics_data_stub.stub_logger&.info do |entry|
191
+ entry.set_system_name
192
+ entry.set_service
193
+ entry.message = "Created client for #{entry.service}"
194
+ entry.set_credentials_fields credentials
195
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
196
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
197
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
198
+ end
188
199
  end
189
200
 
190
201
  ##
@@ -194,6 +205,15 @@ module Google
194
205
  #
195
206
  attr_reader :operations_client
196
207
 
208
+ ##
209
+ # The logger used for request/response debug logging.
210
+ #
211
+ # @return [Logger]
212
+ #
213
+ def logger
214
+ @analytics_data_stub.logger
215
+ end
216
+
197
217
  # Service calls
198
218
 
199
219
  ##
@@ -367,7 +387,6 @@ module Google
367
387
 
368
388
  @analytics_data_stub.call_rpc :run_report, request, options: options do |response, operation|
369
389
  yield response, operation if block_given?
370
- return response
371
390
  end
372
391
  rescue ::GRPC::BadStatus => e
373
392
  raise ::Google::Cloud::Error.from_error(e)
@@ -513,7 +532,6 @@ module Google
513
532
 
514
533
  @analytics_data_stub.call_rpc :run_pivot_report, request, options: options do |response, operation|
515
534
  yield response, operation if block_given?
516
- return response
517
535
  end
518
536
  rescue ::GRPC::BadStatus => e
519
537
  raise ::Google::Cloud::Error.from_error(e)
@@ -611,7 +629,6 @@ module Google
611
629
 
612
630
  @analytics_data_stub.call_rpc :batch_run_reports, request, options: options do |response, operation|
613
631
  yield response, operation if block_given?
614
- return response
615
632
  end
616
633
  rescue ::GRPC::BadStatus => e
617
634
  raise ::Google::Cloud::Error.from_error(e)
@@ -709,7 +726,6 @@ module Google
709
726
 
710
727
  @analytics_data_stub.call_rpc :batch_run_pivot_reports, request, options: options do |response, operation|
711
728
  yield response, operation if block_given?
712
- return response
713
729
  end
714
730
  rescue ::GRPC::BadStatus => e
715
731
  raise ::Google::Cloud::Error.from_error(e)
@@ -814,7 +830,6 @@ module Google
814
830
 
815
831
  @analytics_data_stub.call_rpc :get_metadata, request, options: options do |response, operation|
816
832
  yield response, operation if block_given?
817
- return response
818
833
  end
819
834
  rescue ::GRPC::BadStatus => e
820
835
  raise ::Google::Cloud::Error.from_error(e)
@@ -947,7 +962,6 @@ module Google
947
962
 
948
963
  @analytics_data_stub.call_rpc :run_realtime_report, request, options: options do |response, operation|
949
964
  yield response, operation if block_given?
950
- return response
951
965
  end
952
966
  rescue ::GRPC::BadStatus => e
953
967
  raise ::Google::Cloud::Error.from_error(e)
@@ -1063,7 +1077,6 @@ module Google
1063
1077
 
1064
1078
  @analytics_data_stub.call_rpc :check_compatibility, request, options: options do |response, operation|
1065
1079
  yield response, operation if block_given?
1066
- return response
1067
1080
  end
1068
1081
  rescue ::GRPC::BadStatus => e
1069
1082
  raise ::Google::Cloud::Error.from_error(e)
@@ -1184,7 +1197,7 @@ module Google
1184
1197
  @analytics_data_stub.call_rpc :create_audience_export, request, options: options do |response, operation|
1185
1198
  response = ::Gapic::Operation.new response, @operations_client, options: options
1186
1199
  yield response, operation if block_given?
1187
- return response
1200
+ throw :response, response
1188
1201
  end
1189
1202
  rescue ::GRPC::BadStatus => e
1190
1203
  raise ::Google::Cloud::Error.from_error(e)
@@ -1310,7 +1323,6 @@ module Google
1310
1323
 
1311
1324
  @analytics_data_stub.call_rpc :query_audience_export, request, options: options do |response, operation|
1312
1325
  yield response, operation if block_given?
1313
- return response
1314
1326
  end
1315
1327
  rescue ::GRPC::BadStatus => e
1316
1328
  raise ::Google::Cloud::Error.from_error(e)
@@ -1408,7 +1420,6 @@ module Google
1408
1420
 
1409
1421
  @analytics_data_stub.call_rpc :get_audience_export, request, options: options do |response, operation|
1410
1422
  yield response, operation if block_given?
1411
- return response
1412
1423
  end
1413
1424
  rescue ::GRPC::BadStatus => e
1414
1425
  raise ::Google::Cloud::Error.from_error(e)
@@ -1525,7 +1536,7 @@ module Google
1525
1536
  @analytics_data_stub.call_rpc :list_audience_exports, request, options: options do |response, operation|
1526
1537
  response = ::Gapic::PagedEnumerable.new @analytics_data_stub, :list_audience_exports, request, response, operation, options
1527
1538
  yield response, operation if block_given?
1528
- return response
1539
+ throw :response, response
1529
1540
  end
1530
1541
  rescue ::GRPC::BadStatus => e
1531
1542
  raise ::Google::Cloud::Error.from_error(e)
@@ -1566,8 +1577,6 @@ module Google
1566
1577
  # @return [::String,nil]
1567
1578
  # @!attribute [rw] credentials
1568
1579
  # Credentials to send with calls. You may provide any of the following types:
1569
- # * (`String`) The path to a service account key file in JSON format
1570
- # * (`Hash`) A service account key as a Hash
1571
1580
  # * (`Google::Auth::Credentials`) A googleauth credentials object
1572
1581
  # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1573
1582
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
@@ -1575,6 +1584,32 @@ module Google
1575
1584
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1576
1585
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1577
1586
  # * (`nil`) indicating no credentials
1587
+ #
1588
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
1589
+ # is deprecated. Providing an unvalidated credential configuration to
1590
+ # Google APIs can compromise the security of your systems and data.
1591
+ #
1592
+ # @example
1593
+ #
1594
+ # # The recommended way to provide credentials is to use the `make_creds` method
1595
+ # # on the appropriate credentials class for your environment.
1596
+ #
1597
+ # require "googleauth"
1598
+ #
1599
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
1600
+ # json_key_io: ::File.open("/path/to/keyfile.json")
1601
+ # )
1602
+ #
1603
+ # client = ::Google::Analytics::Data::V1beta::AnalyticsData::Client.new do |config|
1604
+ # config.credentials = credentials
1605
+ # end
1606
+ #
1607
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
1608
+ # external source for authentication to Google Cloud, you must validate it before
1609
+ # providing it to a Google API client library. Providing an unvalidated credential
1610
+ # configuration to Google APIs can compromise the security of your systems and data.
1611
+ # For more information, refer to [Validate credential configurations from external
1612
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1578
1613
  # @return [::Object]
1579
1614
  # @!attribute [rw] scope
1580
1615
  # The OAuth scopes
@@ -1603,6 +1638,7 @@ module Google
1603
1638
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1604
1639
  # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1605
1640
  # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1641
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
1606
1642
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1607
1643
  # trigger a retry.
1608
1644
  # @return [::Hash]
@@ -1614,6 +1650,11 @@ module Google
1614
1650
  # default endpoint URL. The default value of nil uses the environment
1615
1651
  # universe (usually the default "googleapis.com" universe).
1616
1652
  # @return [::String,nil]
1653
+ # @!attribute [rw] logger
1654
+ # A custom logger to use for request/response debug logging, or the value
1655
+ # `:default` (the default) to construct a default logger, or `nil` to
1656
+ # explicitly disable logging.
1657
+ # @return [::Logger,:default,nil]
1617
1658
  #
1618
1659
  class Configuration
1619
1660
  extend ::Gapic::Config
@@ -1624,8 +1665,8 @@ module Google
1624
1665
 
1625
1666
  config_attr :endpoint, nil, ::String, nil
1626
1667
  config_attr :credentials, nil do |value|
1627
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1628
- allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
1668
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1669
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
1629
1670
  allowed.any? { |klass| klass === value }
1630
1671
  end
1631
1672
  config_attr :scope, nil, ::String, ::Array, nil
@@ -1638,6 +1679,7 @@ module Google
1638
1679
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1639
1680
  config_attr :quota_project, nil, ::String, nil
1640
1681
  config_attr :universe_domain, nil, ::String, nil
1682
+ config_attr :logger, :default, ::Logger, nil, :default
1641
1683
 
1642
1684
  # @private
1643
1685
  def initialize parent_config = nil
@@ -1680,6 +1722,7 @@ module Google
1680
1722
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1681
1723
  # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1682
1724
  # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1725
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
1683
1726
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1684
1727
  # trigger a retry.
1685
1728
  #
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2021 Google LLC
3
+ # Copyright 2026 Google LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2023 Google LLC
3
+ # Copyright 2026 Google LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.
@@ -134,7 +134,7 @@ module Google
134
134
  # @param options [::Gapic::CallOptions, ::Hash]
135
135
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
136
136
  #
137
- # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil)
137
+ # @overload list_operations(name: nil, filter: nil, page_size: nil, page_token: nil, return_partial_success: nil)
138
138
  # Pass arguments to `list_operations` via keyword arguments. Note that at
139
139
  # least one keyword argument is required. To specify no parameters, or to keep all
140
140
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -147,6 +147,17 @@ module Google
147
147
  # The standard list page size.
148
148
  # @param page_token [::String]
149
149
  # The standard list page token.
150
+ # @param return_partial_success [::Boolean]
151
+ # When set to `true`, operations that are reachable are returned as normal,
152
+ # and those that are unreachable are returned in the
153
+ # [ListOperationsResponse.unreachable] field.
154
+ #
155
+ # This can only be `true` when reading across collections e.g. when `parent`
156
+ # is set to `"projects/example/locations/-"`.
157
+ #
158
+ # This field is not by default supported and will result in an
159
+ # `UNIMPLEMENTED` error if set unless explicitly documented otherwise in
160
+ # service or product specific documentation.
150
161
  #
151
162
  # @yield [response, operation] Access the result along with the RPC operation
152
163
  # @yieldparam response [::Gapic::PagedEnumerable<::Gapic::Operation>]
@@ -213,7 +224,7 @@ module Google
213
224
  wrap_lro_operation = ->(op_response) { ::Gapic::Operation.new op_response, @operations_client }
214
225
  response = ::Gapic::PagedEnumerable.new @operations_stub, :list_operations, request, response, operation, options, format_resource: wrap_lro_operation
215
226
  yield response, operation if block_given?
216
- return response
227
+ throw :response, response
217
228
  end
218
229
  rescue ::GRPC::BadStatus => e
219
230
  raise ::Google::Cloud::Error.from_error(e)
@@ -309,7 +320,7 @@ module Google
309
320
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
310
321
  response = ::Gapic::Operation.new response, @operations_client, options: options
311
322
  yield response, operation if block_given?
312
- return response
323
+ throw :response, response
313
324
  end
314
325
  rescue ::GRPC::BadStatus => e
315
326
  raise ::Google::Cloud::Error.from_error(e)
@@ -398,7 +409,6 @@ module Google
398
409
 
399
410
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
400
411
  yield response, operation if block_given?
401
- return response
402
412
  end
403
413
  rescue ::GRPC::BadStatus => e
404
414
  raise ::Google::Cloud::Error.from_error(e)
@@ -494,7 +504,6 @@ module Google
494
504
 
495
505
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
496
506
  yield response, operation if block_given?
497
- return response
498
507
  end
499
508
  rescue ::GRPC::BadStatus => e
500
509
  raise ::Google::Cloud::Error.from_error(e)
@@ -592,7 +601,7 @@ module Google
592
601
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
593
602
  response = ::Gapic::Operation.new response, @operations_client, options: options
594
603
  yield response, operation if block_given?
595
- return response
604
+ throw :response, response
596
605
  end
597
606
  rescue ::GRPC::BadStatus => e
598
607
  raise ::Google::Cloud::Error.from_error(e)
@@ -633,8 +642,6 @@ module Google
633
642
  # @return [::String,nil]
634
643
  # @!attribute [rw] credentials
635
644
  # Credentials to send with calls. You may provide any of the following types:
636
- # * (`String`) The path to a service account key file in JSON format
637
- # * (`Hash`) A service account key as a Hash
638
645
  # * (`Google::Auth::Credentials`) A googleauth credentials object
639
646
  # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
640
647
  # * (`Signet::OAuth2::Client`) A signet oauth2 client object
@@ -642,6 +649,32 @@ module Google
642
649
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
643
650
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
644
651
  # * (`nil`) indicating no credentials
652
+ #
653
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
654
+ # is deprecated. Providing an unvalidated credential configuration to
655
+ # Google APIs can compromise the security of your systems and data.
656
+ #
657
+ # @example
658
+ #
659
+ # # The recommended way to provide credentials is to use the `make_creds` method
660
+ # # on the appropriate credentials class for your environment.
661
+ #
662
+ # require "googleauth"
663
+ #
664
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
665
+ # json_key_io: ::File.open("/path/to/keyfile.json")
666
+ # )
667
+ #
668
+ # client = ::Google::Longrunning::Operations::Client.new do |config|
669
+ # config.credentials = credentials
670
+ # end
671
+ #
672
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
673
+ # external source for authentication to Google Cloud, you must validate it before
674
+ # providing it to a Google API client library. Providing an unvalidated credential
675
+ # configuration to Google APIs can compromise the security of your systems and data.
676
+ # For more information, refer to [Validate credential configurations from external
677
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
645
678
  # @return [::Object]
646
679
  # @!attribute [rw] scope
647
680
  # The OAuth scopes
@@ -670,6 +703,7 @@ module Google
670
703
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
671
704
  # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
672
705
  # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
706
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
673
707
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
674
708
  # trigger a retry.
675
709
  # @return [::Hash]
@@ -681,6 +715,11 @@ module Google
681
715
  # default endpoint URL. The default value of nil uses the environment
682
716
  # universe (usually the default "googleapis.com" universe).
683
717
  # @return [::String,nil]
718
+ # @!attribute [rw] logger
719
+ # A custom logger to use for request/response debug logging, or the value
720
+ # `:default` (the default) to construct a default logger, or `nil` to
721
+ # explicitly disable logging.
722
+ # @return [::Logger,:default,nil]
684
723
  #
685
724
  class Configuration
686
725
  extend ::Gapic::Config
@@ -691,8 +730,8 @@ module Google
691
730
 
692
731
  config_attr :endpoint, nil, ::String, nil
693
732
  config_attr :credentials, nil do |value|
694
- allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
695
- allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
733
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
734
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
696
735
  allowed.any? { |klass| klass === value }
697
736
  end
698
737
  config_attr :scope, nil, ::String, ::Array, nil
@@ -705,6 +744,7 @@ module Google
705
744
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
706
745
  config_attr :quota_project, nil, ::String, nil
707
746
  config_attr :universe_domain, nil, ::String, nil
747
+ config_attr :logger, :default, ::Logger, nil, :default
708
748
 
709
749
  # @private
710
750
  def initialize parent_config = nil
@@ -747,6 +787,7 @@ module Google
747
787
  # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
748
788
  # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
749
789
  # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
790
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
750
791
  # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
751
792
  # trigger a retry.
752
793
  #
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Copyright 2021 Google LLC
3
+ # Copyright 2026 Google LLC
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License");
6
6
  # you may not use this file except in compliance with the License.