basecamp-sdk 0.12.0 → 0.13.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.
- checksums.yaml +4 -4
- data/README.md +127 -8
- data/lib/basecamp/client.rb +35 -11
- data/lib/basecamp/config.rb +69 -0
- data/lib/basecamp/generated/metadata.json +280 -141
- data/lib/basecamp/generated/services/base_service.rb +37 -16
- data/lib/basecamp/generated/services/bookmarks_service.rb +5 -4
- data/lib/basecamp/generated/services/boosts_service.rb +12 -6
- data/lib/basecamp/generated/services/campfires_service.rb +54 -41
- data/lib/basecamp/generated/services/cards_service.rb +6 -3
- data/lib/basecamp/generated/services/checkins_service.rb +28 -15
- data/lib/basecamp/generated/services/client_approvals_service.rb +8 -5
- data/lib/basecamp/generated/services/client_correspondences_service.rb +8 -5
- data/lib/basecamp/generated/services/client_replies_service.rb +12 -7
- data/lib/basecamp/generated/services/cloud_files_service.rb +57 -0
- data/lib/basecamp/generated/services/comments_service.rb +6 -3
- data/lib/basecamp/generated/services/documents_service.rb +9 -6
- data/lib/basecamp/generated/services/drafts_service.rb +5 -4
- data/lib/basecamp/generated/services/events_service.rb +6 -3
- data/lib/basecamp/generated/services/everything_service.rb +70 -56
- data/lib/basecamp/generated/services/folders_service.rb +62 -0
- data/lib/basecamp/generated/services/forwards_service.rb +12 -17
- data/lib/basecamp/generated/services/gauges_service.rb +12 -7
- data/lib/basecamp/generated/services/google_documents_service.rb +61 -0
- data/lib/basecamp/generated/services/message_types_service.rb +4 -3
- data/lib/basecamp/generated/services/messages_service.rb +6 -4
- data/lib/basecamp/generated/services/my_notes_service.rb +1 -1
- data/lib/basecamp/generated/services/my_notifications_service.rb +8 -5
- data/lib/basecamp/generated/services/people_service.rb +17 -10
- data/lib/basecamp/generated/services/projects_service.rb +26 -4
- data/lib/basecamp/generated/services/recordings_service.rb +6 -13
- data/lib/basecamp/generated/services/reports_service.rb +15 -9
- data/lib/basecamp/generated/services/schedules_service.rb +90 -16
- data/lib/basecamp/generated/services/search_service.rb +6 -4
- data/lib/basecamp/generated/services/templates_service.rb +6 -4
- data/lib/basecamp/generated/services/timeline_service.rb +6 -3
- data/lib/basecamp/generated/services/timesheets_service.rb +22 -8
- data/lib/basecamp/generated/services/todolist_groups_service.rb +7 -4
- data/lib/basecamp/generated/services/todolists_service.rb +11 -9
- data/lib/basecamp/generated/services/todos_service.rb +6 -14
- data/lib/basecamp/generated/services/uploads_service.rb +10 -6
- data/lib/basecamp/generated/services/vaults_service.rb +6 -3
- data/lib/basecamp/generated/services/webhooks_service.rb +4 -3
- data/lib/basecamp/generated/types.rb +527 -139
- data/lib/basecamp/http.rb +346 -163
- data/lib/basecamp/list_enumerator.rb +29 -0
- data/lib/basecamp/list_meta.rb +44 -0
- data/lib/basecamp/services/cards_extensions.rb +35 -27
- data/lib/basecamp/services/documents_extensions.rb +136 -0
- data/lib/basecamp/services/merge_safe.rb +255 -0
- data/lib/basecamp/services/schedules_extensions.rb +354 -0
- data/lib/basecamp/services/todolists_extensions.rb +274 -0
- data/lib/basecamp/services/todos_extensions.rb +22 -6
- data/lib/basecamp/validation_error.rb +11 -1
- data/lib/basecamp/version.rb +2 -2
- data/lib/basecamp.rb +94 -4
- data/scripts/generate-services.rb +74 -25
- data/scripts/generate-types.rb +2 -1
- data/scripts/go_type_spellings.rb +26 -0
- metadata +12 -2
|
@@ -9,85 +9,96 @@ module Basecamp
|
|
|
9
9
|
# @generated from OpenAPI spec
|
|
10
10
|
class CampfiresService < BaseService
|
|
11
11
|
|
|
12
|
-
# List all campfires across the account
|
|
13
|
-
# @return [Enumerator<Hash>] paginated results
|
|
14
|
-
def list()
|
|
15
|
-
wrap_paginated(service: "campfires", operation: "list", is_mutation: false) do
|
|
16
|
-
paginate("/chats.json", operation: "ListCampfires")
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
# Get a campfire by ID
|
|
21
|
-
# @param campfire_id [Integer] campfire id ID
|
|
22
|
-
# @return [Hash] response data
|
|
23
|
-
def get(campfire_id:)
|
|
24
|
-
with_operation(service: "campfires", operation: "get", is_mutation: false, resource_id: campfire_id) do
|
|
25
|
-
http_get("/chats/#{campfire_id}", operation: "GetCampfire").json
|
|
26
|
-
end
|
|
27
|
-
end
|
|
28
|
-
|
|
29
12
|
# List all chatbots for a campfire
|
|
13
|
+
# @param bucket_id [Integer] bucket id ID
|
|
30
14
|
# @param campfire_id [Integer] campfire id ID
|
|
31
|
-
# @
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
15
|
+
# @param max_items [Integer, nil] cap on items yielded across pages; nil or non-positive means no cap
|
|
16
|
+
# @return [ListEnumerator<Hash>] lazily paginated results (#meta carries pagination metadata)
|
|
17
|
+
def list_chatbots(bucket_id:, campfire_id:, max_items: nil)
|
|
18
|
+
wrap_paginated(service: "campfires", operation: "list_chatbots", is_mutation: false, project_id: bucket_id, resource_id: campfire_id) do
|
|
19
|
+
paginate("/buckets/#{bucket_id}/chats/#{campfire_id}/integrations.json", operation: "ListChatbots", max_items: max_items)
|
|
35
20
|
end
|
|
36
21
|
end
|
|
37
22
|
|
|
38
23
|
# Create a new chatbot for a campfire
|
|
24
|
+
# @param bucket_id [Integer] bucket id ID
|
|
39
25
|
# @param campfire_id [Integer] campfire id ID
|
|
40
26
|
# @param service_name [String] service name
|
|
41
27
|
# @param command_url [String, nil] command url
|
|
42
28
|
# @return [Hash] response data
|
|
43
|
-
def create_chatbot(campfire_id:, service_name:, command_url: nil)
|
|
44
|
-
with_operation(service: "campfires", operation: "create_chatbot", is_mutation: true, resource_id: campfire_id) do
|
|
45
|
-
http_post("/chats/#{campfire_id}/integrations.json", body: compact_params(service_name: service_name, command_url: command_url)).json
|
|
29
|
+
def create_chatbot(bucket_id:, campfire_id:, service_name:, command_url: nil)
|
|
30
|
+
with_operation(service: "campfires", operation: "create_chatbot", is_mutation: true, project_id: bucket_id, resource_id: campfire_id) do
|
|
31
|
+
http_post("/buckets/#{bucket_id}/chats/#{campfire_id}/integrations.json", body: compact_params(service_name: service_name, command_url: command_url)).json
|
|
46
32
|
end
|
|
47
33
|
end
|
|
48
34
|
|
|
49
35
|
# Get a chatbot by ID
|
|
36
|
+
# @param bucket_id [Integer] bucket id ID
|
|
50
37
|
# @param campfire_id [Integer] campfire id ID
|
|
51
38
|
# @param chatbot_id [Integer] chatbot id ID
|
|
52
39
|
# @return [Hash] response data
|
|
53
|
-
def get_chatbot(campfire_id:, chatbot_id:)
|
|
54
|
-
with_operation(service: "campfires", operation: "get_chatbot", is_mutation: false, resource_id: chatbot_id) do
|
|
55
|
-
http_get("/chats/#{campfire_id}/integrations/#{chatbot_id}", operation: "GetChatbot").json
|
|
40
|
+
def get_chatbot(bucket_id:, campfire_id:, chatbot_id:)
|
|
41
|
+
with_operation(service: "campfires", operation: "get_chatbot", is_mutation: false, project_id: bucket_id, resource_id: chatbot_id) do
|
|
42
|
+
http_get("/buckets/#{bucket_id}/chats/#{campfire_id}/integrations/#{chatbot_id}", operation: "GetChatbot").json
|
|
56
43
|
end
|
|
57
44
|
end
|
|
58
45
|
|
|
59
46
|
# Update an existing chatbot
|
|
47
|
+
# @param bucket_id [Integer] bucket id ID
|
|
60
48
|
# @param campfire_id [Integer] campfire id ID
|
|
61
49
|
# @param chatbot_id [Integer] chatbot id ID
|
|
62
50
|
# @param service_name [String] service name
|
|
63
51
|
# @param command_url [String, nil] command url
|
|
64
52
|
# @return [Hash] response data
|
|
65
|
-
def update_chatbot(campfire_id:, chatbot_id:, service_name:, command_url: nil)
|
|
66
|
-
with_operation(service: "campfires", operation: "update_chatbot", is_mutation: true, resource_id: chatbot_id) do
|
|
67
|
-
http_put("/chats/#{campfire_id}/integrations/#{chatbot_id}", body: compact_params(service_name: service_name, command_url: command_url)).json
|
|
53
|
+
def update_chatbot(bucket_id:, campfire_id:, chatbot_id:, service_name:, command_url: nil)
|
|
54
|
+
with_operation(service: "campfires", operation: "update_chatbot", is_mutation: true, project_id: bucket_id, resource_id: chatbot_id) do
|
|
55
|
+
http_put("/buckets/#{bucket_id}/chats/#{campfire_id}/integrations/#{chatbot_id}", body: compact_params(service_name: service_name, command_url: command_url)).json
|
|
68
56
|
end
|
|
69
57
|
end
|
|
70
58
|
|
|
71
59
|
# Delete a chatbot
|
|
60
|
+
# @param bucket_id [Integer] bucket id ID
|
|
72
61
|
# @param campfire_id [Integer] campfire id ID
|
|
73
62
|
# @param chatbot_id [Integer] chatbot id ID
|
|
74
63
|
# @return [void]
|
|
75
|
-
def delete_chatbot(campfire_id:, chatbot_id:)
|
|
76
|
-
with_operation(service: "campfires", operation: "delete_chatbot", is_mutation: true, resource_id: chatbot_id) do
|
|
77
|
-
http_delete("/chats/#{campfire_id}/integrations/#{chatbot_id}")
|
|
64
|
+
def delete_chatbot(bucket_id:, campfire_id:, chatbot_id:)
|
|
65
|
+
with_operation(service: "campfires", operation: "delete_chatbot", is_mutation: true, project_id: bucket_id, resource_id: chatbot_id) do
|
|
66
|
+
http_delete("/buckets/#{bucket_id}/chats/#{campfire_id}/integrations/#{chatbot_id}")
|
|
78
67
|
nil
|
|
79
68
|
end
|
|
80
69
|
end
|
|
81
70
|
|
|
71
|
+
# List all campfires across the account
|
|
72
|
+
# @param page [Integer, nil] Page number for paginating through results. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8.
|
|
73
|
+
# @param max_items [Integer, nil] cap on items yielded across pages; nil or non-positive means no cap
|
|
74
|
+
# @return [ListEnumerator<Hash>] lazily paginated results (#meta carries pagination metadata)
|
|
75
|
+
def list(page: nil, max_items: nil)
|
|
76
|
+
wrap_paginated(service: "campfires", operation: "list", is_mutation: false) do
|
|
77
|
+
params = compact_query_params(page: page)
|
|
78
|
+
paginate("/chats.json", params: params, operation: "ListCampfires", max_items: max_items)
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
# Get a campfire by ID
|
|
83
|
+
# @param campfire_id [Integer] campfire id ID
|
|
84
|
+
# @return [Hash] response data
|
|
85
|
+
def get(campfire_id:)
|
|
86
|
+
with_operation(service: "campfires", operation: "get", is_mutation: false, resource_id: campfire_id) do
|
|
87
|
+
http_get("/chats/#{campfire_id}", operation: "GetCampfire").json
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
82
91
|
# List all lines (messages) in a campfire
|
|
83
92
|
# @param campfire_id [Integer] campfire id ID
|
|
84
93
|
# @param sort [String, nil] created_at|updated_at
|
|
85
94
|
# @param direction [String, nil] asc|desc
|
|
86
|
-
# @
|
|
87
|
-
|
|
95
|
+
# @param page [Integer, nil] Page number for paginating through results. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8.
|
|
96
|
+
# @param max_items [Integer, nil] cap on items yielded across pages; nil or non-positive means no cap
|
|
97
|
+
# @return [ListEnumerator<Hash>] lazily paginated results (#meta carries pagination metadata)
|
|
98
|
+
def list_lines(campfire_id:, sort: nil, direction: nil, page: nil, max_items: nil)
|
|
88
99
|
wrap_paginated(service: "campfires", operation: "list_lines", is_mutation: false, resource_id: campfire_id) do
|
|
89
|
-
params = compact_query_params(sort: sort, direction: direction)
|
|
90
|
-
paginate("/chats/#{campfire_id}/lines.json", params: params, operation: "ListCampfireLines")
|
|
100
|
+
params = compact_query_params(sort: sort, direction: direction, page: page)
|
|
101
|
+
paginate("/chats/#{campfire_id}/lines.json", params: params, operation: "ListCampfireLines", max_items: max_items)
|
|
91
102
|
end
|
|
92
103
|
end
|
|
93
104
|
|
|
@@ -139,11 +150,13 @@ module Basecamp
|
|
|
139
150
|
# @param campfire_id [Integer] campfire id ID
|
|
140
151
|
# @param sort [String, nil] created_at|updated_at
|
|
141
152
|
# @param direction [String, nil] asc|desc
|
|
142
|
-
# @
|
|
143
|
-
|
|
153
|
+
# @param page [Integer, nil] Page number for paginating through results. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8.
|
|
154
|
+
# @param max_items [Integer, nil] cap on items yielded across pages; nil or non-positive means no cap
|
|
155
|
+
# @return [ListEnumerator<Hash>] lazily paginated results (#meta carries pagination metadata)
|
|
156
|
+
def list_uploads(campfire_id:, sort: nil, direction: nil, page: nil, max_items: nil)
|
|
144
157
|
wrap_paginated(service: "campfires", operation: "list_uploads", is_mutation: false, resource_id: campfire_id) do
|
|
145
|
-
params = compact_query_params(sort: sort, direction: direction)
|
|
146
|
-
paginate("/chats/#{campfire_id}/uploads.json", params: params, operation: "ListCampfireUploads")
|
|
158
|
+
params = compact_query_params(sort: sort, direction: direction, page: page)
|
|
159
|
+
paginate("/chats/#{campfire_id}/uploads.json", params: params, operation: "ListCampfireUploads", max_items: max_items)
|
|
147
160
|
end
|
|
148
161
|
end
|
|
149
162
|
|
|
@@ -43,10 +43,13 @@ module Basecamp
|
|
|
43
43
|
|
|
44
44
|
# List cards in a column
|
|
45
45
|
# @param column_id [Integer] column id ID
|
|
46
|
-
# @
|
|
47
|
-
|
|
46
|
+
# @param page [Integer, nil] Page number for paginating through results. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8.
|
|
47
|
+
# @param max_items [Integer, nil] cap on items yielded across pages; nil or non-positive means no cap
|
|
48
|
+
# @return [ListEnumerator<Hash>] lazily paginated results (#meta carries pagination metadata)
|
|
49
|
+
def list(column_id:, page: nil, max_items: nil)
|
|
48
50
|
wrap_paginated(service: "cards", operation: "list", is_mutation: false, resource_id: column_id) do
|
|
49
|
-
|
|
51
|
+
params = compact_query_params(page: page)
|
|
52
|
+
paginate("/card_tables/lists/#{column_id}/cards.json", params: params, operation: "ListCards", max_items: max_items)
|
|
50
53
|
end
|
|
51
54
|
end
|
|
52
55
|
|
|
@@ -8,10 +8,13 @@ module Basecamp
|
|
|
8
8
|
class CheckinsService < BaseService
|
|
9
9
|
|
|
10
10
|
# Get pending check-in reminders for the current user
|
|
11
|
-
# @
|
|
12
|
-
|
|
11
|
+
# @param page [Integer, nil] Page number for paginating through results. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8.
|
|
12
|
+
# @param max_items [Integer, nil] cap on items yielded across pages; nil or non-positive means no cap
|
|
13
|
+
# @return [ListEnumerator<Hash>] lazily paginated results (#meta carries pagination metadata)
|
|
14
|
+
def reminders(page: nil, max_items: nil)
|
|
13
15
|
wrap_paginated(service: "checkins", operation: "reminders", is_mutation: false) do
|
|
14
|
-
|
|
16
|
+
params = compact_query_params(page: page)
|
|
17
|
+
paginate("/my/question_reminders.json", params: params, operation: "GetQuestionReminders", max_items: max_items)
|
|
15
18
|
end
|
|
16
19
|
end
|
|
17
20
|
|
|
@@ -47,10 +50,13 @@ module Basecamp
|
|
|
47
50
|
|
|
48
51
|
# List all questions in a questionnaire
|
|
49
52
|
# @param questionnaire_id [Integer] questionnaire id ID
|
|
50
|
-
# @
|
|
51
|
-
|
|
53
|
+
# @param page [Integer, nil] Page number for paginating through results. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8.
|
|
54
|
+
# @param max_items [Integer, nil] cap on items yielded across pages; nil or non-positive means no cap
|
|
55
|
+
# @return [ListEnumerator<Hash>] lazily paginated results (#meta carries pagination metadata)
|
|
56
|
+
def list_questions(questionnaire_id:, page: nil, max_items: nil)
|
|
52
57
|
wrap_paginated(service: "checkins", operation: "list_questions", is_mutation: false, resource_id: questionnaire_id) do
|
|
53
|
-
|
|
58
|
+
params = compact_query_params(page: page)
|
|
59
|
+
paginate("/questionnaires/#{questionnaire_id}/questions.json", params: params, operation: "ListQuestions", max_items: max_items)
|
|
54
60
|
end
|
|
55
61
|
end
|
|
56
62
|
|
|
@@ -89,10 +95,13 @@ module Basecamp
|
|
|
89
95
|
|
|
90
96
|
# List all answers for a question
|
|
91
97
|
# @param question_id [Integer] question id ID
|
|
92
|
-
# @
|
|
93
|
-
|
|
98
|
+
# @param page [Integer, nil] Page number for paginating through results. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8.
|
|
99
|
+
# @param max_items [Integer, nil] cap on items yielded across pages; nil or non-positive means no cap
|
|
100
|
+
# @return [ListEnumerator<Hash>] lazily paginated results (#meta carries pagination metadata)
|
|
101
|
+
def list_answers(question_id:, page: nil, max_items: nil)
|
|
94
102
|
wrap_paginated(service: "checkins", operation: "list_answers", is_mutation: false, resource_id: question_id) do
|
|
95
|
-
|
|
103
|
+
params = compact_query_params(page: page)
|
|
104
|
+
paginate("/questions/#{question_id}/answers.json", params: params, operation: "ListAnswers", max_items: max_items)
|
|
96
105
|
end
|
|
97
106
|
end
|
|
98
107
|
|
|
@@ -109,20 +118,24 @@ module Basecamp
|
|
|
109
118
|
|
|
110
119
|
# List all people who have answered a question (answerers)
|
|
111
120
|
# @param question_id [Integer] question id ID
|
|
112
|
-
# @
|
|
113
|
-
|
|
121
|
+
# @param max_items [Integer, nil] cap on items yielded across pages; nil or non-positive means no cap
|
|
122
|
+
# @return [ListEnumerator<Hash>] lazily paginated results (#meta carries pagination metadata)
|
|
123
|
+
def answerers(question_id:, max_items: nil)
|
|
114
124
|
wrap_paginated(service: "checkins", operation: "answerers", is_mutation: false, resource_id: question_id) do
|
|
115
|
-
paginate("/questions/#{question_id}/answers/by.json", operation: "ListQuestionAnswerers")
|
|
125
|
+
paginate("/questions/#{question_id}/answers/by.json", operation: "ListQuestionAnswerers", max_items: max_items)
|
|
116
126
|
end
|
|
117
127
|
end
|
|
118
128
|
|
|
119
129
|
# Get all answers from a specific person for a question
|
|
120
130
|
# @param question_id [Integer] question id ID
|
|
121
131
|
# @param person_id [Integer] person id ID
|
|
122
|
-
# @
|
|
123
|
-
|
|
132
|
+
# @param page [Integer, nil] Page number for paginating through results. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8.
|
|
133
|
+
# @param max_items [Integer, nil] cap on items yielded across pages; nil or non-positive means no cap
|
|
134
|
+
# @return [ListEnumerator<Hash>] lazily paginated results (#meta carries pagination metadata)
|
|
135
|
+
def by_person(question_id:, person_id:, page: nil, max_items: nil)
|
|
124
136
|
wrap_paginated(service: "checkins", operation: "by_person", is_mutation: false, resource_id: person_id) do
|
|
125
|
-
|
|
137
|
+
params = compact_query_params(page: page)
|
|
138
|
+
paginate("/questions/#{question_id}/answers/by/#{person_id}", params: params, operation: "GetAnswersByPerson", max_items: max_items)
|
|
126
139
|
end
|
|
127
140
|
end
|
|
128
141
|
|
|
@@ -8,13 +8,16 @@ module Basecamp
|
|
|
8
8
|
class ClientApprovalsService < BaseService
|
|
9
9
|
|
|
10
10
|
# List all client approvals in a project
|
|
11
|
+
# @param bucket_id [Integer] bucket id ID
|
|
11
12
|
# @param sort [String, nil] created_at|updated_at
|
|
12
13
|
# @param direction [String, nil] asc|desc
|
|
13
|
-
# @
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
# @param page [Integer, nil] Page number for paginating through results. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8.
|
|
15
|
+
# @param max_items [Integer, nil] cap on items yielded across pages; nil or non-positive means no cap
|
|
16
|
+
# @return [ListEnumerator<Hash>] lazily paginated results (#meta carries pagination metadata)
|
|
17
|
+
def list(bucket_id:, sort: nil, direction: nil, page: nil, max_items: nil)
|
|
18
|
+
wrap_paginated(service: "clientapprovals", operation: "list", is_mutation: false, project_id: bucket_id) do
|
|
19
|
+
params = compact_query_params(sort: sort, direction: direction, page: page)
|
|
20
|
+
paginate("/buckets/#{bucket_id}/client/approvals.json", params: params, operation: "ListClientApprovals", max_items: max_items)
|
|
18
21
|
end
|
|
19
22
|
end
|
|
20
23
|
|
|
@@ -8,13 +8,16 @@ module Basecamp
|
|
|
8
8
|
class ClientCorrespondencesService < BaseService
|
|
9
9
|
|
|
10
10
|
# List all client correspondences in a project
|
|
11
|
+
# @param bucket_id [Integer] bucket id ID
|
|
11
12
|
# @param sort [String, nil] created_at|updated_at
|
|
12
13
|
# @param direction [String, nil] asc|desc
|
|
13
|
-
# @
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
# @param page [Integer, nil] Page number for paginating through results. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8.
|
|
15
|
+
# @param max_items [Integer, nil] cap on items yielded across pages; nil or non-positive means no cap
|
|
16
|
+
# @return [ListEnumerator<Hash>] lazily paginated results (#meta carries pagination metadata)
|
|
17
|
+
def list(bucket_id:, sort: nil, direction: nil, page: nil, max_items: nil)
|
|
18
|
+
wrap_paginated(service: "clientcorrespondences", operation: "list", is_mutation: false, project_id: bucket_id) do
|
|
19
|
+
params = compact_query_params(sort: sort, direction: direction, page: page)
|
|
20
|
+
paginate("/buckets/#{bucket_id}/client/correspondences.json", params: params, operation: "ListClientCorrespondences", max_items: max_items)
|
|
18
21
|
end
|
|
19
22
|
end
|
|
20
23
|
|
|
@@ -8,21 +8,26 @@ module Basecamp
|
|
|
8
8
|
class ClientRepliesService < BaseService
|
|
9
9
|
|
|
10
10
|
# List all client replies for a recording (correspondence or approval)
|
|
11
|
+
# @param bucket_id [Integer] bucket id ID
|
|
11
12
|
# @param recording_id [Integer] recording id ID
|
|
12
|
-
# @
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
# @param page [Integer, nil] Page number for paginating through results. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8.
|
|
14
|
+
# @param max_items [Integer, nil] cap on items yielded across pages; nil or non-positive means no cap
|
|
15
|
+
# @return [ListEnumerator<Hash>] lazily paginated results (#meta carries pagination metadata)
|
|
16
|
+
def list(bucket_id:, recording_id:, page: nil, max_items: nil)
|
|
17
|
+
wrap_paginated(service: "clientreplies", operation: "list", is_mutation: false, project_id: bucket_id, resource_id: recording_id) do
|
|
18
|
+
params = compact_query_params(page: page)
|
|
19
|
+
paginate("/buckets/#{bucket_id}/client/recordings/#{recording_id}/replies.json", params: params, operation: "ListClientReplies", max_items: max_items)
|
|
16
20
|
end
|
|
17
21
|
end
|
|
18
22
|
|
|
19
23
|
# Get a single client reply by id
|
|
24
|
+
# @param bucket_id [Integer] bucket id ID
|
|
20
25
|
# @param recording_id [Integer] recording id ID
|
|
21
26
|
# @param reply_id [Integer] reply id ID
|
|
22
27
|
# @return [Hash] response data
|
|
23
|
-
def get(recording_id:, reply_id:)
|
|
24
|
-
with_operation(service: "clientreplies", operation: "get", is_mutation: false, resource_id: reply_id) do
|
|
25
|
-
http_get("/client/recordings/#{recording_id}/replies/#{reply_id}", operation: "GetClientReply").json
|
|
28
|
+
def get(bucket_id:, recording_id:, reply_id:)
|
|
29
|
+
with_operation(service: "clientreplies", operation: "get", is_mutation: false, project_id: bucket_id, resource_id: reply_id) do
|
|
30
|
+
http_get("/buckets/#{bucket_id}/client/recordings/#{recording_id}/replies/#{reply_id}", operation: "GetClientReply").json
|
|
26
31
|
end
|
|
27
32
|
end
|
|
28
33
|
end
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Basecamp
|
|
4
|
+
module Services
|
|
5
|
+
# Service for CloudFiles operations
|
|
6
|
+
#
|
|
7
|
+
# @generated from OpenAPI spec
|
|
8
|
+
class CloudFilesService < BaseService
|
|
9
|
+
|
|
10
|
+
# Create a new cloud file in a vault.
|
|
11
|
+
# @param bucket_id [Integer] bucket id ID
|
|
12
|
+
# @param vault_id [Integer] vault id ID
|
|
13
|
+
# @param url [String] url
|
|
14
|
+
# @param service [String] Short identifier for the external service — "dropbox", "google_doc",
|
|
15
|
+
# "figma", "other", … Derived from the CloudFile::Service subclass name, so it
|
|
16
|
+
# is always present. `other` accepts any well-formed HTTPS URL.
|
|
17
|
+
# @param title [String, nil] title
|
|
18
|
+
# @param description [String, nil] description
|
|
19
|
+
# @param subscriptions [Array, nil] subscriptions
|
|
20
|
+
# @param visible_to_clients [Boolean, nil] Whether the cloud file is visible to the project's clients. Applies only
|
|
21
|
+
# when creating directly in the tool's vault — an item created inside a
|
|
22
|
+
# folder inherits the folder's visibility and ignores this. A client caller
|
|
23
|
+
# always creates client-visible records regardless of what is sent.
|
|
24
|
+
# @return [Hash] response data
|
|
25
|
+
def create_cloud_file(bucket_id:, vault_id:, url:, service:, title: nil, description: nil, subscriptions: nil, visible_to_clients: nil)
|
|
26
|
+
with_operation(service: "cloudfiles", operation: "create_cloud_file", is_mutation: true, project_id: bucket_id, resource_id: vault_id) do
|
|
27
|
+
http_post("/buckets/#{bucket_id}/vaults/#{vault_id}/cloud_files.json", body: compact_params(url: url, service: service, title: title, description: description, subscriptions: subscriptions, visible_to_clients: visible_to_clients)).json
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Get a single cloud file by id
|
|
32
|
+
# @param cloud_file_id [Integer] cloud file id ID
|
|
33
|
+
# @return [Hash] response data
|
|
34
|
+
def get_cloud_file(cloud_file_id:)
|
|
35
|
+
with_operation(service: "cloudfiles", operation: "get_cloud_file", is_mutation: false, resource_id: cloud_file_id) do
|
|
36
|
+
http_get("/cloud_files/#{cloud_file_id}", operation: "GetCloudFile").json
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Replace a cloud file with a new complete representation.
|
|
41
|
+
# @param cloud_file_id [Integer] cloud file id ID
|
|
42
|
+
# @param url [String] url
|
|
43
|
+
# @param service [String] Short identifier for the external service — "dropbox", "google_doc",
|
|
44
|
+
# "figma", "other", … Derived from the CloudFile::Service subclass name, so it
|
|
45
|
+
# is always present. `other` accepts any well-formed HTTPS URL.
|
|
46
|
+
# @param title [String, nil] title
|
|
47
|
+
# @param description [String, nil] description
|
|
48
|
+
# @param subscriptions [Array, nil] subscriptions
|
|
49
|
+
# @return [Hash] response data
|
|
50
|
+
def update_cloud_file(cloud_file_id:, url:, service:, title: nil, description: nil, subscriptions: nil)
|
|
51
|
+
with_operation(service: "cloudfiles", operation: "update_cloud_file", is_mutation: true, resource_id: cloud_file_id) do
|
|
52
|
+
http_put("/cloud_files/#{cloud_file_id}", body: compact_params(url: url, service: service, title: title, description: description, subscriptions: subscriptions)).json
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
@@ -28,10 +28,13 @@ module Basecamp
|
|
|
28
28
|
|
|
29
29
|
# List comments on a recording
|
|
30
30
|
# @param recording_id [Integer] recording id ID
|
|
31
|
-
# @
|
|
32
|
-
|
|
31
|
+
# @param page [Integer, nil] Page number for paginating through results. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8.
|
|
32
|
+
# @param max_items [Integer, nil] cap on items yielded across pages; nil or non-positive means no cap
|
|
33
|
+
# @return [ListEnumerator<Hash>] lazily paginated results (#meta carries pagination metadata)
|
|
34
|
+
def list(recording_id:, page: nil, max_items: nil)
|
|
33
35
|
wrap_paginated(service: "comments", operation: "list", is_mutation: false, resource_id: recording_id) do
|
|
34
|
-
|
|
36
|
+
params = compact_query_params(page: page)
|
|
37
|
+
paginate("/recordings/#{recording_id}/comments.json", params: params, operation: "ListComments", max_items: max_items)
|
|
35
38
|
end
|
|
36
39
|
end
|
|
37
40
|
|
|
@@ -16,23 +16,26 @@ module Basecamp
|
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
18
|
|
|
19
|
-
#
|
|
19
|
+
# Replace a document with a new complete representation.
|
|
20
20
|
# @param document_id [Integer] document id ID
|
|
21
21
|
# @param title [String, nil] title
|
|
22
22
|
# @param content [String, nil] content
|
|
23
23
|
# @return [Hash] response data
|
|
24
|
-
def
|
|
25
|
-
with_operation(service: "documents", operation: "
|
|
24
|
+
def replace(document_id:, title: nil, content: nil)
|
|
25
|
+
with_operation(service: "documents", operation: "replace", is_mutation: true, resource_id: document_id) do
|
|
26
26
|
http_put("/documents/#{document_id}", body: compact_params(title: title, content: content)).json
|
|
27
27
|
end
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
# List documents in a vault
|
|
31
31
|
# @param vault_id [Integer] vault id ID
|
|
32
|
-
# @
|
|
33
|
-
|
|
32
|
+
# @param page [Integer, nil] Page number for paginating through results. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8.
|
|
33
|
+
# @param max_items [Integer, nil] cap on items yielded across pages; nil or non-positive means no cap
|
|
34
|
+
# @return [ListEnumerator<Hash>] lazily paginated results (#meta carries pagination metadata)
|
|
35
|
+
def list(vault_id:, page: nil, max_items: nil)
|
|
34
36
|
wrap_paginated(service: "documents", operation: "list", is_mutation: false, resource_id: vault_id) do
|
|
35
|
-
|
|
37
|
+
params = compact_query_params(page: page)
|
|
38
|
+
paginate("/vaults/#{vault_id}/documents.json", params: params, operation: "ListDocuments", max_items: max_items)
|
|
36
39
|
end
|
|
37
40
|
end
|
|
38
41
|
|
|
@@ -8,12 +8,13 @@ module Basecamp
|
|
|
8
8
|
class DraftsService < BaseService
|
|
9
9
|
|
|
10
10
|
# List the current user's drafts across their active projects, most recently
|
|
11
|
-
# @param page [Integer, nil] Page number for paginating through results. Defaults to 1.
|
|
12
|
-
# @
|
|
13
|
-
|
|
11
|
+
# @param page [Integer, nil] Page number for paginating through results. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8.
|
|
12
|
+
# @param max_items [Integer, nil] cap on items yielded across pages; nil or non-positive means no cap
|
|
13
|
+
# @return [ListEnumerator<Hash>] lazily paginated results (#meta carries pagination metadata)
|
|
14
|
+
def list_my_drafts(page: nil, max_items: nil)
|
|
14
15
|
wrap_paginated(service: "drafts", operation: "list_my_drafts", is_mutation: false) do
|
|
15
16
|
params = compact_query_params(page: page)
|
|
16
|
-
paginate("/my/drafts.json", params: params, operation: "ListMyDrafts")
|
|
17
|
+
paginate("/my/drafts.json", params: params, operation: "ListMyDrafts", max_items: max_items)
|
|
17
18
|
end
|
|
18
19
|
end
|
|
19
20
|
end
|
|
@@ -9,10 +9,13 @@ module Basecamp
|
|
|
9
9
|
|
|
10
10
|
# List all events for a recording
|
|
11
11
|
# @param recording_id [Integer] recording id ID
|
|
12
|
-
# @
|
|
13
|
-
|
|
12
|
+
# @param page [Integer, nil] Page number for paginating through results. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8.
|
|
13
|
+
# @param max_items [Integer, nil] cap on items yielded across pages; nil or non-positive means no cap
|
|
14
|
+
# @return [ListEnumerator<Hash>] lazily paginated results (#meta carries pagination metadata)
|
|
15
|
+
def list(recording_id:, page: nil, max_items: nil)
|
|
14
16
|
wrap_paginated(service: "events", operation: "list", is_mutation: false, resource_id: recording_id) do
|
|
15
|
-
|
|
17
|
+
params = compact_query_params(page: page)
|
|
18
|
+
paginate("/recordings/#{recording_id}/events.json", params: params, operation: "ListEvents", max_items: max_items)
|
|
16
19
|
end
|
|
17
20
|
end
|
|
18
21
|
end
|