amsi 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/.ci +125 -0
  3. data/.gitignore +2 -0
  4. data/.rspec +3 -0
  5. data/CHANGELOG.txt +20 -0
  6. data/CODEOWNERS +1 -0
  7. data/Gemfile +6 -0
  8. data/LICENSE.txt +21 -0
  9. data/README.md +319 -0
  10. data/Rakefile +6 -0
  11. data/amsi.gemspec +32 -0
  12. data/bin/console +15 -0
  13. data/bin/setup +8 -0
  14. data/config/multi_xml.rb +4 -0
  15. data/lib/amsi/attribute_parser/base.rb +23 -0
  16. data/lib/amsi/attribute_parser/boolean.rb +25 -0
  17. data/lib/amsi/attribute_parser/date.rb +28 -0
  18. data/lib/amsi/attribute_parser/date_time.rb +24 -0
  19. data/lib/amsi/attribute_parser/decimal.rb +15 -0
  20. data/lib/amsi/attribute_parser/integer.rb +15 -0
  21. data/lib/amsi/attribute_parser/string.rb +13 -0
  22. data/lib/amsi/attribute_parser.rb +45 -0
  23. data/lib/amsi/document_parser/base.rb +52 -0
  24. data/lib/amsi/document_parser/get_moveins.rb +66 -0
  25. data/lib/amsi/document_parser/guest_card_result.rb +31 -0
  26. data/lib/amsi/document_parser/leases.rb +46 -0
  27. data/lib/amsi/document_parser/properties.rb +103 -0
  28. data/lib/amsi/error/bad_request.rb +18 -0
  29. data/lib/amsi/error/base.rb +9 -0
  30. data/lib/amsi/error/invalid_response.rb +9 -0
  31. data/lib/amsi/error/request_fault.rb +18 -0
  32. data/lib/amsi/error/request_timeout.rb +9 -0
  33. data/lib/amsi/error/unparsable_response.rb +11 -0
  34. data/lib/amsi/model/address.rb +18 -0
  35. data/lib/amsi/model/base/attribute.rb +63 -0
  36. data/lib/amsi/model/base/attribute_store.rb +37 -0
  37. data/lib/amsi/model/base.rb +64 -0
  38. data/lib/amsi/model/guest_card.rb +18 -0
  39. data/lib/amsi/model/guest_card_result.rb +26 -0
  40. data/lib/amsi/model/lease.rb +63 -0
  41. data/lib/amsi/model/leasing_agent.rb +21 -0
  42. data/lib/amsi/model/manager.rb +16 -0
  43. data/lib/amsi/model/marketing_source.rb +21 -0
  44. data/lib/amsi/model/occupant.rb +32 -0
  45. data/lib/amsi/model/property.rb +35 -0
  46. data/lib/amsi/model/unit_type.rb +38 -0
  47. data/lib/amsi/parameter/contact_type.rb +10 -0
  48. data/lib/amsi/parameter/prospect.rb +19 -0
  49. data/lib/amsi/request/add_guest_card.rb +93 -0
  50. data/lib/amsi/request/base.rb +106 -0
  51. data/lib/amsi/request/get_moveins_by_first_marketing_source.rb +57 -0
  52. data/lib/amsi/request/get_property_list.rb +49 -0
  53. data/lib/amsi/request/get_property_residents.rb +45 -0
  54. data/lib/amsi/request_section/add_guest_card.rb +105 -0
  55. data/lib/amsi/request_section/auth.rb +22 -0
  56. data/lib/amsi/request_section/moveins_filter.rb +42 -0
  57. data/lib/amsi/request_section/property_list_filter.rb +45 -0
  58. data/lib/amsi/request_section/property_resident_filter.rb +32 -0
  59. data/lib/amsi/utils/request_fetcher.rb +37 -0
  60. data/lib/amsi/utils/request_generator.rb +54 -0
  61. data/lib/amsi/utils/snowflake_event_tracker.rb +113 -0
  62. data/lib/amsi/validator/base.rb +95 -0
  63. data/lib/amsi/validator/prospect_event_validator.rb +20 -0
  64. data/lib/amsi/validator/request_errors.rb +61 -0
  65. data/lib/amsi/validator/request_fault.rb +57 -0
  66. data/lib/amsi/validator/resident_event_validator.rb +20 -0
  67. data/lib/amsi/validator.rb +7 -0
  68. data/lib/amsi/version.rb +3 -0
  69. data/lib/amsi.rb +31 -0
  70. metadata +265 -0
