google-analytics-admin 0.5.1 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 540f28c6b48a43e130b180ba77be70b74d6f74afed03df80b412138eb51e1618
4
- data.tar.gz: 58c232b3a9de7af30eda04939227c58cb9297aa666a906404e4a02e5d7a36203
3
+ metadata.gz: 3fba8da31bae919fd2d1b6e8312b045d4d6a580fbf6e641ce18dbc8a9149d701
4
+ data.tar.gz: 111307a11f9302e5e52dff8106b86f1e8f24a96a951d988700d8b2b1d083966b
5
5
  SHA512:
6
- metadata.gz: 8aa4668b12ac05022489a0a4b7548a1608ce0c8482ed679f6a6ec06db1e0c4a5b5108364344dce4098e7fdbb89f11e007f54af4bc53f4570650a747347b020cc
7
- data.tar.gz: e15853b3ca2a9abb0da78b589795036b9060ac1f845d16ccc8f857356be3cd34feabc41acff38d4508f208782f6cddf6b84aa04c88eb9f1b89261d97e0f6648d
6
+ metadata.gz: 899342fde9e74a04a7a9d7cfd08dcab8f6420dfeaad7214e5598aa1a1a32a91a44542b3c5bd0e75420ef38f5153ac11b103cb928de4955c4448cb619467356e6
7
+ data.tar.gz: f287d8f89c047ee0e7c8acc2d6cf2915cc401fb3c8652251309fe42f086849faabc8b98b76fea4297d641acd37c9a79d8ad5ce01ab089180d00e25b0f2188156
data/README.md CHANGED
@@ -31,9 +31,39 @@ In order to use this library, you first need to go through the following steps:
31
31
  1. [Enable the API.](https://console.cloud.google.com/apis/library/analyticsadmin.googleapis.com)
32
32
  1. {file:AUTHENTICATION.md Set up authentication.}
33
33
 
34
+ ## Debug Logging
35
+
36
+ This library comes with opt-in Debug Logging that can help you troubleshoot
37
+ your application's integration with the API. When logging is activated, key
38
+ events such as requests and responses, along with data payloads and metadata
39
+ such as headers and client configuration, are logged to the standard error
40
+ stream.
41
+
42
+ **WARNING:** Client Library Debug Logging includes your data payloads in
43
+ plaintext, which could include sensitive data such as PII for yourself or your
44
+ customers, private keys, or other security data that could be compromising if
45
+ leaked. Always practice good data hygiene with your application logs, and follow
46
+ the principle of least access. Google also recommends that Client Library Debug
47
+ Logging be enabled only temporarily during active debugging, and not used
48
+ permanently in production.
49
+
50
+ To enable logging, set the environment variable `GOOGLE_SDK_RUBY_LOGGING_GEMS`
51
+ to the value `all`. Alternatively, you can set the value to a comma-delimited
52
+ list of client library gem names. This will select the default logging behavior,
53
+ which writes logs to the standard error stream. On a local workstation, this may
54
+ result in logs appearing on the console. When running on a Google Cloud hosting
55
+ service such as [Google Cloud Run](https://cloud.google.com/run), this generally
56
+ results in logs appearing alongside your application logs in the
57
+ [Google Cloud Logging](https://cloud.google.com/logging/) service.
58
+
59
+ Debug logging also requires that the versioned clients for this service be
60
+ sufficiently recent, released after about Dec 10, 2024. If logging is not
61
+ working, try updating the versioned clients in your bundle or installed gems:
62
+ [google-analytics-admin-v1alpha](https://rubydoc.info/gems/google-analytics-admin-v1alpha).
63
+
34
64
  ## Supported Ruby Versions
35
65
 
36
- This library is supported on Ruby 2.7+.
66
+ This library is supported on Ruby 3.0+.
37
67
 
38
68
  Google provides official support for Ruby versions that are actively supported
39
69
  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 Admin
23
- VERSION = "0.5.1"
23
+ VERSION = "0.6.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 AnalyticsAdminService service.
45
+ # You can determine whether the method will succeed by calling
46
+ # {Google::Analytics::Admin.analytics_admin_service_available?}.
47
+ #
43
48
  # ## About AnalyticsAdminService
44
49
  #
45
50
  # Service Interface for the Analytics Admin API (GA4).
@@ -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 AnalyticsAdminService service is supported by the current client.
71
+ # If true, you can retrieve a client object by calling {Google::Analytics::Admin.analytics_admin_service}.
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 AnalyticsAdminService service,
74
+ # or if the versioned client gem needs an update to support the AnalyticsAdminService service.
75
+ #
76
+ # @param version [::String, ::Symbol] The API version to connect to. Optional.
77
+ # Defaults to `:v1alpha`.
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_admin_service_available? version: :v1alpha, transport: :grpc
82
+ require "google/analytics/admin/#{version.to_s.downcase}"
83
+ package_name = Google::Analytics::Admin
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::Admin.const_get package_name
89
+ return false unless service_module.const_defined? :AnalyticsAdminService
90
+ service_module = service_module.const_get :AnalyticsAdminService
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-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.6.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-08-08 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-admin-v1alpha
@@ -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 Admin API
85
82
  test_files: []