basecamp-sdk 0.10.0 → 0.12.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 (67) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +106 -10
  3. data/lib/basecamp/client.rb +28 -8
  4. data/lib/basecamp/config.rb +4 -3
  5. data/lib/basecamp/generated/metadata.json +178 -17
  6. data/lib/basecamp/generated/services/account_service.rb +1 -1
  7. data/lib/basecamp/generated/services/automation_service.rb +1 -1
  8. data/lib/basecamp/generated/services/bookmarks_service.rb +49 -0
  9. data/lib/basecamp/generated/services/boosts_service.rb +3 -3
  10. data/lib/basecamp/generated/services/calendars_service.rb +30 -0
  11. data/lib/basecamp/generated/services/campfires_service.rb +7 -7
  12. data/lib/basecamp/generated/services/card_columns_service.rb +1 -1
  13. data/lib/basecamp/generated/services/card_steps_service.rb +1 -1
  14. data/lib/basecamp/generated/services/card_tables_service.rb +1 -1
  15. data/lib/basecamp/generated/services/cards_service.rb +2 -2
  16. data/lib/basecamp/generated/services/checkins_service.rb +8 -8
  17. data/lib/basecamp/generated/services/client_approvals_service.rb +2 -2
  18. data/lib/basecamp/generated/services/client_correspondences_service.rb +2 -2
  19. data/lib/basecamp/generated/services/client_replies_service.rb +2 -2
  20. data/lib/basecamp/generated/services/comments_service.rb +2 -2
  21. data/lib/basecamp/generated/services/documents_service.rb +2 -2
  22. data/lib/basecamp/generated/services/drafts_service.rb +21 -0
  23. data/lib/basecamp/generated/services/events_service.rb +1 -1
  24. data/lib/basecamp/generated/services/everything_service.rb +69 -46
  25. data/lib/basecamp/generated/services/forwards_service.rb +5 -5
  26. data/lib/basecamp/generated/services/gauges_service.rb +3 -3
  27. data/lib/basecamp/generated/services/hill_charts_service.rb +1 -1
  28. data/lib/basecamp/generated/services/message_boards_service.rb +1 -1
  29. data/lib/basecamp/generated/services/message_types_service.rb +2 -2
  30. data/lib/basecamp/generated/services/messages_service.rb +2 -2
  31. data/lib/basecamp/generated/services/my_assignments_service.rb +34 -3
  32. data/lib/basecamp/generated/services/my_notes_service.rb +28 -0
  33. data/lib/basecamp/generated/services/my_notifications_service.rb +2 -2
  34. data/lib/basecamp/generated/services/people_service.rb +8 -8
  35. data/lib/basecamp/generated/services/projects_service.rb +2 -2
  36. data/lib/basecamp/generated/services/recordings_service.rb +2 -2
  37. data/lib/basecamp/generated/services/reports_service.rb +5 -5
  38. data/lib/basecamp/generated/services/schedules_service.rb +4 -4
  39. data/lib/basecamp/generated/services/search_service.rb +2 -2
  40. data/lib/basecamp/generated/services/subscriptions_service.rb +1 -1
  41. data/lib/basecamp/generated/services/templates_service.rb +3 -3
  42. data/lib/basecamp/generated/services/timeline_service.rb +1 -1
  43. data/lib/basecamp/generated/services/timesheets_service.rb +4 -4
  44. data/lib/basecamp/generated/services/todolist_groups_service.rb +1 -1
  45. data/lib/basecamp/generated/services/todolists_service.rb +2 -2
  46. data/lib/basecamp/generated/services/todos_service.rb +19 -2
  47. data/lib/basecamp/generated/services/todosets_service.rb +1 -1
  48. data/lib/basecamp/generated/services/tools_service.rb +1 -1
  49. data/lib/basecamp/generated/services/uploads_service.rb +3 -3
  50. data/lib/basecamp/generated/services/vaults_service.rb +2 -2
  51. data/lib/basecamp/generated/services/webhooks_service.rb +2 -2
  52. data/lib/basecamp/generated/types.rb +313 -34
  53. data/lib/basecamp/http.rb +47 -19
  54. data/lib/basecamp/oauth/device_authorization.rb +37 -0
  55. data/lib/basecamp/oauth/device_flow.rb +873 -0
  56. data/lib/basecamp/oauth/device_flow_error.rb +46 -0
  57. data/lib/basecamp/oauth/discovery.rb +13 -11
  58. data/lib/basecamp/oauth/exchange.rb +44 -5
  59. data/lib/basecamp/oauth/fetcher.rb +626 -56
  60. data/lib/basecamp/oauth/oauth_error.rb +3 -1
  61. data/lib/basecamp/oauth/refresh_request.rb +8 -2
  62. data/lib/basecamp/oauth/resource.rb +13 -10
  63. data/lib/basecamp/oauth/token.rb +10 -3
  64. data/lib/basecamp/oauth.rb +47 -2
  65. data/lib/basecamp/version.rb +2 -2
  66. data/scripts/generate-services.rb +10 -7
  67. metadata +9 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06b1a1a19b501f386b63739724bb50b0f1d778660d2765f04d2c6a0d2214ef14
