dotloop_api 0.1.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 (51) hide show
  1. checksums.yaml +7 -0
  2. checksums.yaml.gz.sig +0 -0
  3. data/.gitignore +9 -0
  4. data/.rspec +2 -0
  5. data/.rubocop.yml +34 -0
  6. data/.travis.yml +8 -0
  7. data/CODE_OF_CONDUCT.md +74 -0
  8. data/Gemfile +4 -0
  9. data/LICENSE.txt +21 -0
  10. data/README.md +77 -0
  11. data/Rakefile +6 -0
  12. data/bin/console +7 -0
  13. data/bin/setup +8 -0
  14. data/certs/shanedavies.pem +21 -0
  15. data/dotloop_api.gemspec +43 -0
  16. data/lib/dotloop_api/auth.rb +120 -0
  17. data/lib/dotloop_api/client.rb +89 -0
  18. data/lib/dotloop_api/end_points/account.rb +19 -0
  19. data/lib/dotloop_api/end_points/activity.rb +22 -0
  20. data/lib/dotloop_api/end_points/base.rb +37 -0
  21. data/lib/dotloop_api/end_points/batch.rb +34 -0
  22. data/lib/dotloop_api/end_points/contact.rb +9 -0
  23. data/lib/dotloop_api/end_points/detail.rb +28 -0
  24. data/lib/dotloop_api/end_points/document.rb +25 -0
  25. data/lib/dotloop_api/end_points/folder.rb +32 -0
  26. data/lib/dotloop_api/end_points/loop.rb +17 -0
  27. data/lib/dotloop_api/end_points/loop_template.rb +19 -0
  28. data/lib/dotloop_api/end_points/model_builder.rb +65 -0
  29. data/lib/dotloop_api/end_points/param_helper.rb +60 -0
  30. data/lib/dotloop_api/end_points/participant.rb +22 -0
  31. data/lib/dotloop_api/end_points/profile.rb +10 -0
  32. data/lib/dotloop_api/end_points/task.rb +23 -0
  33. data/lib/dotloop_api/end_points/task_list.rb +21 -0
  34. data/lib/dotloop_api/exceptions.rb +25 -0
  35. data/lib/dotloop_api/models/config.rb +18 -0
  36. data/lib/dotloop_api/models/contact.rb +38 -0
  37. data/lib/dotloop_api/models/profile/loop/activity.rb +13 -0
  38. data/lib/dotloop_api/models/profile/loop/detail.rb +129 -0
  39. data/lib/dotloop_api/models/profile/loop/folder/document.rb +27 -0
  40. data/lib/dotloop_api/models/profile/loop/folder.rb +25 -0
  41. data/lib/dotloop_api/models/profile/loop/participant.rb +9 -0
  42. data/lib/dotloop_api/models/profile/loop/tasklist/task.rb +16 -0
  43. data/lib/dotloop_api/models/profile/loop/tasklist.rb +22 -0
  44. data/lib/dotloop_api/models/profile/loop.rb +58 -0
  45. data/lib/dotloop_api/models/profile/loop_template.rb +16 -0
  46. data/lib/dotloop_api/models/profile.rb +63 -0
  47. data/lib/dotloop_api/version.rb +3 -0
  48. data/lib/dotloop_api.rb +47 -0
  49. data.tar.gz.sig +0 -0
  50. metadata +309 -0
  51. metadata.gz.sig +0 -0
