active_campaign_wrapper 0.2.0 → 0.3.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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1590dc0b398aa32233b19bcf394874316aa2d5c1a0b38b569fdfe57d333ab97e
|
4
|
+
data.tar.gz: 2946ac23c953474593a0dbde6e5aafa27e2843acb60e660139044eb7a9b3d943
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 920d304e2e617f68af61d8238e67b3f23b5d6e9a44f99a930e6316b5a9781ae5184f846985db7aec4e7677b466a26b71b3a7d0d0bc675afd9ea23373873c35ae
|
7
|
+
data.tar.gz: 72e5fa0c1a16b06de14dc775f975cdfbc331f019841bbd049b9d991cc82640ff222de2d1e2b8b5395c7a55110166ee51f19eea9032ad1175a3248cda8d2f067e
|
@@ -17,5 +17,11 @@ module ActiveCampaignWrapper
|
|
17
17
|
|
18
18
|
class Error < StandardError; end
|
19
19
|
|
20
|
-
class
|
20
|
+
class Forbidden < StandardError; end
|
21
|
+
|
22
|
+
class UnprocessableEntity < StandardError; end
|
23
|
+
|
24
|
+
class NotFound < StandardError; end
|
25
|
+
|
26
|
+
class TooManyRequests < StandardError; end
|
21
27
|
end
|
@@ -7,8 +7,11 @@ module ActiveCampaignWrapper
|
|
7
7
|
module_function
|
8
8
|
|
9
9
|
def normalize_response(response)
|
10
|
-
raise ActiveCampaignWrapper::
|
11
|
-
raise ActiveCampaignWrapper::
|
10
|
+
raise ActiveCampaignWrapper::Forbidden, response['message'] if response.forbidden?
|
11
|
+
raise ActiveCampaignWrapper::NotFound, response['message'] if response.not_found?
|
12
|
+
raise ActiveCampaignWrapper::UnprocessableEntity, response['errors']&.join(', ') || response['error'] if response.unprocessable_entity?
|
13
|
+
raise ActiveCampaignWrapper::TooManyRequests, response['message'] if response.too_many_requests?
|
14
|
+
raise ActiveCampaignWrapper::Error, response['message'] unless response.success?
|
12
15
|
|
13
16
|
if response&.body.present?
|
14
17
|
transform_keys(response, [:underscore])
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_campaign_wrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anmol Yousaf
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|