basecamp-sdk 0.9.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.
@@ -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
@@ -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,7 +26,7 @@ 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
32
  http_get("/my/assignments/due.json", params: compact_query_params(scope: scope)).json
@@ -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_query_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
 
@@ -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
@@ -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
@@ -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
@@ -50,7 +50,7 @@ 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
56
  http_get("/reports/timesheet.json", params: compact_query_params(from: from, to: to, person_id: person_id)).json
@@ -11,10 +11,11 @@ module Basecamp
11
11
  # @param bucket_id [Integer] bucket id ID
12
12
  # @param tool_type [String] Tool type to add to the project dock. Values: Chat::Transcript|Inbox|Kanban::Board|Message::Board|Questionnaire|Schedule|Todoset|Vault.
13
13
  # @param title [String, nil] Title for the new tool. When omitted, Basecamp assigns the next available default title for the tool type.
14
+ # @param visible_to_clients [Boolean, nil] Create the tool already visible to clients. Honored only for tool types that manage their own client visibility (Chat::Transcript, Kanban::Board), which otherwise start hidden; every other tool type ignores it and inherits the project default.
14
15
  # @return [Hash] response data
15
- def create(bucket_id:, tool_type:, title: nil)
16
+ def create(bucket_id:, tool_type:, title: nil, visible_to_clients: nil)
16
17
  with_operation(service: "tools", operation: "create", is_mutation: true, project_id: bucket_id) do
17
- http_post("/buckets/#{bucket_id}/dock/tools.json", body: compact_params(tool_type: tool_type, title: title)).json
18
+ http_post("/buckets/#{bucket_id}/dock/tools.json", body: compact_params(tool_type: tool_type, title: title, visible_to_clients: visible_to_clients)).json
18
19
  end
19
20
  end
20
21