@@ -0,0 +1,58 @@
1
+ module DotloopApi
2
+ module Models
3
+ class Profile
4
+ class Loop
5
+ STATUS_TYPES = {
6
+ PURCHASE_OFFER: %w[ARCHIVED PRE_OFFER SOLD UNDER_CONTRACT],
7
+ LISTING_FOR_SALE: %w[ACTIVE_LISTING ARCHIVED PRE_LISTING PRIVATE_LISTING SOLD UNDER_CONTRACT],
8
+ LISTING_FOR_LEASE: %w[ACTIVE_LISTING ARCHIVED LEASED PRE_LISTING PRIVATE_LISTING UNDER_CONTRACT],
9
+ LEASE_OFFER: %w[ARCHIVED LEASED PRE_OFFER UNDER_CONTRACT],
10
+ REAL_ESTATE_OTHER: %w[ARCHIVED DONE IN_PROGRESS NEW],
11
+ OTHER: %w[ARCHIVED DONE IN_PROGRESS NEW]
12
+ }.freeze
13
+ TRANSACTION_TYPES = STATUS_TYPES.keys
14
+ include Virtus.model
15
+ attribute :completed_task_count, Integer, default: 0
16
+ attribute :created
17
+ attribute :id, Integer
18
+ attribute :loop_url
19
+ attribute :name
20
+ attribute :owner_profile_id, Integer
21
+ attribute :profile_id, Integer
22
+ attribute :status
23
+ attribute :total_task_count, Integer, default: 0
24
+ attribute :transaction_type
25
+ attribute :updated
26
+ attribute :details, DotloopApi::Models::Profile::Loop::Detail
27
+ attribute :all_participants, Array[DotloopApi::Models::Profile::Loop::Participant]
28
+ attr_accessor :client
29
+
30
+ def activities
31
+ DotloopApi::EndPoints::Activity.new(client: client, profile_id: profile_id, loop_id: id).all
32
+ end
33
+
34
+ def detail
35
+ @details = DotloopApi::EndPoints::Detail.new(
36
+ client: client, profile_id: profile_id, loop_id: id
37
+ ).find
38
+ end
39
+
40
+ def folders(options = {})
41
+ DotloopApi::EndPoints::Folder.new(
42
+ client: client, profile_id: profile_id, loop_id: id
43
+ ).all(options)
44
+ end
45
+
46
+ def participants
47
+ @all_participants = DotloopApi::EndPoints::Participant.new(
48
+ client: client, profile_id: profile_id, loop_id: id
49
+ ).all
50
+ end
51
+
52
+ def task_lists
53
+ DotloopApi::EndPoints::TaskList.new(client: client, profile_id: profile_id, loop_id: id).all
54
+ end
55
+ end
56
+ end
57
+ end
58
+ end
@@ -0,0 +1,16 @@
1
+ module DotloopApi
2
+ module Models
3
+ class Profile
4
+ class LoopTemplate
5
+ include Virtus.model
6
+ attribute :id, Integer
7
+ attribute :profile_id, Integer
8
+ attribute :name
9
+ attribute :transaction_type
10
+ attribute :shared, Boolean
11
+ attribute :global, Boolean
12
+ attr_accessor :client
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,63 @@
1
+ module DotloopApi
2
+ module Models
3
+ class Profile
4
+ # define nested classes first for dependency resolution
5
+ class Loop
6
+ class Activity; end
7
+ class Detail
8
+ class ContractDates; end
9
+ class ContractInfo; end
10
+ class Financials; end
11
+ class GeographicDescription; end
12
+ class ListingInformation; end
13
+ class OfferDates; end
14
+ class Property; end
15
+ class PropertyAddress; end
16
+ class Referral; end
17
+ end
18
+ class Folder
19
+ class Document; end
20
+ end
21
+ class Participant < ::DotloopApi::Models::Contact; end
22
+ class TaskList
23
+ class Task; end
24
+ end
25
+ end
26
+ class LoopTemplate; end
27
+
28
+ PROFILE_TYPES = %w[ASSOCIATION COMPANY INDIVIDUAL NATIONAL_PARTNER OFFICE TEAM].freeze
29
+ include Virtus.model
30
+ attribute :address
31
+ attribute :city
32
+ attribute :company
33
+ attribute :country
34
+ attribute :default, Boolean, default: false
35
+ attribute :fax
36
+ attribute :id, Integer
37
+ attribute :name
38
+ attribute :phone
39
+ attribute :state
40
+ attribute :type
41
+ attribute :zipcode
42
+ attr_accessor :client
43
+
44
+ def loops(options = {})
45
+ loop_endpoint.all(options)
46
+ end
47
+
48
+ def loop(id)
49
+ loop_endpoint.find(id: id)
50
+ end
51
+
52
+ def loop_templates
53
+ DotloopApi::EndPoints::LoopTemplate.new(client: client, profile_id: id).all
54
+ end
55
+
56
+ private
57
+
58
+ def loop_endpoint
59
+ DotloopApi::EndPoints::Loop.new(client: client, profile_id: id)
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,3 @@
1
+ module DotloopApi
2
+ VERSION = '0.1.0'.freeze
3
+ end
@@ -0,0 +1,47 @@
1
+ # vendors
2
+ require 'plissken'
3
+ require 'httparty'
4
+ require 'virtus'
5
+
6
+ # helpers w/o dependencies
7
+ require 'dotloop_api/version'
8
+ require 'dotloop_api/exceptions'
9
+ require 'dotloop_api/end_points/param_helper'
10
+ require 'dotloop_api/end_points/model_builder'
11
+ require 'dotloop_api/end_points/base'
12
+ require 'dotloop_api/end_points/batch'
13
+
14
+ # dotloop models
15
+ require 'dotloop_api/models/config'
16
+ require 'dotloop_api/models/contact'
17
+ require 'dotloop_api/models/profile'
18
+ require 'dotloop_api/models/profile/loop'
19
+ require 'dotloop_api/models/profile/loop/activity'
20
+ require 'dotloop_api/models/profile/loop/detail'
21
+ require 'dotloop_api/models/profile/loop/folder'
22
+ require 'dotloop_api/models/profile/loop/folder/document'
23
+ require 'dotloop_api/models/profile/loop/tasklist'
24
+ require 'dotloop_api/models/profile/loop/tasklist/task'
25
+ require 'dotloop_api/models/profile/loop_template'
26
+
27
+ # auth classes
28
+ require 'dotloop_api/auth'
29
+ require 'dotloop_api/client'
30
+
31
+ # dotloop endpoints
32
+ require 'dotloop_api/end_points/account'
33
+ require 'dotloop_api/end_points/contact'
34
+ require 'dotloop_api/end_points/profile'
35
+ require 'dotloop_api/end_points/loop'
36
+ require 'dotloop_api/end_points/detail'
37
+ require 'dotloop_api/end_points/activity'
38
+ require 'dotloop_api/end_points/task'
39
+ require 'dotloop_api/end_points/loop_template'
40
+ require 'dotloop_api/end_points/task_list'
41
+ require 'dotloop_api/end_points/document'
42
+ require 'dotloop_api/end_points/folder'
43
+ require 'dotloop_api/end_points/participant'
44
+
45
+ module DotloopApi
46
+ # Your code goes here...
47
+ end
data.tar.gz.sig ADDED
Binary file
metadata ADDED
@@ -0,0 +1,309 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dotloop_api
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Loft47
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MRAwDgYDVQQDDAdzZGF2
14
+ aWVzMRYwFAYKCZImiZPyLGQBGRYGbG9mdDQ3MRMwEQYKCZImiZPyLGQBGRYDY29t
15
+ MB4XDTE3MTExNDE2Mjk1NFoXDTE4MTExNDE2Mjk1NFowPzEQMA4GA1UEAwwHc2Rh
16
+ dmllczEWMBQGCgmSJomT8ixkARkWBmxvZnQ0NzETMBEGCgmSJomT8ixkARkWA2Nv
17
+ bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMmnC3pm+VvzYArTzzEJ
18
+ r3FNDkGtv9grWLFGMG+uD1uNtSvyoB2gJvYvYXw0IWBPnGGOlnG3mbJN39uu/Mw5
19
+ wxd8qZo2Jbht3oz/o2P8ymiR6D7CBL26sdQlTLd9vQbe0Ee7h/9iOIziNTnpPf3S
20
+ mjjKxFw65Db6cCF4nA7QN7wa5VjHDkF+y34Tn3QalpRAEcL7e0AcvUSj4zaPZwQc
21
+ NMQ1anPAc1SyFSlyjFOpJO8/DGW7svgw+HE7ht+wUwJU86pmVsacolUILyggAQnz
22
+ J8zOqCYx2gAkuPgZSN6blAgy+MaMq5g7JCQrpGyZ2B56Y4OvEpZo85MU0z6SQH8b
23
+ 6G8CAwEAAaN3MHUwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFJz2
24
+ HNGO7UZ6Lb7vfP5OlcUexZU/MB0GA1UdEQQWMBSBEnNkYXZpZXNAbG9mdDQ3LmNv
25
+ bTAdBgNVHRIEFjAUgRJzZGF2aWVzQGxvZnQ0Ny5jb20wDQYJKoZIhvcNAQEFBQAD
26
+ ggEBAFV+1gvsCyfx7a0Rxx4j5lIWp7j3IcBl08M50bUfqvGk0tVQQoqmwL9NvV/j
27
+ gxTc1WWkXwieCpq7syR8s5XYATXKtKxDraMjUvt4I6RCbyPIKA/26eEBllqzQ6ne
28
+ XatCbJMh2gIgkvmzJTjxX8st66KCYNLwzNUNTbjhlKaKZGkKFd314VTYfR7/6kfl
29
+ 6j39ofZdlo2GEwGRtgsjZa4aCqdAXcGJ9SvM2yJslIbXm0/SYhQ2tlJwr5jQ9vGL
30
+ UJ5WQPTBtyrpUNA3NZDQW/W0bEm41+2evyAwvcBkahBAWsfM+vpPFP+EZ6ymugVT
31
+ hGNADh27PqHgBxcLvQ9JSHtcxvE=
32
+ -----END CERTIFICATE-----
33
+ date: 2018-11-06 00:00:00.000000000 Z
34
+ dependencies:
35
+ - !ruby/object:Gem::Dependency
36
+ name: activesupport
37
+ requirement: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '5'
42
+ type: :runtime
43
+ prerelease: false
44
+ version_requirements: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - "~>"
47
+ - !ruby/object:Gem::Version
48
+ version: '5'
49
+ - !ruby/object:Gem::Dependency
50
+ name: coveralls
51
+ requirement: !ruby/object:Gem::Requirement
52
+ requirements:
53
+ - - "~>"
54
+ - !ruby/object:Gem::Version
55
+ version: '0.8'
56
+ type: :runtime
57
+ prerelease: false
58
+ version_requirements: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '0.8'
63
+ - !ruby/object:Gem::Dependency
64
+ name: httparty
65
+ requirement: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - "~>"
68
+ - !ruby/object:Gem::Version
69
+ version: '0.16'
70
+ type: :runtime
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ requirements:
74
+ - - "~>"
75
+ - !ruby/object:Gem::Version
76
+ version: '0.16'
77
+ - !ruby/object:Gem::Dependency
78
+ name: plissken
79
+ requirement: !ruby/object:Gem::Requirement
80
+ requirements:
81
+ - - "~>"
82
+ - !ruby/object:Gem::Version
83
+ version: '1.2'
84
+ type: :runtime
85
+ prerelease: false
86
+ version_requirements: !ruby/object:Gem::Requirement
87
+ requirements:
88
+ - - "~>"
89
+ - !ruby/object:Gem::Version
90
+ version: '1.2'
91
+ - !ruby/object:Gem::Dependency
92
+ name: simplecov
93
+ requirement: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - "~>"
96
+ - !ruby/object:Gem::Version
97
+ version: '0.16'
98
+ type: :runtime
99
+ prerelease: false
100
+ version_requirements: !ruby/object:Gem::Requirement
101
+ requirements:
102
+ - - "~>"
103
+ - !ruby/object:Gem::Version
104
+ version: '0.16'
105
+ - !ruby/object:Gem::Dependency
106
+ name: virtus
107
+ requirement: !ruby/object:Gem::Requirement
108
+ requirements:
109
+ - - "~>"
110
+ - !ruby/object:Gem::Version
111
+ version: '1.0'
112
+ type: :runtime
113
+ prerelease: false
114
+ version_requirements: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - "~>"
117
+ - !ruby/object:Gem::Version
118
+ version: '1.0'
119
+ - !ruby/object:Gem::Dependency
120
+ name: bundler
121
+ requirement: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - "~>"
124
+ - !ruby/object:Gem::Version
125
+ version: '1.16'
126
+ type: :development
127
+ prerelease: false
128
+ version_requirements: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - "~>"
131
+ - !ruby/object:Gem::Version
132
+ version: '1.16'
133
+ - !ruby/object:Gem::Dependency
134
+ name: byebug
135
+ requirement: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - "~>"
138
+ - !ruby/object:Gem::Version
139
+ version: '10.0'
140
+ type: :development
141
+ prerelease: false
142
+ version_requirements: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - "~>"
145
+ - !ruby/object:Gem::Version
146
+ version: '10.0'
147
+ - !ruby/object:Gem::Dependency
148
+ name: pry
149
+ requirement: !ruby/object:Gem::Requirement
150
+ requirements:
151
+ - - "~>"
152
+ - !ruby/object:Gem::Version
153
+ version: '0.11'
154
+ type: :development
155
+ prerelease: false
156
+ version_requirements: !ruby/object:Gem::Requirement
157
+ requirements:
158
+ - - "~>"
159
+ - !ruby/object:Gem::Version
160
+ version: '0.11'
161
+ - !ruby/object:Gem::Dependency
162
+ name: rake
163
+ requirement: !ruby/object:Gem::Requirement
164
+ requirements:
165
+ - - "~>"
166
+ - !ruby/object:Gem::Version
167
+ version: '12.3'
168
+ type: :development
169
+ prerelease: false
170
+ version_requirements: !ruby/object:Gem::Requirement
171
+ requirements:
172
+ - - "~>"
173
+ - !ruby/object:Gem::Version
174
+ version: '12.3'
175
+ - !ruby/object:Gem::Dependency
176
+ name: rspec
177
+ requirement: !ruby/object:Gem::Requirement
178
+ requirements:
179
+ - - "~>"
180
+ - !ruby/object:Gem::Version
181
+ version: '3.8'
182
+ type: :development
183
+ prerelease: false
184
+ version_requirements: !ruby/object:Gem::Requirement
185
+ requirements:
186
+ - - "~>"
187
+ - !ruby/object:Gem::Version
188
+ version: '3.8'
189
+ - !ruby/object:Gem::Dependency
190
+ name: rubocop
191
+ requirement: !ruby/object:Gem::Requirement
192
+ requirements:
193
+ - - "~>"
194
+ - !ruby/object:Gem::Version
195
+ version: '0.58'
196
+ type: :development
197
+ prerelease: false
198
+ version_requirements: !ruby/object:Gem::Requirement
199
+ requirements:
200
+ - - "~>"
201
+ - !ruby/object:Gem::Version
202
+ version: '0.58'
203
+ - !ruby/object:Gem::Dependency
204
+ name: travis
205
+ requirement: !ruby/object:Gem::Requirement
206
+ requirements:
207
+ - - "~>"
208
+ - !ruby/object:Gem::Version
209
+ version: '1.8'
210
+ type: :development
211
+ prerelease: false
212
+ version_requirements: !ruby/object:Gem::Requirement
213
+ requirements:
214
+ - - "~>"
215
+ - !ruby/object:Gem::Version
216
+ version: '1.8'
217
+ - !ruby/object:Gem::Dependency
218
+ name: webmock
219
+ requirement: !ruby/object:Gem::Requirement
220
+ requirements:
221
+ - - "~>"
222
+ - !ruby/object:Gem::Version
223
+ version: '3.4'
224
+ type: :development
225
+ prerelease: false
226
+ version_requirements: !ruby/object:Gem::Requirement
227
+ requirements:
228
+ - - "~>"
229
+ - !ruby/object:Gem::Version
230
+ version: '3.4'
231
+ description: Ruby library for Dotloop API V2.
232
+ email:
233
+ - support@loft47.com
234
+ executables: []
235
+ extensions: []
236
+ extra_rdoc_files: []
237
+ files:
238
+ - ".gitignore"
239
+ - ".rspec"
240
+ - ".rubocop.yml"
241
+ - ".travis.yml"
242
+ - CODE_OF_CONDUCT.md
243
+ - Gemfile
244
+ - LICENSE.txt
245
+ - README.md
246
+ - Rakefile
247
+ - bin/console
248
+ - bin/setup
249
+ - certs/shanedavies.pem
250
+ - dotloop_api.gemspec
251
+ - lib/dotloop_api.rb
252
+ - lib/dotloop_api/auth.rb
253
+ - lib/dotloop_api/client.rb
254
+ - lib/dotloop_api/end_points/account.rb
255
+ - lib/dotloop_api/end_points/activity.rb
256
+ - lib/dotloop_api/end_points/base.rb
257
+ - lib/dotloop_api/end_points/batch.rb
258
+ - lib/dotloop_api/end_points/contact.rb
259
+ - lib/dotloop_api/end_points/detail.rb
260
+ - lib/dotloop_api/end_points/document.rb
261
+ - lib/dotloop_api/end_points/folder.rb
262
+ - lib/dotloop_api/end_points/loop.rb
263
+ - lib/dotloop_api/end_points/loop_template.rb
264
+ - lib/dotloop_api/end_points/model_builder.rb
265
+ - lib/dotloop_api/end_points/param_helper.rb
266
+ - lib/dotloop_api/end_points/participant.rb
267
+ - lib/dotloop_api/end_points/profile.rb
268
+ - lib/dotloop_api/end_points/task.rb
269
+ - lib/dotloop_api/end_points/task_list.rb
270
+ - lib/dotloop_api/exceptions.rb
271
+ - lib/dotloop_api/models/config.rb
272
+ - lib/dotloop_api/models/contact.rb
273
+ - lib/dotloop_api/models/profile.rb
274
+ - lib/dotloop_api/models/profile/loop.rb
275
+ - lib/dotloop_api/models/profile/loop/activity.rb
276
+ - lib/dotloop_api/models/profile/loop/detail.rb
277
+ - lib/dotloop_api/models/profile/loop/folder.rb
278
+ - lib/dotloop_api/models/profile/loop/folder/document.rb
279
+ - lib/dotloop_api/models/profile/loop/participant.rb
280
+ - lib/dotloop_api/models/profile/loop/tasklist.rb
281
+ - lib/dotloop_api/models/profile/loop/tasklist/task.rb
282
+ - lib/dotloop_api/models/profile/loop_template.rb
283
+ - lib/dotloop_api/version.rb
284
+ homepage: http://github.com/Loft47/dotloop_api
285
+ licenses:
286
+ - MIT
287
+ metadata:
288
+ allowed_push_host: https://rubygems.org
289
+ post_install_message:
290
+ rdoc_options: []
291
+ require_paths:
292
+ - lib
293
+ required_ruby_version: !ruby/object:Gem::Requirement
294
+ requirements:
295
+ - - "~>"
296
+ - !ruby/object:Gem::Version
297
+ version: '2.5'
298
+ required_rubygems_version: !ruby/object:Gem::Requirement
299
+ requirements:
300
+ - - ">="
301
+ - !ruby/object:Gem::Version
302
+ version: '0'
303
+ requirements: []
304
+ rubyforge_project:
305
+ rubygems_version: 2.7.6
306
+ signing_key:
307
+ specification_version: 4
308
+ summary: DotloopApi library
309
+ test_files: []
metadata.gz.sig ADDED
Binary file