4
- data.tar.gz: 3c2b5c8409d5a334eabb01b668e430510ad79b93cefc5ead3c5475f4b8f5d661
3
+ metadata.gz: 99e64617bcf9bcf031f03ea1ae0311f37f46c5da4ac4fba9caeca9a768e44a22
4
+ data.tar.gz: 83dd4b5a6d15ffc7909121dc742e2ccbaf9d1159d2b743a8482bb5a1cd17241f
5
5
  SHA512:
6
- metadata.gz: 0d9134c7b9996490c035fccc0c949acd1c05faff5c52b40aa5f30ab913456c10701a8742b74df33aea35539d197dd8c4932df3a1305d73db3efe2ac3de7bfa34
7
- data.tar.gz: 3a4c47cb7196bd642f1c0863d25ff02fcf8ec607e102a6ce16cafe54aa5a74ef6290561c1897e365ff848e77911bdf8d7b3d31d85395adc4ba0b0753ba21d641
6
+ metadata.gz: 1e5ce39f93f07dad1c1b79b2da9ac39db5ac70e8871eba73af86a92eb986d56f5b4002af55c40eb16a8f4bed14d2407ead7c1be3b5c817664dcf5033397db7eb
7
+ data.tar.gz: 5263d6241a9de95303c8a546efe7f412db59def57207a0e0f8c22c45ab06d0b40b4d2c05e7b4d7ab05e02d7cb451246a5ccb5c4992afb52127541b464dbeeb3e
data/README.md CHANGED
@@ -42,7 +42,6 @@ project = account.projects.get(project_id: 12345)
42
42
 
43
43
  # Create a todo
