diff --git a/CHANGELOG.md b/CHANGELOG.md index ff94779e..32b3c78f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ # Changelog ### Unreleased +* Added query support for folders * Added dependency on `ostruct` gem * Enable SDK to reattach large files to messages on retry diff --git a/lib/nylas/resources/folders.rb b/lib/nylas/resources/folders.rb index 963a7d33..886f9469 100644 --- a/lib/nylas/resources/folders.rb +++ b/lib/nylas/resources/folders.rb @@ -14,10 +14,12 @@ class Folders < Resource # Return all folders. # # @param identifier [String] Grant ID or email account to query. + # @param query_params [Hash, nil] Query params to pass to the request. # @return [Array(Array(Hash), String, String)] The list of folders, API Request ID, and next cursor. - def list(identifier:) + def list(identifier:, query_params: nil) get_list( - path: "#{api_uri}/v3/grants/#{identifier}/folders" + path: "#{api_uri}/v3/grants/#{identifier}/folders", + query_params: query_params ) end diff --git a/spec/nylas/resources/folders_spec.rb b/spec/nylas/resources/folders_spec.rb index 8c6e40c8..daa8c20a 100644 --- a/spec/nylas/resources/folders_spec.rb +++ b/spec/nylas/resources/folders_spec.rb @@ -27,7 +27,7 @@ identifier = "abc-123-grant-id" path = "#{api_uri}/v3/grants/#{identifier}/folders" allow(folders).to receive(:get_list) - .with(path: path) + .with(path: path, query_params: nil) .and_return(list_response) folders_response = folders.list(identifier: identifier)