lib/chatwork/client/task_methods.rb in chatwork-0.10.0 vs lib/chatwork/client/task_methods.rb in chatwork-0.11.0
- old
+ new
@@ -104,6 +104,29 @@
# "status": "open"
# }
def find_task(room_id:, task_id:, &block)
get("/rooms/#{room_id}/tasks/#{task_id}", &block)
end
+
+ # Update task completion status
+ #
+ # @see http://developer.chatwork.com/ja/endpoint_rooms.html#PUT-rooms-room_id-tasks-task_id-status
+ # @see http://download.chatwork.com/ChatWork_API_Documentation.pdf
+ #
+ # @param room_id [Integer]
+ # @param task_id [Integer]
+ # @param body [String] Task completion status (e.g. `open`, `done`)
+ #
+ # @yield [response_body, response_header] if block was given, return response body and response header through block arguments
+ # @yieldparam response_body [Hashie::Mash] response body
+ # @yieldparam response_header [Hash<String, String>] response header (e.g. X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset)
+ #
+ # @return [Hashie::Mash]
+ #
+ # @example response format
+ # {
+ # "task_id": 1234
+ # }
+ def update_task_status(room_id:, task_id:, body:, &block)
+ put("/rooms/#{room_id}/tasks/#{task_id}/status", body: body, &block)
+ end
end