basecamp-sdk 0.8.0 → 0.10.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 (42) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -1
  3. data/lib/basecamp/client.rb +10 -0
  4. data/lib/basecamp/generated/metadata.json +343 -12
  5. data/lib/basecamp/generated/services/automation_service.rb +1 -1
  6. data/lib/basecamp/generated/services/base_service.rb +13 -0
  7. data/lib/basecamp/generated/services/campfires_service.rb +2 -2
  8. data/lib/basecamp/generated/services/card_columns_service.rb +3 -3
  9. data/lib/basecamp/generated/services/cards_service.rb +2 -2
  10. data/lib/basecamp/generated/services/checkins_service.rb +5 -4
  11. data/lib/basecamp/generated/services/client_approvals_service.rb +1 -1
  12. data/lib/basecamp/generated/services/client_correspondences_service.rb +1 -1
  13. data/lib/basecamp/generated/services/documents_service.rb +3 -2
  14. data/lib/basecamp/generated/services/everything_service.rb +179 -0
  15. data/lib/basecamp/generated/services/forwards_service.rb +1 -1
  16. data/lib/basecamp/generated/services/gauges_service.rb +4 -4
  17. data/lib/basecamp/generated/services/message_types_service.rb +20 -15
  18. data/lib/basecamp/generated/services/messages_service.rb +4 -3
  19. data/lib/basecamp/generated/services/my_assignments_service.rb +3 -3
  20. data/lib/basecamp/generated/services/my_notifications_service.rb +16 -2
  21. data/lib/basecamp/generated/services/people_service.rb +3 -3
  22. data/lib/basecamp/generated/services/projects_service.rb +2 -2
  23. data/lib/basecamp/generated/services/recordings_service.rb +2 -2
  24. data/lib/basecamp/generated/services/reports_service.rb +2 -2
  25. data/lib/basecamp/generated/services/schedules_service.rb +14 -5
  26. data/lib/basecamp/generated/services/search_service.rb +14 -3
  27. data/lib/basecamp/generated/services/templates_service.rb +4 -5
  28. data/lib/basecamp/generated/services/timesheets_service.rb +4 -4
  29. data/lib/basecamp/generated/services/todolists_service.rb +15 -3
  30. data/lib/basecamp/generated/services/todos_service.rb +1 -1
  31. data/lib/basecamp/generated/services/tools_service.rb +4 -3
  32. data/lib/basecamp/generated/services/uploads_service.rb +3 -2
  33. data/lib/basecamp/generated/services/webhooks_service.rb +2 -2
  34. data/lib/basecamp/generated/services/wormholes_service.rb +44 -0
  35. data/lib/basecamp/generated/types.rb +656 -71
  36. data/lib/basecamp/http.rb +2 -1
  37. data/lib/basecamp/services/cards_extensions.rb +67 -0
  38. data/lib/basecamp/version.rb +2 -2
  39. data/lib/basecamp.rb +5 -0
  40. data/scripts/generate-services.rb +39 -10
  41. data/scripts/generate-types.rb +60 -1
  42. metadata +5 -2
