Module: Insightly2::DSL::Notes
- Included in:
- Insightly2::DSL
- Defined in:
- lib/insightly2/dsl/notes.rb
Instance Method Summary collapse
-
#create_note(note:) ⇒ Insightly2::Resources::Note?
POST /v2.1/Notes Creates a note.
-
#create_note_comment(id:, comment:) ⇒ Faraday::Response
POST /v2.1/Notes/c_id/Comments Create a comment for a note.
-
#create_note_file(id:, filename:) ⇒ Faraday::Response
POST /v2.1/Notes?c_id=c_id&filename=filename Adds a File Attachment to a Note.
-
#delete_note(id:) ⇒ Faraday::Response
DELETE /v2.1/Notes/id.
-
#get_note(id:) ⇒ Insightly2::Resources::Note?
GET /v2.1/Notes/id Get a note.
-
#get_note_comments(id:) ⇒ Array?
GET /v2.1/Notes/c_id/Comments Gets the comments attached to a note.
-
#get_notes ⇒ Insightly2::Resources::Note?
GET /v2.1/Notes Get a list of notes.
-
#update_note(note:) ⇒ Insightly2::Resources::Note?
PUT /v2.1/Notes Updates a note.
Instance Method Details
#create_note(note:) ⇒ Insightly2::Resources::Note?
POST /v2.1/Notes Creates a note.
37 38 39 40 |
# File 'lib/insightly2/dsl/notes.rb', line 37 def create_note(note:) raise ArgumentError, "Note cannot be blank" if note.blank? Resources::Note.parse(request(:post, "Notes", note)) end |
#create_note_comment(id:, comment:) ⇒ Faraday::Response
POST /v2.1/Notes/c_id/Comments Create a comment for a note.
48 49 50 51 52 |
# File 'lib/insightly2/dsl/notes.rb', line 48 def create_note_comment(id:, comment:) raise ArgumentError, "ID cannot be blank" if id.blank? raise ArgumentError, "Comment cannot be blank" if comment.blank? request(:post, "Notes/#{id}/Comments", comment) end |
#create_note_file(id:, filename:) ⇒ Faraday::Response
POST /v2.1/Notes?c_id=c_id&filename=filename Adds a File Attachment to a Note.
60 61 62 63 64 |
# File 'lib/insightly2/dsl/notes.rb', line 60 def create_note_file(id:, filename:) raise ArgumentError, "ID cannot be blank" if id.blank? raise ArgumentError, "Filename cannot be blank" if filename.blank? request(:post, "Notes?c_id=#{id}&filename=#{filename}") end |
#delete_note(id:) ⇒ Faraday::Response
DELETE /v2.1/Notes/id
80 81 82 83 |
# File 'lib/insightly2/dsl/notes.rb', line 80 def delete_note(id:) raise ArgumentError, "ID cannot be blank" if id.blank? request(:delete, "Notes/#{id}") end |
#get_note(id:) ⇒ Insightly2::Resources::Note?
GET /v2.1/Notes/id Get a note.
10 11 12 13 |
# File 'lib/insightly2/dsl/notes.rb', line 10 def get_note(id:) raise ArgumentError, "ID cannot be blank" if id.blank? Resources::Note.parse(request(:get, "Notes/#{id}")) end |
#get_note_comments(id:) ⇒ Array?
GET /v2.1/Notes/c_id/Comments Gets the comments attached to a note.
20 21 22 23 |
# File 'lib/insightly2/dsl/notes.rb', line 20 def get_note_comments(id:) raise ArgumentError, "ID cannot be blank" if id.blank? Resources::Comment.parse(request(:get, "Notes/#{id}/Comments")) end |
#get_notes ⇒ Insightly2::Resources::Note?
GET /v2.1/Notes Get a list of notes.
28 29 30 |
# File 'lib/insightly2/dsl/notes.rb', line 28 def get_notes Resources::Note.parse(request(:get, "Notes")) end |
#update_note(note:) ⇒ Insightly2::Resources::Note?
PUT /v2.1/Notes Updates a note.
71 72 73 74 |
# File 'lib/insightly2/dsl/notes.rb', line 71 def update_note(note:) raise ArgumentError, "Note cannot be blank" if note.blank? Resources::Note.parse(request(:put, "Notes", note)) end |