google-apis-core 0.11.3 → 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: f085e1d76ff530d5ad81f7971fc851fe8e2f65bc5c4f618ae4cd4d4a83ebb791
4
- data.tar.gz: a6257b235ec0141d76a40ef7e04f9c77da805ca67a7445c34ce54aaf1aac16b0
3
+ metadata.gz: e2348f0ac304503e08c287b735907645b6a10f684b7b5a11f1a95109afbf2e5f
4
+ data.tar.gz: b14ea78945be659f3486b257c22aa9b9ea1e34637bd2ae11fc190e29a6cf790e
5
5
  SHA512:
6
- metadata.gz: 8f4e051906ec4aa5ceb984e962d96b7eb07ed23782e7b56bc5ae24423993357b36af896de75d35d54374355e09fa93de3e1aa467f3e907a02a546665b33e6012
7
- data.tar.gz: 66b09b1c8f9fcaa8751815f9967d4a409c5cef642482cf4b5695ed719e9043ae0d9249f203e2804f4586549fe4d1a9dde6156e3ddfc3b9b4cf65da384c431904
6
+ metadata.gz: b6f7769444411932dcdf043dec431114421a8e7d22275a0dd8d4de2e908b4b81757f8974a96431b1f3e9fcbf07869f84d3b0a7f74a6afa485b7c117df0aeb744
7
+ data.tar.gz: 7b3cfe83244a183a39f706d7ff4f4f033346a95d42ceb7847c732940aa37e6f59bc3ab1545343eedc817c4f5db7a6e2215ad3e50c31af5d771ff3303bf2aff4d
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
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
+
3
9
  ### 0.11.3 (2024-01-17)
4
10
 
5
11
  #### 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'
@@ -16,7 +16,7 @@ module Google
16
16
  module Apis
17
17
  module Core
18
18
  # Core version
19
- VERSION = "0.11.3".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.3
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-17 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
@@ -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.11.3
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: []