44
44
  todo = account.todos.create(
45
- project_id: 12345,
46
45
  todolist_id: 67890,
47
46
  content: "Review PR",
48
47
  due_on: "2024-12-31"
@@ -57,7 +56,7 @@ todo = account.todos.create(
57
56
  config = Basecamp::Config.new(
58
57
  base_url: "https://3.basecampapi.com", # Default
59
58
  timeout: 30, # Request timeout in seconds
60
- max_retries: 3, # Max retry attempts for GET requests
59
+ max_retries: 3, # Total request attempts for GET requests (including the initial request)
61
60
  base_delay: 1.0, # Base delay for exponential backoff
62
61
  max_pages: 10_000 # Max pages for pagination
63
62
  )
@@ -72,7 +71,7 @@ client = Basecamp::Client.new(config: config, token_provider: token_provider)
72
71
  |--------|---------|-------------|
73
72
  | `base_url` | `https://3.basecampapi.com` | Basecamp API base URL |
74
73
  | `timeout` | `30` | HTTP request timeout (seconds) |
75
- | `max_retries` | `3` | Maximum retry attempts for GET requests |
74
+ | `max_retries` | `3` | Total request attempts for GET requests (including the initial request) |
76
75
  | `base_delay` | `1.0` | Base delay for exponential backoff (seconds) |
77
76
  | `max_jitter` | `0.1` | Maximum random jitter added to delays |
78
77
  | `max_pages` | `10_000` | Maximum pages to fetch during pagination |
@@ -133,6 +132,99 @@ if token.expired?
133
132
  end
134
133
  ```
135
134
 
135
+ ### Device Authorization Grant (RFC 8628)
136
+
137
+ For input-constrained clients (CLIs, TVs) that can't host a redirect URI, the
138
+ device flow trades a redirect for a user-entered code. Basecamp pre-registers the
139
+ public `basecamp-cli` client (`token_endpoint_auth_method: none`, no secret); an
140
+ omitted scope defaults to `read` — prefer pinning it explicitly with
141
+ `scope: "read"`. Pass bare origins everywhere (no trailing slash): binding is
142
+ code-point exact — a trailing-slash `expected_issuer` raises a **hard**
143
+ `expected_issuer_unavailable`, while a trailing-slash resource origin breaks
144
+ the hop-1 binding and silently soft-falls back to Launchpad.
145
+
146
+ ```ruby
147
+ # The device grant runs against an ALREADY-SELECTED config whose issuer advertises
148
+ # a device_authorization_endpoint. Resolve one with resource-first discovery —
149
+ # NOT discover_launchpad: Launchpad advertises no device endpoint, so the
150
+ # capability guard would reject it.
151
+ result = Basecamp::Oauth.discover_from_resource("https://3.basecampapi.com")
152
+ raise "device login is not available for this resource" unless result.selected?
153
+ config = result.config
154
+
155
+ # One call runs the whole grant against the SELECTED config: it guards
156
+ # capability, requests a device/user code, shows it via the display hook, then
157
+ # polls the token endpoint until the user approves.
158
+ token = Basecamp::Oauth.perform_device_login(
159
+ config: config,
160
+ client_id: "basecamp-cli",
161
+ display: ->(auth) do
162
+ puts "Visit #{auth.verification_uri} and enter code: #{auth.user_code}"
163
+ puts "Or open: #{auth.verification_uri_complete}" if auth.verification_uri_complete
164
+ end
165
+ )
166
+
167
+ client = Basecamp.client(access_token: token.access_token)
168
+
169
+ # BC5 device logins as basecamp-cli mint MULTI-ACCOUNT refresh tokens: the
170
+ # token carries an RFC 8707 resource indicator (token.resource,
171
+ # "urn:bc:account:<id>"), and refreshing without echoing it is rejected
172
+ # (400 invalid_request). Persist token.resource alongside the tokens and
173
+ # echo it on refresh:
174
+ # A device-token response MAY omit refresh_token — guard it: without one,
175
+ # refreshing is impossible and the user must re-run the device login.
176
+ if token.expired? && token.refresh_token
177
+ fresh = Basecamp::Oauth.refresh_token(
178
+ token_endpoint: config.token_endpoint,
179
+ refresh_token: token.refresh_token,
180
+ client_id: "basecamp-cli", # public client — no secret
181
+ resource: token.resource
182
+ )
183
+ # A refresh response MAY omit resource (the binding is unchanged) — persist
184
+ # `fresh.resource || token.resource` so the next refresh still echoes it.
185
+ end
186
+ ```
187
+
188
+ The capability guard requires BOTH `config.device_authorization_endpoint` AND the
189
+ exact grant-type URN `urn:ietf:params:oauth:grant-type:device_code` in
190
+ `config.grant_types_supported` — servers advertise the full URN, so checking for
191
+ a bare `device_code` entry would wrongly conclude the flow is unavailable;
192
+ otherwise it raises
193
+ `Basecamp::Oauth::DeviceFlowError` with `reason: :unavailable` before any request
194
+ is issued. The two lower-level steps are also exposed directly:
195
+
196
+ ```ruby
197
+ auth = Basecamp::Oauth.request_device_authorization(
198
+ device_authorization_endpoint: config.device_authorization_endpoint,
199
+ client_id: "basecamp-cli"
200
+ )
201
+
202
+ token = Basecamp::Oauth.poll_device_token(
203
+ token_endpoint: config.token_endpoint,
204
+ client_id: "basecamp-cli",
205
+ device_code: auth.device_code,
206
+ interval: auth.interval,
207
+ expires_in: auth.expires_in
208
+ )
209
+ ```
210
+
211
+ The polling loop waits at least `interval` seconds between polls against a
212
+ **monotonic** deadline, sustains a `slow_down` bump (+5s for every later poll),
213
+ and backs off exponentially on connection timeouts. A terminal outcome raises
214
+ `DeviceFlowError` carrying a `reason` whose parent `type` is derived from it:
215
+
216
+ | `reason` | `type` | Meaning |
217
+ |---|---|---|
218
+ | `:access_denied` | `auth` | The user declined the request |
219
+ | `:expired` | `auth` | The code expired before approval |
220
+ | `:transport` | `network` (retryable) | A network failure ended the flow |
221
+ | `:unavailable` | `validation` | The config can't do device flow |
222
+ | `:cancelled` | `usage` | The caller cancelled the flow |
223
+
224
+ `poll_device_token` and `perform_device_login` accept injectable `clock`,
225
+ `sleeper`, and `cancelled` callables — pass a `cancelled` probe (e.g. one that
226
+ checks a signal set by SIGINT) to abort a pending login cleanly.
227
+
136
228
  ### Resource-First Discovery (RFC 9728 + RFC 8414)
137
229
 
138
230
  BC5's Authorization Server (AS) metadata lives only at the canonical issuer (the
@@ -179,7 +271,7 @@ aborts before an oversized body is buffered.
179
271
 
180
272
  ## Services
181
273
 
182
- The SDK provides 45 account-scoped services. The table below covers the common ones; see `lib/basecamp/generated/services/` for the authoritative, complete set:
274
+ The SDK provides 46 account-scoped services. The table below covers the common ones; see `lib/basecamp/generated/services/` for the authoritative, complete set:
183
275
 
184
276
  | Service | Description |
185
277
  |---------|-------------|
@@ -260,13 +352,15 @@ result = account.download_url(url)
260
352
 
261
353
  ## Retry Behavior
262
354
 
263
- GET requests automatically retry on transient failures with exponential backoff:
264
-
265
- - **Retryable errors**: 429 (rate limit), 502, 503, 504 (gateway errors)
266
- - **Backoff**: Exponential with jitter (1s, 2s, 4s...)
267
- - **Rate limits**: Respects `Retry-After` header
355
+ Only plain GET requests retry — automatically, with exponential backoff. Mutation operations (POST, PUT, DELETE) do **not** retry to prevent data duplication, and the raw upload and download paths skip the retry loop entirely (the upload path is strictly one request; the download hop keeps only the one-shot 401 replay below).
268
356
 
269
- Mutation operations (POST, PUT, DELETE) do **not** retry to prevent data duplication.
357
+ - **Which errors**: Retry keys off the error's `retryable?` classification, not a declared status list — 429 (rate limit), 500, 502, 503, 504, and any other 5xx all retry, as does `NetworkError` (connection failures, including DNS and connect-phase timeouts). Read timeouts are the exception: Faraday surfaces them as a status-less `ApiError` with `retryable? == false`, so a GET that times out mid-response fails on the first attempt. 400, 401, 403, 404, and 422 never retry.
358
+ - **`max_retries`**: Total request attempts for GET requests, including the initial request — the default `3` means one initial attempt plus two retries. **`max_retries: 0` sends zero requests** and raises `Basecamp::ApiError` (`"Request failed after 0 attempts"`).
359
+ - **Backoff**: Exponential with jitter — `base_delay * 2^(attempt - 1) + rand * max_jitter` — uncapped, bounded in practice by the attempt budget.
360
+ - **Rate limits**: A 429's `Retry-After` header overrides the calculated backoff. Only 429 carries it: 5xx and network errors always use the exponential backoff.
361
+ - **401 responses**: With a refresh-capable token provider, the SDK refreshes the token and replays the request **once** — for all methods, including mutations — outside the `max_retries` budget. A second 401 is surfaced. The raw upload path has no 401 replay.
362
+ - **Per-operation metadata**: The retry policy operations declare (`retry_on` statuses, per-operation `max`) is inert in Ruby — every API GET issued through the client, including the Launchpad authorization fetch, rides the same classification-based loop bounded by `config.max_retries` alone. (The download flow's redirect hop and OAuth discovery use their own single-attempt transports.)
363
+ - **`retryable?`**: Unlike SDKs where the error classification is only a hint for your own code, in Ruby an error's `retryable?` (and `retry_after`) is exactly what the transport acts on for GET requests.
270
364
 
271
365
  ## Error Handling
272
366
 
@@ -335,6 +429,8 @@ client = Basecamp::Client.new(
335
429
  | `BASECAMP_TOKEN` | OAuth access token |
336
430
  | `BASECAMP_ACCOUNT_ID` | Account ID |
337
431
  | `BASECAMP_BASE_URL` | API base URL (default: `https://3.basecampapi.com`) |
432
+ | `BASECAMP_TIMEOUT` | Request timeout in seconds (default: `30`) |
433
+ | `BASECAMP_MAX_RETRIES` | Total request attempts for GET requests, including the initial request (default: `3`) |
338
434
 
339
435
  ## Development
340
436
 
@@ -152,8 +152,8 @@ module Basecamp
152
152
  # @param path [String] URL path (without account prefix)
153
153
  # @param params [Hash] query parameters
154
154
  # @return [Response]
155
- def get(path, params: {})
156
- @parent.http.get(account_path(path), params: params)
155
+ def get(path, params: {}, operation: nil)
156
+ @parent.http.get(account_path(path), params: params, operation: operation)
157
157
  end
158
158
 
159
159
  # Performs a POST request scoped to this account.
@@ -204,8 +204,8 @@ module Basecamp
204
204
  # @param params [Hash] query parameters
205
205
  # @yield [Hash] each item from the response
206
206
  # @return [Enumerator] if no block given
207
- def paginate(path, params: {}, &)
208
- @parent.http.paginate(account_path(path), params: params, &)
207
+ def paginate(path, params: {}, operation: nil, &)
208
+ @parent.http.paginate(account_path(path), params: params, operation: operation, &)
209
209
  end
210
210
 
211
211
  # Fetches all pages of a paginated resource, extracting items from a key.
@@ -215,8 +215,8 @@ module Basecamp
215
215
  # @param params [Hash] query parameters
216
216
  # @yield [Hash] each item from the response
217
217
  # @return [Enumerator] if no block given
218
- def paginate_key(path, key:, params: {}, &)
219
- @parent.http.paginate_key(account_path(path), key: key, params: params, &)
218
+ def paginate_key(path, key:, params: {}, operation: nil, &)
219
+ @parent.http.paginate_key(account_path(path), key: key, params: params, operation: operation, &)
220
220
  end
221
221
 
222
222
  # Fetches a wrapped paginated resource, returning wrapper fields + lazy paginated items.
@@ -224,8 +224,8 @@ module Basecamp
224
224
  # @param key [String] the key containing the array of paginated items
225
225
  # @param params [Hash] query parameters
226
226
  # @return [Hash] wrapper fields merged with key => Enumerator of all items
227
- def paginate_wrapped(path, key:, params: {})
228
- @parent.http.paginate_wrapped(account_path(path), key: key, params: params)
227
+ def paginate_wrapped(path, key:, params: {}, operation: nil)
228
+ @parent.http.paginate_wrapped(account_path(path), key: key, params: params, operation: operation)
229
229
  end
230
230
 
231
231
  # Downloads file content from any API-routable download URL.
@@ -481,6 +481,26 @@ module Basecamp
481
481
  service(:tools) { Services::ToolsService.new(self) }
482
482
  end
483
483
 
484
+ # @return [Services::BookmarksService]
485
+ def bookmarks
486
+ service(:bookmarks) { Services::BookmarksService.new(self) }
487
+ end
488
+
489
+ # @return [Services::DraftsService]
490
+ def drafts
491
+ service(:drafts) { Services::DraftsService.new(self) }
492
+ end
493
+
494
+ # @return [Services::CalendarsService]
495
+ def calendars
496
+ service(:calendars) { Services::CalendarsService.new(self) }
497
+ end
498
+
499
+ # @return [Services::MyNotesService]
500
+ def my_notes
501
+ service(:my_notes) { Services::MyNotesService.new(self) }
502
+ end
503
+
484
504
  # @return [Services::SubscriptionsService]
485
505
  def subscriptions
486
506
  service(:subscriptions) { Services::SubscriptionsService.new(self) }
@@ -24,7 +24,8 @@ module Basecamp
24
24
  # @return [Integer] request timeout in seconds
25
25
  attr_accessor :timeout
26
26
 
27
- # @return [Integer] maximum retry attempts for GET requests
27
+ # @return [Integer] total request attempts for GET requests, including the
28
+ # initial request (0 sends no requests at all and raises)
28
29
  attr_accessor :max_retries
29
30
 
30
31
  # @return [Float] initial backoff delay in seconds
@@ -48,7 +49,7 @@ module Basecamp
48
49
  #
49
50
  # @param base_url [String] API base URL
50
51
  # @param timeout [Integer] request timeout in seconds
51
- # @param max_retries [Integer] maximum retry attempts
52
+ # @param max_retries [Integer] total request attempts for GET requests, including the initial request
52
53
  # @param base_delay [Float] initial backoff delay
53
54
  # @param max_jitter [Float] maximum jitter
54
55
  # @param max_pages [Integer] maximum pages to fetch
@@ -78,7 +79,7 @@ module Basecamp
78
79
  # Environment variables:
79
80
  # - BASECAMP_BASE_URL: API base URL
80
81
  # - BASECAMP_TIMEOUT: Request timeout in seconds
81
- # - BASECAMP_MAX_RETRIES: Maximum retry attempts
82
+ # - BASECAMP_MAX_RETRIES: Total request attempts for GET requests, including the initial request
82
83
  #
83
84
  # @return [Config]
84
85
  def self.from_env
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://basecamp.com/schemas/sdk-metadata.json",
3
3
  "version": "1.0.0",
4
- "generated": "2026-07-28T21:34:14Z",
4
+ "generated": "2026-07-31T15:59:31Z",
5
5
  "operations": {
6
6
  "GetAccount": {
7
7
  "retry": {
@@ -67,22 +67,6 @@
67
67
  ]
68
68
  }
69
69
  },
70
- "GetEverythingBoosts": {
71
- "retry": {
72
- "maxAttempts": 3,
73
- "baseDelayMs": 1000,
74
- "backoff": "exponential",
75
- "retryOn": [
76
- 429,
77
- 503
78
- ]
79
- },
80
- "pagination": {
81
- "style": "link",
82
- "totalCountHeader": "X-Total-Count",
83
- "maxPageSize": 50
84
- }
85
- },
86
70
  "GetBoost": {
87
71
  "retry": {
88
72
  "maxAttempts": 3,
@@ -131,6 +115,9 @@
131
115
  429,
132
116
  503
133
117
  ]
118
+ },
119
+ "idempotent": {
120
+ "natural": true
134
121
  }
135
122
  },
136
123
  "DisableCardColumnOnHold": {
@@ -263,6 +250,17 @@
263
250
  ]
264
251
  }