@@ -0,0 +1,179 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Basecamp
4
+ module Services
5
+ # Service for Everything operations
6
+ #
7
+ # @generated from OpenAPI spec
8
+ class EverythingService < BaseService
9
+
10
+ # Get every boost across all accessible projects, newest-first (paginated).
11
+ # @param page [Integer, nil] Page number for paginating through results. Defaults to 1.
12
+ # @return [Enumerator<Hash>] paginated results
13
+ def get_everything_boosts(page: nil)
14
+ wrap_paginated(service: "everything", operation: "get_everything_boosts", is_mutation: false) do
15
+ params = compact_query_params(page: page)
16
+ paginate("/boosts.json", params: params)
17
+ end
18
+ end
19
+
20
+ # Completed cards across all accessible projects, grouped by project (paginated).
21
+ # @param page [Integer, nil] Page number for paginating through results. Defaults to 1.
22
+ # @return [Enumerator<Hash>] paginated results
23
+ def get_everything_completed_cards(page: nil)
24
+ wrap_paginated(service: "everything", operation: "get_everything_completed_cards", is_mutation: false) do
25
+ params = compact_query_params(page: page)
26
+ paginate("/cards/completed.json", params: params)
27
+ end
28
+ end
29
+
30
+ # Open cards with no due date across all accessible projects, grouped by project (paginated).
31
+ # @param page [Integer, nil] Page number for paginating through results. Defaults to 1.
32
+ # @return [Enumerator<Hash>] paginated results
33
+ def get_everything_no_due_date_cards(page: nil)
34
+ wrap_paginated(service: "everything", operation: "get_everything_no_due_date_cards", is_mutation: false) do
35
+ params = compact_query_params(page: page)
36
+ paginate("/cards/no_due_date.json", params: params)
37
+ end
38
+ end
39
+
40
+ # Cards parked in a project's "Not now" column across all accessible projects, grouped by project (paginated).
41
+ # @param page [Integer, nil] Page number for paginating through results. Defaults to 1.
42
+ # @return [Enumerator<Hash>] paginated results
43
+ def get_everything_not_now_cards(page: nil)
44
+ wrap_paginated(service: "everything", operation: "get_everything_not_now_cards", is_mutation: false) do
45
+ params = compact_query_params(page: page)
46
+ paginate("/cards/not_now.json", params: params)
47
+ end
48
+ end
49
+
50
+ # Incomplete cards in active columns across all accessible projects, grouped by project (paginated).
51
+ # @param page [Integer, nil] Page number for paginating through results. Defaults to 1.
52
+ # @return [Enumerator<Hash>] paginated results
53
+ def get_everything_open_cards(page: nil)
54
+ wrap_paginated(service: "everything", operation: "get_everything_open_cards", is_mutation: false) do
55
+ params = compact_query_params(page: page)
56
+ paginate("/cards/open.json", params: params)
57
+ end
58
+ end
59
+
60
+ # Get every overdue card across all accessible projects, oldest-due-date-first.
61
+ # @return [Array<Hash>] response data
62
+ def get_everything_overdue_cards()
63
+ with_operation(service: "everything", operation: "get_everything_overdue_cards", is_mutation: false) do
64
+ http_get("/cards/overdue.json").json
65
+ end
66
+ end
67
+
68
+ # Open, unassigned cards across all accessible projects, grouped by project (paginated).
69
+ # @param page [Integer, nil] Page number for paginating through results. Defaults to 1.
70
+ # @return [Enumerator<Hash>] paginated results
71
+ def get_everything_unassigned_cards(page: nil)
72
+ wrap_paginated(service: "everything", operation: "get_everything_unassigned_cards", is_mutation: false) do
73
+ params = compact_query_params(page: page)
74
+ paginate("/cards/unassigned.json", params: params)
75
+ end
76
+ end
77
+
78
+ # Get every automatic check-in answer across all accessible projects, newest-first.
79
+ # @param page [Integer, nil] Page number for paginating through results. Defaults to 1.
80
+ # @return [Enumerator<Hash>] paginated results
81
+ def get_everything_checkins(page: nil)
82
+ wrap_paginated(service: "everything", operation: "get_everything_checkins", is_mutation: false) do
83
+ params = compact_query_params(page: page)
84
+ paginate("/checkins.json", params: params)
85
+ end
86
+ end
87
+
88
+ # Get every comment across all accessible projects, newest-first (paginated).
89
+ # @param page [Integer, nil] Page number for paginating through results. Defaults to 1.
90
+ # @return [Enumerator<Hash>] paginated results
91
+ def get_everything_comments(page: nil)
92
+ wrap_paginated(service: "everything", operation: "get_everything_comments", is_mutation: false) do
93
+ params = compact_query_params(page: page)
94
+ paginate("/comments.json", params: params)
95
+ end
96
+ end
97
+
98
+ # Get every file recording across all accessible projects, newest-first (paginated).
99
+ # @param kind [String, nil] Filter by file kind: all (default), images, pdfs, documents, or videos.
100
+ # @param people_ids [Array, nil] Restrict to files created by the given people (repeatable).
101
+ # @param page [Integer, nil] Page number for paginating through results. Defaults to 1.
102
+ # @return [Enumerator<Hash>] paginated results
103
+ def get_everything_files(kind: nil, people_ids: nil, page: nil)
104
+ wrap_paginated(service: "everything", operation: "get_everything_files", is_mutation: false) do
105
+ params = compact_query_params(kind: kind, people_ids: people_ids, page: page)
106
+ paginate("/files.json", params: params)
107
+ end
108
+ end
109
+
110
+ # Get every inbox forward across all accessible projects, newest-first (paginated).
111
+ # @param page [Integer, nil] Page number for paginating through results. Defaults to 1.
112
+ # @return [Enumerator<Hash>] paginated results
113
+ def get_everything_forwards(page: nil)
114
+ wrap_paginated(service: "everything", operation: "get_everything_forwards", is_mutation: false) do
115
+ params = compact_query_params(page: page)
116
+ paginate("/forwards.json", params: params)
117
+ end
118
+ end
119
+
120
+ # Get every message across all accessible projects, newest-first (paginated).
121
+ # @param page [Integer, nil] Page number for paginating through results. Defaults to 1.
122
+ # @return [Enumerator<Hash>] paginated results
123
+ def get_everything_messages(page: nil)
124
+ wrap_paginated(service: "everything", operation: "get_everything_messages", is_mutation: false) do
125
+ params = compact_query_params(page: page)
126
+ paginate("/messages.json", params: params)
127
+ end
128
+ end
129
+
130
+ # Completed to-dos across all accessible projects, grouped by project (paginated).
131
+ # @param page [Integer, nil] Page number for paginating through results. Defaults to 1.
132
+ # @return [Enumerator<Hash>] paginated results
133
+ def get_everything_completed_todos(page: nil)
134
+ wrap_paginated(service: "everything", operation: "get_everything_completed_todos", is_mutation: false) do
135
+ params = compact_query_params(page: page)
136
+ paginate("/todos/completed.json", params: params)
137
+ end
138
+ end
139
+
140
+ # Open to-dos with no due date across all accessible projects, grouped by project (paginated).
141
+ # @param page [Integer, nil] Page number for paginating through results. Defaults to 1.
142
+ # @return [Enumerator<Hash>] paginated results
143
+ def get_everything_no_due_date_todos(page: nil)
144
+ wrap_paginated(service: "everything", operation: "get_everything_no_due_date_todos", is_mutation: false) do
145
+ params = compact_query_params(page: page)
146
+ paginate("/todos/no_due_date.json", params: params)
147
+ end
148
+ end
149
+
150
+ # Active, incomplete to-dos across all accessible projects, grouped by project (paginated).
151
+ # @param page [Integer, nil] Page number for paginating through results. Defaults to 1.
152
+ # @return [Enumerator<Hash>] paginated results
153
+ def get_everything_open_todos(page: nil)
154
+ wrap_paginated(service: "everything", operation: "get_everything_open_todos", is_mutation: false) do
155
+ params = compact_query_params(page: page)
156
+ paginate("/todos/open.json", params: params)
157
+ end
158
+ end
159
+
160
+ # Get every overdue to-do across all accessible projects, oldest-due-date-first.
161
+ # @return [Array<Hash>] response data
162
+ def get_everything_overdue_todos()
163
+ with_operation(service: "everything", operation: "get_everything_overdue_todos", is_mutation: false) do
164
+ http_get("/todos/overdue.json").json
165
+ end
166
+ end
167
+
168
+ # Open, unassigned to-dos across all accessible projects, grouped by project (paginated).
169
+ # @param page [Integer, nil] Page number for paginating through results. Defaults to 1.
170
+ # @return [Enumerator<Hash>] paginated results
171
+ def get_everything_unassigned_todos(page: nil)
172
+ wrap_paginated(service: "everything", operation: "get_everything_unassigned_todos", is_mutation: false) do
173
+ params = compact_query_params(page: page)
174
+ paginate("/todos/unassigned.json", params: params)
175
+ end
176
+ end
177
+ end
178
+ end
179
+ end
@@ -61,7 +61,7 @@ module Basecamp
61
61
  # @return [Enumerator<Hash>] paginated results
62
62
  def list(inbox_id:, sort: nil, direction: nil)
63
63
  wrap_paginated(service: "forwards", operation: "list", is_mutation: false, resource_id: inbox_id) do
64
- params = compact_params(sort: sort, direction: direction)
64
+ params = compact_query_params(sort: sort, direction: direction)
65
65
  paginate("/inboxes/#{inbox_id}/forwards.json", params: params)
66
66
  end
67
67
  end
@@ -18,7 +18,7 @@ module Basecamp
18
18
 
19
19
  # Update a gauge needle's description. Position and color are immutable.
20
20
  # @param needle_id [Integer] needle id ID
21
- # @param gauge_needle [String, nil] gauge needle
21
+ # @param gauge_needle [Hash, nil] gauge needle
22
22
  # @return [Hash] response data
23
23
  def update_gauge_needle(needle_id:, gauge_needle: nil)
24
24
  with_operation(service: "gauges", operation: "update_gauge_needle", is_mutation: true, resource_id: needle_id) do
@@ -38,7 +38,7 @@ module Basecamp
38
38
 
39
39
  # Enable or disable the gauge for a project. Only project admins can toggle gauges.
40
40
  # @param project_id [Integer] project id ID
41
- # @param gauge [String] gauge
41
+ # @param gauge [Hash] gauge
42
42
  # @return [void]
43
43
  def toggle_gauge(project_id:, gauge:)
44
44
  with_operation(service: "gauges", operation: "toggle_gauge", is_mutation: true, project_id: project_id) do
@@ -58,7 +58,7 @@ module Basecamp
58
58
 
59
59
  # Create a gauge needle (progress update) for a project
60
60
  # @param project_id [Integer] project id ID
61
- # @param gauge_needle [String] gauge needle
61
+ # @param gauge_needle [Hash] gauge needle
62
62
  # @param notify [String, nil] Who to notify: "everyone", "working_on", "custom", or omit for nobody
63
63
  # @param subscriptions [Array, nil] Array of people IDs to notify (only used when notify is "custom")
64
64
  # @return [Hash] response data
@@ -74,7 +74,7 @@ module Basecamp
74
74
  # @return [Enumerator<Hash>] paginated results
75
75
  def list_gauges(bucket_ids: nil)
76
76
  wrap_paginated(service: "gauges", operation: "list_gauges", is_mutation: false) do
