Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added query support for folders #492

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading