Skip to content

Commit 12440fc

Browse files
committed
feat: add support for include_hidden_folders query parameter in folders list endpoint
1 parent 3544b17 commit 12440fc

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
### [Unreleased]
4+
* Added support for `include_hidden_folders` query parameter in folders list endpoint for Microsoft accounts to control whether hidden folders are included in the response
5+
36
### 6.5.0 / 2025-06-13
47
* Replaced `rest-client` dependency with `httparty` for improved maintainability and security
58
- `rest-client` is no longer actively maintained and has known security vulnerabilities

lib/nylas/resources/folders.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class Folders < Resource
1515
#
1616
# @param identifier [String] Grant ID or email account to query.
1717
# @param query_params [Hash, nil] Query params to pass to the request.
18+
# - include_hidden_folders [Boolean] (Microsoft only) When true, includes hidden folders.
1819
# @return [Array(Array(Hash), String, String)] The list of folders, API Request ID, and next cursor.
1920
def list(identifier:, query_params: nil)
2021
get_list(

spec/nylas/resources/folders_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@
3434

3535
expect(folders_response).to eq(list_response)
3636
end
37+
38+
it "calls the get method with the correct query parameters including include_hidden_folders" do
39+
identifier = "abc-123-grant-id"
40+
query_params = { include_hidden_folders: true }
41+
path = "#{api_uri}/v3/grants/#{identifier}/folders"
42+
allow(folders).to receive(:get_list)
43+
.with(path: path, query_params: query_params)
44+
.and_return(list_response)
45+
46+
folders_response = folders.list(identifier: identifier, query_params: query_params)
47+
48+
expect(folders_response).to eq(list_response)
49+
end
3750
end
3851

3952
describe "#find" do

0 commit comments

Comments
 (0)