closeio 1.0.7 → 2.0.0

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.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/Gemfile +0 -1
  4. data/Gemfile.lock +21 -10
  5. data/README.md +20 -17
  6. data/closeio.gemspec +10 -6
  7. data/lib/closeio.rb +1 -42
  8. data/lib/closeio/client.rb +59 -0
  9. data/lib/closeio/resources/activity.rb +81 -0
  10. data/lib/closeio/resources/bulk_action.rb +34 -0
  11. data/lib/closeio/resources/contact.rb +37 -0
  12. data/lib/closeio/resources/custom_field.rb +33 -0
  13. data/lib/closeio/resources/email_template.rb +32 -0
  14. data/lib/closeio/resources/lead.rb +40 -0
  15. data/lib/closeio/resources/lead_status.rb +29 -0
  16. data/lib/closeio/resources/opportunity.rb +37 -0
  17. data/lib/closeio/resources/opportunity_status.rb +29 -0
  18. data/lib/closeio/resources/organization.rb +15 -0
  19. data/lib/closeio/resources/paginated_list.rb +4 -0
  20. data/lib/closeio/resources/report.rb +19 -0
  21. data/lib/closeio/resources/smart_view.rb +33 -0
  22. data/lib/closeio/resources/task.rb +37 -0
  23. data/lib/closeio/resources/user.rb +15 -0
  24. data/lib/closeio/version.rb +1 -1
  25. metadata +86 -35
  26. data/.document +0 -5
  27. data/lib/closeio/activity_report.rb +0 -20
  28. data/lib/closeio/base.rb +0 -92
  29. data/lib/closeio/bulk_action.rb +0 -25
  30. data/lib/closeio/config.rb +0 -23
  31. data/lib/closeio/contact.rb +0 -3
  32. data/lib/closeio/custom_field.rb +0 -8
  33. data/lib/closeio/custom_report.rb +0 -15
  34. data/lib/closeio/email_activity.rb +0 -8
  35. data/lib/closeio/email_template.rb +0 -3
  36. data/lib/closeio/lead.rb +0 -28
  37. data/lib/closeio/lead_status.rb +0 -7
  38. data/lib/closeio/note_activity.rb +0 -8
  39. data/lib/closeio/opportunity.rb +0 -15
  40. data/lib/closeio/opportunity_status.rb +0 -7
  41. data/lib/closeio/organization.rb +0 -8
  42. data/lib/closeio/paginated_list.rb +0 -27
  43. data/lib/closeio/railtie.rb +0 -12
  44. data/lib/closeio/saved_search.rb +0 -7
  45. data/lib/closeio/status_report.rb +0 -11
  46. data/lib/closeio/task.rb +0 -3
  47. data/lib/closeio/user.rb +0 -7
