Module: Paperdrive::Client::Notes

Includes:
Parameters
Included in:
Paperdrive::Client
Defined in:
lib/paperdrive/client/notes.rb

Overview

Instance methods related to Notes to embed into Paperdrive::Client
arguments are compatible with the Pipedribe API.

Instance Method Summary collapse

Instance Method Details

#all_notes(**args) ⇒ Paperdrive::Response

GET

fetch Notes list



18
19
20
21
22
23
# File 'lib/paperdrive/client/notes.rb', line 18

def all_notes(**args)
  params = parameters(args) do
    optional_params :user_id, :deal_id, :person_id, :org_id, :start, :limit, :sort, :start_date, :end_date, :pinned_to_deal_flag, :pinned_to_organization_flag, :pinned_to_person_flag
  end
  request(:get, 'notes', params)
end

#create_note(**args) ⇒ Paperdrive::Response

POST

create a single Note



41
42
43
44
45
46
47
# File 'lib/paperdrive/client/notes.rb', line 41

def create_note(**args)
  params = parameters(args) do
    required_params :content
    optional_params :content, :deal_id, :person_id, :org_id, :add_time, :pinned_to_deal_flag, :pinned_to_organization_flag, :pinned_to_person_flag
  end
  request(:post, 'notes', params)
end

#delete_note(id:, **args) ⇒ Paperdrive::Response

DELETE

delete a single note



66
67
68
69
70
71
# File 'lib/paperdrive/client/notes.rb', line 66

def delete_note(id:, **args)
  params = parameters(args) do
    optional_params
  end
  request(:delete, "notes/#{id}", params)
end

#edit_note(id:, **args) ⇒ Paperdrive::Response

PUT

update a single note

Parameters:

  • id: (integer)

    ID of the note to update

Returns:

See Also:



54
55
56
57
58
59
60
# File 'lib/paperdrive/client/notes.rb', line 54

def edit_note(id:, **args)
  params = parameters(args) do
    required_params :content
    optional_params :content, :deal_id, :person_id, :org_id, :add_time, :pinned_to_deal_flag, :pinned_to_organization_flag, :pinned_to_person_flag
  end
  request(:put, "notes/#{id}", params)
end

#note_detail(id:, **args) ⇒ Paperdrive::Response

GET

fetch a single note whose ID specified

Parameters:

  • id: (integer)

    ID of the note to fetch

Returns:

See Also:



30
31
32
33
34
35
# File 'lib/paperdrive/client/notes.rb', line 30

def note_detail(id:, **args)
  params = parameters(args) do
    optional_params
  end
  request(:get, "notes/#{id}", params)
end