265
252
  },
253
+ "CreateTodosetTodo": {
254
+ "retry": {
255
+ "maxAttempts": 3,
256
+ "baseDelayMs": 1000,
257
+ "backoff": "exponential",
258
+ "retryOn": [
259
+ 429,
260
+ 503
261
+ ]
262
+ }
263
+ },
266
264
  "ListWebhooks": {
267
265
  "retry": {
268
266
  "maxAttempts": 3,
@@ -290,6 +288,31 @@
290
288
  ]
291
289
  }
292
290
  },
291
+ "GetCalendar": {
292
+ "retry": {
293
+ "maxAttempts": 3,
294
+ "baseDelayMs": 1000,
295
+ "backoff": "exponential",
296
+ "retryOn": [
297
+ 429,
298
+ 503
299
+ ]
300
+ }
301
+ },
302
+ "UpdateCalendar": {
303
+ "retry": {
304
+ "maxAttempts": 3,
305
+ "baseDelayMs": 1000,
306
+ "backoff": "exponential",
307
+ "retryOn": [
308
+ 429,
309
+ 503
310
+ ]
311
+ },
312
+ "idempotent": {
313
+ "natural": true
314
+ }
315
+ },
293
316
  "GetCard": {
294
317
  "retry": {
295
318
  "maxAttempts": 3,
@@ -1304,6 +1327,63 @@
1304
1327
  ]
1305
1328
  }
