google-apis-core 0.11.2 → 0.12.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: 82086ecd9dad2239ce9089b943519c39de9b7574a9f1d089bee6cf6531c10eea
4
- data.tar.gz: defab5fb9d8dc49ee7e0dc228a9d687d173444ad477f41060c0b418212354058
3
+ metadata.gz: e2348f0ac304503e08c287b735907645b6a10f684b7b5a11f1a95109afbf2e5f
4
+ data.tar.gz: b14ea78945be659f3486b257c22aa9b9ea1e34637bd2ae11fc190e29a6cf790e
5
5
  SHA512:
6
- metadata.gz: d28bfc73a1293291b6e16ddc520082404030a34d9d78c4eb6e88c81bb038ef13996235ae49f436736e9d2cf82850ed54869141508de0f24f19c96c1a30bd0c4e
7
- data.tar.gz: 035f5285444a0af8631f87e6164d5cc52554534e5c4e94cfaef122236937bd73597b58c0c475d89c795d04d76051051b16279d3f8437aa671eef86fb455d3c8c
6
+ metadata.gz: b6f7769444411932dcdf043dec431114421a8e7d22275a0dd8d4de2e908b4b81757f8974a96431b1f3e9fcbf07869f84d3b0a7f74a6afa485b7c117df0aeb744
7
+ data.tar.gz: 7b3cfe83244a183a39f706d7ff4f4f033346a95d42ceb7847c732940aa37e6f59bc3ab1545343eedc817c4f5db7a6e2215ad3e50c31af5d771ff3303bf2aff4d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # Release History
2
2
 
3
+ ### 0.12.0 (2024-01-22)
4
+
5
+ #### Features
6
+
7
+ * Support for universe_domain ([#17131](https://github.com/googleapis/google-api-ruby-client/issues/17131))
8
+
9
+ ### 0.11.3 (2024-01-17)
10
+
11
+ #### Bug Fixes
12
+
13
+ * download with destination as pathname ([#17120](https://github.com/googleapis/google-api-ruby-client/issues/17120))
14
+
3
15
  ### 0.11.2 (2023-10-27)
4
16
 
5
17
  #### Bug Fixes
@@ -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
- attr_accessor :root_url
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'
@@ -35,7 +35,10 @@ module Google
35
35
  @state = :start
36
36
  @download_url = nil
37
37
  @offset = 0
38
- if download_dest.respond_to?(:write)
38
+ if @download_dest.is_a?(Pathname)
39
+ @download_io = File.open(download_dest, 'wb')
40
+ @close_io_on_finish = true
41
+ elsif download_dest.respond_to?(:write)
39
42
  @download_io = download_dest
40
43
  @close_io_on_finish = false
41
44
  elsif download_dest.is_a?(String)
@@ -16,7 +16,7 @@ module Google
16
16
  module Apis
17
17
  module Core
18
18
  # Core version
19
- VERSION = "0.11.2".freeze
19
+ VERSION = "0.12.0".freeze
20
20
  end
21
21
  end
22
22
  end
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.11.2
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: 2023-10-27 00:00:00.000000000 Z
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: 2.a
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: 2.a
94
+ version: '1.9'
101
95
  - !ruby/object:Gem::Dependency
102
96
  name: httpclient
103
97
  requirement: !ruby/object:Gem::Requirement
@@ -132,20 +126,6 @@ dependencies:
132
126
  - - ">="
133
127
  - !ruby/object:Gem::Version
134
128
  version: '0'
135
- - !ruby/object:Gem::Dependency
136
- name: webrick
137
- requirement: !ruby/object:Gem::Requirement
138
- requirements:
139
- - - ">="
140
- - !ruby/object:Gem::Version
141
- version: '0'
142
- type: :runtime
143
- prerelease: false
144
- version_requirements: !ruby/object:Gem::Requirement
145
- requirements:
146
- - - ">="
147
- - !ruby/object:Gem::Version
148
- version: '0'
149
129
  description:
150
130
  email: googleapis-packages@google.com
151
131
  executables: []
@@ -186,7 +166,7 @@ licenses:
186
166
  metadata:
187
167
  bug_tracker_uri: https://github.com/googleapis/google-api-ruby-client/issues
188
168
  changelog_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/google-apis-core/CHANGELOG.md
189
- documentation_uri: https://googleapis.dev/ruby/google-apis-core/v0.11.2
169
+ documentation_uri: https://googleapis.dev/ruby/google-apis-core/v0.12.0
190
170
  source_code_uri: https://github.com/googleapis/google-api-ruby-client/tree/main/google-apis-core
191
171
  post_install_message:
192
172
  rdoc_options: []
@@ -203,7 +183,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
183
  - !ruby/object:Gem::Version
204
184
  version: '0'
205
185
  requirements: []
206
- rubygems_version: 3.4.19
186
+ rubygems_version: 3.5.3
207
187
  signing_key:
208
188
  specification_version: 4
209
189
  summary: Common utility and base classes for legacy Google REST clients