gds-api-adapters 47.5.0 → 47.6.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
  SHA1:
3
- metadata.gz: e0fccfdbf4145dd639ac1a8f6d8229db64247fc1
4
- data.tar.gz: 96a76cf6550fe9802ed6b6be8c6c1941370f8ad4
3
+ metadata.gz: ae0dd1b0adbf3a001fadccdbe68dea76ff09bf27
4
+ data.tar.gz: 85eb9fa08bad4fb4e05cddaea9652af4f3bcb09c
5
5
  SHA512:
6
- metadata.gz: 002a7582303c07a8e7a21c09906754cdec93fa4f020cfec6ac69dc4f546599cc09eb9f00fee8b91b3206d4aa538fc0b02000104d0299ca693f89ff5491dbb079
7
- data.tar.gz: 070828f166c9a87ffc5aec6583f7db0c5649984d0cccdafc1692faa59f317df62d5f99dc1f21d49e6f39340f03a120642b7b096a82750d8583dd632f0a2827ac
6
+ metadata.gz: ac731345787b7b273faf175da76b8842ce8723e8b09f5258ec9f057204ea02beef49861d93d5cac212fa7be8b0b5b3a8dd86fb711e2b51749021bcfa414e8849
7
+ data.tar.gz: 773dcbee4272c367b68bce82894822f735c5a1555e7a320d435e81faf043824d1d14d0bbdf23528cd6e0174ab3d8b479eb5e115a29a377a10e822e1902861edb
@@ -35,7 +35,7 @@ class GdsApi::PublishingApiV2 < GdsApi::Base
35
35
 
36
36
  # @private
37
37
  def get_content!(*)
38
- raise "`PublishingApiV2#delete_content!` is deprecated. Use `PublishingApiV2#delete_content`"
38
+ raise "`PublishingApiV2#get_content!` is deprecated. Use `PublishingApiV2#get_content`"
39
39
  end
40
40
 
41
41
  # Find the content_ids for a list of base_paths.
@@ -211,14 +211,14 @@ class GdsApi::PublishingApiV2 < GdsApi::Base
211
211
  #
212
212
  # @param content_id [UUID]
213
213
  # @param with_drafts [Bool] Whether links to draft-only editions are returned, defaulting to `true`.
214
+ # @param generate [Bool] Whether to require publishing-api to generate the expanded links, which may be slow. Defaults to `false`.
214
215
  #
215
216
  # @example
216
217
  #
217
218
  # publishing_api.get_expanded_links("8157589b-65e2-4df6-92ba-2c91d80006c0", with_drafts: false).to_h
218
219
  #
219
220
  # #=> {
220
- # "content_id" => "8157589b-65e2-4df6-92ba-2c91d80006c0",
221
- # "version" => 10,
221
+ # "generated" => "2017-08-01T10:42:49Z",
222
222
  # "expanded_links" => {
223
223
  # "organisations" => [
224
224
  # {
@@ -230,8 +230,10 @@ class GdsApi::PublishingApiV2 < GdsApi::Base
230
230
  # }
231
231
  #
232
232
  # @see https://github.com/alphagov/publishing-api/blob/master/doc/api.md#get-v2expanded-linkscontent_id
233
- def get_expanded_links(content_id, with_drafts: true)
234
- params = with_drafts ? {} : { with_drafts: "false" }
233
+ def get_expanded_links(content_id, with_drafts: true, generate: false)
234
+ params = {}
235
+ params[:with_drafts] = "false" unless with_drafts
236
+ params[:generate] = "true" if generate
235
237
  query = query_string(params)
236
238
  validate_content_id(content_id)
237
239
  get_json("#{endpoint}/v2/expanded-links/#{content_id}#{query}")
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '47.5.0'.freeze
2
+ VERSION = '47.6.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: 47.5.0
4
+ version: 47.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Stewart
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-01 00:00:00.000000000 Z
11
+ date: 2017-08-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plek