google-analytics-data 0.6.0 → 0.7.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e402507c1a00613f346fcad5ef7319b7757d5f2d9fd3a30f58366b2f49e12bc5
4
- data.tar.gz: 96b1f23b20d39675e1e1c5b471ad9e169e665dc6c35dd19d0c72ffd0a8c91941
3
+ metadata.gz: bab9a6fea0ba117b93eceaecc50f4dee4397754d88de895e5198008cde709afc
4
+ data.tar.gz: b40bcbf65a3467dc6ec492ca079d99d79d45ca9672c11aeac117b14487d667ff
5
5
  SHA512:
6
- metadata.gz: b51b4f1bb05ed6c24918c2dd52f3ca286ff162f3239f2dc4fae557a6c99ebd465e0940f025599aec26637191410c37f016f3e9219d4662a50545b244e21f355c
7
- data.tar.gz: 0a936f20776e2555b2942589401d43b061a65292603c6d220c6eec357f76eb7f62ce4b991589183ab25e704088f6fce55c9ef336f58d388fa6e8ac2f8d339bda
6
+ metadata.gz: d3f330033f8c2749632c548e958d629b51e3e0bb94bbba709d8eee262085e265f7d33c152f4cc1f995edad04d964a2305b9115db60ee8cb32329859d727a1ff8
7
+ data.tar.gz: da8da399d5ad97da597d5c4dace3cc00e1085c84746ed9e84ee64a61f49b7250e2cb856b521d04ac36fb8f3a23f913310d303a71e75ec23a5157fa4e55534939
data/README.md CHANGED
@@ -34,9 +34,39 @@ In order to use this library, you first need to go through the following steps:
34
34
  1. [Enable the API.](https://console.cloud.google.com/apis/library/analyticsdata.googleapis.com)
35
35
  1. {file:AUTHENTICATION.md Set up authentication.}
36
36
 
37
+ ## Debug Logging
38
+
39
+ This library comes with opt-in Debug Logging that can help you troubleshoot
40
+ your application's integration with the API. When logging is activated, key
41
+ events such as requests and responses, along with data payloads and metadata
42
+ such as headers and client configuration, are logged to the standard error
43
+ stream.
44
+
45
+ **WARNING:** Client Library Debug Logging includes your data payloads in
46
+ plaintext, which could include sensitive data such as PII for yourself or your
47
+ customers, private keys, or other security data that could be compromising if
48
+ leaked. Always practice good data hygiene with your application logs, and follow
49
+ the principle of least access. Google also recommends that Client Library Debug
50
+ Logging be enabled only temporarily during active debugging, and not used
51
+ permanently in production.
52
+
53
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
54
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
55
+ list of client library gem names. This will select the default logging behavior,
56
+ which writes logs to the standard error stream. On a local workstation, this may
57
+ result in logs appearing on the console. When running on a Google Cloud hosting
58
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
59
+ results in logs appearing alongside your application logs in the
60
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
61
+
62
+ Debug logging also requires that the versioned clients for this service be
63
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
64
+ working, try updating the versioned clients in your bundle or installed gems:
65
+ [google-analytics-data-v1beta](https://rubydoc.info/gems/google-analytics-data-v1beta).
66
+
37
67
  ## Supported Ruby Versions
38
68
 
39
- This library is supported on Ruby 2.7+.
69
+ This library is supported on Ruby 3.0+.
40
70
 
41
71
  Google provides official support for Ruby versions that are actively supported
42
72
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -20,7 +20,7 @@
20
20
  module Google
21
21
  module Analytics
22
22
  module Data
23
- VERSION = "0.6.0"
23
+ VERSION = "0.7.0"
24
24
  end
25
25
  end
26
26
  end
@@ -40,6 +40,11 @@ module Google
40
40
  # You can also specify a different transport by passing `:rest` or `:grpc` in
41
41
  # the `transport` parameter.
42
42
  #
43
+ # Raises an exception if the currently installed versioned client gem for the
44
+ # given API version does not support the given transport of the AnalyticsData service.
45
+ # You can determine whether the method will succeed by calling
46
+ # {Google::Analytics::Data.analytics_data_available?}.
47
+ #
43
48
  # ## About AnalyticsData
44
49
  #
45
50
  # Google Analytics reporting data service.
@@ -60,6 +65,37 @@ module Google
60
65
  service_module = service_module.const_get(:Rest) if transport == :rest
61
66
  service_module.const_get(:Client).new(&block)
62
67
  end
68
+
69
+ ##
70
+ # Determines whether the AnalyticsData service is supported by the current client.
71
+ # If true, you can retrieve a client object by calling {Google::Analytics::Data.analytics_data}.
72
+ # If false, that method will raise an exception. This could happen if the given
73
+ # API version does not exist or does not support the AnalyticsData service,
74
+ # or if the versioned client gem needs an update to support the AnalyticsData service.
75
+ #
76
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
77
+ # Defaults to `:v1beta`.
78
+ # @param transport [:grpc, :rest] The transport to use. Defaults to `:grpc`.
79
+ # @return [boolean] Whether the service is available.
80
+ #
81
+ def self.analytics_data_available? version: :v1beta, transport: :grpc
82
+ require "google/analytics/data/#{version.to_s.downcase}"
83
+ package_name = Google::Analytics::Data
84
+ .constants
85
+ .select { |sym| sym.to_s.downcase == version.to_s.downcase.tr("_", "") }
86
+ .first
87
+ return false unless package_name
88
+ service_module = Google::Analytics::Data.const_get package_name
89
+ return false unless service_module.const_defined? :AnalyticsData
90
+ service_module = service_module.const_get :AnalyticsData
91
+ if transport == :rest
92
+ return false unless service_module.const_defined? :Rest
93
+ service_module = service_module.const_get :Rest
94
+ end
95
+ service_module.const_defined? :Client
96
+ rescue ::LoadError
97
+ false
98
+ end
63
99
  end
64
100
  end
65
101
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-analytics-data
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-02-26 00:00:00.000000000 Z
10
+ date: 2025-01-29 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: google-analytics-data-v1beta
@@ -63,7 +62,6 @@ homepage: https://github.com/googleapis/google-cloud-ruby
63
62
  licenses:
64
63
  - Apache-2.0
65
64
  metadata: {}
66
- post_install_message:
67
65
  rdoc_options: []
68
66
  require_paths:
69
67
  - lib
@@ -71,15 +69,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
71
69
  requirements:
72
70
  - - ">="
73
71
  - !ruby/object:Gem::Version
74
- version: '2.7'
72
+ version: '3.0'
75
73
  required_rubygems_version: !ruby/object:Gem::Requirement
76
74
  requirements:
77
75
  - - ">="
78
76
  - !ruby/object:Gem::Version
79
77
  version: '0'
80
78
  requirements: []
81
- rubygems_version: 3.5.6
82
- signing_key:
79
+ rubygems_version: 3.6.2
83
80
  specification_version: 4
84
81
  summary: API Client library for the Google Analytics Data API
85
82
  test_files: []