gds-api-adapters 30.4.0 → 30.5.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
  SHA1:
3
- metadata.gz: 45470b12b8841677669e769a1cda10981a25d5ad
4
- data.tar.gz: 0c32f6ac9fca548e90072e70597d3227b9697a6f
3
+ metadata.gz: 73f4ec1858d59e35d24b807bc1563ef99425a246
4
+ data.tar.gz: 2bf51592ac65dc4aad37e5bcfc517c1a9d27df07
5
5
  SHA512:
6
- metadata.gz: e8340c617333eb1810e1e46ef72bed25ac8cc080c65325c2e375dc71790d1ad8781a3582ed4abca59508a1b940cdbe1a83e3c6966a2673ceb7c65fc81b29d504
7
- data.tar.gz: 160d311984d37bfa2992313be1d240a898005b8063b95448ad420f3d0da40d2dfb03d73691ab75a6fa9f4f66735e2a1fe6429c123af95c2e65ad933bf995fda2
6
+ metadata.gz: c98b6e0f62db2002483a65c405d8d428ec66870fbee80f0bc76a148dbd204f2222c594ff3f1afc2ba53a2008728cc4707db7fd20bada1240026b47a91d0bd0b8
7
+ data.tar.gz: dbac2675ea0da5641190d1fd904822cecdc2c4a0e06bf2d8b9593c2e0c4cb6a5a36f61ca6e2dd46e3d20077f854ec20abb694d0f3cb77ec19c1a476ccbe7e7a2
@@ -118,9 +118,10 @@ class GdsApi::PublishingApiV2 < GdsApi::Base
118
118
  # @param alternative_path [String] (optional) Alternative path to show on the page or redirect to.
119
119
  # @param discard_drafts [Boolean] (optional) Whether to discard drafts on that item. Defaults to false.
120
120
  # @param previous_version [Integer] (optional) A lock version number for optimistic locking.
121
+ # @param locale [String] (optional) The content item locale.
121
122
  #
122
- # @see TODO
123
- def unpublish(content_id, type:, explanation: nil, alternative_path: nil, discard_drafts: false, previous_version: nil)
123
+ # @see https://github.com/alphagov/publishing-api/blob/master/doc/publishing-api-syntactic-usage.md#post-v2contentcontent_idunpublish
124
+ def unpublish(content_id, type:, explanation: nil, alternative_path: nil, discard_drafts: false, previous_version: nil, locale: nil)
124
125
  params = {
125
126
  type: type
126
127
  }
@@ -129,6 +130,7 @@ class GdsApi::PublishingApiV2 < GdsApi::Base
129
130
  params.merge!(alternative_path: alternative_path) if alternative_path
130
131
  params.merge!(previous_version: previous_version) if previous_version
131
132
  params.merge!(discard_drafts: discard_drafts) if discard_drafts
133
+ params.merge!(locale: locale) if locale
132
134
 
133
135
  post_json!(unpublish_url(content_id), params)
134
136
  end
@@ -40,6 +40,16 @@ module GdsApi
40
40
  stub_request(:post, url).with(body: body).to_return(response)
41
41
  end
42
42
 
43
+ def stub_publishing_api_unpublish(content_id, params, response_hash = {})
44
+ url = PUBLISHING_API_V2_ENDPOINT + "/content/#{content_id}/unpublish"
45
+ response = {
46
+ status: 200,
47
+ body: '{}',
48
+ headers: {"Content-Type" => "application/json; charset=utf-8"}
49
+ }.merge(response_hash)
50
+ stub_request(:post, url).with(params).to_return(response)
51
+ end
52
+
43
53
  def stub_publishing_api_discard_draft(content_id)
44
54
  url = PUBLISHING_API_V2_ENDPOINT + "/content/#{content_id}/discard-draft"
45
55
  stub_request(:post, url).to_return(status: 200, headers: {"Content-Type" => "application/json; charset=utf-8"})
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '30.4.0'
2
+ VERSION = '30.5.0'
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: 30.4.0
4
+ version: 30.5.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: 2016-05-09 00:00:00.000000000 Z
11
+ date: 2016-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plek