77
- params = compact_params(bucket_ids: bucket_ids)
77
+ params = compact_query_params(bucket_ids: bucket_ids)
78
78
  paginate("/reports/gauges.json", params: params)
79
79
  end
80
80
  end
@@ -8,49 +8,54 @@ module Basecamp
8
8
  class MessageTypesService < BaseService
9
9
 
10
10
  # List message types in a project
11
+ # @param bucket_id [Integer] bucket id ID
11
12
  # @return [Enumerator<Hash>] paginated results
12
- def list()
13
- wrap_paginated(service: "messagetypes", operation: "list", is_mutation: false) do
14
- paginate("/categories.json")
13
+ def list(bucket_id:)
14
+ wrap_paginated(service: "messagetypes", operation: "list", is_mutation: false, project_id: bucket_id) do
15
+ paginate("/buckets/#{bucket_id}/categories.json")
15
16
  end
16
17
  end
17
18
 
18
19
  # Create a new message type in a project
20
+ # @param bucket_id [Integer] bucket id ID
19
21
  # @param name [String] name
20
22
  # @param icon [String] icon
21
23
  # @return [Hash] response data
22
- def create(name:, icon:)
23
- with_operation(service: "messagetypes", operation: "create", is_mutation: true) do
24
- http_post("/categories.json", body: compact_params(name: name, icon: icon)).json
24
+ def create(bucket_id:, name:, icon:)
25
+ with_operation(service: "messagetypes", operation: "create", is_mutation: true, project_id: bucket_id) do
26
+ http_post("/buckets/#{bucket_id}/categories.json", body: compact_params(name: name, icon: icon)).json
25
27
  end
26
28
  end
27
29
 
28
30
  # Get a single message type by id
31
+ # @param bucket_id [Integer] bucket id ID
29
32
  # @param type_id [Integer] type id ID
30
33
  # @return [Hash] response data
31
- def get(type_id:)
32
- with_operation(service: "messagetypes", operation: "get", is_mutation: false, resource_id: type_id) do
33
- http_get("/categories/#{type_id}").json
34
+ def get(bucket_id:, type_id:)
35
+ with_operation(service: "messagetypes", operation: "get", is_mutation: false, project_id: bucket_id, resource_id: type_id) do
36
+ http_get("/buckets/#{bucket_id}/categories/#{type_id}").json
34
37
  end
35
38
  end
36
39
 
37
40
  # Update an existing message type
41
+ # @param bucket_id [Integer] bucket id ID
38
42
  # @param type_id [Integer] type id ID
39
43
  # @param name [String, nil] name
40
44
  # @param icon [String, nil] icon
41
45
  # @return [Hash] response data
42
- def update(type_id:, name: nil, icon: nil)
43
- with_operation(service: "messagetypes", operation: "update", is_mutation: true, resource_id: type_id) do
44
- http_put("/categories/#{type_id}", body: compact_params(name: name, icon: icon)).json
46
+ def update(bucket_id:, type_id:, name: nil, icon: nil)
47
+ with_operation(service: "messagetypes", operation: "update", is_mutation: true, project_id: bucket_id, resource_id: type_id) do
48
+ http_put("/buckets/#{bucket_id}/categories/#{type_id}", body: compact_params(name: name, icon: icon)).json
45
49
  end
46
50
  end
47
51
 
48
52
  # Delete a message type
53
+ # @param bucket_id [Integer] bucket id ID
49
54
  # @param type_id [Integer] type id ID
50
55
  # @return [void]
51
- def delete(type_id:)
52
- with_operation(service: "messagetypes", operation: "delete", is_mutation: true, resource_id: type_id) do
53
- http_delete("/categories/#{type_id}")
56
+ def delete(bucket_id:, type_id:)
57
+ with_operation(service: "messagetypes", operation: "delete", is_mutation: true, project_id: bucket_id, resource_id: type_id) do
58
+ http_delete("/buckets/#{bucket_id}/categories/#{type_id}")
54
59
  nil
55
60
  end
56
61
  end
@@ -14,7 +14,7 @@ module Basecamp
14
14
  # @return [Enumerator<Hash>] paginated results
15
15
  def list(board_id:, sort: nil, direction: nil)
16
16
  wrap_paginated(service: "messages", operation: "list", is_mutation: false, resource_id: board_id) do
17
- params = compact_params(sort: sort, direction: direction)
17
+ params = compact_query_params(sort: sort, direction: direction)
18
18
  paginate("/message_boards/#{board_id}/messages.json", params: params)
19
19
  end
20
20
  end
@@ -26,10 +26,11 @@ module Basecamp
26
26
  # @param status [String, nil] active|drafted
27
27
  # @param category_id [Integer, nil] category id
28
28
  # @param subscriptions [Array, nil] subscriptions
29
+ # @param visible_to_clients [Boolean, nil] visible to clients
29
30
  # @return [Hash] response data
