cronofy 0.25.0 → 0.25.1
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/CHANGELOG.md +6 -0
- data/lib/cronofy/client.rb +25 -0
- data/lib/cronofy/types.rb +1 -1
- data/lib/cronofy/version.rb +1 -1
- data/spec/lib/cronofy/client_spec.rb +59 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa2dbaa1fff22d1bf386ea8510b33592ae43307b
|
4
|
+
data.tar.gz: 98f437522497ffa946e62e1d860d9ddbbbcd5726
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8526a9632f28225092530b0250af075529bca6607260897f9b599438d846cf4c624c5d86d42a4ae59359d71e7e2047101a1aff0b6b6ddb5e02f7b2f74b9e4a53
|
7
|
+
data.tar.gz: dd3774efc5c33c90001829391c7bf8a30c3636a4308485e5ffa3ca5e9ddfea2a2b224177c318cf7eef1a6b6b5af120aba8cebab79c1475e1165b0a05a6b0b801
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## [0.25.1]
|
2
|
+
|
3
|
+
* Support for Cancelling Smart Invites [#55]
|
4
|
+
|
1
5
|
## [0.25.0]
|
2
6
|
|
3
7
|
* Support for Smart Invites [#49]
|
@@ -86,6 +90,7 @@
|
|
86
90
|
[0.24.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.24.0
|
87
91
|
[0.24.1]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.24.1
|
88
92
|
[0.25.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.25.0
|
93
|
+
[0.25.1]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.25.1
|
89
94
|
|
90
95
|
[#13]: https://github.com/cronofy/cronofy-ruby/pull/13
|
91
96
|
[#16]: https://github.com/cronofy/cronofy-ruby/pull/16
|
@@ -110,3 +115,4 @@
|
|
110
115
|
[#49]: https://github.com/cronofy/cronofy-ruby/pull/49
|
111
116
|
[#50]: https://github.com/cronofy/cronofy-ruby/pull/50
|
112
117
|
[#52]: https://github.com/cronofy/cronofy-ruby/pull/52
|
118
|
+
[#55]: https://github.com/cronofy/cronofy-ruby/pull/55
|
data/lib/cronofy/client.rb
CHANGED
@@ -1052,6 +1052,31 @@ module Cronofy
|
|
1052
1052
|
parse_json(SmartInviteResponse, nil, response)
|
1053
1053
|
end
|
1054
1054
|
|
1055
|
+
|
1056
|
+
# Public: Cancels a smart invite
|
1057
|
+
#
|
1058
|
+
# smart_invite_id - A String uniquely identifying the event for your
|
1059
|
+
# application (note: this is NOT an ID generated
|
1060
|
+
# by Cronofy).
|
1061
|
+
# recipient - A Hash containing the intended recipient of the invite
|
1062
|
+
# :email - A String for thee email address you are
|
1063
|
+
# going to send the Smart Invite to.
|
1064
|
+
#
|
1065
|
+
# See http://www.cronofy.com/developers/alpha/api#smart-invite for reference.
|
1066
|
+
#
|
1067
|
+
# Returns a SmartInviteResponse.
|
1068
|
+
#
|
1069
|
+
# Raises Cronofy::CredentialsMissingError if no credentials available.
|
1070
|
+
# Raises Cronofy::InvalidRequestError if the request contains invalid
|
1071
|
+
# parameters.
|
1072
|
+
# Raises Cronofy::TooManyRequestsError if the request exceeds the rate
|
1073
|
+
# limits for the application.
|
1074
|
+
def cancel_smart_invite(body={})
|
1075
|
+
body[:method] = 'cancel'
|
1076
|
+
response = wrapped_request { api_key!.post("/v1/smart_invites", json_request_args(body)) }
|
1077
|
+
parse_json(SmartInviteResponse, nil, response)
|
1078
|
+
end
|
1079
|
+
|
1055
1080
|
# Public: Gets the details for a smart invite.
|
1056
1081
|
#
|
1057
1082
|
# smart_invite_id - A String uniquely identifying the event for your
|
data/lib/cronofy/types.rb
CHANGED
data/lib/cronofy/version.rb
CHANGED
@@ -1791,6 +1791,9 @@ describe Cronofy::Client do
|
|
1791
1791
|
{ :minutes => 10 },
|
1792
1792
|
],
|
1793
1793
|
},
|
1794
|
+
recipient: {
|
1795
|
+
email: "example@example.com"
|
1796
|
+
}
|
1794
1797
|
}
|
1795
1798
|
end
|
1796
1799
|
|
@@ -1811,6 +1814,9 @@ describe Cronofy::Client do
|
|
1811
1814
|
{ :minutes => 10 },
|
1812
1815
|
],
|
1813
1816
|
},
|
1817
|
+
recipient: {
|
1818
|
+
email: "example@example.com"
|
1819
|
+
}
|
1814
1820
|
}
|
1815
1821
|
end
|
1816
1822
|
let(:correct_response_code) { 202 }
|
@@ -1826,4 +1832,57 @@ describe Cronofy::Client do
|
|
1826
1832
|
|
1827
1833
|
end
|
1828
1834
|
|
1835
|
+
|
1836
|
+
describe "Cancel Smart Invite" do
|
1837
|
+
let(:request_url) { "https://api.cronofy.com/v1/smart_invites" }
|
1838
|
+
let(:method) { :post }
|
1839
|
+
|
1840
|
+
let(:request_headers) do
|
1841
|
+
{
|
1842
|
+
"Authorization" => "Bearer #{client_secret}",
|
1843
|
+
"User-Agent" => "Cronofy Ruby #{::Cronofy::VERSION}",
|
1844
|
+
"Content-Type" => "application/json; charset=utf-8",
|
1845
|
+
}
|
1846
|
+
end
|
1847
|
+
|
1848
|
+
let(:client_id) { 'example_id' }
|
1849
|
+
let(:client_secret) { 'example_secret' }
|
1850
|
+
|
1851
|
+
let(:client) do
|
1852
|
+
Cronofy::Client.new(
|
1853
|
+
client_id: client_id,
|
1854
|
+
client_secret: client_secret,
|
1855
|
+
)
|
1856
|
+
end
|
1857
|
+
|
1858
|
+
let(:args) do
|
1859
|
+
{
|
1860
|
+
smart_invite_id: "qTtZdczOccgaPncGJaCiLg",
|
1861
|
+
recipient: {
|
1862
|
+
email: "example@example.com"
|
1863
|
+
}
|
1864
|
+
}
|
1865
|
+
end
|
1866
|
+
|
1867
|
+
let(:request_body) do
|
1868
|
+
{
|
1869
|
+
method: 'cancel',
|
1870
|
+
smart_invite_id: "qTtZdczOccgaPncGJaCiLg",
|
1871
|
+
recipient: {
|
1872
|
+
email: "example@example.com"
|
1873
|
+
}
|
1874
|
+
}
|
1875
|
+
end
|
1876
|
+
let(:correct_response_code) { 202 }
|
1877
|
+
let(:correct_response_body) do
|
1878
|
+
request_body.merge({
|
1879
|
+
attachments: []
|
1880
|
+
})
|
1881
|
+
end
|
1882
|
+
|
1883
|
+
subject { client.cancel_smart_invite(request_body) }
|
1884
|
+
|
1885
|
+
it_behaves_like 'a Cronofy request'
|
1886
|
+
|
1887
|
+
end
|
1829
1888
|
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.25.
|
4
|
+
version: 0.25.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sergii Paryzhskyi
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-11-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oauth2
|