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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ec0fa71b77c5c2e4b44a7738181d36c6089b99b7afdfd5a34696261bdc0152c
4
- data.tar.gz: 811610b3bdd0bd041886d456536ff40ec6ec1afa304d406df3298c37e4f0cf5a
3
+ metadata.gz: b5de255ce4237b87f433deb2306447f9bda4534d3d85cad5b2ea3053b8d2dda1
4
+ data.tar.gz: 2144a904a6f4b3eeb6d0ec0c14b11d680d844f37c432d8c2909f843ce67a6927
5
5
  SHA512:
6
- metadata.gz: c0199c4107477873935dfd75c2949bdd2e91034d17e9927df1668c6e214a46d84b5bb9b14abfb2898dcdfc2161ee657a9a8615d0d8ae9dd96a782e9c318c1772
7
- data.tar.gz: 3b108e03797549bcb7dcdb6b14dad018f8ef3e8d4fc4be605a5468cbff7501960be91a1f441628dc9cea88548cef4b37b53f19d17a5eb5c62568187c67d0ad8d
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
- 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)
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
- params = {}
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(
@@ -1,3 +1,3 @@
1
1
  module GdsApi
2
- VERSION = "68.2.0".freeze
2
+ VERSION = "69.0.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: 68.2.0
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-06 00:00:00.000000000 Z
11
+ date: 2021-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable