fizzy-sdk 0.1.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.
Files changed (52) hide show
  1. checksums.yaml +7 -0
  2. data/.rubocop.yml +18 -0
  3. data/Rakefile +26 -0
  4. data/fizzy-sdk.gemspec +45 -0
  5. data/lib/fizzy/auth_strategy.rb +38 -0
  6. data/lib/fizzy/bulkhead.rb +68 -0
  7. data/lib/fizzy/cache.rb +101 -0
  8. data/lib/fizzy/chain_hooks.rb +45 -0
  9. data/lib/fizzy/circuit_breaker.rb +115 -0
  10. data/lib/fizzy/client.rb +212 -0
  11. data/lib/fizzy/config.rb +143 -0
  12. data/lib/fizzy/cookie_auth.rb +27 -0
  13. data/lib/fizzy/errors.rb +291 -0
  14. data/lib/fizzy/generated/metadata.json +1341 -0
  15. data/lib/fizzy/generated/services/boards_service.rb +91 -0
  16. data/lib/fizzy/generated/services/cards_service.rb +313 -0
  17. data/lib/fizzy/generated/services/columns_service.rb +69 -0
  18. data/lib/fizzy/generated/services/comments_service.rb +68 -0
  19. data/lib/fizzy/generated/services/devices_service.rb +35 -0
  20. data/lib/fizzy/generated/services/identity_service.rb +19 -0
  21. data/lib/fizzy/generated/services/miscellaneous_service.rb +256 -0
  22. data/lib/fizzy/generated/services/notifications_service.rb +65 -0
  23. data/lib/fizzy/generated/services/pins_service.rb +19 -0
  24. data/lib/fizzy/generated/services/reactions_service.rb +80 -0
  25. data/lib/fizzy/generated/services/sessions_service.rb +58 -0
  26. data/lib/fizzy/generated/services/steps_service.rb +69 -0
  27. data/lib/fizzy/generated/services/tags_service.rb +20 -0
  28. data/lib/fizzy/generated/services/uploads_service.rb +24 -0
  29. data/lib/fizzy/generated/services/users_service.rb +52 -0
  30. data/lib/fizzy/generated/services/webhooks_service.rb +83 -0
  31. data/lib/fizzy/generated/types.rb +988 -0
  32. data/lib/fizzy/hooks.rb +70 -0
  33. data/lib/fizzy/http.rb +411 -0
  34. data/lib/fizzy/logger_hooks.rb +46 -0
  35. data/lib/fizzy/magic_link_flow.rb +57 -0
  36. data/lib/fizzy/noop_hooks.rb +9 -0
  37. data/lib/fizzy/operation_info.rb +17 -0
  38. data/lib/fizzy/rate_limiter.rb +68 -0
  39. data/lib/fizzy/request_info.rb +10 -0
  40. data/lib/fizzy/request_result.rb +14 -0
  41. data/lib/fizzy/resilience.rb +59 -0
  42. data/lib/fizzy/security.rb +103 -0
  43. data/lib/fizzy/services/base_service.rb +116 -0
  44. data/lib/fizzy/static_token_provider.rb +24 -0
  45. data/lib/fizzy/token_provider.rb +42 -0
  46. data/lib/fizzy/version.rb +6 -0
  47. data/lib/fizzy/webhooks/verify.rb +36 -0
  48. data/lib/fizzy.rb +95 -0
  49. data/scripts/generate-metadata.rb +105 -0
  50. data/scripts/generate-services.rb +681 -0
  51. data/scripts/generate-types.rb +160 -0
  52. metadata +252 -0
@@ -0,0 +1,256 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fizzy
4
+ module Services
5
+ # Service for Miscellaneous operations
6
+ #
7
+ # @generated from OpenAPI spec
8
+ class MiscellaneousService < BaseService
9
+
10
+ # list_access_tokens operation
11
+ # @return [Hash] response data
12
+ def list_access_tokens()
13
+ with_operation(service: "miscellaneous", operation: "ListAccessTokens", is_mutation: false) do
14
+ http_get("/my/access_tokens.json").json
15
+ end
16
+ end
17
+
18
+ # create_access_token operation
19
+ # @param description [String] description
20
+ # @param permission [String] permission
21
+ # @return [Hash] response data
22
+ def create_access_token(description:, permission:)
23
+ with_operation(service: "miscellaneous", operation: "CreateAccessToken", is_mutation: true) do
24
+ http_post("/my/access_tokens.json", body: compact_params(description: description, permission: permission)).json
25
+ end
26
+ end
27
+
28
+ # delete_access_token operation
29
+ # @param access_token_id [String] access token id ID
30
+ # @return [void]
31
+ def delete_access_token(access_token_id:)
32
+ with_operation(service: "miscellaneous", operation: "DeleteAccessToken", is_mutation: true, resource_id: access_token_id) do
33
+ http_delete("/my/access_tokens/#{access_token_id}")
34
+ nil
35
+ end
36
+ end
37
+
38
+ # update_account_entropy operation
39
+ # @param account_id [String] account id ID
40
+ # @param auto_postpone_period [Integer, nil] auto postpone period
41
+ # @return [void]
42
+ def update_account_entropy(account_id:, auto_postpone_period: nil)
43
+ with_operation(service: "miscellaneous", operation: "UpdateAccountEntropy", is_mutation: true, resource_id: account_id) do
44
+ http_patch("/#{account_id}/account/entropy.json", body: compact_params(auto_postpone_period: auto_postpone_period))
45
+ nil
46
+ end
47
+ end
48
+
49
+ # create_account_export operation
50
+ # @param account_id [String] account id ID
51
+ # @return [Hash] response data
52
+ def create_account_export(account_id:)
53
+ with_operation(service: "miscellaneous", operation: "CreateAccountExport", is_mutation: true, resource_id: account_id) do
54
+ http_post("/#{account_id}/account/exports.json").json
55
+ end
56
+ end
57
+
58
+ # get_account_export operation
59
+ # @param account_id [String] account id ID
60
+ # @param export_id [String] export id ID
61
+ # @return [Hash] response data
62
+ def get_account_export(account_id:, export_id:)
63
+ with_operation(service: "miscellaneous", operation: "GetAccountExport", is_mutation: false, resource_id: export_id) do
64
+ http_get("/#{account_id}/account/exports/#{export_id}").json
65
+ end
66
+ end
67
+
68
+ # get_join_code operation
69
+ # @param account_id [String] account id ID
70
+ # @return [Hash] response data
71
+ def get_join_code(account_id:)
72
+ with_operation(service: "miscellaneous", operation: "GetJoinCode", is_mutation: false, resource_id: account_id) do
73
+ http_get("/#{account_id}/account/join_code.json").json
74
+ end
75
+ end
76
+
77
+ # update_join_code operation
78
+ # @param account_id [String] account id ID
79
+ # @param usage_limit [Integer, nil] usage limit
80
+ # @return [void]
81
+ def update_join_code(account_id:, usage_limit: nil)
82
+ with_operation(service: "miscellaneous", operation: "UpdateJoinCode", is_mutation: true, resource_id: account_id) do
83
+ http_patch("/#{account_id}/account/join_code.json", body: compact_params(usage_limit: usage_limit))
84
+ nil
85
+ end
86
+ end
87
+
88
+ # reset_join_code operation
89
+ # @param account_id [String] account id ID
90
+ # @return [void]
91
+ def reset_join_code(account_id:)
92
+ with_operation(service: "miscellaneous", operation: "ResetJoinCode", is_mutation: true, resource_id: account_id) do
93
+ http_delete("/#{account_id}/account/join_code.json")
94
+ nil
95
+ end
96
+ end
97
+
98
+ # get_account_settings operation
99
+ # @param account_id [String] account id ID
100
+ # @return [Hash] response data
101
+ def get_account_settings(account_id:)
102
+ with_operation(service: "miscellaneous", operation: "GetAccountSettings", is_mutation: false, resource_id: account_id) do
103
+ http_get("/#{account_id}/account/settings.json").json
104
+ end
105
+ end
106
+
107
+ # update_account_settings operation
108
+ # @param account_id [String] account id ID
109
+ # @param name [String, nil] name
110
+ # @return [void]
111
+ def update_account_settings(account_id:, name: nil)
112
+ with_operation(service: "miscellaneous", operation: "UpdateAccountSettings", is_mutation: true, resource_id: account_id) do
113
+ http_patch("/#{account_id}/account/settings.json", body: compact_params(name: name))
114
+ nil
115
+ end
116
+ end
117
+
118
+ # update_board_entropy operation
119
+ # @param account_id [String] account id ID
120
+ # @param board_id [String] board id ID
121
+ # @param auto_postpone_period [Integer, nil] auto postpone period
122
+ # @return [void]
123
+ def update_board_entropy(account_id:, board_id:, auto_postpone_period: nil)
124
+ with_operation(service: "miscellaneous", operation: "UpdateBoardEntropy", is_mutation: true, resource_id: board_id) do
125
+ http_patch("/#{account_id}/boards/#{board_id}/entropy.json", body: compact_params(auto_postpone_period: auto_postpone_period))
126
+ nil
127
+ end
128
+ end
129
+
130
+ # update_board_involvement operation
131
+ # @param account_id [String] account id ID
132
+ # @param board_id [String] board id ID
133
+ # @param involvement [String, nil] involvement
134
+ # @return [void]
135
+ def update_board_involvement(account_id:, board_id:, involvement: nil)
136
+ with_operation(service: "miscellaneous", operation: "UpdateBoardInvolvement", is_mutation: true, resource_id: board_id) do
137
+ http_patch("/#{account_id}/boards/#{board_id}/involvement.json", body: compact_params(involvement: involvement))
138
+ nil
139
+ end
140
+ end
141
+
142
+ # mark_card_read operation
143
+ # @param account_id [String] account id ID
144
+ # @param card_number [Integer] card number ID
145
+ # @return [void]
146
+ def mark_card_read(account_id:, card_number:)
147
+ with_operation(service: "miscellaneous", operation: "MarkCardRead", is_mutation: true, resource_id: card_number) do
148
+ http_post("/#{account_id}/cards/#{card_number}/reading.json", retryable: true)
149
+ nil
150
+ end
151
+ end
152
+
153
+ # mark_card_unread operation
154
+ # @param account_id [String] account id ID
155
+ # @param card_number [Integer] card number ID
156
+ # @return [void]
157
+ def mark_card_unread(account_id:, card_number:)
158
+ with_operation(service: "miscellaneous", operation: "MarkCardUnread", is_mutation: true, resource_id: card_number) do
159
+ http_delete("/#{account_id}/cards/#{card_number}/reading.json")
160
+ nil
161
+ end
162
+ end
163
+
164
+ # move_column_left operation
165
+ # @param account_id [String] account id ID
166
+ # @param column_id [String] column id ID
167
+ # @return [void]
168
+ def move_column_left(account_id:, column_id:)
169
+ with_operation(service: "miscellaneous", operation: "MoveColumnLeft", is_mutation: true, resource_id: column_id) do
170
+ http_post("/#{account_id}/columns/#{column_id}/left_position.json", retryable: true)
171
+ nil
172
+ end
173
+ end
174
+
175
+ # move_column_right operation
176
+ # @param account_id [String] account id ID
177
+ # @param column_id [String] column id ID
178
+ # @return [void]
179
+ def move_column_right(account_id:, column_id:)
180
+ with_operation(service: "miscellaneous", operation: "MoveColumnRight", is_mutation: true, resource_id: column_id) do
181
+ http_post("/#{account_id}/columns/#{column_id}/right_position.json", retryable: true)
182
+ nil
183
+ end
184
+ end
185
+
186
+ # get_notification_settings operation
187
+ # @param account_id [String] account id ID
188
+ # @return [Hash] response data
189
+ def get_notification_settings(account_id:)
190
+ with_operation(service: "miscellaneous", operation: "GetNotificationSettings", is_mutation: false, resource_id: account_id) do
191
+ http_get("/#{account_id}/notifications/settings.json").json
192
+ end
193
+ end
194
+
195
+ # update_notification_settings operation
196
+ # @param account_id [String] account id ID
197
+ # @param bundle_email_frequency [String, nil] bundle email frequency
198
+ # @return [void]
199
+ def update_notification_settings(account_id:, bundle_email_frequency: nil)
200
+ with_operation(service: "miscellaneous", operation: "UpdateNotificationSettings", is_mutation: true, resource_id: account_id) do
201
+ http_patch("/#{account_id}/notifications/settings.json", body: compact_params(bundle_email_frequency: bundle_email_frequency))
202
+ nil
203
+ end
204
+ end
205
+
206
+ # delete_user_avatar operation
207
+ # @param account_id [String] account id ID
208
+ # @param user_id [String] user id ID
209
+ # @return [void]
210
+ def delete_user_avatar(account_id:, user_id:)
211
+ with_operation(service: "miscellaneous", operation: "DeleteUserAvatar", is_mutation: true, resource_id: user_id) do
212
+ http_delete("/#{account_id}/users/#{user_id}/avatar")
213
+ nil
214
+ end
215
+ end
216
+
217
+ # create_push_subscription operation
218
+ # @param account_id [String] account id ID
219
+ # @param user_id [String] user id ID
220
+ # @param endpoint [String] endpoint
221
+ # @param p256dh_key [String] p256dh key
222
+ # @param auth_key [String] auth key
223
+ # @return [void]
224
+ def create_push_subscription(account_id:, user_id:, endpoint:, p256dh_key:, auth_key:)
225
+ with_operation(service: "miscellaneous", operation: "CreatePushSubscription", is_mutation: true, resource_id: user_id) do
226
+ http_post("/#{account_id}/users/#{user_id}/push_subscriptions.json", body: compact_params(endpoint: endpoint, p256dh_key: p256dh_key, auth_key: auth_key))
227
+ nil
228
+ end
229
+ end
230
+
231
+ # delete_push_subscription operation
232
+ # @param account_id [String] account id ID
233
+ # @param user_id [String] user id ID
234
+ # @param push_subscription_id [String] push subscription id ID
235
+ # @return [void]
236
+ def delete_push_subscription(account_id:, user_id:, push_subscription_id:)
237
+ with_operation(service: "miscellaneous", operation: "DeletePushSubscription", is_mutation: true, resource_id: push_subscription_id) do
238
+ http_delete("/#{account_id}/users/#{user_id}/push_subscriptions/#{push_subscription_id}")
239
+ nil
240
+ end
241
+ end
242
+
243
+ # update_user_role operation
244
+ # @param account_id [String] account id ID
245
+ # @param user_id [String] user id ID
246
+ # @param role [String] role
247
+ # @return [void]
248
+ def update_user_role(account_id:, user_id:, role:)
249
+ with_operation(service: "miscellaneous", operation: "UpdateUserRole", is_mutation: true, resource_id: user_id) do
250
+ http_patch("/#{account_id}/users/#{user_id}/role.json", body: compact_params(role: role))
251
+ nil
252
+ end
253
+ end
254
+ end
255
+ end
256
+ end
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fizzy
4
+ module Services
5
+ # Service for Notifications operations
6
+ #
7
+ # @generated from OpenAPI spec
8
+ class NotificationsService < BaseService
9
+
10
+ # list operation
11
+ # @param account_id [String] account id ID
12
+ # @param read [Boolean, nil] read
13
+ # @return [Enumerator<Hash>] paginated results
14
+ def list(account_id:, read: nil)
15
+ wrap_paginated(service: "notifications", operation: "ListNotifications", is_mutation: false, resource_id: account_id) do
16
+ params = compact_params(read: read)
17
+ paginate("/#{account_id}/notifications.json", params: params)
18
+ end
19
+ end
20
+
21
+ # bulk_read operation
22
+ # @param account_id [String] account id ID
23
+ # @param notification_ids [Array, nil] notification ids
24
+ # @return [void]
25
+ def bulk_read(account_id:, notification_ids: nil)
26
+ with_operation(service: "notifications", operation: "BulkReadNotifications", is_mutation: true, resource_id: account_id) do
27
+ http_post("/#{account_id}/notifications/bulk_reading.json", body: compact_params(notification_ids: notification_ids))
28
+ nil
29
+ end
30
+ end
31
+
32
+ # tray operation
33
+ # @param account_id [String] account id ID
34
+ # @param include_read [Boolean, nil] include read
35
+ # @return [Hash] response data
36
+ def tray(account_id:, include_read: nil)
37
+ with_operation(service: "notifications", operation: "GetNotificationTray", is_mutation: false, resource_id: account_id) do
38
+ http_get("/#{account_id}/notifications/tray.json", params: compact_params(include_read: include_read)).json
39
+ end
40
+ end
41
+
42
+ # read operation
43
+ # @param account_id [String] account id ID
44
+ # @param notification_id [String] notification id ID
45
+ # @return [void]
46
+ def read(account_id:, notification_id:)
47
+ with_operation(service: "notifications", operation: "ReadNotification", is_mutation: true, resource_id: notification_id) do
48
+ http_post("/#{account_id}/notifications/#{notification_id}/reading.json", retryable: true)
49
+ nil
50
+ end
51
+ end
52
+
53
+ # unread operation
54
+ # @param account_id [String] account id ID
55
+ # @param notification_id [String] notification id ID
56
+ # @return [void]
57
+ def unread(account_id:, notification_id:)
58
+ with_operation(service: "notifications", operation: "UnreadNotification", is_mutation: true, resource_id: notification_id) do
59
+ http_delete("/#{account_id}/notifications/#{notification_id}/reading.json")
60
+ nil
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fizzy
4
+ module Services
5
+ # Service for Pins operations
6
+ #
7
+ # @generated from OpenAPI spec
8
+ class PinsService < BaseService
9
+
10
+ # list operation
11
+ # @return [Hash] response data
12
+ def list()
13
+ with_operation(service: "pins", operation: "ListPins", is_mutation: false) do
14
+ http_get("/my/pins.json").json
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,80 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fizzy
4
+ module Services
5
+ # Service for Reactions operations
6
+ #
7
+ # @generated from OpenAPI spec
8
+ class ReactionsService < BaseService
9
+
10
+ # list_for_comment operation
11
+ # @param account_id [String] account id ID
12
+ # @param card_number [Integer] card number ID
13
+ # @param comment_id [String] comment id ID
14
+ # @return [Hash] response data
15
+ def list_for_comment(account_id:, card_number:, comment_id:)
16
+ with_operation(service: "reactions", operation: "ListCommentReactions", is_mutation: false, resource_id: comment_id) do
17
+ http_get("/#{account_id}/cards/#{card_number}/comments/#{comment_id}/reactions.json").json
18
+ end
19
+ end
20
+
21
+ # create_for_comment operation
22
+ # @param account_id [String] account id ID
23
+ # @param card_number [Integer] card number ID
24
+ # @param comment_id [String] comment id ID
25
+ # @param content [String] content
26
+ # @return [Hash] response data
27
+ def create_for_comment(account_id:, card_number:, comment_id:, content:)
28
+ with_operation(service: "reactions", operation: "CreateCommentReaction", is_mutation: true, resource_id: comment_id) do
29
+ http_post("/#{account_id}/cards/#{card_number}/comments/#{comment_id}/reactions.json", body: compact_params(content: content)).json
30
+ end
31
+ end
32
+
33
+ # delete_for_comment operation
34
+ # @param account_id [String] account id ID
35
+ # @param card_number [Integer] card number ID
36
+ # @param comment_id [String] comment id ID
37
+ # @param reaction_id [String] reaction id ID
38
+ # @return [void]
39
+ def delete_for_comment(account_id:, card_number:, comment_id:, reaction_id:)
40
+ with_operation(service: "reactions", operation: "DeleteCommentReaction", is_mutation: true, resource_id: reaction_id) do
41
+ http_delete("/#{account_id}/cards/#{card_number}/comments/#{comment_id}/reactions/#{reaction_id}")
42
+ nil
43
+ end
44
+ end
45
+
46
+ # list_for_card operation
47
+ # @param account_id [String] account id ID
48
+ # @param card_number [Integer] card number ID
49
+ # @return [Hash] response data
50
+ def list_for_card(account_id:, card_number:)
51
+ with_operation(service: "reactions", operation: "ListCardReactions", is_mutation: false, resource_id: card_number) do
52
+ http_get("/#{account_id}/cards/#{card_number}/reactions.json").json
53
+ end
54
+ end
55
+
56
+ # create_for_card operation
57
+ # @param account_id [String] account id ID
58
+ # @param card_number [Integer] card number ID
59
+ # @param content [String] content
60
+ # @return [Hash] response data
61
+ def create_for_card(account_id:, card_number:, content:)
62
+ with_operation(service: "reactions", operation: "CreateCardReaction", is_mutation: true, resource_id: card_number) do
63
+ http_post("/#{account_id}/cards/#{card_number}/reactions.json", body: compact_params(content: content)).json
64
+ end
65
+ end
66
+
67
+ # delete_for_card operation
68
+ # @param account_id [String] account id ID
69
+ # @param card_number [Integer] card number ID
70
+ # @param reaction_id [String] reaction id ID
71
+ # @return [void]
72
+ def delete_for_card(account_id:, card_number:, reaction_id:)
73
+ with_operation(service: "reactions", operation: "DeleteCardReaction", is_mutation: true, resource_id: reaction_id) do
74
+ http_delete("/#{account_id}/cards/#{card_number}/reactions/#{reaction_id}")
75
+ nil
76
+ end
77
+ end
78
+ end
79
+ end
80
+ end
@@ -0,0 +1,58 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fizzy
4
+ module Services
5
+ # Service for Sessions operations
6
+ #
7
+ # @generated from OpenAPI spec
8
+ class SessionsService < BaseService
9
+
10
+ # create operation
11
+ # @param email_address [String] email address
12
+ # @return [Hash] response data
13
+ def create(email_address:)
14
+ with_operation(service: "sessions", operation: "CreateSession", is_mutation: true) do
15
+ http_post("/session.json", body: compact_params(email_address: email_address)).json
16
+ end
17
+ end
18
+
19
+ # destroy operation
20
+ # @return [void]
21
+ def destroy()
22
+ with_operation(service: "sessions", operation: "DestroySession", is_mutation: true) do
23
+ http_delete("/session.json", retryable: false)
24
+ nil
25
+ end
26
+ end
27
+
28
+ # redeem_magic_link operation
29
+ # @param token [String] token
30
+ # @return [Hash] response data
31
+ def redeem_magic_link(token:)
32
+ with_operation(service: "sessions", operation: "RedeemMagicLink", is_mutation: true) do
33
+ http_post("/session/magic_link.json", body: compact_params(token: token)).json
34
+ end
35
+ end
36
+
37
+ # complete_signup operation
38
+ # @param full_name [String] full name
39
+ # @return [void]
40
+ def complete_signup(full_name:)
41
+ with_operation(service: "sessions", operation: "CompleteSignup", is_mutation: true) do
42
+ http_post("/signup/completion.json", body: compact_params(full_name: full_name))
43
+ nil
44
+ end
45
+ end
46
+
47
+ # complete_join operation
48
+ # @param name [String] name
49
+ # @return [void]
50
+ def complete_join(name:)
51
+ with_operation(service: "sessions", operation: "CompleteJoin", is_mutation: true) do
52
+ http_post("/users/joins.json", body: compact_params(name: name))
53
+ nil
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fizzy
4
+ module Services
5
+ # Service for Steps operations
6
+ #
7
+ # @generated from OpenAPI spec
8
+ class StepsService < BaseService
9
+
10
+ # list operation
11
+ # @param account_id [String] account id ID
12
+ # @param card_number [Integer] card number ID
13
+ # @return [Hash] response data
14
+ def list(account_id:, card_number:)
15
+ with_operation(service: "steps", operation: "ListSteps", is_mutation: false, resource_id: card_number) do
16
+ http_get("/#{account_id}/cards/#{card_number}/steps.json").json
17
+ end
18
+ end
19
+
20
+ # create operation
21
+ # @param account_id [String] account id ID
22
+ # @param card_number [Integer] card number ID
23
+ # @param content [String] content
24
+ # @param completed [Boolean, nil] completed
25
+ # @return [Hash] response data
26
+ def create(account_id:, card_number:, content:, completed: nil)
27
+ with_operation(service: "steps", operation: "CreateStep", is_mutation: true, resource_id: card_number) do
28
+ http_post("/#{account_id}/cards/#{card_number}/steps.json", body: compact_params(content: content, completed: completed)).json
29
+ end
30
+ end
31
+
32
+ # get operation
33
+ # @param account_id [String] account id ID
34
+ # @param card_number [Integer] card number ID
35
+ # @param step_id [String] step id ID
36
+ # @return [Hash] response data
37
+ def get(account_id:, card_number:, step_id:)
38
+ with_operation(service: "steps", operation: "GetStep", is_mutation: false, resource_id: step_id) do
39
+ http_get("/#{account_id}/cards/#{card_number}/steps/#{step_id}").json
40
+ end
41
+ end
42
+
43
+ # update operation
44
+ # @param account_id [String] account id ID
45
+ # @param card_number [Integer] card number ID
46
+ # @param step_id [String] step id ID
47
+ # @param content [String, nil] content
48
+ # @param completed [Boolean, nil] completed
49
+ # @return [Hash] response data
50
+ def update(account_id:, card_number:, step_id:, content: nil, completed: nil)
51
+ with_operation(service: "steps", operation: "UpdateStep", is_mutation: true, resource_id: step_id) do
52
+ http_patch("/#{account_id}/cards/#{card_number}/steps/#{step_id}", body: compact_params(content: content, completed: completed)).json
53
+ end
54
+ end
55
+
56
+ # delete operation
57
+ # @param account_id [String] account id ID
58
+ # @param card_number [Integer] card number ID
59
+ # @param step_id [String] step id ID
60
+ # @return [void]
61
+ def delete(account_id:, card_number:, step_id:)
62
+ with_operation(service: "steps", operation: "DeleteStep", is_mutation: true, resource_id: step_id) do
63
+ http_delete("/#{account_id}/cards/#{card_number}/steps/#{step_id}")
64
+ nil
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fizzy
4
+ module Services
5
+ # Service for Tags operations
6
+ #
7
+ # @generated from OpenAPI spec
8
+ class TagsService < BaseService
9
+
10
+ # list operation
11
+ # @param account_id [String] account id ID
12
+ # @return [Enumerator<Hash>] paginated results
13
+ def list(account_id:)
14
+ wrap_paginated(service: "tags", operation: "ListTags", is_mutation: false, resource_id: account_id) do
15
+ paginate("/#{account_id}/tags.json")
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fizzy
4
+ module Services
5
+ # Service for Uploads operations
6
+ #
7
+ # @generated from OpenAPI spec
8
+ class UploadsService < BaseService
9
+
10
+ # create_direct operation
11
+ # @param account_id [String] account id ID
12
+ # @param filename [String] filename
13
+ # @param content_type [String] content type
14
+ # @param byte_size [Integer] byte size
15
+ # @param checksum [String] checksum
16
+ # @return [Hash] response data
17
+ def create_direct(account_id:, filename:, content_type:, byte_size:, checksum:)
18
+ with_operation(service: "uploads", operation: "CreateDirectUpload", is_mutation: true, resource_id: account_id) do
19
+ http_post("/#{account_id}/rails/active_storage/direct_uploads", body: compact_params(filename: filename, content_type: content_type, byte_size: byte_size, checksum: checksum)).json
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,52 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Fizzy
4
+ module Services
5
+ # Service for Users operations
6
+ #
7
+ # @generated from OpenAPI spec
8
+ class UsersService < BaseService
9
+
10
+ # list operation
11
+ # @param account_id [String] account id ID
12
+ # @return [Enumerator<Hash>] paginated results
13
+ def list(account_id:)
14
+ wrap_paginated(service: "users", operation: "ListUsers", is_mutation: false, resource_id: account_id) do
15
+ paginate("/#{account_id}/users.json")
16
+ end
17
+ end
18
+
19
+ # get operation
20
+ # @param account_id [String] account id ID
21
+ # @param user_id [String] user id ID
22
+ # @return [Hash] response data
23
+ def get(account_id:, user_id:)
24
+ with_operation(service: "users", operation: "GetUser", is_mutation: false, resource_id: user_id) do
25
+ http_get("/#{account_id}/users/#{user_id}").json
26
+ end
27
+ end
28
+
29
+ # update operation
30
+ # @param account_id [String] account id ID
31
+ # @param user_id [String] user id ID
32
+ # @param name [String, nil] name
33
+ # @return [Hash] response data
34
+ def update(account_id:, user_id:, name: nil)
35
+ with_operation(service: "users", operation: "UpdateUser", is_mutation: true, resource_id: user_id) do
36
+ http_patch("/#{account_id}/users/#{user_id}", body: compact_params(name: name)).json
37
+ end
38
+ end
39
+
40
+ # deactivate operation
41
+ # @param account_id [String] account id ID
42
+ # @param user_id [String] user id ID
43
+ # @return [void]
44
+ def deactivate(account_id:, user_id:)
45
+ with_operation(service: "users", operation: "DeactivateUser", is_mutation: true, resource_id: user_id) do
46
+ http_delete("/#{account_id}/users/#{user_id}")
47
+ nil
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end