gds-api-adapters 47.1.1 → 47.1.2

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: 4ef33bc6ded80f8b5585aa3eacdef99b2c06257c
4
- data.tar.gz: c38816d7b8061a336df2835b16c8871a756aed15
3
+ metadata.gz: a17d11273afbf8570787c39195b5a82169afbbc5
4
+ data.tar.gz: 75c2fdecf164e1b60cddd4e04d75e1c17f10afb4
5
5
  SHA512:
6
- metadata.gz: b10cbeb80228493c6e6d75adc4c41341f2979375c85ba21e14bc3cc471d68a78e8043102781d825e334060f2235ce6e5cf098185c95f44eb2b6253ad3833b8e6
7
- data.tar.gz: 0b46f6e2aa914728a621bf5f7608ffd94b3f8ade25cf75e9f5f3f3c714fe2f5afaa1b538f6303f036eb3cb7d1613b23590b33175c2c821d1b56a664214ffa157
6
+ metadata.gz: 3b536ed4c51f78eb622c5642ac950ce0dffc5bde4c29ec1e049e9b69241682ad1af4428b9be9d6929da4b8c4bc57fbacc9c30cbc24e3993ff56199ed9a98689e
7
+ data.tar.gz: b6f03de36bfd875e3ede56462744d512030df55cfc92f16aad9e589f9e887877cf6f3d4721a0918b3c96490a3fe84bdf7909787fd6b152cf31b1197a898614d8
@@ -41,6 +41,8 @@ class GdsApi::PublishingApiV2 < GdsApi::Base
41
41
  # Find the content_ids for a list of base_paths.
42
42
  #
43
43
  # @param base_paths [Array]
44
+ # @param exclude_document_types [Array] (optional)
45
+ # @param exclude_publishing_types [Array] (optional)
44
46
  # @return [Hash] a hash, keyed by `base_path` with `content_id` as value
45
47
  # @example
46
48
  #
@@ -48,8 +50,11 @@ class GdsApi::PublishingApiV2 < GdsApi::Base
48
50
  # # => { "/foo" => "51ac4247-fd92-470a-a207-6b852a97f2db", "/bar" => "261bd281-f16c-48d5-82d2-9544019ad9ca" }
49
51
  #
50
52
  # @see https://github.com/alphagov/publishing-api/blob/master/doc/api.md#post-lookup-by-base-path
51
- def lookup_content_ids(base_paths:)
52
- response = post_json("#{endpoint}/lookup-by-base-path", base_paths: base_paths)
53
+ def lookup_content_ids(base_paths:, exclude_document_types: nil, exclude_publishing_types: nil)
54
+ options = { base_paths: base_paths }
55
+ options[:exclude_document_types] = exclude_document_types if exclude_document_types
56
+ options[:exclude_publishing_types] = exclude_publishing_types if exclude_publishing_types
57
+ response = post_json("#{endpoint}/lookup-by-base-path", options)
53
58
  response.to_hash
54
59
  end
55
60
 
@@ -59,6 +64,8 @@ class GdsApi::PublishingApiV2 < GdsApi::Base
59
64
  # base_path. For multiple base_paths, use {GdsApi::PublishingApiV2#lookup_content_ids}.
60
65
  #
61
66
  # @param base_path [String]
67
+ # @param exclude_document_types [Array] (optional)
68
+ # @param exclude_publishing_types [Array] (optional)
62
69
  #
63
70
  # @return [UUID] the `content_id` for the `base_path`
64
71
  #
@@ -68,8 +75,12 @@ class GdsApi::PublishingApiV2 < GdsApi::Base
68
75
  # # => "51ac4247-fd92-470a-a207-6b852a97f2db"
69
76
  #
70
77
  # @see https://github.com/alphagov/publishing-api/blob/master/doc/api.md#post-lookup-by-base-path
71
- def lookup_content_id(base_path:)
72
- lookups = lookup_content_ids(base_paths: [base_path])
78
+ def lookup_content_id(base_path:, exclude_document_types: nil, exclude_publishing_types: nil)
79
+ lookups = lookup_content_ids(
80
+ base_paths: [base_path],
81
+ exclude_document_types: exclude_document_types,
82
+ exclude_publishing_types: exclude_publishing_types
83
+ )
73
84
  lookups[base_path]
74
85
  end
75
86
 
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '47.1.1'.freeze
2
+ VERSION = '47.1.2'.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.1.1
4
+ version: 47.1.2
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-07-04 00:00:00.000000000 Z
11
+ date: 2017-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plek