youcanbookme 0.0.1.alpha → 0.0.6.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/{.rubocom.yml → .rubocop.yml} +12 -9
  3. data/CHANGELOG.md +37 -2
  4. data/README.md +22 -25
  5. data/lib/youcanbookme/client.rb +235 -13
  6. data/lib/youcanbookme/error.rb +1 -1
  7. data/lib/youcanbookme/http_command.rb +6 -1
  8. data/lib/youcanbookme/{common_module.rb → loggable.rb} +2 -2
  9. data/lib/youcanbookme/models/account.rb +153 -13
  10. data/lib/youcanbookme/models/account_allocation.rb +22 -0
  11. data/lib/youcanbookme/models/account_child.rb +20 -0
  12. data/lib/youcanbookme/models/{caligraph_safe_local_account.rb → account_parent.rb} +3 -2
  13. data/lib/youcanbookme/models/action.rb +5 -0
  14. data/lib/youcanbookme/models/answer.rb +0 -1
  15. data/lib/youcanbookme/models/booking.rb +8 -4
  16. data/lib/youcanbookme/models/booking_lobby.rb +2 -1
  17. data/lib/youcanbookme/models/calendar.rb +1 -1
  18. data/lib/youcanbookme/models/card.rb +0 -1
  19. data/lib/youcanbookme/models/event.rb +6 -9
  20. data/lib/youcanbookme/models/{participant.rb → event_participant.rb} +3 -2
  21. data/lib/youcanbookme/models/{reminder.rb → event_reminder.rb} +3 -3
  22. data/lib/youcanbookme/models/link.rb +0 -1
  23. data/lib/youcanbookme/models/model_utils.rb +8 -6
  24. data/lib/youcanbookme/models/name_and_address.rb +0 -1
  25. data/lib/youcanbookme/models/permission.rb +17 -5
  26. data/lib/youcanbookme/models/profile.rb +4 -3
  27. data/lib/youcanbookme/models/{profile_local_account.rb → profile_account.rb} +1 -2
  28. data/lib/youcanbookme/models/profile_afterwards.rb +0 -1
  29. data/lib/youcanbookme/models/profile_appointment_type.rb +0 -1
  30. data/lib/youcanbookme/models/profile_appointment_types.rb +0 -1
  31. data/lib/youcanbookme/models/profile_calendar.rb +6 -1
  32. data/lib/youcanbookme/models/profile_calendars.rb +0 -1
  33. data/lib/youcanbookme/models/profile_cancel_or_reschedule.rb +0 -1
  34. data/lib/youcanbookme/models/profile_display.rb +0 -1
  35. data/lib/youcanbookme/models/profile_payments.rb +1 -1
  36. data/lib/youcanbookme/models/profile_remote_account.rb +3 -2
  37. data/lib/youcanbookme/models/profile_remote_reminder.rb +0 -1
  38. data/lib/youcanbookme/models/profile_team_member.rb +0 -1
  39. data/lib/youcanbookme/models/profile_team_members.rb +1 -1
  40. data/lib/youcanbookme/models/profile_tentative.rb +0 -2
  41. data/lib/youcanbookme/models/profile_times.rb +1 -1
  42. data/lib/youcanbookme/models/profile_vouchers.rb +0 -1
  43. data/lib/youcanbookme/models/provider.rb +0 -1
  44. data/lib/youcanbookme/models/purchase.rb +8 -4
  45. data/lib/youcanbookme/models/purchases_sync_changes.rb +0 -1
  46. data/lib/youcanbookme/models/question.rb +1 -0
  47. data/lib/youcanbookme/models/remote_account.rb +8 -4
  48. data/lib/youcanbookme/models/template_event.rb +0 -1
  49. data/lib/youcanbookme/models/transaction.rb +6 -3
  50. data/lib/youcanbookme/models/warning.rb +0 -1
  51. data/lib/youcanbookme/version.rb +1 -1
  52. metadata +11 -20
  53. data/lib/youcanbookme/models/appointment_type.rb +0 -7
  54. data/lib/youcanbookme/models/caligraph_calendar.rb +0 -29
  55. data/lib/youcanbookme/models/caligraph_event.rb +0 -8
  56. data/lib/youcanbookme/models/caligraph_link.rb +0 -17
  57. data/lib/youcanbookme/models/caligraph_local_account.rb +0 -47
  58. data/lib/youcanbookme/models/caligraph_permission.rb +0 -32
  59. data/lib/youcanbookme/models/caligraph_remote_account.rb +0 -23
  60. data/lib/youcanbookme/models/instant.rb +0 -9
  61. data/lib/youcanbookme/models/local_account.rb +0 -180
  62. data/lib/youcanbookme/models/query.rb +0 -8
  63. data/lib/youcanbookme/models/team_member.rb +0 -8
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YouCanBookMe
4
- # YouCanBookMe's ProfileTentative model.
5
4
  class ProfileTentative
6
5
  include ModelUtils
7
6
 
@@ -11,6 +10,5 @@ module YouCanBookMe
11
10
  attr_accessor :autoRejectActive
12
11
  # @return [Integer]
13
12
  attr_accessor :autoRejectAfterMinutes
14
-
15
13
  end
16
14
  end
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YouCanBookMe
4
- # YouCanBookMe's ProfileTimes model.
5
4
  class ProfileTimes
6
5
  include ModelUtils
7
6
 
@@ -48,6 +47,7 @@ module YouCanBookMe
48
47
  # @return [Integer]
49
48
  attr_accessor :slotLengthMinutes
50
49
  # @return [String]
50
+ # ['MONDAY', 'TUESDAY', 'WEDNESDAY', 'THURSDAY', 'FRIDAY', 'SATURDAY', 'SUNDAY']
51
51
  attr_accessor :startingDayOfWeek
52
52
  # @return [Boolean]
53
53
  attr_accessor :sunActive
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YouCanBookMe
4
- # YouCanBookMe's ProfileVouchers model.
5
4
  class ProfileVouchers
6
5
  include ModelUtils
7
6
 
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YouCanBookMe
4
- # YouCanBookMe's Provider model.
5
4
  class Provider
6
5
  include ModelUtils
7
6
 
@@ -1,19 +1,22 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YouCanBookMe
4
- # YouCanBookMe's Purchase model.
5
4
  class Purchase
6
5
  include ModelUtils
7
6
 
8
7
  ASSOCIATION = {
9
- localAccount: LocalAccount,
8
+ account: Account,
10
9
  nameAndAddress: NameAndAddress,
11
10
  transactions: Transaction,
12
11
  transactionsSorted: Transaction
13
12
  }.freeze
14
13
 
14
+ # @return [YouCanBookMe::Account]
15
+ attr_accessor :account
15
16
  # @return [Integer]
16
17
  attr_accessor :accountDiscount
18
+ # @return [String]
19
+ attr_accessor :accountId
17
20
  # @return [Boolean]
18
21
  attr_accessor :active
19
22
  # @return [Integer]
@@ -56,8 +59,6 @@ module YouCanBookMe
56
59
  attr_accessor :id
57
60
  # @return [Boolean]
58
61
  attr_accessor :liableForVAT
59
- # @return [YouCanBookMe::LocalAccount]
60
- attr_accessor :localAccount
61
62
  # @return [String]
62
63
  attr_accessor :localAccountId
63
64
  # @return [Integer]
@@ -95,10 +96,12 @@ module YouCanBookMe
95
96
  # @return [String]
96
97
  attr_accessor :regionHibernate
97
98
  # @return [String]
99
+ # ['setUpDispute', 'writeOff', 'retryPayment', 'refund']
98
100
  attr_accessor :requestedAction
99
101
  # @return [Boolean]
100
102
  attr_accessor :retryPayment
101
103
  # @return [String]
104
+ # ['ONGOING', 'PREVIEW', 'PERSIST', 'DAEMON', 'CHECKOUT', 'REAL', 'ONGOING_PREVIEW', 'RAW']
102
105
  attr_accessor :setUpMode
103
106
  # @return [Integer]
104
107
  attr_accessor :shortPeriodDiscount
@@ -115,6 +118,7 @@ module YouCanBookMe
115
118
  # @return [Array<YouCanBookMe::Transaction>]
116
119
  attr_accessor :transactionsSorted
117
120
  # @return [String]
121
+ # ['PURCHASE', 'RETURN', 'CASH_OUT', 'REVERSED_CHARGE', 'UNKNOWN']
118
122
  attr_accessor :type
119
123
  # @return [Integer]
120
124
  attr_accessor :unitPrice
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YouCanBookMe
4
- # YouCanBookMe's PurchasesSyncChanges model.
5
4
  class PurchasesSyncChanges
6
5
  include ModelUtils
7
6
 
@@ -15,6 +15,7 @@ module YouCanBookMe
15
15
  # @return [Boolean]
16
16
  attr_accessor :required
17
17
  # @return [String]
18
+ # ['CHECKBOX', 'HIDDEN', 'MULTI_CHECKBOXES', 'MULTI_DROPDOWN', 'MULTI_RADIO', 'PARAGRAPH', 'PASSTHROUGH', 'SIMPLE', 'TEXT']
18
19
  attr_accessor :type
19
20
  # @return [String]
20
21
  attr_accessor :validation
@@ -1,15 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YouCanBookMe
4
- # YouCanBookMe's RemoteAccount model.
5
4
  class RemoteAccount
6
5
  include ModelUtils
7
6
 
8
7
  ASSOCIATION = {
8
+ account: Account,
9
9
  calendars: Calendar,
10
10
  databaseVersion: RemoteAccount,
11
11
  links: Link,
12
- localAccount: LocalAccount,
13
12
  provider: Provider
14
13
  }.freeze
15
14
 
@@ -17,6 +16,12 @@ module YouCanBookMe
17
16
  attr_accessor :accessToken
18
17
  # @return [String]
19
18
  attr_accessor :accessTokenExpiresAt
19
+ # @return [YouCanBookMe::Account]
20
+ attr_accessor :account
21
+ # @return [String]
22
+ attr_accessor :accountEmail
23
+ # @return [String]
24
+ attr_accessor :accountId
20
25
  # @return [String]
21
26
  attr_accessor :calendarHome
22
27
  # @return [Array<YouCanBookMe::Calendar>]
@@ -33,8 +38,6 @@ module YouCanBookMe
33
38
  attr_accessor :id
34
39
  # @return [Array<YouCanBookMe::Link>]
35
40
  attr_accessor :links
36
- # @return [YouCanBookMe::LocalAccount>]
37
- attr_accessor :localAccount
38
41
  # @return [String]
39
42
  attr_accessor :localAccountEmail
40
43
  # @return [String]
@@ -48,6 +51,7 @@ module YouCanBookMe
48
51
  # @return [String]
49
52
  attr_accessor :refreshToken
50
53
  # @return [String]
54
+ # ['invalidateCache']
51
55
  attr_accessor :requestedAction
52
56
  # @return [String]
53
57
  attr_accessor :revision
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YouCanBookMe
4
- # YouCanBookMe's TemplateEvent model.
5
4
  class TemplateEvent
6
5
  include ModelUtils
7
6
 
@@ -1,18 +1,20 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YouCanBookMe
4
- # YouCanBookMe's Transaction model.
5
4
  class Transaction
6
5
  include ModelUtils
7
6
 
8
7
  ASSOCIATION = {
8
+ account: Account,
9
9
  linked: Transaction,
10
- purchase: Purchase,
10
+ purchase: Purchase
11
11
  }.freeze
12
12
 
13
- # @return [String]
13
+ # @return [YouCanBookMe::Account]
14
14
  attr_accessor :account
15
15
  # @return [String]
16
+ attr_accessor :accountId
17
+ # @return [String]
16
18
  attr_accessor :createdAt
17
19
  # @return [String]
18
20
  attr_accessor :description
@@ -35,6 +37,7 @@ module YouCanBookMe
35
37
  # @return [Integer]
36
38
  attr_accessor :tax
37
39
  # @return [String]
40
+ # ['INVOICE', 'CREDIT_NOTE', 'FAILED_PAYMENT', 'PAYMENT', 'REFUND', 'CREDIT', 'USE_OF_CREDIT']
38
41
  attr_accessor :type
39
42
  # @return [String]
40
43
  attr_accessor :updatedAt
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YouCanBookMe
4
- # YouCanBookMe's Warning model.
5
4
  class Warning
6
5
  include ModelUtils
7
6
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module YouCanBookMe
4
- VERSION = '0.0.1.alpha'
4
+ VERSION = '0.0.6.alpha'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: youcanbookme
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1.alpha
4
+ version: 0.0.6.alpha
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kenji Koshikawa
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-02 00:00:00.000000000 Z
11
+ date: 2020-09-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -146,7 +146,7 @@ files:
146
146
  - ".github/workflows/gem-push.yml"
147
147
  - ".github/workflows/test.yml"
148
148
  - ".gitignore"
149
- - ".rubocom.yml"
149
+ - ".rubocop.yml"
150
150
  - CHANGELOG.md
151
151
  - CODE_OF_CONDUCT.md
152
152
  - Gemfile
@@ -157,34 +157,29 @@ files:
157
157
  - bin/setup
158
158
  - lib/youcanbookme.rb
159
159
  - lib/youcanbookme/client.rb
160
- - lib/youcanbookme/common_module.rb
161
160
  - lib/youcanbookme/configuration.rb
162
161
  - lib/youcanbookme/error.rb
163
162
  - lib/youcanbookme/http_command.rb
163
+ - lib/youcanbookme/loggable.rb
164
164
  - lib/youcanbookme/models/account.rb
165
+ - lib/youcanbookme/models/account_allocation.rb
166
+ - lib/youcanbookme/models/account_child.rb
167
+ - lib/youcanbookme/models/account_parent.rb
165
168
  - lib/youcanbookme/models/action.rb
166
169
  - lib/youcanbookme/models/answer.rb
167
- - lib/youcanbookme/models/appointment_type.rb
168
170
  - lib/youcanbookme/models/booking.rb
169
171
  - lib/youcanbookme/models/booking_lobby.rb
170
172
  - lib/youcanbookme/models/calendar.rb
171
- - lib/youcanbookme/models/caligraph_calendar.rb
172
- - lib/youcanbookme/models/caligraph_event.rb
173
- - lib/youcanbookme/models/caligraph_link.rb
174
- - lib/youcanbookme/models/caligraph_local_account.rb
175
- - lib/youcanbookme/models/caligraph_permission.rb
176
- - lib/youcanbookme/models/caligraph_remote_account.rb
177
- - lib/youcanbookme/models/caligraph_safe_local_account.rb
178
173
  - lib/youcanbookme/models/card.rb
179
174
  - lib/youcanbookme/models/event.rb
180
- - lib/youcanbookme/models/instant.rb
175
+ - lib/youcanbookme/models/event_participant.rb
176
+ - lib/youcanbookme/models/event_reminder.rb
181
177
  - lib/youcanbookme/models/link.rb
182
- - lib/youcanbookme/models/local_account.rb
183
178
  - lib/youcanbookme/models/model_utils.rb
184
179
  - lib/youcanbookme/models/name_and_address.rb
185
- - lib/youcanbookme/models/participant.rb
186
180
  - lib/youcanbookme/models/permission.rb
187
181
  - lib/youcanbookme/models/profile.rb
182
+ - lib/youcanbookme/models/profile_account.rb
188
183
  - lib/youcanbookme/models/profile_afterwards.rb
189
184
  - lib/youcanbookme/models/profile_appointment_type.rb
190
185
  - lib/youcanbookme/models/profile_appointment_types.rb
@@ -192,7 +187,6 @@ files:
192
187
  - lib/youcanbookme/models/profile_calendars.rb
193
188
  - lib/youcanbookme/models/profile_cancel_or_reschedule.rb
194
189
  - lib/youcanbookme/models/profile_display.rb
195
- - lib/youcanbookme/models/profile_local_account.rb
196
190
  - lib/youcanbookme/models/profile_payments.rb
197
191
  - lib/youcanbookme/models/profile_remote_account.rb
198
192
  - lib/youcanbookme/models/profile_remote_reminder.rb
@@ -204,11 +198,8 @@ files:
204
198
  - lib/youcanbookme/models/provider.rb
205
199
  - lib/youcanbookme/models/purchase.rb
206
200
  - lib/youcanbookme/models/purchases_sync_changes.rb
207
- - lib/youcanbookme/models/query.rb
208
201
  - lib/youcanbookme/models/question.rb
209
- - lib/youcanbookme/models/reminder.rb
210
202
  - lib/youcanbookme/models/remote_account.rb
211
- - lib/youcanbookme/models/team_member.rb
212
203
  - lib/youcanbookme/models/template_event.rb
213
204
  - lib/youcanbookme/models/transaction.rb
214
205
  - lib/youcanbookme/models/warning.rb
@@ -221,7 +212,7 @@ metadata:
221
212
  homepage_uri: https://github.com/koshilife/youcanbookme-api-ruby-client
222
213
  source_code_uri: https://github.com/koshilife/youcanbookme-api-ruby-client
223
214
  changelog_uri: https://github.com/koshilife/youcanbookme-api-ruby-client/blob/master/CHANGELOG.md
224
- documentation_uri: https://www.rubydoc.info/gems/youcanbookme/0.0.1.alpha
215
+ documentation_uri: https://www.rubydoc.info/gems/youcanbookme/0.0.6.alpha
225
216
  post_install_message:
