glia-errors 0.3.0 → 0.5.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: 71d9c420c3a6350067f4f47cba98ebb07598c203951106c743e8d245938e4fb5
4
- data.tar.gz: 2d74dd1fbe3272416010b8ee66b698484002baaf9f2786efde680d6a6292150e
3
+ metadata.gz: cf61f6be102a1651954298dacfe9e93cfeb27f81ad078e52ec7bf16542bf402b
4
+ data.tar.gz: 2c9d1373869e3f9525d9f01116ecff9b5a09396b855c7c8ce1e3d9fc96eb43d2
5
5
  SHA512:
6
- metadata.gz: 23120c8979c3ad4b4a9524a9ac61deb2a2452f8c44cd79a059099b201e5cc8e07357e102a20c74c2e1716e22154ce930096be2e8d45ceafa1006aacb643a28c6
7
- data.tar.gz: 9f0848627646f37ee78b24cd3bf3dea1b193e5541f5302782ce891727cfaeb82b502a56103350de43e41ad284340f8e2cf8848d88febf00b30c1492f7bc74b65
6
+ metadata.gz: ec694ade2f6c374c638832d8ad3a6d67523c218e296901b92560807dae34a29b173edc1eacde316c15c616ec063831886aec324da280b81fed6cc97840c435d4
7
+ data.tar.gz: d69081a24657b4647e7146d72c165e68b70698f548e7a0b2f1216ade437161a48d873a74b88adcb18f886f10d7fef4b60e0df589ce12466df707e40c7380d48f
data/README.md CHANGED
@@ -62,7 +62,6 @@ url = URI('https://api.glia.com/engagement_requests')
62
62
 
63
63
  http = Net::HTTP.new(url.host, url.port)
64
64
  http.use_ssl = true
65
- http.verify_mode = OpenSSL::SSL::VERIFY_NONE
66
65
  request = Net::HTTP::Post.new(url)
67
66
  request["Accept"] = 'application/json'
68
67
  request["Content-Type"] = 'application/json'
data/glia-errors.gemspec CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'glia-errors'
8
- spec.version = '0.3.0'
8
+ spec.version = '0.5.0'
9
9
  spec.authors = ['Glia TechMovers']
10
10
  spec.email = ['techmovers@glia.com']
11
11
 
@@ -171,6 +171,26 @@ module Glia
171
171
  )
172
172
  end
173
173
  end
174
+
175
+ class AuthorizationError < Error
176
+ def initialize(message: nil)
177
+ super(
178
+ type: AUTHORIZATION_ERROR,
179
+ ref: "https://example.com/errors/#{AUTHORIZATION_ERROR}.html",
180
+ message: message || 'You do not have permissions to perform the action'
181
+ )
182
+ end
183
+ end
184
+
185
+ class RecipientOptedOutError < Error
186
+ def initialize(message: nil)
187
+ super(
188
+ type: RECIPIENT_OPTED_OUT_ERROR,
189
+ ref: "https://example.com/errors/#{RECIPIENT_OPTED_OUT_ERROR}.html",
190
+ message: message || 'Recipient has opted out'
191
+ )
192
+ end
193
+ end
174
194
  # rubocop:enable Style/Documentation
175
195
  end
176
196
  end
@@ -16,5 +16,7 @@ module Glia
16
16
  LIMIT_EXCEEDED_ERROR = 'limit_exceeded_error'
17
17
  RESOURCE_ALREADY_EXISTS_ERROR = 'resource_already_exists_error'
18
18
  INVALID_RESOURCE_STATE_ERROR = 'invalid_resource_state_error'
19
+ AUTHORIZATION_ERROR = 'authorization_error'
20
+ RECIPIENT_OPTED_OUT_ERROR = 'recipient_opted_out_error'
19
21
  end
20
22
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glia-errors
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Glia TechMovers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-02 00:00:00.000000000 Z
11
+ date: 2021-02-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: ''
14
14
  email:
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
55
  - !ruby/object:Gem::Version
56
56
  version: '0'
57
57
  requirements: []
58
- rubygems_version: 3.1.2
58
+ rubygems_version: 3.0.6
59
59
  signing_key:
60
60
  specification_version: 4
61
61
  summary: Glia REST API errors