1306
1329
  },
1330
+ "ListMyBookmarks": {
1331
+ "retry": {
1332
+ "maxAttempts": 3,
1333
+ "baseDelayMs": 1000,
1334
+ "backoff": "exponential",
1335
+ "retryOn": [
1336
+ 429,
1337
+ 503
1338
+ ]
1339
+ },
1340
+ "pagination": {
1341
+ "style": "link",
1342
+ "totalCountHeader": "X-Total-Count",
1343
+ "maxPageSize": 50
1344
+ }
1345
+ },
1346
+ "ListMyDrafts": {
1347
+ "retry": {
1348
+ "maxAttempts": 3,
1349
+ "baseDelayMs": 1000,
1350
+ "backoff": "exponential",
1351
+ "retryOn": [
1352
+ 429,
1353
+ 503
1354
+ ]
1355
+ },
1356
+ "pagination": {
1357
+ "style": "link",
1358
+ "totalCountHeader": "X-Total-Count",
1359
+ "maxPageSize": 50
1360
+ }
1361
+ },
1362
+ "GetMyNote": {
1363
+ "retry": {
1364
+ "maxAttempts": 3,
1365
+ "baseDelayMs": 1000,
1366
+ "backoff": "exponential",
1367
+ "retryOn": [
1368
+ 429,
1369
+ 503
1370
+ ]
1371
+ }
1372
+ },
1373
+ "UpdateMyNote": {
1374
+ "retry": {
1375
+ "maxAttempts": 3,
1376
+ "baseDelayMs": 1000,
1377
+ "backoff": "exponential",
1378
+ "retryOn": [
1379
+ 429,
1380
+ 503
1381
+ ]
1382
+ },
1383
+ "idempotent": {
1384
+ "natural": true
1385
+ }
1386
+ },
1307
1387
  "GetMyPreferences": {
1308
1388
  "retry": {
1309
1389
  "maxAttempts": 3,
@@ -1329,6 +1409,45 @@
1329
1409
  "natural": true
1330
1410
  }
1331
1411
  },
