google-apis-core 0.11.3 → 0.12.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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/google/apis/core/base_service.rb +42 -2
- data/lib/google/apis/core/version.rb +1 -1
- metadata +7 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e2348f0ac304503e08c287b735907645b6a10f684b7b5a11f1a95109afbf2e5f
|
4
|
+
data.tar.gz: b14ea78945be659f3486b257c22aa9b9ea1e34637bd2ae11fc190e29a6cf790e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6f7769444411932dcdf043dec431114421a8e7d22275a0dd8d4de2e908b4b81757f8974a96431b1f3e9fcbf07869f84d3b0a7f74a6afa485b7c117df0aeb744
|
7
|
+
data.tar.gz: 7b3cfe83244a183a39f706d7ff4f4f033346a95d42ceb7847c732940aa37e6f59bc3ab1545343eedc817c4f5db7a6e2215ad3e50c31af5d771ff3303bf2aff4d
|
data/CHANGELOG.md
CHANGED
@@ -93,11 +93,49 @@ module Google
|
|
93
93
|
# Base service for all APIs. Not to be used directly.
|
94
94
|
#
|
95
95
|
class BaseService
|
96
|
+
##
|
97
|
+
# A substitution string for the universe domain in an endpoint template
|
98
|
+
# @return [String]
|
99
|
+
#
|
100
|
+
ENDPOINT_SUBSTITUTION = "$UNIVERSE_DOMAIN$".freeze
|
101
|
+
|
96
102
|
include Logging
|
97
103
|
|
104
|
+
# Universe domain
|
105
|
+
# @return [String]
|
106
|
+
attr_reader :universe_domain
|
107
|
+
|
108
|
+
# Set the universe domain.
|
109
|
+
# If the root URL was set with a universe domain substitution, it is
|
110
|
+
# updated to reflect the new universe domain.
|
111
|
+
#
|
112
|
+
# @param new_ud [String,nil] The new universe domain, or nil to use the Google Default Universe
|
113
|
+
def universe_domain= new_ud
|
114
|
+
new_ud ||= ENV["GOOGLE_CLOUD_UNIVERSE_DOMAIN"] || "googleapis.com"
|
115
|
+
if @root_url_template
|
116
|
+
@root_url = @root_url_template.gsub ENDPOINT_SUBSTITUTION, new_ud
|
117
|
+
end
|
118
|
+
@universe_domain = new_ud
|
119
|
+
end
|
120
|
+
|
98
121
|
# Root URL (host/port) for the API
|
99
122
|
# @return [Addressable::URI]
|
100
|
-
|
123
|
+
attr_reader :root_url
|
124
|
+
|
125
|
+
# Set the root URL.
|
126
|
+
# If the given url includes a universe domain substitution, it is
|
127
|
+
# resolved in the current universe domain
|
128
|
+
#
|
129
|
+
# @param url_or_template [String] The URL, which can include a universe domain substitution
|
130
|
+
def root_url= url_or_template
|
131
|
+
if url_or_template.include? ENDPOINT_SUBSTITUTION
|
132
|
+
@root_url_template = url_or_template
|
133
|
+
@root_url = url_or_template.gsub ENDPOINT_SUBSTITUTION, universe_domain
|
134
|
+
else
|
135
|
+
@root_url_template = nil
|
136
|
+
@root_url = url_or_template
|
137
|
+
end
|
138
|
+
end
|
101
139
|
|
102
140
|
# Additional path prefix for all API methods
|
103
141
|
# @return [Addressable::URI]
|
@@ -136,7 +174,9 @@ module Google
|
|
136
174
|
# @param [String,Addressable::URI] base_path
|
137
175
|
# Additional path prefix for all API methods
|
138
176
|
# @api private
|
139
|
-
def initialize(root_url, base_path, client_name: nil, client_version: nil)
|
177
|
+
def initialize(root_url, base_path, client_name: nil, client_version: nil, universe_domain: nil)
|
178
|
+
@root_url_template = nil
|
179
|
+
self.universe_domain = universe_domain
|
140
180
|
self.root_url = root_url
|
141
181
|
self.base_path = base_path
|
142
182
|
self.client_name = client_name || 'google-api-ruby-client'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-apis-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.12.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-01-
|
11
|
+
date: 2024-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: representable
|
@@ -82,22 +82,16 @@ dependencies:
|
|
82
82
|
name: googleauth
|
83
83
|
requirement: !ruby/object:Gem::Requirement
|
84
84
|
requirements:
|
85
|
-
- - "
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
version: 0.16.2
|
88
|
-
- - "<"
|
85
|
+
- - "~>"
|
89
86
|
- !ruby/object:Gem::Version
|
90
|
-
version:
|
87
|
+
version: '1.9'
|
91
88
|
type: :runtime
|
92
89
|
prerelease: false
|
93
90
|
version_requirements: !ruby/object:Gem::Requirement
|
94
91
|
requirements:
|
95
|
-
- - "
|
96
|
-
- !ruby/object:Gem::Version
|
97
|
-
version: 0.16.2
|
98
|
-
- - "<"
|
92
|
+
- - "~>"
|
99
93
|
- !ruby/object:Gem::Version
|
100
|
-
version:
|
94
|
+
version: '1.9'
|
101
95
|
- !ruby/object:Gem::Dependency
|
102
96
|
name: httpclient
|
103
97
|
requirement: !ruby/object:Gem::Requirement
|
@@ -172,7 +166,7 @@ licenses:
|
|
172
166
|
metadata:
|
173
167
|
bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
|
174
168
|
changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/google-apis-core/CHANGELOG.md
|
175
|
-
documentation_uri: https://googleapis.dev/ruby/google-apis-core/v0.
|
169
|
+
documentation_uri: https://googleapis.dev/ruby/google-apis-core/v0.12.0
|
176
170
|
source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/google-apis-core
|
177
171
|
post_install_message:
|
178
172
|
rdoc_options: []
|