gds-api-adapters 88.1.0 → 88.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 79fe1575665027a5ad13f85d14e744690c101f68b96eb07bdcaddda05cb64e8a
4
- data.tar.gz: 660f4807575e2cf6027eac405bcf0dbe5b07d176a8416be908d44c6a785f1af9
3
+ metadata.gz: 7adeea7abfc8234541609b17eca719cd8d39be01991cc68ca285bda907f9a96a
4
+ data.tar.gz: 3e75818f4bf1a56e94089e94e341a5d8adb8f9a8e3b6faa5a8592f929355a0d9
5
5
  SHA512:
6
- metadata.gz: 6a50caa040385b76a6238df0f1f13ffce44a2b807434b6cc51f280109b3f15ae9d756cbf93c2ea3c7ae7b9790ae3a314aae1e28ed85bf6be24414edf7911d7af
7
- data.tar.gz: 68e20ea7f52cb1451d1cdb847125c3278901381d6346941e74a13fdf21dafd58bd74a3363348c2f573b5f046eddc3e271de06a569374304eff3887c0fdd0e8d4
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)
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = "88.1.0".freeze
2
+ VERSION = "88.2.0".freeze
3
3
  end
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.1.0
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-05-30 00:00:00.000000000 Z
11
+ date: 2023-06-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable