paperdrive 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.rspec +3 -0
- data/.rubocop.yml +18 -0
- data/.travis.yml +9 -0
- data/CHANGELOG.md +29 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +75 -0
- data/README.md +120 -0
- data/Rakefile +8 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/lib/paperdrive/client/activities.rb +92 -0
- data/lib/paperdrive/client/activity_fields.rb +36 -0
- data/lib/paperdrive/client/activity_types.rb +77 -0
- data/lib/paperdrive/client/currencies.rb +26 -0
- data/lib/paperdrive/client/deal_fields.rb +87 -0
- data/lib/paperdrive/client/deals.rb +335 -0
- data/lib/paperdrive/client/filters.rb +87 -0
- data/lib/paperdrive/client/global_messages.rb +38 -0
- data/lib/paperdrive/client/mail_messages.rb +26 -0
- data/lib/paperdrive/client/mail_threads.rb +75 -0
- data/lib/paperdrive/client/note_fields.rb +25 -0
- data/lib/paperdrive/client/notes.rb +74 -0
- data/lib/paperdrive/client/organization_fields.rb +87 -0
- data/lib/paperdrive/client/organization_relationships.rb +75 -0
- data/lib/paperdrive/client/organizations.rb +233 -0
- data/lib/paperdrive/client/permission_sets.rb +89 -0
- data/lib/paperdrive/client/person_fields.rb +87 -0
- data/lib/paperdrive/client/persons.rb +258 -0
- data/lib/paperdrive/client/pipelines.rb +111 -0
- data/lib/paperdrive/client/product_fields.rb +87 -0
- data/lib/paperdrive/client/products.rb +160 -0
- data/lib/paperdrive/client/recents.rb +27 -0
- data/lib/paperdrive/client/roles.rb +149 -0
- data/lib/paperdrive/client/search_results.rb +39 -0
- data/lib/paperdrive/client/stages.rb +98 -0
- data/lib/paperdrive/client/user_connections.rb +26 -0
- data/lib/paperdrive/client/user_settings.rb +26 -0
- data/lib/paperdrive/client/users.rb +235 -0
- data/lib/paperdrive/client/webhooks.rb +50 -0
- data/lib/paperdrive/client.rb +122 -0
- data/lib/paperdrive/error.rb +42 -0
- data/lib/paperdrive/parameters.rb +34 -0
- data/lib/paperdrive/response.rb +42 -0
- data/lib/paperdrive/version.rb +6 -0
- data/lib/paperdrive.rb +7 -0
- data/paperdrive.gemspec +33 -0
- metadata +203 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 9e70d62d8272e1fb31e8f490c696daf0aee9e6b24fdd2166dc89a50d377027cf
|
4
|
+
data.tar.gz: 027bd41cf1cd3ecbda7fa80bc0b377c175f95e6800fb61937ed0bda8dded5b0e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6aff1139b7d433fc1fcb52350e8ca1ba3eab0f90b1886ea468d991179d0a627de3c8d94bd7a331487d42d28f2ea1f68c88766b07cdd6b9f22ae20a71c1d28e17
|
7
|
+
data.tar.gz: 83e4f629d87bbb641d30e69a9c98a7e9b2a4d8a1d3a829257c30318ba63c2f95ee4916a6827f021be2f010cffb94272c0790a6e785ef99dddcd027acbde345d1
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
AllCops:
|
2
|
+
DisplayCopNames: true
|
3
|
+
TargetRubyVersion: 2.3
|
4
|
+
LineLength:
|
5
|
+
Enabled: false
|
6
|
+
Layout/EmptyLineAfterMagicComment:
|
7
|
+
StyleGuide: '#separate-magic-comments-from-code'
|
8
|
+
Enabled: true
|
9
|
+
Metrics/AbcSize:
|
10
|
+
Enabled: false
|
11
|
+
Style/StructInheritance:
|
12
|
+
Enabled: false
|
13
|
+
Style/Documentation:
|
14
|
+
Enabled: false
|
15
|
+
Style/RedundantFreeze:
|
16
|
+
Enabled: true
|
17
|
+
Metrics:
|
18
|
+
Enabled: false
|
data/.travis.yml
ADDED
data/CHANGELOG.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Change Log
|
2
|
+
All notable changes to this project will be documented in this file.
|
3
|
+
|
4
|
+
The format is maybe based on [Keep a Changelog](http://keepachangelog.com/)
|
5
|
+
|
6
|
+
## [0.0.5] - 2019-01-26
|
7
|
+
### Changed
|
8
|
+
- changed the gem name from 'Paperdrive' to 'paperdrive'.
|
9
|
+
|
10
|
+
## [0.0.4] - 2019-01-16
|
11
|
+
### Added
|
12
|
+
- add many PaperDrive::Client::XXXXs
|
13
|
+
|
14
|
+
## [0.0.3] - 2019-01-15
|
15
|
+
### Added
|
16
|
+
- add many PaperDrive::Client::XXXXs
|
17
|
+
|
18
|
+
## [0.0.2] - 2019-01-15
|
19
|
+
### Added
|
20
|
+
- CHANGELOG.md
|
21
|
+
- PaperDrive::Client::Activities
|
22
|
+
- PaperDrive::Client::Notes
|
23
|
+
|
24
|
+
### Changed
|
25
|
+
- Drastically changed the architecture
|
26
|
+
|
27
|
+
## 0.0.1 - 2019-01-08 [yanked]
|
28
|
+
### Added
|
29
|
+
- Released!
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,75 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
Paperdrive (0.0.4)
|
5
|
+
activesupport
|
6
|
+
faraday (~> 0.15.4)
|
7
|
+
faraday_middleware (~> 0.12.2)
|
8
|
+
|
9
|
+
GEM
|
10
|
+
remote: https://rubygems.org/
|
11
|
+
specs:
|
12
|
+
activesupport (5.2.2)
|
13
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
|
+
i18n (>= 0.7, < 2)
|
15
|
+
minitest (~> 5.1)
|
16
|
+
tzinfo (~> 1.1)
|
17
|
+
ast (2.4.0)
|
18
|
+
concurrent-ruby (1.1.4)
|
19
|
+
diff-lcs (1.3)
|
20
|
+
faraday (0.15.4)
|
21
|
+
multipart-post (>= 1.2, < 3)
|
22
|
+
faraday_middleware (0.12.2)
|
23
|
+
faraday (>= 0.7.4, < 1.0)
|
24
|
+
i18n (1.5.2)
|
25
|
+
concurrent-ruby (~> 1.0)
|
26
|
+
jaro_winkler (1.5.2)
|
27
|
+
minitest (5.11.3)
|
28
|
+
multipart-post (2.0.0)
|
29
|
+
parallel (1.12.1)
|
30
|
+
parser (2.5.3.0)
|
31
|
+
ast (~> 2.4.0)
|
32
|
+
powerpack (0.1.2)
|
33
|
+
rainbow (3.0.0)
|
34
|
+
rake (10.5.0)
|
35
|
+
rspec (3.7.0)
|
36
|
+
rspec-core (~> 3.7.0)
|
37
|
+
rspec-expectations (~> 3.7.0)
|
38
|
+
rspec-mocks (~> 3.7.0)
|
39
|
+
rspec-core (3.7.1)
|
40
|
+
rspec-support (~> 3.7.0)
|
41
|
+
rspec-expectations (3.7.0)
|
42
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
43
|
+
rspec-support (~> 3.7.0)
|
44
|
+
rspec-mocks (3.7.0)
|
45
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
46
|
+
rspec-support (~> 3.7.0)
|
47
|
+
rspec-support (3.7.1)
|
48
|
+
rubocop (0.62.0)
|
49
|
+
jaro_winkler (~> 1.5.1)
|
50
|
+
parallel (~> 1.10)
|
51
|
+
parser (>= 2.5, != 2.5.1.1)
|
52
|
+
powerpack (~> 0.1)
|
53
|
+
rainbow (>= 2.2.2, < 4.0)
|
54
|
+
ruby-progressbar (~> 1.7)
|
55
|
+
unicode-display_width (~> 1.4.0)
|
56
|
+
ruby-progressbar (1.10.0)
|
57
|
+
thread_safe (0.3.6)
|
58
|
+
tzinfo (1.2.5)
|
59
|
+
thread_safe (~> 0.1)
|
60
|
+
unicode-display_width (1.4.1)
|
61
|
+
yard (0.9.16)
|
62
|
+
|
63
|
+
PLATFORMS
|
64
|
+
ruby
|
65
|
+
|
66
|
+
DEPENDENCIES
|
67
|
+
Paperdrive!
|
68
|
+
bundler (~> 1.16)
|
69
|
+
rake (~> 10.0)
|
70
|
+
rspec (~> 3.0)
|
71
|
+
rubocop (~> 0.62.0)
|
72
|
+
yard
|
73
|
+
|
74
|
+
BUNDLED WITH
|
75
|
+
1.16.1
|
data/README.md
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
# Paperdrive
|
2
|
+
|
3
|
+
Paperdrive is the unofficial [Pipedrive](https://www.pipedrive.com/) API wrapper gem.
|
4
|
+
[](https://travis-ci.org/rnitta/Paperdrive)
|
5
|
+
[](https://rubygems.org/gems/Paperdrive)
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile (Recommended):
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'paperdrive'
|
13
|
+
```
|
14
|
+
|
15
|
+
```shell
|
16
|
+
$ bundle install
|
17
|
+
```
|
18
|
+
|
19
|
+
---
|
20
|
+
|
21
|
+
Or install it on your global:
|
22
|
+
|
23
|
+
```shell
|
24
|
+
$ gem install paperdrive
|
25
|
+
```
|
26
|
+
|
27
|
+
## Document
|
28
|
+
[YARD doc](https://paperdrive-doc.netlify.com/)
|
29
|
+
|
30
|
+
## Usage
|
31
|
+
|
32
|
+
First, you should get API Token from Pipedrive dashboard.
|
33
|
+
|
34
|
+
Then,
|
35
|
+
|
36
|
+
```ruby
|
37
|
+
require 'paperdrive'
|
38
|
+
|
39
|
+
client = Paperdrive::Client.new(token: 'your_token_here')
|
40
|
+
# or setting token to ENV['PAPERDRIVE_TOKEN'] and you can initialize with `Paperdrive::Client.new`.
|
41
|
+
|
42
|
+
response = client.all_activities(user_id: 1, done: 1)
|
43
|
+
# => #<Paperdrive::Response>
|
44
|
+
|
45
|
+
pp response
|
46
|
+
# =>
|
47
|
+
# #<Paperdrive::Response:0x00007ff811221b70
|
48
|
+
# @body=
|
49
|
+
# {"success"=>true,
|
50
|
+
# "data"=>
|
51
|
+
# [{"id"=>0,
|
52
|
+
# "company_id"=>000000,
|
53
|
+
# "user_id"=>000000,
|
54
|
+
# "done"=>false,
|
55
|
+
# "type"=>"call",
|
56
|
+
# "reference_type"=>nil,
|
57
|
+
# "reference_id"=>nil,
|
58
|
+
# "due_date"=>"2019-01-08",
|
59
|
+
# "due_time"=>"",
|
60
|
+
# "duration"=>"",
|
61
|
+
# "add_time"=>"2019-01-08 20:28:31",
|
62
|
+
# "marked_as_done_time"=>"",
|
63
|
+
# "last_notification_time"=>nil,
|
64
|
+
# "last_notification_user_id"=>nil,
|
65
|
+
# "notification_language_id"=>nil,
|
66
|
+
# "subject"=>"Call",
|
67
|
+
# ...
|
68
|
+
|
69
|
+
response.success? #=> true
|
70
|
+
|
71
|
+
```
|
72
|
+
|
73
|
+
See `Paperdrive::Client` instance methods list [here (document)](https://paperdrive-doc.netlify.com/paperdrive/client)
|
74
|
+
|
75
|
+
|
76
|
+
## Development
|
77
|
+
|
78
|
+
Now developing, I appreciate your help.
|
79
|
+
|
80
|
+
|
81
|
+
### TODO
|
82
|
+
There are few APIs (mainly related to uploading files) still not wrapped.
|
83
|
+
|
84
|
+
- ~~Activities~~ (implemented)
|
85
|
+
- ~~ActivityFields~~ (implemented)
|
86
|
+
- ~~ActivityTypes~~ (implemented)
|
87
|
+
- Authorizations
|
88
|
+
- ~~Currencies~~ (implemented)
|
89
|
+
- ~~Deals~~ (implemented)
|
90
|
+
- ~~DealFields~~ (implemented)
|
91
|
+
- Files
|
92
|
+
- ~~Filters~~ (implemented)
|
93
|
+
- ~~GlobalMessages~~ (implemented)
|
94
|
+
- ~~MailMessages~~ (implemented)
|
95
|
+
- ~~MailThreads~~ (implemented)
|
96
|
+
- ~~Notes~~ (implemented)
|
97
|
+
- ~~NoteFields~~ (implemented)
|
98
|
+
- ~~OrganizationFields~~ (implemented)
|
99
|
+
- ~~Organizations~~ (implemented)
|
100
|
+
- ~~OrganizationRelationships~~ (implemented)
|
101
|
+
- ~~PermissionSets~~ (implemented)
|
102
|
+
- Persons (almost implemented)
|
103
|
+
- ~~PersonFields~~ (implemented)
|
104
|
+
- ~~Pipelines~~ (implemented)
|
105
|
+
- ~~Products~~ (implemented)
|
106
|
+
- ~~ProductFields~~ (implemented)
|
107
|
+
- ~~Recents~~ (implemented)
|
108
|
+
- ~~Roles~~ (implemented)
|
109
|
+
- ~~SearchResults~~ (implemented)
|
110
|
+
- ~~Stages~~ (implemented)
|
111
|
+
- ~~Users~~ (implemented)
|
112
|
+
- ~~UserConnections~~ (implemented)
|
113
|
+
- ~~UserSettings~~ (implemented)
|
114
|
+
- ~~Webhooks~~ (implemented)
|
115
|
+
|
116
|
+
- specs
|
117
|
+
|
118
|
+
## Contributing
|
119
|
+
|
120
|
+
Issue/Pull Request Please
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'paperdrive'
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require 'irb'
|
15
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'paperdrive/parameters'
|
4
|
+
|
5
|
+
module Paperdrive
|
6
|
+
class Client
|
7
|
+
# Instance methods related to Activities to embed into Paperdrive::Client<br>
|
8
|
+
# arguments are compatible with the Pipedribe API.
|
9
|
+
#
|
10
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/Activities
|
11
|
+
module Activities
|
12
|
+
include Paperdrive::Parameters
|
13
|
+
|
14
|
+
# [GET] fetch Activities list
|
15
|
+
#
|
16
|
+
# @example
|
17
|
+
# client.all_activities(type: 'task', start_date: '2020-05-01', done: 0)
|
18
|
+
#
|
19
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/Activities/get_activities
|
20
|
+
# @return [Paperdrive::Response]
|
21
|
+
def all_activities(**args)
|
22
|
+
params = parameters(args) do
|
23
|
+
optional_params :user_id, :filter_id, :type, :start, :limit, :start_date, :end_date, :done
|
24
|
+
end
|
25
|
+
request(:get, 'activities', params)
|
26
|
+
end
|
27
|
+
|
28
|
+
# [GET] fetch a single activity
|
29
|
+
#
|
30
|
+
# @param [integer] id: ID of the activity to fetch
|
31
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/Activities/get_activities_id
|
32
|
+
# @return [Paperdrive::Response]
|
33
|
+
def activity_detail(id:, **args)
|
34
|
+
params = parameters(args) do
|
35
|
+
optional_params
|
36
|
+
end
|
37
|
+
request(:get, "activities/#{id}", params)
|
38
|
+
end
|
39
|
+
|
40
|
+
# [POST] create a single activity
|
41
|
+
#
|
42
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/Activities/post_activities
|
43
|
+
# @return [Paperdrive::Response]
|
44
|
+
def create_activity(**args)
|
45
|
+
params = parameters(args) do
|
46
|
+
required_params :subject, :type
|
47
|
+
optional_params :subject, :type, :done, :due_date, :due_time, :duration, :user_id, :deal_id, :person_id, :participants, :org_id, :note
|
48
|
+
end
|
49
|
+
request(:post, 'activities', params)
|
50
|
+
end
|
51
|
+
|
52
|
+
# [PUT] update a single activity
|
53
|
+
#
|
54
|
+
# @param [integer] id: ID of the actibity to update
|
55
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/Activities/put_activities_id
|
56
|
+
# @return [Paperdrive::Response]
|
57
|
+
def edit_activity(id:, **args)
|
58
|
+
params = parameters(args) do
|
59
|
+
optional_params :subject, :type, :done, :due_date, :due_time, :duration, :user_id, :deal_id, :person_id, :participants, :org_id, :note
|
60
|
+
end
|
61
|
+
request(:put, "activities/#{id}", params)
|
62
|
+
end
|
63
|
+
|
64
|
+
# [DELETE] delete multiple activities
|
65
|
+
#
|
66
|
+
# @example Delete activities whose IDs are 1,2,3,4,5,6,7,8,9,10
|
67
|
+
# client.delete_activities(ids: [*(1..10)])
|
68
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/Activities/delete_activities
|
69
|
+
# @return [Paperdrive::Response]
|
70
|
+
def delete_activities(**args)
|
71
|
+
params = parameters(args) do
|
72
|
+
required_params :ids
|
73
|
+
optional_params :ids
|
74
|
+
end
|
75
|
+
request(:delete, 'activities', params)
|
76
|
+
end
|
77
|
+
|
78
|
+
# [DELETE] delete a single activity
|
79
|
+
#
|
80
|
+
# @example Delete the actibity whose id = 1
|
81
|
+
# client.delete_activities(id: 1)
|
82
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/Activities/delete_activities_id
|
83
|
+
# @return [Paperdrive::Response]
|
84
|
+
def delete_activity(id:, **args)
|
85
|
+
params = parameters(args) do
|
86
|
+
optional_params
|
87
|
+
end
|
88
|
+
request(:delete, "activities/#{id}", params)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'paperdrive/parameters'
|
4
|
+
|
5
|
+
module Paperdrive
|
6
|
+
class Client
|
7
|
+
# Instance methods related to ActivityFields to embed into Paperdrive::Client
|
8
|
+
#
|
9
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/ActivityFields
|
10
|
+
module ActivityFields
|
11
|
+
include Paperdrive::Parameters
|
12
|
+
|
13
|
+
# [GET] fetch all fields for activity.
|
14
|
+
#
|
15
|
+
# @example
|
16
|
+
# client.activity_fields.body
|
17
|
+
# #=> {
|
18
|
+
# "success": true,
|
19
|
+
# "data": [
|
20
|
+
# {
|
21
|
+
# "id": 1,
|
22
|
+
# "key": "id",
|
23
|
+
# "name": "ID",
|
24
|
+
# ....
|
25
|
+
#
|
26
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/ActivityFields/get_activityFields
|
27
|
+
# @return [Paperdrive::Response]
|
28
|
+
def all_activities(**args)
|
29
|
+
params = parameters(args) do
|
30
|
+
optional_params
|
31
|
+
end
|
32
|
+
request(:get, 'activityFields', params)
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'paperdrive/parameters'
|
4
|
+
|
5
|
+
module Paperdrive
|
6
|
+
class Client
|
7
|
+
# Instance methods related to ActivityTypes to embed into Paperdrive::Client<br>
|
8
|
+
# arguments are compatible with the Pipedribe API.
|
9
|
+
#
|
10
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/ActivityTypes
|
11
|
+
module ActivityTypes
|
12
|
+
include Paperdrive::Parameters
|
13
|
+
|
14
|
+
# [GET] fetch activity types list
|
15
|
+
#
|
16
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/ActivityTypes/get_activityTypes
|
17
|
+
# @return [Paperdrive::Response]
|
18
|
+
def all_activity_types(**args)
|
19
|
+
params = parameters(args) do
|
20
|
+
optional_params
|
21
|
+
end
|
22
|
+
request(:get, 'activityTypes', params)
|
23
|
+
end
|
24
|
+
|
25
|
+
# [POST] create an activity type
|
26
|
+
#
|
27
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/ActivityTypes/post_activityTypes
|
28
|
+
# @return [Paperdrive::Response]
|
29
|
+
def create_activity_type(**args)
|
30
|
+
params = parameters(args) do
|
31
|
+
required_params :name, :icon_key
|
32
|
+
optional_params :name, :icon_key, :color
|
33
|
+
end
|
34
|
+
request(:post, 'activityTypes', params)
|
35
|
+
end
|
36
|
+
|
37
|
+
# [PUT] update an activity type
|
38
|
+
#
|
39
|
+
# @param [integer] id: ID of the activity type to update
|
40
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/ActivityTypes/put_activityTypes_id
|
41
|
+
# @return [Paperdrive::Response]
|
42
|
+
def edit_activity_type(id:, **args)
|
43
|
+
params = parameters(args) do
|
44
|
+
optional_params :name, :icon_key, :color, :order_nr
|
45
|
+
end
|
46
|
+
request(:put, "activityTypes/#{id}", params)
|
47
|
+
end
|
48
|
+
|
49
|
+
# [DELETE] delete multiple activity types
|
50
|
+
#
|
51
|
+
# @example Delete activity types whose IDs are 1,2,3,4,5,6,7,8,9,10
|
52
|
+
# client.delete_activity_types(ids: [*(1..10)])
|
53
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/ActivityTypes/delete_activityTypes
|
54
|
+
# @return [Paperdrive::Response]
|
55
|
+
def delete_activitiy_types(**args)
|
56
|
+
params = parameters(args) do
|
57
|
+
required_params :ids
|
58
|
+
optional_params :ids
|
59
|
+
end
|
60
|
+
request(:delete, 'activityTypes', params)
|
61
|
+
end
|
62
|
+
|
63
|
+
# [DELETE] delete an activity type
|
64
|
+
#
|
65
|
+
# @example Delete the activity type whose id = 1
|
66
|
+
# client.delete_activity_types(id: 1)
|
67
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/ActivityTypes/delete_activityTypes_id
|
68
|
+
# @return [Paperdrive::Response]
|
69
|
+
def delete_activity_type(id:, **args)
|
70
|
+
params = parameters(args) do
|
71
|
+
optional_params
|
72
|
+
end
|
73
|
+
request(:delete, "activityTypes/#{id}", params)
|
74
|
+
end
|
75
|
+
end
|
76
|
+
end
|
77
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'paperdrive/parameters'
|
4
|
+
|
5
|
+
module Paperdrive
|
6
|
+
class Client
|
7
|
+
# Instance methods related to Currencies to embed into Paperdrive::Client<br>
|
8
|
+
# arguments are compatible with the Pipedribe API.
|
9
|
+
#
|
10
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/Currencies
|
11
|
+
module Currencies
|
12
|
+
include Paperdrive::Parameters
|
13
|
+
|
14
|
+
# [GET] fetch all supported currencies
|
15
|
+
#
|
16
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/Currencies/get_currencies
|
17
|
+
# @return [Paperdrive::Response]
|
18
|
+
def all_currencies(**args)
|
19
|
+
params = parameters(args) do
|
20
|
+
optional_params :term
|
21
|
+
end
|
22
|
+
request(:get, 'currencies', params)
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,87 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'paperdrive/parameters'
|
4
|
+
|
5
|
+
module Paperdrive
|
6
|
+
class Client
|
7
|
+
# Instance methods related to DealFields to embed into Paperdrive::Client<br>
|
8
|
+
# arguments are compatible with the Pipedribe API.
|
9
|
+
#
|
10
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/DealFields
|
11
|
+
module DealFields
|
12
|
+
include Paperdrive::Parameters
|
13
|
+
|
14
|
+
# [GET] Get all deal fields
|
15
|
+
#
|
16
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/DealFields/get_dealFields
|
17
|
+
# @return [Paperdrive::Response]
|
18
|
+
def all_deal_fields(**args)
|
19
|
+
params = parameters(args) do
|
20
|
+
optional_params :start, :limit
|
21
|
+
end
|
22
|
+
request(:get, 'dealFields', params)
|
23
|
+
end
|
24
|
+
|
25
|
+
# [GET] Get one deal field
|
26
|
+
#
|
27
|
+
# @param [integer] id:
|
28
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/DealFields/get_dealFields_id
|
29
|
+
# @return [Paperdrive::Response]
|
30
|
+
def deal_field(id:, **args)
|
31
|
+
params = parameters(args) do
|
32
|
+
optional_params
|
33
|
+
end
|
34
|
+
request(:get, "dealFields/#{id}", params)
|
35
|
+
end
|
36
|
+
|
37
|
+
# [POST] Add a new deal field
|
38
|
+
#
|
39
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/DealFields/post_dealFields
|
40
|
+
# @return [Paperdrive::Response]
|
41
|
+
def create_deal_field(**args)
|
42
|
+
params = parameters(args) do
|
43
|
+
required_params :name, :field_type
|
44
|
+
optional_params :name, :field_type, :options
|
45
|
+
end
|
46
|
+
request(:post, 'dealFields', params)
|
47
|
+
end
|
48
|
+
|
49
|
+
# [PUT] Update a deal field
|
50
|
+
#
|
51
|
+
# @param [integer] id:
|
52
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/DealFields/put_dealFields_id
|
53
|
+
# @return [Paperdrive::Response]
|
54
|
+
def update_deal_field(id:, **args)
|
55
|
+
params = parameters(args) do
|
56
|
+
required_params :name
|
57
|
+
optional_params :name, :options
|
58
|
+
end
|
59
|
+
request(:put, "dealFields/#{id}", params)
|
60
|
+
end
|
61
|
+
|
62
|
+
# [DELETE] Delete multiple deal fields in bulk
|
63
|
+
#
|
64
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/DealFields/delete_dealFields
|
65
|
+
# @return [Paperdrive::Response]
|
66
|
+
def delete_deal_fields(**args)
|
67
|
+
params = parameters(args) do
|
68
|
+
required_params :ids
|
69
|
+
optional_params :ids
|
70
|
+
end
|
71
|
+
request(:delete, 'dealFields', params)
|
72
|
+
end
|
73
|
+
|
74
|
+
# [DELETE] Delete a deal field
|
75
|
+
#
|
76
|
+
# @param [integer] id:
|
77
|
+
# @see https://developers.pipedrive.com/docs/api/v1/#!/DealFields/delete_dealFields_id
|
78
|
+
# @return [Paperdrive::Response]
|
79
|
+
def delete_deal_field(id:, **args)
|
80
|
+
params = parameters(args) do
|
81
|
+
optional_params
|
82
|
+
end
|
83
|
+
request(:delete, "dealFields/#{id}", params)
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
end
|