30
- def create(board_id:, subject:, content: nil, status: nil, category_id: nil, subscriptions: nil)
31
+ def create(board_id:, subject:, content: nil, status: nil, category_id: nil, subscriptions: nil, visible_to_clients: nil)
31
32
  with_operation(service: "messages", operation: "create", is_mutation: true, resource_id: board_id) do
32
- http_post("/message_boards/#{board_id}/messages.json", body: compact_params(subject: subject, content: content, status: status, category_id: category_id, subscriptions: subscriptions)).json
33
+ http_post("/message_boards/#{board_id}/messages.json", body: compact_params(subject: subject, content: content, status: status, category_id: category_id, subscriptions: subscriptions, visible_to_clients: visible_to_clients)).json
33
34
  end
34
35
  end
35
36
 
@@ -16,7 +16,7 @@ module Basecamp
16
16
  end
17
17
 
18
18
  # Get the current user's completed assignments.
19
- # @return [Hash] response data
19
+ # @return [Array<Hash>] response data
20
20
  def get_my_completed_assignments()
21
21
  with_operation(service: "myassignments", operation: "get_my_completed_assignments", is_mutation: false) do
22
22
  http_get("/my/assignments/completed.json").json
@@ -26,10 +26,10 @@ module Basecamp
26
26
  # Get the current user's assignments filtered by due date scope.
27
27
  # @param scope [String, nil] Filter by due date range: overdue, due_today, due_tomorrow,
28
28
  # due_later_this_week, due_next_week, due_later
29
- # @return [Hash] response data
29
+ # @return [Array<Hash>] response data
30
30
  def get_my_due_assignments(scope: nil)
31
31
  with_operation(service: "myassignments", operation: "get_my_due_assignments", is_mutation: false) do
32
- http_get("/my/assignments/due.json", params: compact_params(scope: scope)).json
32
+ http_get("/my/assignments/due.json", params: compact_query_params(scope: scope)).json
33
33
  end
34
34
  end
35
35
  end
@@ -9,10 +9,24 @@ module Basecamp
9
9
 
10
10
  # Get the current user's notification inbox (the "Hey!" menu).
11
11
  # @param page [Integer, nil] Page number for paginating through read items. Defaults to 1.
12
+ # @param limit_bubble_ups [Boolean, nil] Set to true to cap `bubble_ups` at 2 current bubble-ups and omit the
13
+ # `scheduled_bubble_ups` key entirely. Defaults to false. Use the dedicated
14
+ # bubble-ups endpoint (GetBubbleUps) to page through all current and
15
+ # scheduled bubble-ups.
12
16
  # @return [Hash] response data
13
- def get_my_notifications(page: nil)
17
+ def get_my_notifications(page: nil, limit_bubble_ups: nil)
14
18
  with_operation(service: "mynotifications", operation: "get_my_notifications", is_mutation: false) do
15
- http_get("/my/readings.json", params: compact_params(page: page)).json
19
+ http_get("/my/readings.json", params: compact_query_params(page: page, limit_bubble_ups: limit_bubble_ups)).json
20
+ end
21
+ end
22
+
23
+ # Get the current user's current and scheduled bubble-ups (paginated, 50 per page).
24
+ # @param page [Integer, nil] Page number. Defaults to 1.
25
+ # @return [Enumerator<Hash>] paginated results
26
+ def get_bubble_ups(page: nil)
27
+ wrap_paginated(service: "mynotifications", operation: "get_bubble_ups", is_mutation: false) do
28
+ params = compact_query_params(page: page)
29
+ paginate("/my/readings/bubble_ups.json", params: params)
16
30
  end
17
31
  end
18
32
 
@@ -24,7 +24,7 @@ module Basecamp
24
24
  end
25
25
 
26
26
  # Update the current user's preferences
27
- # @param person [String] person
27
+ # @param person [Hash] person
28
28
  # @return [Hash] response data
29
29
  def update_my_preferences(person:)
30
30
  with_operation(service: "people", operation: "update_my_preferences", is_mutation: true) do
@@ -85,7 +85,7 @@ module Basecamp
85
85
 
86
86
  # Enable or replace out of office for a person.
87
87
  # @param person_id [Integer] person id ID
88
- # @param out_of_office [String] out of office
88
+ # @param out_of_office [Hash] out of office
89
89
  # @return [Hash] response data
90
90
  def enable_out_of_office(person_id:, out_of_office:)
91
91
  with_operation(service: "people", operation: "enable_out_of_office", is_mutation: true, resource_id: person_id) do
@@ -125,7 +125,7 @@ module Basecamp
125
125
  end
126
126
 
127
127
  # List people who can be assigned todos
128
- # @return [Hash] response data
128
+ # @return [Array<Hash>] response data
129
129
  def list_assignable()
130
130
  with_operation(service: "people", operation: "list_assignable", is_mutation: false) do
131
131
  http_get("/reports/todos/assigned.json").json
@@ -12,7 +12,7 @@ module Basecamp
12
12
  # @return [Enumerator<Hash>] paginated results
