From 7c619b53baa8b57ee5d654946a25d9b3f74eea81 Mon Sep 17 00:00:00 2001 From: Blag Date: Wed, 21 Feb 2024 12:43:18 -0500 Subject: [PATCH] Update Grants.rb add Patch (#464) * Update Grants.rb add Patch Add Patch operation, as it is needed when doing Update Grant * Update grants_spec to use patch Test should use patch instead of put for grants update --- lib/nylas/resources/grants.rb | 3 ++- spec/nylas/resources/grants_spec.rb | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/nylas/resources/grants.rb b/lib/nylas/resources/grants.rb index 912bbe27..f6234c37 100644 --- a/lib/nylas/resources/grants.rb +++ b/lib/nylas/resources/grants.rb @@ -9,6 +9,7 @@ class Grants < Resource include ApiOperations::Get include ApiOperations::Put include ApiOperations::Delete + include ApiOperations::Patch # Return all grants. # @@ -37,7 +38,7 @@ def find(grant_id:) # @param request_body [Hash] The values to update the grant with # @return [Array(Hash, String)] The updated grant and API Request ID. def update(grant_id:, request_body:) - put( + patch( path: "#{api_uri}/v3/grants/#{grant_id}", request_body: request_body ) diff --git a/spec/nylas/resources/grants_spec.rb b/spec/nylas/resources/grants_spec.rb index 78eea7e2..c923d1ab 100644 --- a/spec/nylas/resources/grants_spec.rb +++ b/spec/nylas/resources/grants_spec.rb @@ -56,7 +56,7 @@ scope: %w[https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile] } path = "#{api_uri}/v3/grants/#{grant_id}" - allow(grants).to receive(:put) + allow(grants).to receive(:patch) .with(path: path, request_body: request_body) .and_return(response)