@@ -0,0 +1,20 @@
1
+ require 'amsi/validator'
2
+ require_relative 'base'
3
+
4
+ module Amsi
5
+ module Validator
6
+ class ResidentEventValidator < Base
7
+
8
+ def initialize(response = nil)
9
+ end
10
+
11
+ def validate!
12
+ end
13
+
14
+ # Send parased response's individual resident data to Snowflake via event tracker
15
+ def send_event(lease, params)
16
+ send_pms_resident_event(lease: lease, params: params || {})
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,7 @@
1
+ module Amsi
2
+ # Make validators private, preventing access outside this gem
3
+ module Validator
4
+ end
5
+
6
+ private_constant :Validator
7
+ end
@@ -0,0 +1,3 @@
1
+ module Amsi
2
+ VERSION = '1.0.0'
3
+ end
data/lib/amsi.rb ADDED
@@ -0,0 +1,31 @@
1
+ require_relative '../config/multi_xml.rb'
2
+
3
+ require 'amsi/error/bad_request'
4
+ require 'amsi/error/invalid_response'
5
+ require 'amsi/error/request_fault'
6
+ require 'amsi/error/request_timeout'
7
+ require 'amsi/error/unparsable_response'
8
+
9
+ require 'amsi/model/address'
10
+ require 'amsi/model/guest_card'
11
+ require 'amsi/model/guest_card_result'
12
+ require 'amsi/model/lease'
13
+ require 'amsi/model/leasing_agent'
14
+ require 'amsi/model/manager'
15
+ require 'amsi/model/marketing_source'
16
+ require 'amsi/model/occupant'
17
+ require 'amsi/model/property'
18
+ require 'amsi/model/unit_type'
19
+
20
+ require 'amsi/parameter/contact_type'
21
+ require 'amsi/parameter/prospect'
22
+
23
+ require 'amsi/request/add_guest_card'
24
+ require 'amsi/request/get_property_list'
25
+ require 'amsi/request/get_property_residents'
26
+ require 'amsi/request/get_moveins_by_first_marketing_source'
27
+
28
+ require 'amsi/version'
29
+
30
+ module Amsi
31
+ end
metadata ADDED
@@ -0,0 +1,265 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: amsi
3
+ version: !ruby/object:Gem::Version
4
+ version: 1.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Justin Richard
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2021-12-15 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: faraday
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '0.9'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '0.9'
27
+ - !ruby/object:Gem::Dependency
28
+ name: multi_xml
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.5'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.5'
41
+ - !ruby/object:Gem::Dependency
42
+ name: nokogiri
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.6'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.6'
55
+ - !ruby/object:Gem::Dependency
56
+ name: ox
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.3'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: tzinfo
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.2'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.2'
83
+ - !ruby/object:Gem::Dependency
84
+ name: bundler
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '2'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '2'
97
+ - !ruby/object:Gem::Dependency
98
+ name: pry-byebug
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '3.3'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '3.3'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rake
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '10.0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '10.0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rspec
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '3.4'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '3.4'
139
+ - !ruby/object:Gem::Dependency
140
+ name: timecop
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '0.8'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '0.8'
153
+ - !ruby/object:Gem::Dependency
154
+ name: webmock
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - "~>"
158
+ - !ruby/object:Gem::Version
159
+ version: '1.21'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - "~>"
165
+ - !ruby/object:Gem::Version
166
+ version: '1.21'
167
+ description:
168
+ email:
169
+ - justin@apartmentlist.com
170
+ executables: []
171
+ extensions: []
172
+ extra_rdoc_files: []
173
+ files:
174
+ - ".ci"
175
+ - ".gitignore"
176
+ - ".rspec"
177
+ - CHANGELOG.txt
178
+ - CODEOWNERS
179
+ - Gemfile
180
+ - LICENSE.txt
181
+ - README.md
182
+ - Rakefile
183
+ - amsi.gemspec
184
+ - bin/console
185
+ - bin/setup
186
+ - config/multi_xml.rb
187
+ - lib/amsi.rb
188
+ - lib/amsi/attribute_parser.rb
189
+ - lib/amsi/attribute_parser/base.rb
190
+ - lib/amsi/attribute_parser/boolean.rb
191
+ - lib/amsi/attribute_parser/date.rb
192
+ - lib/amsi/attribute_parser/date_time.rb
193
+ - lib/amsi/attribute_parser/decimal.rb
194
+ - lib/amsi/attribute_parser/integer.rb
195
+ - lib/amsi/attribute_parser/string.rb
196
+ - lib/amsi/document_parser/base.rb
197
+ - lib/amsi/document_parser/get_moveins.rb
198
+ - lib/amsi/document_parser/guest_card_result.rb
199
+ - lib/amsi/document_parser/leases.rb
200
+ - lib/amsi/document_parser/properties.rb
201
+ - lib/amsi/error/bad_request.rb
202
+ - lib/amsi/error/base.rb
203
+ - lib/amsi/error/invalid_response.rb
204
+ - lib/amsi/error/request_fault.rb
205
+ - lib/amsi/error/request_timeout.rb
206
+ - lib/amsi/error/unparsable_response.rb
207
+ - lib/amsi/model/address.rb
208
+ - lib/amsi/model/base.rb
209
+ - lib/amsi/model/base/attribute.rb
210
+ - lib/amsi/model/base/attribute_store.rb
211
+ - lib/amsi/model/guest_card.rb
212
+ - lib/amsi/model/guest_card_result.rb
213
+ - lib/amsi/model/lease.rb
214
+ - lib/amsi/model/leasing_agent.rb
215
+ - lib/amsi/model/manager.rb
216
+ - lib/amsi/model/marketing_source.rb
217
+ - lib/amsi/model/occupant.rb
218
+ - lib/amsi/model/property.rb
219
+ - lib/amsi/model/unit_type.rb
220
+ - lib/amsi/parameter/contact_type.rb
221
+ - lib/amsi/parameter/prospect.rb
222
+ - lib/amsi/request/add_guest_card.rb
223
+ - lib/amsi/request/base.rb
224
+ - lib/amsi/request/get_moveins_by_first_marketing_source.rb
225
+ - lib/amsi/request/get_property_list.rb
226
+ - lib/amsi/request/get_property_residents.rb
227
+ - lib/amsi/request_section/add_guest_card.rb
228
+ - lib/amsi/request_section/auth.rb
229
+ - lib/amsi/request_section/moveins_filter.rb
230
+ - lib/amsi/request_section/property_list_filter.rb
231
+ - lib/amsi/request_section/property_resident_filter.rb
232
+ - lib/amsi/utils/request_fetcher.rb
233
+ - lib/amsi/utils/request_generator.rb
234
+ - lib/amsi/utils/snowflake_event_tracker.rb
235
+ - lib/amsi/validator.rb
236
+ - lib/amsi/validator/base.rb
237
+ - lib/amsi/validator/prospect_event_validator.rb
238
+ - lib/amsi/validator/request_errors.rb
239
+ - lib/amsi/validator/request_fault.rb
240
+ - lib/amsi/validator/resident_event_validator.rb
241
+ - lib/amsi/version.rb
242
+ homepage: https://github.com/apartmentlist/amsi
243
+ licenses:
244
+ - MIT
245
+ metadata: {}
246
+ post_install_message:
247
+ rdoc_options: []
248
+ require_paths:
249
+ - lib
250
+ required_ruby_version: !ruby/object:Gem::Requirement
251
+ requirements:
252
+ - - ">="
253
+ - !ruby/object:Gem::Version
254
+ version: '0'
255
+ required_rubygems_version: !ruby/object:Gem::Requirement
256
+ requirements:
257
+ - - ">="
258
+ - !ruby/object:Gem::Version
259
+ version: '0'
260
+ requirements: []
261
+ rubygems_version: 3.0.3.1
262
+ signing_key:
263
+ specification_version: 4
264
+ summary: Ruby client of AMSI Evolution Suite API
265
+ test_files: []