gds-api-adapters 68.2.0 → 69.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gds_api/email_alert_api.rb +2 -27
- data/lib/gds_api/test_helpers/email_alert_api.rb +0 -13
- data/lib/gds_api/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5de255ce4237b87f433deb2306447f9bda4534d3d85cad5b2ea3053b8d2dda1
|
4
|
+
data.tar.gz: 2144a904a6f4b3eeb6d0ec0c14b11d680d844f37c432d8c2909f843ce67a6927
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d045fefa180fd19839f9f10db2f6743bfe6e70f916434d486dd1745c8457b2874870f4fbd7f3f46eca5ee010afe9fc01b3b63e625694684d36feae3b69febb4b
|
7
|
+
data.tar.gz: 812e40c01ab8876121451782fbf6103facfe9dd97f2e1b246a047ef3ec628f116dda681f7de2bdd36dfdc8fafd8ae8ba450bfed00da3b9100a02abd8ee51c78e
|
@@ -10,37 +10,12 @@ 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
|
-
|
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)
|
22
|
-
tags = attributes["tags"]
|
23
|
-
links = attributes["links"]
|
24
|
-
document_type = attributes["document_type"]
|
25
|
-
email_document_supertype = attributes["email_document_supertype"]
|
26
|
-
government_document_supertype = attributes["government_document_supertype"]
|
27
|
-
combine_mode = attributes["combine_mode"]
|
28
|
-
|
29
|
-
if tags && links
|
13
|
+
if attributes["tags"] && attributes["links"]
|
30
14
|
message = "please provide either tags or links (or neither), but not both"
|
31
15
|
raise ArgumentError, message
|
32
16
|
end
|
33
17
|
|
34
|
-
|
35
|
-
params[:tags] = tags if tags
|
36
|
-
params[:links] = links if links
|
37
|
-
params[:document_type] = document_type if document_type
|
38
|
-
params[:email_document_supertype] = email_document_supertype if email_document_supertype
|
39
|
-
params[:government_document_supertype] = government_document_supertype if government_document_supertype
|
40
|
-
params[:combine_mode] = combine_mode if combine_mode
|
41
|
-
|
42
|
-
query_string = nested_query_string(params)
|
43
|
-
get_json("#{endpoint}/subscriber-lists?" + query_string)
|
18
|
+
create_subscriber_list(attributes)
|
44
19
|
end
|
45
20
|
|
46
21
|
# Post a subscriber list
|
@@ -124,19 +124,6 @@ module GdsApi
|
|
124
124
|
matching.last
|
125
125
|
end
|
126
126
|
|
127
|
-
def stub_email_alert_api_has_subscriber_list(attributes)
|
128
|
-
stub_request(:get, build_subscriber_lists_url(attributes))
|
129
|
-
.to_return(
|
130
|
-
status: 200,
|
131
|
-
body: get_subscriber_list_response(attributes).to_json,
|
132
|
-
)
|
133
|
-
end
|
134
|
-
|
135
|
-
def stub_email_alert_api_does_not_have_subscriber_list(attributes)
|
136
|
-
stub_request(:get, build_subscriber_lists_url(attributes))
|
137
|
-
.to_return(status: 404)
|
138
|
-
end
|
139
|
-
|
140
127
|
def stub_email_alert_api_creates_subscriber_list(attributes)
|
141
128
|
stub_request(:post, build_subscriber_lists_url)
|
142
129
|
.to_return(
|
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:
|
4
|
+
version: 69.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-01-
|
11
|
+
date: 2021-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|