13
13
  def list(status: nil)
14
14
  wrap_paginated(service: "projects", operation: "list", is_mutation: false) do
15
- params = compact_params(status: status)
15
+ params = compact_query_params(status: status)
16
16
  paginate("/projects.json", params: params)
17
17
  end
18
18
  end
@@ -41,7 +41,7 @@ module Basecamp
41
41
  # @param name [String] name
42
42
  # @param description [String, nil] description
43
43
  # @param admissions [String, nil] invite|employee|team
44
- # @param schedule_attributes [String, nil] schedule attributes
44
+ # @param schedule_attributes [Hash, nil] schedule attributes
45
45
  # @return [Hash] response data
46
46
  def update(project_id:, name:, description: nil, admissions: nil, schedule_attributes: nil)
47
47
  with_operation(service: "projects", operation: "update", is_mutation: true, project_id: project_id) do
@@ -8,7 +8,7 @@ module Basecamp
8
8
  class RecordingsService < BaseService
9
9
 
10
10
  # List recordings of a given type across projects
11
- # @param type [String] Comment|Document|Kanban::Card|Kanban::Step|Message|Question::Answer|Schedule::Entry|Todo|Todolist|Upload|Vault
11
+ # @param type [String] Comment|Document|Door|Kanban::Card|Kanban::Step|Message|Question::Answer|Schedule::Entry|Todo|Todolist|Upload|Vault
12
12
  # @param bucket [String, nil] bucket
13
13
  # @param status [String, nil] active|archived|trashed
14
14
  # @param sort [String, nil] created_at|updated_at
@@ -16,7 +16,7 @@ module Basecamp
16
16
  # @return [Enumerator<Hash>] paginated results
17
17
  def list(type:, bucket: nil, status: nil, sort: nil, direction: nil)
18
18
  wrap_paginated(service: "recordings", operation: "list", is_mutation: false) do
19
- params = compact_params(type: type, bucket: bucket, status: status, sort: sort, direction: direction)
19
+ params = compact_query_params(type: type, bucket: bucket, status: status, sort: sort, direction: direction)
20
20
  paginate("/projects/recordings.json", params: params)
21
21
  end
22
22
  end
@@ -21,7 +21,7 @@ module Basecamp
21
21
  # @return [Hash] response data
22
22
  def upcoming(window_starts_on: nil, window_ends_on: nil)
23
23
  with_operation(service: "reports", operation: "upcoming", is_mutation: false) do
24
- http_get("/reports/schedules/upcoming.json", params: compact_params(window_starts_on: window_starts_on, window_ends_on: window_ends_on)).json
24
+ http_get("/reports/schedules/upcoming.json", params: compact_query_params(window_starts_on: window_starts_on, window_ends_on: window_ends_on)).json
25
25
  end
26
26
  end
27
27
 
@@ -31,7 +31,7 @@ module Basecamp
31
31
  # @return [Hash] response data
32
32
  def assigned(person_id:, group_by: nil)
33
33
  with_operation(service: "reports", operation: "assigned", is_mutation: false, resource_id: person_id) do
34
- http_get("/reports/todos/assigned/#{person_id}", params: compact_params(group_by: group_by)).json
34
+ http_get("/reports/todos/assigned/#{person_id}", params: compact_query_params(group_by: group_by)).json
35
35
  end
36
36
  end
37
37
 
@@ -22,7 +22,15 @@ module Basecamp
22
22
  # @param starts_at [String, nil] starts at (RFC3339 (e.g., 2024-12-15T09:00:00Z))
23
23
  # @param ends_at [String, nil] ends at (RFC3339 (e.g., 2024-12-15T09:00:00Z))
24
24
  # @param description [String, nil] description
25
- # @param participant_ids [Array, nil] participant ids
25
+ # @param participant_ids [Array, nil] Replaces the entry's participants.
26
+ #
27
+ # Omitting this member preserves the current participants; sending an empty
28
+ # array clears them. That guarantee is BC3-side and recent: until
29
+ # basecamp/bc3#12425, `Schedules::EntriesController#update` called
30
+ # `replace_participants` unconditionally, so any update omitting the key —
31
+ # including the shape in BC3's own "Update a schedule entry" doc example —
32
+ # silently removed every participant and notified each one. The controller
33
+ # now guards on the request actually addressing participants.
26
34
  # @param all_day [Boolean, nil] all day
27
35
  # @param notify [Boolean, nil] notify
28
36
  # @return [Hash] response data
@@ -37,7 +45,7 @@ module Basecamp
37
45
  # @param date [String] date ID
38
46
  # @return [Hash] response data
39
47
  def get_entry_occurrence(entry_id:, date:)
40
- with_operation(service: "schedules", operation: "get_entry_occurrence", is_mutation: false, resource_id: date) do
48
+ with_operation(service: "schedules", operation: "get_entry_occurrence", is_mutation: false, resource_id: entry_id) do
41
49
  http_get("/schedule_entries/#{entry_id}/occurrences/#{date}").json
