Class: Attio::Resources::Notes Private
- Defined in:
- lib/attio/resources/notes.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
API resource for managing notes in Attio
Notes can be attached to records to track important information, meeting notes, or any other textual data.
Instance Method Summary collapse
-
#create(parent_object:, parent_record_id:, title:, content:, **data) ⇒ Hash
private
Create a new note.
-
#delete(id:) ⇒ Hash
private
Delete a note.
-
#get(id:) ⇒ Hash
private
Get a specific note by ID.
-
#list(parent_object:, parent_record_id:, **params) ⇒ Hash
private
List notes for a specific parent record.
-
#update(id:, **data) ⇒ Hash
private
Update an existing note.
- #validate_note_update_data!(data) ⇒ Object private private
Constructor Details
This class inherits a constructor from Attio::Resources::Base
Instance Method Details
#create(parent_object:, parent_record_id:, title:, content:, **data) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Create a new note
63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/attio/resources/notes.rb', line 63 def create(parent_object:, parent_record_id:, title:, content:, **data) validate_parent!(parent_object, parent_record_id) validate_required_string!(title, "Note title") validate_required_string!(content, "Note content") request(:post, "notes", data.merge( parent_object: parent_object, parent_record_id: parent_record_id, title: title, content: content )) end |
#delete(id:) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Delete a note
97 98 99 100 |
# File 'lib/attio/resources/notes.rb', line 97 def delete(id:) validate_id!(id, "Note") request(:delete, "notes/#{id}") end |
#get(id:) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Get a specific note by ID
48 49 50 51 |
# File 'lib/attio/resources/notes.rb', line 48 def get(id:) validate_id!(id, "Note") request(:get, "notes/#{id}") end |
#list(parent_object:, parent_record_id:, **params) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
List notes for a specific parent record
34 35 36 37 38 39 40 |
# File 'lib/attio/resources/notes.rb', line 34 def list(parent_object:, parent_record_id:, **params) validate_parent!(parent_object, parent_record_id) request(:get, "notes", params.merge( parent_object: parent_object, parent_record_id: parent_record_id )) end |
#update(id:, **data) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Update an existing note
85 86 87 88 89 |
# File 'lib/attio/resources/notes.rb', line 85 def update(id:, **data) validate_id!(id, "Note") validate_note_update_data!(data) request(:patch, "notes/#{id}", data) end |
#validate_note_update_data!(data) ⇒ Object (private)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
102 103 104 105 106 107 |
# File 'lib/attio/resources/notes.rb', line 102 private def validate_note_update_data!(data) raise ArgumentError, "Update data is required" if data.empty? return if data.key?(:title) || data.key?(:content) raise ArgumentError, "Must provide title or content to update" end |