1412
+ "PrioritizeAssignment": {
1413
+ "retry": {
1414
+ "maxAttempts": 3,
1415
+ "baseDelayMs": 1000,
1416
+ "backoff": "exponential",
1417
+ "retryOn": [
1418
+ 429,
1419
+ 503
1420
+ ]
1421
+ },
1422
+ "idempotent": {
1423
+ "natural": true
1424
+ }
1425
+ },
1426
+ "DeprioritizeAssignment": {
1427
+ "retry": {
1428
+ "maxAttempts": 3,
1429
+ "baseDelayMs": 1000,
1430
+ "backoff": "exponential",
1431
+ "retryOn": [
1432
+ 429,
1433
+ 503
1434
+ ]
1435
+ },
1436
+ "idempotent": {
1437
+ "natural": true
1438
+ }
1439
+ },
1440
+ "ReorderUpNext": {
1441
+ "retry": {
1442
+ "maxAttempts": 3,
1443
+ "baseDelayMs": 1000,
1444
+ "backoff": "exponential",
1445
+ "retryOn": [
1446
+ 429,
1447
+ 503
1448
+ ]
1449
+ }
1450
+ },
1332
1451
  "GetMyProfile": {
1333
1452
  "retry": {
1334
1453
  "maxAttempts": 3,
@@ -1881,6 +2000,45 @@
1881
2000
  ]
1882
2001
  }