42
50
  end
43
51
  end
@@ -67,7 +75,7 @@ module Basecamp
67
75
  # @return [Enumerator<Hash>] paginated results
68
76
  def list_entries(schedule_id:, status: nil)
69
77
  wrap_paginated(service: "schedules", operation: "list_entries", is_mutation: false, resource_id: schedule_id) do
70
- params = compact_params(status: status)
78
+ params = compact_query_params(status: status)
71
79
  paginate("/schedules/#{schedule_id}/entries.json", params: params)
72
80
  end
73
81
  end
@@ -82,10 +90,11 @@ module Basecamp
82
90
  # @param all_day [Boolean, nil] all day
83
91
  # @param notify [Boolean, nil] notify
84
92
  # @param subscriptions [Array, nil] subscriptions
93
+ # @param visible_to_clients [Boolean, nil] visible to clients
85
94
  # @return [Hash] response data
86
- def create_entry(schedule_id:, summary:, starts_at:, ends_at:, description: nil, participant_ids: nil, all_day: nil, notify: nil, subscriptions: nil)
95
+ def create_entry(schedule_id:, summary:, starts_at:, ends_at:, description: nil, participant_ids: nil, all_day: nil, notify: nil, subscriptions: nil, visible_to_clients: nil)
87
96
  with_operation(service: "schedules", operation: "create_entry", is_mutation: true, resource_id: schedule_id) do
88
- http_post("/schedules/#{schedule_id}/entries.json", body: compact_params(summary: summary, starts_at: starts_at, ends_at: ends_at, description: description, participant_ids: participant_ids, all_day: all_day, notify: notify, subscriptions: subscriptions)).json
97
+ http_post("/schedules/#{schedule_id}/entries.json", body: compact_params(summary: summary, starts_at: starts_at, ends_at: ends_at, description: description, participant_ids: participant_ids, all_day: all_day, notify: notify, subscriptions: subscriptions, visible_to_clients: visible_to_clients)).json
89
98
  end
90
99
  end
91
100
  end
@@ -9,11 +9,22 @@ module Basecamp
9
9
 
10
10
  # Search for content across the account
11
11
  # @param q [String] q
12
- # @param sort [String, nil] best_match|created_at
12
+ # @param type_names [Array, nil] Recording types to include. Use `key` values from the metadata
13
+ # endpoint's `recording_search_types`. Available since Basecamp 5.
14
+ # @param bucket_ids [Array, nil] Project IDs to filter by. Available since Basecamp 5.
15
+ # @param creator_ids [Array, nil] Creator person IDs to filter by. Available since Basecamp 5.
16
+ # @param file_type [String, nil] Filter attachments by type. Use `key` values from the metadata
17
+ # endpoint's `file_search_types`.
18
+ # @param exclude_chat [Boolean, nil] Set to true to exclude chat results.
19
+ # @param since [String, nil] last_7_days|last_30_days|last_90_days|last_12_months|forever
20
+ # @param sort [String, nil] best_match|recency
21
+ # @param type [String, nil] Deprecated: prefer type_names[].
22
+ # @param bucket_id [Integer, nil] Deprecated: prefer bucket_ids[].
23
+ # @param creator_id [Integer, nil] Deprecated: prefer creator_ids[].
13
24
  # @return [Enumerator<Hash>] paginated results
14
- def search(q:, sort: nil)
25
+ def search(q:, type_names: nil, bucket_ids: nil, creator_ids: nil, file_type: nil, exclude_chat: nil, since: nil, sort: nil, type: nil, bucket_id: nil, creator_id: nil)
15
26
  wrap_paginated(service: "search", operation: "search", is_mutation: false) do
16
- params = compact_params(q: q, sort: sort)
27
+ params = compact_query_params(q: q, type_names: type_names, bucket_ids: bucket_ids, creator_ids: creator_ids, file_type: file_type, exclude_chat: exclude_chat, since: since, sort: sort, type: type, bucket_id: bucket_id, creator_id: creator_id)
17
28
  paginate("/search.json", params: params)
18
29
  end
19
30
  end
@@ -12,7 +12,7 @@ module Basecamp
12
12
  # @return [Enumerator<Hash>] paginated results
13
13
  def list(status: nil)
14
14
  wrap_paginated(service: "templates", operation: "list", is_mutation: false) do
15
- params = compact_params(status: status)
15
+ params = compact_query_params(status: status)
16
16
  paginate("/templates.json", params: params)
17
17
  end
18
18
  end
@@ -59,12 +59,11 @@ module Basecamp
59
59
 
60
60
  # Create a project from a template (asynchronous)
61
61
  # @param template_id [Integer] template id ID
62
- # @param name [String] name
63
- # @param description [String, nil] description
62
+ # @param project [Hash] project
64
63
  # @return [Hash] response data
65
- def create_project(template_id:, name:, description: nil)
64
+ def create_project(template_id:, project:)
66
65
  with_operation(service: "templates", operation: "create_project", is_mutation: true, resource_id: template_id) do
67
- http_post("/templates/#{template_id}/project_constructions.json", body: compact_params(name: name, description: description)).json
66
+ http_post("/templates/#{template_id}/project_constructions.json", body: compact_params(project: project)).json
68
67
  end
69
68
  end
70
69
 
@@ -15,7 +15,7 @@ module Basecamp
15
15
  # @return [Enumerator<Hash>] paginated results
16
16
  def for_project(project_id:, from: nil, to: nil, person_id: nil)
17
17
  wrap_paginated(service: "timesheets", operation: "for_project", is_mutation: false, project_id: project_id) do
18
- params = compact_params(from: from, to: to, person_id: person_id)
18
+ params = compact_query_params(from: from, to: to, person_id: person_id)
19
19
  paginate("/projects/#{project_id}/timesheet.json", params: params)
20
20
  end
21
21
  end
@@ -28,7 +28,7 @@ module Basecamp
28
28
  # @return [Enumerator<Hash>] paginated results
29
29
  def for_recording(recording_id:, from: nil, to: nil, person_id: nil)
30
30
  wrap_paginated(service: "timesheets", operation: "for_recording", is_mutation: false, resource_id: recording_id) do
31
- params = compact_params(from: from, to: to, person_id: person_id)
31
+ params = compact_query_params(from: from, to: to, person_id: person_id)
32
32
  paginate("/recordings/#{recording_id}/timesheet.json", params: params)
33
33
  end
34
34
  end
@@ -50,10 +50,10 @@ module Basecamp
50
50
  # @param from [String, nil] from
51
51
  # @param to [String, nil] to
52
52
  # @param person_id [Integer, nil] person id
53
- # @return [Hash] response data
53
+ # @return [Array<Hash>] response data
54
54
  def report(from: nil, to: nil, person_id: nil)
55
55
  with_operation(service: "timesheets", operation: "report", is_mutation: false) do
56
- http_get("/reports/timesheet.json", params: compact_params(from: from, to: to, person_id: person_id)).json
56
+ http_get("/reports/timesheet.json", params: compact_query_params(from: from, to: to, person_id: person_id)).json
57
57
  end
58
58
  end
59
59
 
@@ -27,13 +27,24 @@ module Basecamp
27
27
  end
28
28
  end
29
29
 
30
+ # Reposition a to-do list within its to-do set.
31
+ # @param todolist_id [Integer] todolist id ID
32
+ # @param position [Integer] position
33
+ # @return [void]
34
+ def reposition(todolist_id:, position:)
35
+ with_operation(service: "todolists", operation: "reposition", is_mutation: true, resource_id: todolist_id) do
36
+ http_put("/todosets/todolists/#{todolist_id}/position.json", body: compact_params(position: position))
37
+ nil
38
+ end
39
+ end
40
+
30
41
  # List todolists in a todoset
31
42
  # @param todoset_id [Integer] todoset id ID
32
43
  # @param status [String, nil] active|archived|trashed
33
44
  # @return [Enumerator<Hash>] paginated results
34
45
  def list(todoset_id:, status: nil)
35
46
  wrap_paginated(service: "todolists", operation: "list", is_mutation: false, resource_id: todoset_id) do
36
- params = compact_params(status: status)
47
+ params = compact_query_params(status: status)
37
48
  paginate("/todosets/#{todoset_id}/todolists.json", params: params)
38
49
  end
39
50
  end
@@ -42,10 +53,11 @@ module Basecamp
42
53
  # @param todoset_id [Integer] todoset id ID
43
54
  # @param name [String] name
44
55
  # @param description [String, nil] description
56
+ # @param visible_to_clients [Boolean, nil] visible to clients
45
57
  # @return [Hash] response data
46
- def create(todoset_id:, name:, description: nil)
58
+ def create(todoset_id:, name:, description: nil, visible_to_clients: nil)
47
59
  with_operation(service: "todolists", operation: "create", is_mutation: true, resource_id: todoset_id) do
48
- http_post("/todosets/#{todoset_id}/todolists.json", body: compact_params(name: name, description: description)).json
60
+ http_post("/todosets/#{todoset_id}/todolists.json", body: compact_params(name: name, description: description, visible_to_clients: visible_to_clients)).json
49
61
  end
50
62
  end
51
63
  end
@@ -14,7 +14,7 @@ module Basecamp
14
14
  # @return [Enumerator<Hash>] paginated results
15
15
  def list(todolist_id:, status: nil, completed: nil)
16
16
  wrap_paginated(service: "todos", operation: "list", is_mutation: false, resource_id: todolist_id) do
17
- params = compact_params(status: status, completed: completed)
17
+ params = compact_query_params(status: status, completed: completed)
18
18
  paginate("/todolists/#{todolist_id}/todos.json", params: params)
19
19
  end
20
20
  end