Skip to content

Commit

Permalink
Added query support for folders (#492)
Browse files Browse the repository at this point in the history
This PR adds the ability to pass query parameters for listing folders. Closes #488.
  • Loading branch information
mrashed-dev authored Sep 24, 2024
1 parent 7cac99c commit 7b59db5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
6 changes: 4 additions & 2 deletions lib/nylas/resources/folders.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion spec/nylas/resources/folders_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 7b59db5

Please sign in to comment.