youcanbookme 0.0.5.alpha → 0.0.6.alpha

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: a22eecf79a26af28084edbb24d29302fcf7e299202bc2b06ccef19e5ac532c1f
4
- data.tar.gz: 13b2f46e757cc82e5a72444b953813e5aacd0eb4afe06397ca50250be409e48c
3
+ metadata.gz: 220fc0b04f4037f4daa16043fba1337cdd69817f406ae3cc3dda763409f0d299
4
+ data.tar.gz: 398dad8620738536ad7be8ae689eee0683b710c5737083f5f8e3db57efb36aa4
5
5
  SHA512:
6
- metadata.gz: d04a57f8f23289e158d3dd3530dc7db72ea812c17c5cb62654e9d62a81ae44194eb3c9ce379368f1667e6366b2e19811f577d86e2ba713214e22928b714b73d4
7
- data.tar.gz: f43802882d8fe67e3821a3d548a9016b64f61ea1ec3bdfc1411c799453187a4ac65c099fa929696a6feef7150e3990028e4cda053234680b4e5592b33ff292ca
6
+ metadata.gz: 572f0f500445237217e6953142531944efe96e98f452811d774e3d0d9d324e0981105a31fa7a3ebf5dd4aeb6aeafb56caf9719065a35319296bb5c3b6444a974
7
+ data.tar.gz: d72e03f30af127d22ba90a78a00797aab82a1efd670958b3cfbda5dd0f02cbc145a21f3cd5bb77d61826b20a503e0ae0d8bc4e6c02816321f63437afd53b4a1a
@@ -1,5 +1,12 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 0.0.6.alpha
4
+
5
+ - support APIs below.
6
+ - GET `/v1/{accountId}/remoteaccounts/{remoteAccountId}/calendars`
7
+ - GET `/v1/{accountId}/remoteaccounts/{remoteAccountId}/calendars/{calendarId}`
8
+ - GET `/v1/{accountId}/remoteaccounts/{remoteAccountId}/calendars/{calendarId}/events/{eventId}`
9
+
3
10
  ## 0.0.5.alpha
4
11
 
5
12
  - support APIs below.
data/README.md CHANGED
@@ -45,15 +45,15 @@ Or install it yourself as:
45
45
  - [ ] DELETE `/v1/{accountId}/profiles/{profileId}/bookings/{bookingId}`
46
46
  - [ ] GET `/v1/ics/{bookingSecret}/{bookingIdOrRef}.ics`
47
47
  - Calendars:
48
- - [ ] GET `/v1/{accountId}/remoteaccounts/{remoteAccountId}/calendars`
48
+ - [x] GET `/v1/{accountId}/remoteaccounts/{remoteAccountId}/calendars`
49
49
  - [ ] POST `/v1/{accountId}/remoteaccounts/{remoteAccountId}/calendars`
50
- - [ ] GET `/v1/{accountId}/remoteaccounts/{remoteAccountId}/calendars/{calendarId}`
50
+ - [x] GET `/v1/{accountId}/remoteaccounts/{remoteAccountId}/calendars/{calendarId}`
51
51
  - [ ] PUT `/v1/{accountId}/remoteaccounts/{remoteAccountId}/calendars/{calendarId}`
52
52
  - [ ] PATCH `/v1/{accountId}/remoteaccounts/{remoteAccountId}/calendars/{calendarId}`
53
53
  - [ ] DELETE `/v1/{accountId}/remoteaccounts/{remoteAccountId}/calendars/{calendarId}`
54
54
  - Events:
55
55
  - [ ] POST `/v1/{accountId}/remoteaccounts/{remoteAccountId}/calendars/{calendarId}/events`
56
- - [ ] GET `/v1/{accountId}/remoteaccounts/{remoteAccountId}/calendars/{calendarId}/events/{eventId}`
56
+ - [x] GET `/v1/{accountId}/remoteaccounts/{remoteAccountId}/calendars/{calendarId}/events/{eventId}`
57
57
  - [ ] PATCH `/v1/{accountId}/remoteaccounts/{remoteAccountId}/calendars/{calendarId}/events/{eventId}`
58
58
  - [ ] DELETE `/v1/{accountId}/remoteaccounts/{remoteAccountId}/calendars/{calendarId}/events/{eventId}`
59
59
  - Profile
@@ -99,6 +99,57 @@ module YouCanBookMe
99
99
  map_as_collection res, Booking
100
100
  end
101
101
 