1883
2002
  },
2003
+ "GetBookmark": {
2004
+ "retry": {
2005
+ "maxAttempts": 3,
2006
+ "baseDelayMs": 1000,
2007
+ "backoff": "exponential",
2008
+ "retryOn": [
2009
+ 429,
2010
+ 503
2011
+ ]
2012
+ }
2013
+ },
2014
+ "CreateBookmark": {
2015
+ "retry": {
2016
+ "maxAttempts": 3,
2017
+ "baseDelayMs": 1000,
2018
+ "backoff": "exponential",
2019
+ "retryOn": [
2020
+ 429,
2021
+ 503
2022
+ ]
2023
+ },
2024
+ "idempotent": {
2025
+ "natural": true
2026
+ }
2027
+ },
2028
+ "DeleteBookmark": {
2029
+ "retry": {
2030
+ "maxAttempts": 3,
2031
+ "baseDelayMs": 1000,
2032
+ "backoff": "exponential",
2033
+ "retryOn": [
2034
+ 429,
2035
+ 503
2036
+ ]
2037
+ },
2038
+ "idempotent": {
2039
+ "natural": true
2040
+ }
2041
+ },
1884
2042
  "ListRecordingBoosts": {
1885
2043
  "retry": {
1886
2044
  "maxAttempts": 3,
@@ -2054,6 +2212,9 @@
2054
2212
  429,
2055
2213
  503
2056
2214
  ]
2215
+ },
2216
+ "idempotent": {
2217
+ "natural": true
2057
2218
  }
2058
2219
  },
