spark_api 1.4.21 → 1.4.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/VERSION +1 -1
- data/lib/spark_api/models.rb +1 -0
- data/lib/spark_api/models/rule.rb +14 -0
- data/spec/fixtures/rules/get.json +39 -0
- data/spec/unit/spark_api/models/rule_spec.rb +18 -0
- metadata +7 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OWJiNjUyZDE4YzI2ZGRlYWI4YTA5OTI4ZmVmOWQzZDgzYjZjMzVlZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NTBhODliNTVlOGNhMmIxNmE1OTdiN2Q2YTJjZjNmMjBkYmU2NTJiMw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OGZhOTg5NzRjZTdkOTRiOWI5ZTdlNGY0NWQzMzdhYTYwYzNhYmJhYTJhNWE0
|
10
|
+
YTNkZWU4YzkyZjJkMGI0NDFiYTE4N2YwZTBlNWZmNDg3ZDFhMjdlMmFjMjI0
|
11
|
+
MTg1NmJhMjZiZTFjZjM0ZWFiYjgxNDk3NDMxOGMwMjZhY2E4Nzg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
N2JmYzhmZDM3OGZiMWVkZmZlMDc5YjcyNTcwMWEyYTA2OWY5MjYzOWUyZGE1
|
14
|
+
ZWFkMTUxOGU4NjQzYjA2M2RlYjY1NmUwMWMwMmFiMTU0ZjMzMGYzNDY1ZGY5
|
15
|
+
MDI3YmQwNDM2M2EwM2MwZTVlNjY0ZTJjZDJhMDcxM2IxYTVhMmU=
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.4.
|
1
|
+
1.4.22
|
data/lib/spark_api/models.rb
CHANGED
@@ -34,6 +34,7 @@ require 'spark_api/models/portal'
|
|
34
34
|
require 'spark_api/models/portal_listing_cart'
|
35
35
|
require 'spark_api/models/property_types'
|
36
36
|
require 'spark_api/models/rental_calendar'
|
37
|
+
require 'spark_api/models/rule'
|
37
38
|
require 'spark_api/models/saved_search'
|
38
39
|
require 'spark_api/models/search_template/quick_search'
|
39
40
|
require 'spark_api/models/shared_link'
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module SparkApi
|
2
|
+
module Models
|
3
|
+
class Rule < Base
|
4
|
+
|
5
|
+
self.element_name="listings/rules"
|
6
|
+
|
7
|
+
def self.for_property_type(property_type, args={})
|
8
|
+
collect(connection.get("/listings/rules/propertytypes/#{property_type}", args))
|
9
|
+
end
|
10
|
+
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
@@ -0,0 +1,39 @@
|
|
1
|
+
{
|
2
|
+
"D": {
|
3
|
+
"Success": true,
|
4
|
+
"Results": [
|
5
|
+
{
|
6
|
+
"Id": 25,
|
7
|
+
"ResourceUri": "/v1/listings/rules/25",
|
8
|
+
"PropertyType": "A",
|
9
|
+
"Domain": "StandardFields",
|
10
|
+
"Group": null,
|
11
|
+
"Field": "BathsTotal",
|
12
|
+
"Order": 1,
|
13
|
+
"Action": "SET_REQUIRED",
|
14
|
+
"Expression": "StandardStatus = 'Active'",
|
15
|
+
"ModificationTimestamp": "2018-05-07T19:03:07Z",
|
16
|
+
"CreatedTimestamp": "2017-12-20T19:00:30Z",
|
17
|
+
"ApprovalStatus": "Published",
|
18
|
+
"Editable": true,
|
19
|
+
"Status": "Fatal"
|
20
|
+
},
|
21
|
+
{
|
22
|
+
"Id": 370,
|
23
|
+
"ResourceUri": "/v1/listings/rules/370",
|
24
|
+
"PropertyType": "A",
|
25
|
+
"Domain": "StandardFields",
|
26
|
+
"Group": null,
|
27
|
+
"Field": "City",
|
28
|
+
"Order": 1,
|
29
|
+
"Action": "SET_REQUIRED",
|
30
|
+
"Expression": ".FALSE.",
|
31
|
+
"ModificationTimestamp": "2018-05-01T15:26:47Z",
|
32
|
+
"CreatedTimestamp": "2018-01-24T16:01:14Z",
|
33
|
+
"ApprovalStatus": "Published",
|
34
|
+
"Editable": true,
|
35
|
+
"Status": "Fatal"
|
36
|
+
}
|
37
|
+
]
|
38
|
+
}
|
39
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
require './spec/spec_helper'
|
2
|
+
|
3
|
+
describe Rule do
|
4
|
+
|
5
|
+
describe 'for_property_type' do
|
6
|
+
|
7
|
+
on_get_it "should get documents for a listing" do
|
8
|
+
stub_auth_request
|
9
|
+
stub_api_get('/listings/rules/propertytypes/A','rules/get.json')
|
10
|
+
|
11
|
+
rules = Rule.for_property_type('A')
|
12
|
+
rules.should be_an(Array)
|
13
|
+
rules.length.should == 2
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spark_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.22
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandon Hornseth
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-06-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -352,6 +352,7 @@ files:
|
|
352
352
|
- lib/spark_api/models/portal_listing_cart.rb
|
353
353
|
- lib/spark_api/models/property_types.rb
|
354
354
|
- lib/spark_api/models/rental_calendar.rb
|
355
|
+
- lib/spark_api/models/rule.rb
|
355
356
|
- lib/spark_api/models/saved_search.rb
|
356
357
|
- lib/spark_api/models/search_template/quick_search.rb
|
357
358
|
- lib/spark_api/models/shared_link.rb
|
@@ -500,6 +501,7 @@ files:
|
|
500
501
|
- spec/fixtures/portal/new.json
|
501
502
|
- spec/fixtures/portal/post.json
|
502
503
|
- spec/fixtures/property_types/property_types.json
|
504
|
+
- spec/fixtures/rules/get.json
|
503
505
|
- spec/fixtures/saved_searches/get.json
|
504
506
|
- spec/fixtures/saved_searches/get_provided.json
|
505
507
|
- spec/fixtures/saved_searches/new.json
|
@@ -555,6 +557,7 @@ files:
|
|
555
557
|
- spec/unit/spark_api/models/portal_spec.rb
|
556
558
|
- spec/unit/spark_api/models/property_types_spec.rb
|
557
559
|
- spec/unit/spark_api/models/rental_calendar_spec.rb
|
560
|
+
- spec/unit/spark_api/models/rule_spec.rb
|
558
561
|
- spec/unit/spark_api/models/saved_search_spec.rb
|
559
562
|
- spec/unit/spark_api/models/search_template/quick_search_spec.rb
|
560
563
|
- spec/unit/spark_api/models/shared_link_spec.rb
|
@@ -620,6 +623,7 @@ test_files:
|
|
620
623
|
- spec/fixtures/standardfields/city.json
|
621
624
|
- spec/fixtures/standardfields/standardfields.json
|
622
625
|
- spec/fixtures/standardfields/stateorprovince.json
|
626
|
+
- spec/fixtures/rules/get.json
|
623
627
|
- spec/fixtures/finders.json
|
624
628
|
- spec/fixtures/notes/agent_shared_empty.json
|
625
629
|
- spec/fixtures/notes/new.json
|
@@ -780,6 +784,7 @@ test_files:
|
|
780
784
|
- spec/unit/spark_api/models/note_spec.rb
|
781
785
|
- spec/unit/spark_api/models/connect_prefs_spec.rb
|
782
786
|
- spec/unit/spark_api/models/newsfeed_spec.rb
|
787
|
+
- spec/unit/spark_api/models/rule_spec.rb
|
783
788
|
- spec/unit/spark_api/models/fields_spec.rb
|
784
789
|
- spec/unit/spark_api/models/concerns/destroyable_spec.rb
|
785
790
|
- spec/unit/spark_api/models/concerns/savable_spec.rb
|