gds-api-adapters 47.6.0 → 47.7.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: ae0dd1b0adbf3a001fadccdbe68dea76ff09bf27
4
- data.tar.gz: 85eb9fa08bad4fb4e05cddaea9652af4f3bcb09c
3
+ metadata.gz: e50f702bd539a12e2492d142ec89f0f26ca72954
4
+ data.tar.gz: a2d80b63024eca94895802c4e213f43c2bb2e209
5
5
  SHA512:
6
- metadata.gz: ac731345787b7b273faf175da76b8842ce8723e8b09f5258ec9f057204ea02beef49861d93d5cac212fa7be8b0b5b3a8dd86fb711e2b51749021bcfa414e8849
7
- data.tar.gz: 773dcbee4272c367b68bce82894822f735c5a1555e7a320d435e81faf043824d1d14d0bbdf23528cd6e0174ab3d8b479eb5e115a29a377a10e822e1902861edb
6
+ metadata.gz: 59a5394045c71d853c9fc645624451301c563cd8e96445ee1e4f279bfa54a8a0048ea4e5772cd6cba09ed68625fd1977df0c3c55f11270d9894529a906e3d407
7
+ data.tar.gz: 1e59365385226ff6ac562c27ff773ee0f2f2655167e62fa163263f31f8027e8a23a20bd8959ae9c6e9d4de476b72a414f118094c1debadca27c29f2a98e31395
@@ -10,6 +10,15 @@ class GdsApi::EmailAlertApi < GdsApi::Base
10
10
  #
11
11
  # @param attributes [Hash] document_type, links, tags used to search existing subscriber lists
12
12
  def find_or_create_subscriber_list(attributes)
13
+ find_subscriber_list(attributes)
14
+ rescue GdsApi::HTTPNotFound
15
+ create_subscriber_list(attributes)
16
+ end
17
+
18
+ # Get a subscriber list
19
+ #
20
+ # @param attributes [Hash] document_type, links, tags used to search existing subscriber lists
21
+ def find_subscriber_list(attributes)
13
22
  tags = attributes["tags"]
14
23
  links = attributes["links"]
15
24
  document_type = attributes["document_type"]
@@ -30,9 +39,15 @@ class GdsApi::EmailAlertApi < GdsApi::Base
30
39
  params[:government_document_supertype] = government_document_supertype if government_document_supertype
31
40
  params[:gov_delivery_id] = gov_delivery_id if gov_delivery_id
32
41
 
33
- search_subscriber_list(params)
34
- rescue GdsApi::HTTPNotFound
35
- create_subscriber_list(attributes)
42
+ query_string = nested_query_string(params)
43
+ get_json("#{endpoint}/subscriber-lists?" + query_string)
44
+ end
45
+
46
+ # Post a subscriber list
47
+ #
48
+ # @param attributes [Hash] document_type, links, tags used to search existing subscriber lists
49
+ def create_subscriber_list(attributes)
50
+ post_json("#{endpoint}/subscriber-lists", attributes)
36
51
  end
37
52
 
38
53
  # Post notification
@@ -64,15 +79,6 @@ class GdsApi::EmailAlertApi < GdsApi::Base
64
79
 
65
80
  private
66
81
 
67
- def search_subscriber_list(params)
68
- query_string = nested_query_string(params)
69
- get_json("#{endpoint}/subscriber-lists?" + query_string)
70
- end
71
-
72
- def create_subscriber_list(attributes)
73
- post_json("#{endpoint}/subscriber-lists", attributes)
74
- end
75
-
76
82
  def nested_query_string(params)
77
83
  Rack::Utils.build_nested_query(params)
78
84
  end
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = '47.6.0'.freeze
2
+ VERSION = '47.7.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.6.0
4
+ version: 47.7.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-03 00:00:00.000000000 Z
11
+ date: 2017-08-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: plek