gds-api-adapters 37.4.0 → 37.5.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: edfaed63bfc9dcd1c1f32e624f418363382bd724
4
- data.tar.gz: d9a162ebd3876a3f10d3dd635c12229da1cf2fb3
3
+ metadata.gz: a6605bc5855ecb13e79667aa0b469918b57c1f69
4
+ data.tar.gz: 7ec49def047a41ac5278175bc0b0f54bdae69be7
5
5
  SHA512:
6
- metadata.gz: 69cfa3476da2b94a81f969290cb1058dd6fbad7c0cd6a2340730afdd0b916011ce9b1f87b5ce3a1f47cd825d14e3169e83236cac4bf1a181f416065881ca8d18
7
- data.tar.gz: de03c96bcd1c5a8bc22c4b583c75612e063068b050a093cf2ad467d7cfe3bd7537218709e36780d7573d900f32be2990fab0cb5604bb6722bb1d4b61d7dd7200
6
+ metadata.gz: 210882ae9dc87120936a8842cf3495fd154670dd97d52de27012044947f4346a30a5147ae7d77cc28525c14d7399c8c7f40c5a50b49ed27a77331c778557c37f
7
+ data.tar.gz: f080ccb5851c2594effa49897c9023f1ea7ee37121383ee7f4dbeef40c172c5ae4e1718a0b15b7203aa322554f06342a06cb92edb8d60661dc04ab88f7723b20
@@ -119,19 +119,21 @@ class GdsApi::PublishingApiV2 < GdsApi::Base
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
121
  # @param locale [String] (optional) The content item locale.
122
+ # @param unpublished_at [Time] (optional) The time the content was withdrawn. Ignored for types other than withdrawn
122
123
  #
123
124
  # @see https://github.com/alphagov/publishing-api/blob/master/doc/api.md#post-v2contentcontent_idunpublish
124
- def unpublish(content_id, type:, explanation: nil, alternative_path: nil, discard_drafts: false, allow_draft: false, previous_version: nil, locale: nil)
125
+ def unpublish(content_id, type:, explanation: nil, alternative_path: nil, discard_drafts: false, allow_draft: false, previous_version: nil, locale: nil, unpublished_at: nil)
125
126
  params = {
126
127
  type: type
127
128
  }
128
129
 
129
- params.merge!(explanation: explanation) if explanation
130
- params.merge!(alternative_path: alternative_path) if alternative_path
131
- params.merge!(previous_version: previous_version) if previous_version
132
- params.merge!(discard_drafts: discard_drafts) if discard_drafts
133
- params.merge!(allow_draft: allow_draft) if allow_draft
134
- params.merge!(locale: locale) if locale
130
+ params[:explanation] = explanation if explanation
131
+ params[:alternative_path] = alternative_path if alternative_path
132
+ params[:previous_version] = previous_version if previous_version
133
+ params[:discard_drafts] = discard_drafts if discard_drafts
134
+ params[:allow_draft] = allow_draft if allow_draft
135
+ params[:locale] = locale if locale
136
+ params[:unpublished_at] = unpublished_at.utc.iso8601 if unpublished_at
135
137
 
136
138
  post_json!(unpublish_url(content_id), params)
137
139
  end
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '37.4.0'.freeze
2
+ VERSION = '37.5.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: 37.4.0
4
+ version: 37.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-10-20 00:00:00.000000000 Z
11
+ date: 2016-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plek