102
+ #
103
+ # Returns a single Calendar by its id.
104
+ #
105
+ # @param [String] remote_account_id the remote_account's unique id.
106
+ # @param [String] calendar_id the calendar's unique id.
107
+ # @param [Array<String>] fields the fields which are included in the response.
108
+ # @return [Calendar]
109
+ # @since 0.0.6
110
+ def calendar(remote_account_id, calendar_id, fields: nil)
111
+ check_not_empty remote_account_id, 'remote_account_id'
112
+ check_not_empty calendar_id, 'calendar_id'
113
+ params = build_fields_params fields
114
+ path = calendar_path remote_account_id, calendar_id
115
+ res = @connection.get path, params
116
+ Calendar.new res.body, self
117
+ end
118
+
119
+ #
120
+ # Get List of Calendar.
121
+ #
122
+ # @param [String] remote_account_id the remote_account's unique id.
123
+ # @param [Array<String>] fields the fields which are included in the response.
124
+ # @return [Array<Calendar>]
125
+ # @since 0.0.6
126
+ def calendars(remote_account_id, fields: nil)
127
+ check_not_empty remote_account_id, 'remote_account_id'
128
+ params = build_fields_params fields
129
+ path = calendar_path remote_account_id
130
+ res = @connection.get path, params
131
+ map_as_collection res, Calendar
132
+ end
133
+
134
+ #
135
+ # Returns a single Event by its id.
136
+ #
137
+ # @param [String] remote_account_id the remote_account's unique id.
138
+ # @param [String] calendar_id the calendar's unique id.
139
+ # @param [String] event_id the event's unique id.
140
+ # @param [Array<String>] fields the fields which are included in the response.
141
+ # @return [Event]
142
+ # @since 0.0.6
143
+ def event(remote_account_id, calendar_id, event_id, fields: nil)
144
+ check_not_empty remote_account_id, 'remote_account_id'
145
+ check_not_empty calendar_id, 'calendar_id'
146
+ check_not_empty event_id, 'event_id'
147
+ params = build_fields_params fields
148
+ path = event_path remote_account_id, calendar_id, event_id
149
+ res = @connection.get path, params
150
+ Event.new res.body, self
151
+ end
152
+
102
153
  #
103
154
  # Returns a single Profile by its id.
104
155
  #
@@ -193,13 +244,6 @@ module YouCanBookMe
193
244
  "/#{API_VERSION}/#{@account_id}"
194
245
  end
195
246
 
196
- def profile_path(profile_id = nil)
197
- path = "#{account_path}/profiles"
198
- return path unless profile_id
199
-
200
- "#{path}/#{profile_id}"
201
- end
202
-
203
247
  def booking_path(profile_id = nil, booking_id = nil)
204
248
  return "#{account_path}/bookings" unless profile_id
205
249
 
@@ -209,6 +253,29 @@ module YouCanBookMe
209
253
  "#{path}/#{booking_id}"
210
254
  end
211
255
 
256
+ def calendar_path(remote_account_id, calendar_id = nil)
257
+ remote_path = remote_account_path remote_account_id
258
+ path = "#{remote_path}/calendars"
259
+ return path unless calendar_id
260
+
261
+ "#{path}/#{calendar_id}"
262
+ end
263
+
264
+ def event_path(remote_account_id, calendar_id, event_id = nil)
265
+ cal_path = calendar_path remote_account_id, calendar_id
266
+ path = "#{cal_path}/events"
267
+ return path unless event_id
268
+
269
+ "#{path}/#{event_id}"
270
+ end
271
+
272
+ def profile_path(profile_id = nil)
273
+ path = "#{account_path}/profiles"
274
+ return path unless profile_id
275
+
276
+ "#{path}/#{profile_id}"
277
+ end
278
+
212
279
  def remote_account_path(remote_account_id = nil)
213
280
  path = "#{account_path}/remoteaccounts"
214
281
  return path unless remote_account_id
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YouCanBookMe
4
- VERSION = '0.0.5.alpha'
4
+ VERSION = '0.0.6.alpha'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: youcanbookme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5.alpha
4
+ version: 0.0.6.alpha
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenji Koshikawa
@@ -212,7 +212,7 @@ metadata:
212
212
  homepage_uri: https://github.com/koshilife/youcanbookme-api-ruby-client
213
213
  source_code_uri: https://github.com/koshilife/youcanbookme-api-ruby-client
214
214
  changelog_uri: https://github.com/koshilife/youcanbookme-api-ruby-client/blob/master/CHANGELOG.md
215
- documentation_uri: https://www.rubydoc.info/gems/youcanbookme/0.0.5.alpha
215
+ documentation_uri: https://www.rubydoc.info/gems/youcanbookme/0.0.6.alpha
216
216
  post_install_message:
217
217
  rdoc_options: []
218
218
  require_paths: