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 +4 -4
- data/lib/gds_api/email_alert_api.rb +18 -12
- data/lib/gds_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e50f702bd539a12e2492d142ec89f0f26ca72954
|
4
|
+
data.tar.gz: a2d80b63024eca94895802c4e213f43c2bb2e209
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
34
|
-
|
35
|
-
|
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
|
data/lib/gds_api/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2017-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: plek
|