gds-api-adapters 97.1.0 → 97.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: c727b23d7397797f8a4dc8167fade432fd4161efcc9062942e6f942058bbdfc7
4
- data.tar.gz: d4f897215feb468597bea8d62cb87c7c92bad5859ab1a7892c010aab99087d59
3
+ metadata.gz: 28d51629867498d4a82ac5e2ea9a1062a016144545e905060d4dadf6a8116b1a
4
+ data.tar.gz: 5c376df981bae6c3197e3c3a98e45375d168256a3d5b6bd3700704e64ca4ee39
5
5
  SHA512:
6
- metadata.gz: 8a2de0818203bbd9f62766cbda6cbe7cb2402f87d5123d2a26cd094997dcf9acdb6a82575379329099c9434cdc13b8461abb57036d195c13a2a7e5e01d8fe609
7
- data.tar.gz: 9663d632dce82d41aaeea134e17fe30334893084d89b0d5c8ac3ae5c8f02c3df804f4e1599fb5017110beec1363c641801ea99d66a98444ad126a9c6fd7e9007
6
+ metadata.gz: fb03d3158c4e924abd93cbef80c524e65b2efd190056d0fa63a296ba7a58ea5af80e98bf53d45ebef59903d02121bc1d826901c2cedc8028521ed5ede199a605
7
+ data.tar.gz: '0334915fa9576323f28f07d4bc9aa5d904ad3573078a63b9b62f6dd5fb3c63bd96f2e6f22ffab5981639bac730231719959686034f91614d111ac4de4d3e0d4a'
@@ -339,18 +339,21 @@ class GdsApi::PublishingApi < GdsApi::Base
339
339
 
340
340
  # Get content items which embed a reusable content_id
341
341
  #
342
- # No params are currently permitted.
343
- #
344
- # @example
342
+ # @param content_id [UUID]
343
+ # @param params [Hash]
345
344
  #
346
- # publishing_api.get_content_by_embedded_document("4b148ebc-b2bb-40db-8e48-dd8cff363ff7")
345
+ # publishing_api.get_content_by_embedded_document(
346
+ # "4b148ebc-b2bb-40db-8e48-dd8cff363ff7",
347
+ # { page: 1, order: '-last_edited_at' }
348
+ # )
347
349
  #
348
350
  # @return [GdsApi::Response] A response containing a summarised list of the content items which embed the target.
349
351
  # The content items returned will be in either the draft of published state.
350
352
  #
351
353
  # @see https://github.com/alphagov/publishing-api/blob/main/docs/api.md#get-v2contentcontent_idembedded
352
- def get_content_by_embedded_document(content_id)
353
- get_json("#{endpoint}/v2/content/#{content_id}/embedded")
354
+ def get_content_by_embedded_document(content_id, params = {})
355
+ query = query_string(params)
356
+ get_json("#{endpoint}/v2/content/#{content_id}/embedded#{query}")
354
357
  end
355
358
 
356
359
  # Returns an Enumerator of content items for the provided
@@ -374,8 +374,9 @@ module GdsApi
374
374
  # )
375
375
  # @param content_id [UUID, Mocha::ParameterMatchers::Anything]
376
376
  # @param total Integer
377
- # @param params [Hash]
378
- def stub_publishing_api_has_embedded_content(content_id:, total: 0, results: [])
377
+ # @param total_pages Integer
378
+ # @param results [Hash]
379
+ def stub_publishing_api_has_embedded_content(content_id:, total: 0, total_pages: 0, results: [])
379
380
  url = if content_id.is_a?(Mocha::ParameterMatchers::Anything)
380
381
  %r{\A#{PUBLISHING_API_V2_ENDPOINT}/content/[0-9a-fA-F-]{36}/embedded}
381
382
  else
@@ -386,6 +387,7 @@ module GdsApi
386
387
  .to_return(body: {
387
388
  "content_id" => content_id,
388
389
  "total" => total,
390
+ "total_pages" => total_pages,
389
391
  "results" => results,
390
392
  }.to_json)
391
393
  end
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = "97.1.0".freeze
2
+ VERSION = "97.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: 97.1.0
4
+ version: 97.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: 2024-10-30 00:00:00.000000000 Z
11
+ date: 2024-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -402,7 +402,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
402
402
  - !ruby/object:Gem::Version
403
403
  version: '0'
404
404
  requirements: []
405
- rubygems_version: 3.5.22
405
+ rubygems_version: 3.5.23
406
406
  signing_key:
407
407
  specification_version: 4
408
408
  summary: Adapters to work with GDS APIs