226
217
  rdoc_options: []
227
218
  require_paths:
@@ -1,7 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module YouCanBookMe
4
- class AppointmentType
5
- include ModelUtils
6
- end
7
- end
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module YouCanBookMe
4
- # YouCanBookMe's CaligraphCalendar model.
5
- class CaligraphCalendar
6
- include ModelUtils
7
-
8
- ASSOCIATION = { links: CaligraphLink }.freeze
9
-
10
- # @return [Boolean]
11
- attr_accessor :deleted
12
- # @return [String]
13
- attr_accessor :id
14
- # @return [Array<YouCanBookMe::CaligraphLink>]
15
- attr_accessor :links
16
- # @return [Integer]
17
- attr_accessor :permissionLevel
18
- # @return [Boolean]
19
- attr_accessor :primary
20
- # @return [String]
21
- attr_accessor :remoteAccountId
22
- # @return [String]
23
- attr_accessor :timeZone
24
- # @return [String]
25
- attr_accessor :title
26
- # @return [String]
27
- attr_accessor :userName
28
- end
29
- end
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module YouCanBookMe
4
- # YouCanBookMe's CaligraphEvent model.
5
- class CaligraphEvent
6
- include ModelUtils
7
- end
8
- end
@@ -1,17 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module YouCanBookMe
4
- # YouCanBookMe's CaligraphLink model.
5
- class CaligraphLink
6
- include ModelUtils
7
-
8
- # @return [String]
9
- attr_accessor :href
10
- # @return [String]
11
- attr_accessor :id
12
- # @return [String]
13
- attr_accessor :rel
14
- # @return [String]
15
- attr_accessor :type
16
- end
17
- end
@@ -1,47 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module YouCanBookMe
4
- # YouCanBookMe's CaligraphLocalAccount model.
5
- class CaligraphLocalAccount
6
- include ModelUtils
7
-
8
- ASSOCIATION = {
9
- permissionsIn: CaligraphPermission,
10
- permissionsOut: CaligraphPermission,
11
- remoteAccounts: CaligraphRemoteAccount
12
- }.freeze
13
-
14
- # @return [String]
15
- attr_accessor :apiKey
16
- # @return [String]
17
- attr_accessor :email
18
- # @return [String]
19
- attr_accessor :id
20
- # @return [Boolean]
21
- attr_accessor :inDebugMode
22
- # @return [String]
23
- attr_accessor :lifecycle
24
- # @return [String]
25
- attr_accessor :parentId
26
- # @return [Array<YouCanBookMe::CaligraphPermission>]
27
- attr_accessor :permissionsIn
28
- # @return [Array<YouCanBookMe::CaligraphPermission>]
29
- attr_accessor :permissionsOut
30
- # @return [String]
31
- attr_accessor :plan
32
- # @return [Integer]
33
- attr_accessor :planMonths
34
- # @return [Integer]
35
- attr_accessor :quantityAllocated
36
- # @return [Integer]
37
- attr_accessor :quantityForFree
38
- # @return [Integer]
39
- attr_accessor :quantityFreeTrial
40
- # @return [Integer]
41
- attr_accessor :quantityPaidFor
42
- # @return [Array<YouCanBookMe::CaligraphRemoteAccount>]
43
- attr_accessor :remoteAccounts
44
- # @return [String]
45
- attr_accessor :trialEndsAt
46
- end
47
- end
@@ -1,32 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module YouCanBookMe
4
- # YouCanBookMe's CaligraphPermission model.
5
- class CaligraphPermission
6
- include ModelUtils
7
-
8
- ASSOCIATION = {
9
- fromLocalAccount: CaligraphSafeLocalAccount,
10
- toLocalAccount: CaligraphSafeLocalAccount
11
- }.freeze
12
-
13
- # @return [String]
14
- attr_accessor :createdAt
15
- # @return [String]
16
- attr_accessor :expiresAt
17
- # @return [YouCanBookMe::CaligraphSafeLocalAccount]
18
- attr_accessor :fromLocalAccount
19
- # @return [String]
20
- attr_accessor :id
21
- # @return [String]
22
- attr_accessor :resource
23
- # @return [String]
24
- attr_accessor :status
25
- # @return [YouCanBookMe::CaligraphSafeLocalAccount]
26
- attr_accessor :toLocalAccount
27
- # @return [String]
28
- attr_accessor :type
29
- # @return [String]
30
- attr_accessor :updatedAt
31
- end
32
- end