cronofy 0.32.0 → 0.33.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/cronofy/client.rb +14 -0
- data/lib/cronofy/version.rb +1 -1
- data/spec/lib/cronofy/client_spec.rb +50 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c592a6641e20c6bccbe1fe2a4af85f1cff4bcbe8a223436181e7f82a8ab7406
|
4
|
+
data.tar.gz: b008a137e2c008fcd10fc9edf83871c99a9f5b2b630ade62d39c5511e0407721
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53e4116e1763cc0795d270fa405d7cadb0cda41641f6edb3c8f62a20605053206c4ccfd088e5c93161f5bfeb5f07c0489b1de76ebc27105e62b181b6b399a81b
|
7
|
+
data.tar.gz: 35b950179483552856421bd5c967728a6e443cc11b6333f9eceea7e8ceff8ce06bf143573f552a4cd882faa94dcb0223adad123caee10beed60bbaac5ddaef16
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## [0.33.0]
|
2
|
+
|
3
|
+
* Support listing Availability Rules [#74]
|
4
|
+
|
1
5
|
## [0.32.0]
|
2
6
|
|
3
7
|
* Support Availability Rules and Scheduling Conversations [#64]
|
@@ -147,6 +151,7 @@
|
|
147
151
|
[0.31.1]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.31.1
|
148
152
|
[0.31.2]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.31.2
|
149
153
|
[0.32.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.32.0
|
154
|
+
[0.33.0]: https://github.com/cronofy/cronofy-ruby/releases/tag/v0.33.0
|
150
155
|
|
151
156
|
[#13]: https://github.com/cronofy/cronofy-ruby/pull/13
|
152
157
|
[#16]: https://github.com/cronofy/cronofy-ruby/pull/16
|
@@ -183,3 +188,4 @@
|
|
183
188
|
[#69]: https://github.com/cronofy/cronofy-ruby/pull/69
|
184
189
|
[#72]: https://github.com/cronofy/cronofy-ruby/pull/72
|
185
190
|
[#73]: https://github.com/cronofy/cronofy-ruby/pull/73
|
191
|
+
[#74]: https://github.com/cronofy/cronofy-ruby/pull/74
|
data/lib/cronofy/client.rb
CHANGED
@@ -1435,6 +1435,20 @@ module Cronofy
|
|
1435
1435
|
parse_json(AvailabilityRule, 'availability_rule', response)
|
1436
1436
|
end
|
1437
1437
|
|
1438
|
+
# Public: Gets all AvailabilityRules for an account.
|
1439
|
+
#
|
1440
|
+
# Returns an array of AvailabilityRules.
|
1441
|
+
#
|
1442
|
+
# Raises Cronofy::CredentialsMissingError if no credentials available.
|
1443
|
+
# Raises Cronofy::InvalidRequestError if the request contains invalid
|
1444
|
+
# parameters.
|
1445
|
+
# Raises Cronofy::TooManyRequestsError if the request exceeds the rate
|
1446
|
+
# limits for the application.
|
1447
|
+
def get_availability_rules
|
1448
|
+
response = wrapped_request { get("/v1/availability_rules") }
|
1449
|
+
parse_collection(AvailabilityRule, 'availability_rules', response)
|
1450
|
+
end
|
1451
|
+
|
1438
1452
|
# Public: Deletes an AvailabilityRule.
|
1439
1453
|
#
|
1440
1454
|
# availability_rule_id - A String uniquely identifying the availability rule
|
data/lib/cronofy/version.rb
CHANGED
@@ -3029,6 +3029,56 @@ describe Cronofy::Client do
|
|
3029
3029
|
it_behaves_like 'a Cronofy request with mapped return value'
|
3030
3030
|
end
|
3031
3031
|
|
3032
|
+
describe "#get_availability_rules" do
|
3033
|
+
let(:request_url) { "https://api.cronofy.com/v1/availability_rules" }
|
3034
|
+
let(:method) { :get }
|
3035
|
+
|
3036
|
+
let(:correct_response_code) { 200 }
|
3037
|
+
let(:correct_response_body) do
|
3038
|
+
{
|
3039
|
+
"availability_rules" => [
|
3040
|
+
{
|
3041
|
+
"availability_rule_id" => "default",
|
3042
|
+
"tzid" => "America/Chicago",
|
3043
|
+
"calendar_ids" => [
|
3044
|
+
"cal_n23kjnwrw2_jsdfjksn234"
|
3045
|
+
],
|
3046
|
+
"weekly_periods" => [
|
3047
|
+
{
|
3048
|
+
"day" => "monday",
|
3049
|
+
"start_time" => "09:30",
|
3050
|
+
"end_time" => "16:30"
|
3051
|
+
},
|
3052
|
+
{
|
3053
|
+
"day" => "wednesday",
|
3054
|
+
"start_time" => "09:30",
|
3055
|
+
"end_time" => "16:30"
|
3056
|
+
}
|
3057
|
+
]
|
3058
|
+
}
|
3059
|
+
]
|
3060
|
+
}
|
3061
|
+
end
|
3062
|
+
|
3063
|
+
let(:correct_mapped_result) do
|
3064
|
+
rule = correct_response_body['availability_rules'][0]
|
3065
|
+
|
3066
|
+
[
|
3067
|
+
Cronofy::AvailabilityRule.new(
|
3068
|
+
availability_rule_id: rule['availability_rule_id'],
|
3069
|
+
tzid: rule['tzid'],
|
3070
|
+
calendar_ids: rule['calendar_ids'],
|
3071
|
+
weekly_periods: rule['weekly_periods'].map { |wp| Cronofy::WeeklyPeriod.new(wp) },
|
3072
|
+
)
|
3073
|
+
]
|
3074
|
+
end
|
3075
|
+
|
3076
|
+
subject { client.get_availability_rules }
|
3077
|
+
|
3078
|
+
it_behaves_like 'a Cronofy request'
|
3079
|
+
it_behaves_like 'a Cronofy request with mapped return value'
|
3080
|
+
end
|
3081
|
+
|
3032
3082
|
describe '#delete_availability_rule' do
|
3033
3083
|
let(:availability_rule_id) { 'default'}
|
3034
3084
|
let(:request_url) { "https://api.cronofy.com/v1/availability_rules/#{availability_rule_id}" }
|
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.
|
4
|
+
version: 0.33.0
|
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: 2019-
|
12
|
+
date: 2019-10-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oauth2
|
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: '0'
|
158
158
|
requirements: []
|
159
|
-
rubygems_version: 3.0.
|
159
|
+
rubygems_version: 3.0.6
|
160
160
|
signing_key:
|
161
161
|
specification_version: 4
|
162
162
|
summary: Cronofy - one API for all the calendars
|