gds-api-adapters 52.3.0 → 52.4.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 +11 -2
- data/lib/gds_api/test_helpers/email_alert_api.rb +14 -0
- data/lib/gds_api/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f25de033dd0924ac2e17348a1c1a8358aa7deb30c502a1ae6483595e997837ed
|
4
|
+
data.tar.gz: 7f0dee4ad67cd1cbbb7e97cb924b96210f6d31480abf713032cdf604fa9a8f6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44f54f5b8cf0a657ee42e4c876fc067397aba75f8319eef8b43aa48d4d8ba6a095f3e20965d38505ba18a64bbc9f22fc993f45014c990e28b74da933012e37b8
|
7
|
+
data.tar.gz: 82f2662c2972eed87740a126c900f748cf44740443d30040ba05599324caf2b5324f21d9984ea382a01d86b9685aa1ab10de1aa24d2625757d5106d05c190d76
|
@@ -68,15 +68,24 @@ class GdsApi::EmailAlertApi < GdsApi::Base
|
|
68
68
|
get_json("#{endpoint}/topic-matches.json?#{query_string}")
|
69
69
|
end
|
70
70
|
|
71
|
-
# Unsubscribe
|
71
|
+
# Unsubscribe subscriber from subscription
|
72
72
|
# #
|
73
73
|
# @param uuid Subscription uuid
|
74
74
|
#
|
75
|
-
# @return
|
75
|
+
# @return null
|
76
76
|
def unsubscribe(uuid)
|
77
77
|
post_json("#{endpoint}/unsubscribe/#{uuid}")
|
78
78
|
end
|
79
79
|
|
80
|
+
# Unsubscribe subscriber from everything
|
81
|
+
# #
|
82
|
+
# @param integer Subscriber id
|
83
|
+
#
|
84
|
+
# @return null
|
85
|
+
def unsubscribe_subscriber(id)
|
86
|
+
delete_json("#{endpoint}/subscribers/#{id}")
|
87
|
+
end
|
88
|
+
|
80
89
|
# Subscribe
|
81
90
|
#
|
82
91
|
# @return [Hash] subscription_id
|
@@ -196,6 +196,16 @@ module GdsApi
|
|
196
196
|
.to_return(status: 404)
|
197
197
|
end
|
198
198
|
|
199
|
+
def email_alert_api_unsubscribes_a_subscriber(subscriber_id)
|
200
|
+
stub_request(:delete, unsubscribe_subscriber_url(subscriber_id))
|
201
|
+
.to_return(status: 204)
|
202
|
+
end
|
203
|
+
|
204
|
+
def email_alert_api_has_no_subscriber(subscriber_id)
|
205
|
+
stub_request(:delete, unsubscribe_subscriber_url(subscriber_id))
|
206
|
+
.to_return(status: 404)
|
207
|
+
end
|
208
|
+
|
199
209
|
def email_alert_api_creates_a_subscription(subscribable_id, address, frequency, returned_subscription_id)
|
200
210
|
stub_request(:post, subscribe_url)
|
201
211
|
.with(
|
@@ -280,6 +290,10 @@ module GdsApi
|
|
280
290
|
EMAIL_ALERT_API_ENDPOINT + "/unsubscribe/#{uuid}"
|
281
291
|
end
|
282
292
|
|
293
|
+
def unsubscribe_subscriber_url(id)
|
294
|
+
EMAIL_ALERT_API_ENDPOINT + "/subscribers/#{id}"
|
295
|
+
end
|
296
|
+
|
283
297
|
def subscribe_url
|
284
298
|
EMAIL_ALERT_API_ENDPOINT + "/subscriptions"
|
285
299
|
end
|
data/lib/gds_api/version.rb
CHANGED