@@ -0,0 +1,32 @@
1
+ module Closeio
2
+ class Client
3
+ module EmailTemplate
4
+
5
+ def list_email_templates
6
+ get(email_template_path)
7
+ end
8
+
9
+ def find_email_template(id)
10
+ get("#{email_template_path}#{id}/")
11
+ end
12
+
13
+ def create_email_template(id, options={})
14
+ post(email_template_path, options)
15
+ end
16
+
17
+ def update_email_template(id, options={})
18
+ put("#{email_template_path}#{id}/", options)
19
+ end
20
+
21
+ def delete_email_template(id)
22
+ delete("#{email_template_path}#{id}/")
23
+ end
24
+
25
+ private
26
+
27
+ def email_template_path
28
+ "email_template/"
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,40 @@
1
+ module Closeio
2
+ class Client
3
+ module Lead
4
+
5
+ def list_leads(options = {})
6
+ get(lead_path, query: options)
7
+ end
8
+
9
+ def find_lead(id)
10
+ get(individual_lead_path(id))
11
+ end
12
+
13
+ def create_lead(options = {})
14
+ post(lead_path, options)
15
+ end
16
+
17
+ def update_lead(id, options = {})
18
+ put(individual_lead_path(id, options))
19
+ end
20
+
21
+ def delete_lead(id)
22
+ delete(individual_lead_path(id))
23
+ end
24
+
25
+ def lead_contacts
26
+ end
27
+
28
+ private
29
+
30
+ def lead_path
31
+ "lead/"
32
+ end
33
+
34
+ def individual_lead_path(id)
35
+ "#{lead_path}#{id}/"
36
+ end
37
+
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,29 @@
1
+ module Closeio
2
+ class Client
3
+ module LeadStatus
4
+
5
+ def list_lead_statuses
6
+ get(lead_status_path)
7
+ end
8
+
9
+ def create_lead_status(options={})
10
+ post(lead_status_path, options)
11
+ end
12
+
13
+ def update_lead_status(id, options={})
14
+ put("#{lead_status_path}#{id}/", options)
15
+ end
16
+
17
+ def delete_lead_status(id)
18
+ delete("#{lead_status_path}#{id}/")
19
+ end
20
+
21
+ private
22
+
23
+ def lead_status_path
24
+ "/status/lead/"
25
+ end
26
+
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,37 @@
1
+ module Closeio
2
+ class Client
3
+ module Opportunity
4
+
5
+ def list_opportunities(options={})
6
+ get(opportunity_path, query: options)
7
+ end
8
+
9
+ def find_opportunity(id)
10
+ get(individual_opportunity_path(id))
11
+ end
12
+
13
+ def create_opportunity(options={})
14
+ post(opportunity_path, options)
15
+ end
16
+
17
+ def update_opportunity(id, options={})
18
+ put(individual_opportunity_path(id), options)
19
+ end
20
+
21
+ def delete_opportunity(id)
22
+ delete(individual_opportunity_path(id))
23
+ end
24
+
25
+ private
26
+
27
+ def opportunity_path
28
+ "opportunity/"
29
+ end
30
+
31
+ def individual_opportunity_path(id)
32
+ "#{opportunity_path}#{id}/"
33
+ end
34
+
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,29 @@
1
+ module Closeio
2
+ class Client
3
+ module OpportunityStatus
4
+
5
+ def list_opportunity_statuses
6
+ get(opportunity_status_path)
7
+ end
8
+
9
+ def create_opportunity_status(options={})
10
+ post(opportunity_status_path, options)
11
+ end
12
+
13
+ def update_opportunity_status(id, options={})
14
+ put("#{opportunity_status_path}#{id}/", options)
15
+ end
16
+
17
+ def delete_opportunity_status(id)
18
+ delete("#{opportunity_status_path}#{id}/")
19
+ end
20
+
21
+ private
22
+
23
+ def opportunity_status_path
24
+ "/status/opportunity/"
25
+ end
26
+
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,15 @@
1
+ module Closeio
2
+ class Client
3
+ module Organization
4
+
5
+ def find_organization(id)
6
+ get("organization/#{id}/")
7
+ end
8
+
9
+ def update_organization(id, options = {})
10
+ put("organization/#{id}/", options)
11
+ end
12
+
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,4 @@
1
+ module Closeio
2
+ class PaginatedList < ::Array
3
+ end
4
+ end
@@ -0,0 +1,19 @@
1
+ module Closeio
2
+ class Client
3
+ module Report
4
+
5
+ # def activity_report(org_id, date_start, date_end, user_id=nil)
6
+ # params = {date_start: date_start, date_end: date_end}
7
+ # params.merge!(user_id: user_id) if user_id
8
+
9
+ # get("#{@path}/#{org_id}", query: params)
10
+ # end
11
+ #
12
+
13
+ def lead_status_report(organization_id, options = {})
14
+ get("report/statuses/lead/#{organization_id}/", options)
15
+ end
16
+
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,33 @@
1
+ module Closeio
2
+ class Client
3
+ module SmartView
4
+
5
+ def list_smart_views
6
+ get(smart_view_path)
7
+ end
8
+
9
+ def find_smart_view(id)
10
+ get("#{smart_view_path}#{id}/")
11
+ end
12
+
13
+ def create_smart_view(options={})
14
+ post(smart_view_path)
15
+ end
16
+
17
+ def update_smart_view(id, options={})
18
+ put("#{smart_view_path}#{id}/", options)
19
+ end
20
+
21
+ def delete_smart_view(id)
22
+ delete("#{smart_view_path}#{id}/")
23
+ end
24
+
25
+ private
26
+
27
+ def smart_view_path
28
+ "saved_search/"
29
+ end
30
+
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,37 @@
1
+ module Closeio
2
+ class Client
3
+ module Task
4
+
5
+ def list_tasks(options={})
6
+ get(task_path, options)
7
+ end
8
+
9
+ def find_task(id)
10
+ get(individual_task_path(id))
11
+ end
12
+
13
+ def create_task(options={})
14
+ post(task_path, options)
15
+ end
16
+
17
+ def update_task(id, options={})
18
+ put(individual_task_path(id), options)
19
+ end
20
+
21
+ def delete_task(id)
22
+ delete(individual_task_path(id))
23
+ end
24
+
25
+ private
26
+
27
+ def task_path
28
+ "task/"
29
+ end
30
+
31
+ def individual_task_path(id)
32
+ "#{task_path}#{id}/"
33
+ end
34
+
35
+ end
36
+ end
37
+ end
@@ -0,0 +1,15 @@
1
+ module Closeio
2
+ class Client
3
+ module User
4
+
5
+ def find_user(id)
6
+ get("user/#{id}/")
7
+ end
8
+
9
+ def me
10
+ get("me/")
11
+ end
12
+
13
+ end
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module Closeio
2
- VERSION = "1.0.7"
2
+ VERSION = "2.0.0"
3
3
  end
metadata CHANGED
@@ -1,57 +1,85 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: closeio
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taylor Brooks
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-03 00:00:00.000000000 Z
11
+ date: 2015-03-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: crack
14
+ name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.1.8
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '>='
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: faraday_middleware
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: json
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '>='
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
20
48
  type: :runtime
21
49
  prerelease: false
22
50
  version_requirements: !ruby/object:Gem::Requirement
23
51
  requirements:
24
52
  - - '>='
25
53
  - !ruby/object:Gem::Version
26
- version: 0.1.8
54
+ version: '0'
27
55
  - !ruby/object:Gem::Dependency
28
- name: httparty
56
+ name: hashie
29
57
  requirement: !ruby/object:Gem::Requirement
30
58
  requirements:
31
59
  - - '>='
32
60
  - !ruby/object:Gem::Version
33
- version: 0.11.0
61
+ version: '0'
34
62
  type: :runtime
35
63
  prerelease: false
36
64
  version_requirements: !ruby/object:Gem::Requirement
37
65
  requirements:
38
66
  - - '>='
39
67
  - !ruby/object:Gem::Version
40
- version: 0.11.0
68
+ version: '0'
41
69
  - !ruby/object:Gem::Dependency
42
70
  name: bundler
43
71
  requirement: !ruby/object:Gem::Requirement
44
72
  requirements:
45
- - - ~>
73
+ - - '>='
46
74
  - !ruby/object:Gem::Version
47
- version: '1.3'
75
+ version: '0'
48
76
  type: :development
49
77
  prerelease: false
50
78
  version_requirements: !ruby/object:Gem::Requirement
51
79
  requirements:
52
- - - ~>
80
+ - - '>='
53
81
  - !ruby/object:Gem::Version
54
- version: '1.3'
82
+ version: '0'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: rake
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +95,35 @@ dependencies:
67
95
  - !ruby/object:Gem::Version
68
96
  version: '0'
69
97
  - !ruby/object:Gem::Dependency
70
- name: test-unit
98
+ name: minitest
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - '>='
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - '>='
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: vcr
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '>='
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '>='
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: webmock
71
127
  requirement: !ruby/object:Gem::Requirement
72
128
  requirements:
73
129
  - - '>='
@@ -88,8 +144,8 @@ executables: []
88
144
  extensions: []
89
145
  extra_rdoc_files: []
90
146
  files:
91
- - .document
92
147
  - .gitignore
148
+ - CHANGELOG.md
93
149
  - Gemfile
94
150
  - Gemfile.lock
95
151
  - LICENSE
@@ -97,27 +153,22 @@ files:
97
153
  - Rakefile
98
154
  - closeio.gemspec
99
155
  - lib/closeio.rb
100
- - lib/closeio/activity_report.rb
101
- - lib/closeio/base.rb
102
- - lib/closeio/bulk_action.rb
103
- - lib/closeio/config.rb
104
- - lib/closeio/contact.rb
105
- - lib/closeio/custom_field.rb
106
- - lib/closeio/custom_report.rb
107
- - lib/closeio/email_activity.rb
108
- - lib/closeio/email_template.rb
109
- - lib/closeio/lead.rb
110
- - lib/closeio/lead_status.rb
111
- - lib/closeio/note_activity.rb
112
- - lib/closeio/opportunity.rb
113
- - lib/closeio/opportunity_status.rb
114
- - lib/closeio/organization.rb
115
- - lib/closeio/paginated_list.rb
116
- - lib/closeio/railtie.rb
117
- - lib/closeio/saved_search.rb
118
- - lib/closeio/status_report.rb
119
- - lib/closeio/task.rb
120
- - lib/closeio/user.rb
156
+ - lib/closeio/client.rb
157
+ - lib/closeio/resources/activity.rb
158
+ - lib/closeio/resources/bulk_action.rb
159
+ - lib/closeio/resources/contact.rb
160
+ - lib/closeio/resources/custom_field.rb
161
+ - lib/closeio/resources/email_template.rb
162
+ - lib/closeio/resources/lead.rb
163
+ - lib/closeio/resources/lead_status.rb
164
+ - lib/closeio/resources/opportunity.rb
165
+ - lib/closeio/resources/opportunity_status.rb
166
+ - lib/closeio/resources/organization.rb
167
+ - lib/closeio/resources/paginated_list.rb
168
+ - lib/closeio/resources/report.rb
169
+ - lib/closeio/resources/smart_view.rb
170
+ - lib/closeio/resources/task.rb
171
+ - lib/closeio/resources/user.rb
121
172
  - lib/closeio/version.rb
122
173
  homepage: https://github.com/taylorbrooks/closeio
123
174
  licenses: