From 8cc50b297256b05771d0b4879d2a5f7d09a9bab2 Mon Sep 17 00:00:00 2001 From: Blag Date: Wed, 20 Dec 2023 09:24:31 -0500 Subject: [PATCH 1/2] Update drafts.rb to include send Adding "send" to the drafts endpoint --- lib/nylas/resources/drafts.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/nylas/resources/drafts.rb b/lib/nylas/resources/drafts.rb index 654dad60..3686fc98 100644 --- a/lib/nylas/resources/drafts.rb +++ b/lib/nylas/resources/drafts.rb @@ -87,5 +87,20 @@ def destroy(identifier:, draft_id:) [true, request_id] end + + # Send an draft. + # + # @param identifier [String] Grant ID or email account from which to delete an object. + # @param draft_id [String] The id of the draft to delete. + # @return [Array(Hash, String)] The sent message draft and the API Request ID. + def send(identifier:, draft_id:) + + response = post( + path: "#{api_uri}/v3/grants/#{identifier}/drafts/#{draft_id}" + ) + + response + end + end end From a93bba18ac8ecc2eb0f5ed37e73c4c3377778919 Mon Sep 17 00:00:00 2001 From: Blag Date: Wed, 20 Dec 2023 10:47:35 -0500 Subject: [PATCH 2/2] Fix doc lines --- lib/nylas/resources/drafts.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nylas/resources/drafts.rb b/lib/nylas/resources/drafts.rb index 3686fc98..c43a2883 100644 --- a/lib/nylas/resources/drafts.rb +++ b/lib/nylas/resources/drafts.rb @@ -90,8 +90,8 @@ def destroy(identifier:, draft_id:) # Send an draft. # - # @param identifier [String] Grant ID or email account from which to delete an object. - # @param draft_id [String] The id of the draft to delete. + # @param identifier [String] Grant ID or email account from which to send the draft. + # @param draft_id [String] The id of the draft to send. # @return [Array(Hash, String)] The sent message draft and the API Request ID. def send(identifier:, draft_id:)