lib/nylas/resources/messages.rb in nylas-6.0.3 vs lib/nylas/resources/messages.rb in nylas-6.1.0
- old
+ new
@@ -36,27 +36,31 @@
# Return a message.
#
# @param identifier [String] Grant ID or email account to query.
# @param message_id [String] The id of the message to return.
+ # @param query_params [Hash, nil] Query params to pass to the request.
# @return [Array(Hash, String)] The message and API request ID.
- def find(identifier:, message_id:)
+ def find(identifier:, message_id:, query_params: nil)
get(
- path: "#{api_uri}/v3/grants/#{identifier}/messages/#{message_id}"
+ path: "#{api_uri}/v3/grants/#{identifier}/messages/#{message_id}",
+ query_params: query_params
)
end
# Update a message.
#
# @param identifier [String] Grant ID or email account in which to update an object.
# @param message_id [String] The id of the message to update.
# @param request_body [Hash] The values to update the message with
+ # @param query_params [Hash, nil] Query params to pass to the request.
# @return [Array(Hash, String)] The updated message and API Request ID.
- def update(identifier:, message_id:, request_body:)
+ def update(identifier:, message_id:, request_body:, query_params: nil)
put(
path: "#{api_uri}/v3/grants/#{identifier}/messages/#{message_id}",
- request_body: request_body
+ request_body: request_body,
+ query_params: query_params
)
end
# Delete a message.
#
@@ -67,9 +71,21 @@
_, request_id = delete(
path: "#{api_uri}/v3/grants/#{identifier}/messages/#{message_id}"
)
[true, request_id]
+ end
+
+ # Clean a message.
+ #
+ # @param identifier [String] Grant ID or email account from which to clean a message.
+ # @param request_body [Hash] The options to clean a message with
+ # @return [Array(Hash)] The list of clean messages.
+ def clean_messages(identifier:, request_body:)
+ put(
+ path: "#{api_uri}/v3/grants/#{identifier}/messages/clean",
+ request_body: request_body
+ )
end
# Send a message.
#
# @param identifier [String] Grant ID or email account from which to delete an object.