2059
2220
  "UpdateSubscription": {
@@ -11,7 +11,7 @@ module Basecamp
11
11
  # @return [Hash] response data
12
12
  def get_account()
13
13
  with_operation(service: "account", operation: "get_account", is_mutation: false) do
14
- http_get("/account.json").json
14
+ http_get("/account.json", operation: "GetAccount").json
15
15
  end
16
16
  end
17
17
 
@@ -11,7 +11,7 @@ module Basecamp
11
11
  # @return [Array<Hash>] response data
12
12
  def list_lineup_markers()
13
13
  with_operation(service: "automation", operation: "list_lineup_markers", is_mutation: false) do
14
- http_get("/lineup/markers.json").json
14
+ http_get("/lineup/markers.json", operation: "ListLineupMarkers").json
15
15
  end
16
16
  end
17
17
  end
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Basecamp
4
+ module Services
5
+ # Service for Bookmarks operations
6
+ #
7
+ # @generated from OpenAPI spec
8
+ class BookmarksService < BaseService
9
+
10
+ # List the current user's bookmarks, most recently bookmarked first (paginated).
11
+ # @param page [Integer, nil] Page number for paginating through results. Defaults to 1.
12
+ # @return [Enumerator<Hash>] paginated results
13
+ def list_my_bookmarks(page: nil)
14
+ wrap_paginated(service: "bookmarks", operation: "list_my_bookmarks", is_mutation: false) do
15
+ params = compact_query_params(page: page)
16
+ paginate("/my/bookmarks.json", params: params, operation: "ListMyBookmarks")
17
+ end
18
+ end
19
+
20
+ # Report whether the current user has bookmarked the recording.
21
+ # @param recording_id [Integer] recording id ID
22
+ # @return [Hash] response data
23
+ def get_bookmark(recording_id:)
24
+ with_operation(service: "bookmarks", operation: "get_bookmark", is_mutation: false, resource_id: recording_id) do
25
+ http_get("/recordings/#{recording_id}/bookmark.json", operation: "GetBookmark").json
26
+ end
27
+ end
28
+
29
+ # Bookmark a recording for the current user.
30
+ # @param recording_id [Integer] recording id ID
31
+ # @return [Hash] response data
32
+ def create_bookmark(recording_id:)
33
+ with_operation(service: "bookmarks", operation: "create_bookmark", is_mutation: true, resource_id: recording_id) do
34
+ http_post("/recordings/#{recording_id}/bookmark.json").json
35
+ end
36
+ end
37
+
38
+ # Remove the current user's bookmark from a recording (returns 204 No Content).
39
+ # @param recording_id [Integer] recording id ID
40
+ # @return [void]
41
+ def delete_bookmark(recording_id:)
42
+ with_operation(service: "bookmarks", operation: "delete_bookmark", is_mutation: true, resource_id: recording_id) do
43
+ http_delete("/recordings/#{recording_id}/bookmark.json")
44
+ nil
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
@@ -12,7 +12,7 @@ module Basecamp
12
12
  # @return [Hash] response data
13
13
  def get_boost(boost_id:)
14
14
  with_operation(service: "boosts", operation: "get_boost", is_mutation: false, resource_id: boost_id) do
15
- http_get("/boosts/#{boost_id}").json
15
+ http_get("/boosts/#{boost_id}", operation: "GetBoost").json
16
16
  end
17
17
  end
18
18
 
@@ -31,7 +31,7 @@ module Basecamp
31
31
  # @return [Enumerator<Hash>] paginated results
32
32
  def list_recording_boosts(recording_id:)
33
33
  wrap_paginated(service: "boosts", operation: "list_recording_boosts", is_mutation: false, resource_id: recording_id) do
34
- paginate("/recordings/#{recording_id}/boosts.json")
34
+ paginate("/recordings/#{recording_id}/boosts.json", operation: "ListRecordingBoosts")
35
35
  end
36
36
  end
37
37
 
@@ -51,7 +51,7 @@ module Basecamp
51
51
  # @return [Enumerator<Hash>] paginated results
52
52
  def list_event_boosts(recording_id:, event_id:)
53
53
  wrap_paginated(service: "boosts", operation: "list_event_boosts", is_mutation: false, resource_id: event_id) do
54
- paginate("/recordings/#{recording_id}/events/#{event_id}/boosts.json")
54
+ paginate("/recordings/#{recording_id}/events/#{event_id}/boosts.json", operation: "ListEventBoosts")
55
55
  end
56
56
  end
57
57
 
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Basecamp
4
+ module Services
5
+ # Service for Calendars operations
6
+ #
7
+ # @generated from OpenAPI spec
8
+ class CalendarsService < BaseService
9
+
10
+ # Get a calendar by its bucket id. A Calendar is a top-level BC5 bucketable
11
+ # @param calendar_id [Integer] calendar id ID
12
+ # @return [Hash] response data
13
+ def get_calendar(calendar_id:)
14
+ with_operation(service: "calendars", operation: "get_calendar", is_mutation: false, resource_id: calendar_id) do
15
+ http_get("/calendars/#{calendar_id}", operation: "GetCalendar").json
16
+ end
17
+ end
18
+
19
+ # Update a calendar's display color. An unknown color returns 422 with a JSON
20
+ # @param calendar_id [Integer] calendar id ID
21
+ # @param calendar [Hash] calendar
22
+ # @return [Hash] response data
23
+ def update_calendar(calendar_id:, calendar:)
24
+ with_operation(service: "calendars", operation: "update_calendar", is_mutation: true, resource_id: calendar_id) do
25
+ http_put("/calendars/#{calendar_id}", body: compact_params(calendar: calendar)).json
26
+ end
27
+ end
28
+ end
29
+ end
30
+ end