Class: Nylas::Folders
- Includes:
- ApiOperations::Delete, ApiOperations::Get, ApiOperations::Post, ApiOperations::Put
- Defined in:
- lib/nylas/resources/folders.rb
Overview
Nylas Folder API
Instance Method Summary collapse
-
#create(identifier:, request_body:) ⇒ Array(Hash, String)
Create a folder.
-
#destroy(identifier:, folder_id:) ⇒ Array(TrueClass, String)
Delete a folder.
-
#find(identifier:, folder_id:) ⇒ Array(Hash, String)
Return a folder.
-
#list(identifier:, query_params: nil) ⇒ Array(Array(Hash), String, String)
Return all folders.
-
#update(identifier:, folder_id:, request_body:) ⇒ Array(Hash, String)
Update a folder.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Nylas::Resource
Instance Method Details
#create(identifier:, request_body:) ⇒ Array(Hash, String)
Create a folder.
42 43 44 45 46 47 |
# File 'lib/nylas/resources/folders.rb', line 42 def create(identifier:, request_body:) post( path: "#{api_uri}/v3/grants/#{identifier}/folders", request_body: request_body ) end |
#destroy(identifier:, folder_id:) ⇒ Array(TrueClass, String)
Delete a folder.
67 68 69 70 71 72 73 |
# File 'lib/nylas/resources/folders.rb', line 67 def destroy(identifier:, folder_id:) _, request_id = delete( path: "#{api_uri}/v3/grants/#{identifier}/folders/#{folder_id}" ) [true, request_id] end |
#find(identifier:, folder_id:) ⇒ Array(Hash, String)
Return a folder.
31 32 33 34 35 |
# File 'lib/nylas/resources/folders.rb', line 31 def find(identifier:, folder_id:) get( path: "#{api_uri}/v3/grants/#{identifier}/folders/#{folder_id}" ) end |
#list(identifier:, query_params: nil) ⇒ Array(Array(Hash), String, String)
Return all folders.
19 20 21 22 23 24 |
# File 'lib/nylas/resources/folders.rb', line 19 def list(identifier:, query_params: nil) get_list( path: "#{api_uri}/v3/grants/#{identifier}/folders", query_params: query_params ) end |
#update(identifier:, folder_id:, request_body:) ⇒ Array(Hash, String)
Update a folder.
55 56 57 58 59 60 |
# File 'lib/nylas/resources/folders.rb', line 55 def update(identifier:, folder_id:, request_body:) put( path: "#{api_uri}/v3/grants/#{identifier}/folders/#{folder_id}", request_body: request_body ) end |