cronofy 0.12.0 → 0.13.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 +4 -4
- data/README.md +1 -1
- data/lib/cronofy/client.rb +17 -0
- data/lib/cronofy/types.rb +3 -0
- data/lib/cronofy/version.rb +1 -1
- data/spec/lib/cronofy/client_spec.rb +33 -0
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3b357138b89d6741ecd41248bf2eae6cbeb58018
|
4
|
+
data.tar.gz: dff25d78e3cf81d67732814944c48f79e54fb384
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d5225dc72f29a5074138180e876cdf54104e9dfb22ed4128e2d39fa1a17a9b725658b23cc954689780800ebec68060fdccc667804a4426309c351635b62d035
|
7
|
+
data.tar.gz: c66f3fcccf7937fc92b43d62119ec85368c0e5d8f77287ded6f1c750a56fa52663206cd8779077d52891563a02220a88bb8dd07085ebcd50ce2237a654d53ca3
|
data/README.md
CHANGED
@@ -23,7 +23,7 @@ bundle install
|
|
23
23
|
|
24
24
|
In order to use the Cronofy API you will need to [create a developer account](https://app.cronofy.com/sign_up/new).
|
25
25
|
|
26
|
-
From there you can [
|
26
|
+
From there you can [use your Calendar Sandbox](https://app.cronofy.com/oauth/sandbox)
|
27
27
|
to access your own calendars, or you can [create an OAuth application](https://app.cronofy.com/oauth/applications/new)
|
28
28
|
to obtain an OAuth `client_id` and `client_secret` to be able to use the full
|
29
29
|
API.
|
data/lib/cronofy/client.rb
CHANGED
@@ -583,6 +583,23 @@ module Cronofy
|
|
583
583
|
parse_json(PermissionsResponse, "permissions_request", response)
|
584
584
|
end
|
585
585
|
|
586
|
+
# Public: Lists all the resources for the service account.
|
587
|
+
#
|
588
|
+
# Returns an Array of Resources.
|
589
|
+
#
|
590
|
+
# Raises Cronofy::CredentialsMissingError if no credentials available
|
591
|
+
# or if non-service account credentials are provided.
|
592
|
+
# Raises Cronofy::AuthenticationFailureError if the access token is no
|
593
|
+
# longer valid.
|
594
|
+
# Raises Cronofy::AuthorizationFailureError if the access token does not
|
595
|
+
# include the required scope.
|
596
|
+
# Raises Cronofy::TooManyRequestsError if the request exceeds the rate
|
597
|
+
# limits for the application.
|
598
|
+
def resources
|
599
|
+
response = get("/v1/resources")
|
600
|
+
parse_collection(Resource, "resources", response)
|
601
|
+
end
|
602
|
+
|
586
603
|
private
|
587
604
|
|
588
605
|
FREE_BUSY_DEFAULT_PARAMS = { tzid: "Etc/UTC" }.freeze
|
data/lib/cronofy/types.rb
CHANGED
data/lib/cronofy/version.rb
CHANGED
@@ -1020,4 +1020,37 @@ describe Cronofy::Client do
|
|
1020
1020
|
end
|
1021
1021
|
end
|
1022
1022
|
end
|
1023
|
+
|
1024
|
+
describe 'Resources' do
|
1025
|
+
let(:request_url) { 'https://api.cronofy.com/v1/resources' }
|
1026
|
+
|
1027
|
+
describe '#resources' do
|
1028
|
+
let(:method) { :get }
|
1029
|
+
|
1030
|
+
let(:correct_response_code) { 200 }
|
1031
|
+
let(:correct_response_body) do
|
1032
|
+
{
|
1033
|
+
'resources' => [
|
1034
|
+
{
|
1035
|
+
'email' => 'board-room-london@example.com',
|
1036
|
+
'name' => 'Board room (London)',
|
1037
|
+
},
|
1038
|
+
{
|
1039
|
+
'email' => 'board-room-madrid@example.com',
|
1040
|
+
'name' => 'Board room (Madrid)',
|
1041
|
+
}
|
1042
|
+
]
|
1043
|
+
}
|
1044
|
+
end
|
1045
|
+
|
1046
|
+
let(:correct_mapped_result) do
|
1047
|
+
correct_response_body["resources"].map { |r| Cronofy::Resource.new(r) }
|
1048
|
+
end
|
1049
|
+
|
1050
|
+
subject { client.resources }
|
1051
|
+
|
1052
|
+
it_behaves_like 'a Cronofy request'
|
1053
|
+
it_behaves_like 'a Cronofy request with mapped return value'
|
1054
|
+
end
|
1055
|
+
end
|
1023
1056
|
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.
|
4
|
+
version: 0.13.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: 2016-
|
12
|
+
date: 2016-11-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: oauth2
|
@@ -148,7 +148,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
148
148
|
version: '0'
|
149
149
|
requirements: []
|
150
150
|
rubyforge_project:
|
151
|
-
rubygems_version: 2.6.
|
151
|
+
rubygems_version: 2.6.4
|
152
152
|
signing_key:
|
153
153
|
specification_version: 4
|
154
154
|
summary: Cronofy - one API for all the calendars
|
@@ -160,4 +160,3 @@ test_files:
|
|
160
160
|
- spec/lib/cronofy/event_spec.rb
|
161
161
|
- spec/response_parser_spec.rb
|
162
162
|
- spec/spec_helper.rb
|
163
|
-
has_rdoc:
|