cronofy 0.0.3 → 0.0.4

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
  SHA1:
3
- metadata.gz: bf3f22a7f76781d1e6ea8671f870cf5fd4b159a3
4
- data.tar.gz: d4d4aea42bf0198af8af3bc7cab228eadf224c90
3
+ metadata.gz: da5d96380934904435706ec98e7aa923abd05cc7
4
+ data.tar.gz: 73720046c2544252bdec8d7f7d5d5af8d7b93f2a
5
5
  SHA512:
6
- metadata.gz: f495b40c4541fddd2a58eaa26371bed12bafa0760a332ff0c389a9fa8b7955526ab48fdd1081bd7097a566cd0f7bda5a103d95488711fa57edcadd1cee381657
7
- data.tar.gz: 453719f98f0620ee3bc0d4f61fe1c61c19f09fa5f8362685f8e64d9d6f64f5feeb0a30075d0ff8f7b5d1889d1ac3d82925f08837cc06387ffe47b743a5e7734d
6
+ metadata.gz: 884b2c8194a158011ee7f4c03218e1f28f75bab6c904d6e36b39ef7734a58082e6601a8ccbc6a02359c5cdbbc1e0d46a3c865ebb33934018b3e0d24a75fcd87c
7
+ data.tar.gz: 96feb5c06ccad53deb93df2fc819fb4182857615776e7713484e45e230626c2f885258448941c912ed21296fed61ec69225808a4be741b3677dc7c92d63605fb
@@ -2,6 +2,7 @@ require "cronofy/version"
2
2
  require "cronofy/auth"
3
3
  require "cronofy/response_parser"
4
4
  require "cronofy/errors"
5
+ require 'json'
5
6
 
6
7
  module Cronofy
7
8
  class Cronofy
@@ -45,7 +46,7 @@ module Cronofy
45
46
  'Content-Type' => 'application/json'
46
47
  }
47
48
 
48
- do_request { access_token!.post("/v1/calendars/#{calendar_id}/events", { body: body.to_json, headers: headers }) }
49
+ do_request { access_token!.post("/v1/calendars/#{calendar_id}/events", { body: JSON.generate(body), headers: headers }) }
49
50
  end
50
51
  alias_method :upsert_event, :create_or_update_event
51
52
 
@@ -96,7 +97,8 @@ module Cronofy
96
97
  private
97
98
 
98
99
  ERROR_MAP = {
99
- 401 => AuthorizationFailureError,
100
+ 401 => AuthenticationFailureError,
101
+ 403 => AuthorizationFailureError,
100
102
  404 => NotFoundError,
101
103
  422 => InvalidRequestError,
102
104
  429 => TooManyRequestsError
@@ -36,6 +36,10 @@ module Cronofy
36
36
 
37
37
  end
38
38
 
39
+ class AuthenticationFailureError < APIError
40
+
41
+ end
42
+
39
43
  class AuthorizationFailureError < APIError
40
44
 
41
45
  end
@@ -1,3 +1,3 @@
1
1
  module Cronofy
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cronofy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergii Paryzhskyi