gds-api-adapters 88.1.0 → 88.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gds_api/asset_manager.rb +13 -2
- data/lib/gds_api/test_helpers/asset_manager.rb +3 -0
- data/lib/gds_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7adeea7abfc8234541609b17eca719cd8d39be01991cc68ca285bda907f9a96a
|
4
|
+
data.tar.gz: 3e75818f4bf1a56e94089e94e341a5d8adb8f9a8e3b6faa5a8592f929355a0d9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a4ae5ac10341ba1c29872cf3772be25db3cbbba4a567a09da807b6b0909c1b7dc8d5bf0acdef4dd93fc07596ea7aa5bb299709f1a11a75d062bbeeb7f1910c12
|
7
|
+
data.tar.gz: b4cc259326d27d9c80b5bcf3ec25759ada42ff3f5440013e4056ff01cc44f2140b2c0d82862017ac72bcded2dd65802ca988a6261b5c7866bf5a389ce0edcc43
|
@@ -128,7 +128,7 @@ class GdsApi::AssetManager < GdsApi::Base
|
|
128
128
|
post_multipart("#{base_url}/whitehall_assets", asset: asset)
|
129
129
|
end
|
130
130
|
|
131
|
-
# Fetches a Whitehall asset given the legacy URL path
|
131
|
+
# Fetches a Whitehall asset's metadata given the legacy URL path
|
132
132
|
#
|
133
133
|
# @param legacy_url_path [String] The Whitehall asset identifier.
|
134
134
|
# @return [GdsApi::Response] A response object containing the parsed JSON
|
@@ -171,7 +171,7 @@ class GdsApi::AssetManager < GdsApi::Base
|
|
171
171
|
put_multipart("#{base_url}/assets/#{id}", asset: asset)
|
172
172
|
end
|
173
173
|
|
174
|
-
# Fetches an asset given the id
|
174
|
+
# Fetches an asset's metadata given the id
|
175
175
|
#
|
176
176
|
# @param id [String] The asset identifier (a UUID).
|
177
177
|
# @return [GdsApi::Response, nil] A response object containing the parsed JSON response. If
|
@@ -228,6 +228,17 @@ class GdsApi::AssetManager < GdsApi::Base
|
|
228
228
|
post_json("#{base_url}/assets/#{id}/restore")
|
229
229
|
end
|
230
230
|
|
231
|
+
# Fetches a Whitehall asset given the legacy URL path
|
232
|
+
#
|
233
|
+
# @param legacy_url_path [String] The Whitehall asset identifier.
|
234
|
+
# @return [GdsApi::Response] A response object containing the raw asset.
|
235
|
+
# If the asset cannot be found, +GdsApi::HTTPNotFound+ will be raised.
|
236
|
+
#
|
237
|
+
# @raise [HTTPErrorResponse] if the request returns an error
|
238
|
+
def whitehall_media(legacy_url_path)
|
239
|
+
get_raw("#{base_url}/#{uri_encode(legacy_url_path)}")
|
240
|
+
end
|
241
|
+
|
231
242
|
private
|
232
243
|
|
233
244
|
def base_url
|
@@ -33,6 +33,9 @@ module GdsApi
|
|
33
33
|
|
34
34
|
stub_request(:get, "#{ASSET_MANAGER_ENDPOINT}/whitehall_assets/#{legacy_url_path}")
|
35
35
|
.to_return(body: response.to_json, status: 200)
|
36
|
+
|
37
|
+
stub_request(:get, "#{ASSET_MANAGER_ENDPOINT}/#{legacy_url_path}")
|
38
|
+
.to_return(body: "Some file content", status: 200)
|
36
39
|
end
|
37
40
|
|
38
41
|
def stub_asset_manager_does_not_have_an_asset(id)
|
data/lib/gds_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gds-api-adapters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 88.
|
4
|
+
version: 88.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|