immobilienscout 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -0
- data/CHANGELOG.md +10 -2
- data/Gemfile.lock +7 -7
- data/README.md +18 -1
- data/lib/immobilienscout/api/attachment.rb +31 -0
- data/lib/immobilienscout/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7088e64b433baae893c02d9ac5d3845ec0ed2e66512deb5c881ca381ca2e7a5c
|
4
|
+
data.tar.gz: 9744cf7bb4d0fd051a3912fb5b40cbc6d8c448140bda4717528a8c0b78093721
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1d760a79dc5c852d8186b602b2cd81eab6d88e1b0cca3b3258ba854599dd36ebfaf490b44ebe38b227327e45c07e048def8d487ea5540853497e9c1b610bf6c9
|
7
|
+
data.tar.gz: 0d4e2caf14860b87ea5c911eab45f6cc11551b976cb8716a342dd81aa03f24320fb35bbb40fe0dbf19cdbd5101101c880f408704750e0ec3a278593a8b6ba98f
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -4,8 +4,16 @@ All notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
-
## [
|
8
|
-
|
7
|
+
## [0.0.8] - 2020-07-16
|
8
|
+
* Added retrieve_all endpoint to attachments to retrieve all attachments of a property
|
9
|
+
* Added destroy endpoint to attachments to destroy an attachment of a property
|
10
|
+
|
11
|
+
## [0.0.7] - 2020-03-30
|
12
|
+
* Improve error handling. Catching a `InvalidRequest` error still works, but now
|
13
|
+
there are additional errors for a more fine-grained error-handling. Namely
|
14
|
+
`ResourceNotFound`, `CommonResourceNotFound` and `ResourceValidation`.
|
15
|
+
* Add `rubocop`, `rubocop-rspec` and `rubocop-performance`
|
16
|
+
* Build with Ruby `2.6.5` on Travis
|
9
17
|
|
10
18
|
## [0.0.6] - 2020-02-18
|
11
19
|
Adding update endpoint to update a property
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
immobilienscout (0.0.
|
4
|
+
immobilienscout (0.0.8)
|
5
5
|
activesupport
|
6
6
|
json
|
7
7
|
multipart-post
|
@@ -9,7 +9,7 @@ PATH
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
|
-
activesupport (5.2.4.
|
12
|
+
activesupport (5.2.4.3)
|
13
13
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
14
14
|
i18n (>= 0.7, < 2)
|
15
15
|
minitest (~> 5.1)
|
@@ -23,11 +23,11 @@ GEM
|
|
23
23
|
safe_yaml (~> 1.0.0)
|
24
24
|
diff-lcs (1.3)
|
25
25
|
hashdiff (1.0.1)
|
26
|
-
i18n (1.8.
|
26
|
+
i18n (1.8.3)
|
27
27
|
concurrent-ruby (~> 1.0)
|
28
28
|
jaro_winkler (1.5.4)
|
29
|
-
json (2.3.
|
30
|
-
minitest (5.14.
|
29
|
+
json (2.3.1)
|
30
|
+
minitest (5.14.1)
|
31
31
|
multipart-post (2.1.1)
|
32
32
|
parallel (1.19.1)
|
33
33
|
parser (2.7.0.5)
|
@@ -65,7 +65,7 @@ GEM
|
|
65
65
|
safe_yaml (1.0.5)
|
66
66
|
thread_safe (0.3.6)
|
67
67
|
timecop (0.8.1)
|
68
|
-
tzinfo (1.2.
|
68
|
+
tzinfo (1.2.7)
|
69
69
|
thread_safe (~> 0.1)
|
70
70
|
unicode-display_width (1.6.1)
|
71
71
|
vcr (5.1.0)
|
@@ -91,4 +91,4 @@ DEPENDENCIES
|
|
91
91
|
webmock (~> 3.6)
|
92
92
|
|
93
93
|
BUNDLED WITH
|
94
|
-
2.
|
94
|
+
2.1.4
|
data/README.md
CHANGED
@@ -37,7 +37,14 @@ Immobilienscout::API::Property.publish({params})
|
|
37
37
|
Immobilienscout::API::Property.update(is24_id, {params})
|
38
38
|
```
|
39
39
|
|
40
|
-
|
40
|
+
_Notes:_
|
41
|
+
|
42
|
+
You have to send all attributes, also if only one attribute has changed. Otherwise Immobilienscout cannot interpret if a missing attribute should be filled in with NULL or not.
|
43
|
+
|
44
|
+
`is24_id` is the id returned by Immobilienscout when you first created the property.
|
45
|
+
|
46
|
+
If you have provided a custom id, you can use `"ext-#{custom_id}"` instead of the is24_id.
|
47
|
+
|
41
48
|
|
42
49
|
- Delete property
|
43
50
|
```ruby
|
@@ -58,6 +65,16 @@ Immobilienscout::API::Attachment.add(is24_id, binary_file, {metadata})
|
|
58
65
|
- Order attachments for a specific property
|
59
66
|
```ruby
|
60
67
|
Immobilienscout::API::Attachment.put_order(is24_id, {params})
|
68
|
+
```
|
69
|
+
|
70
|
+
- Retrieve all attachments for a specific property
|
71
|
+
```ruby
|
72
|
+
Immobilienscout::API::Attachment.retrieve_all(is24_id)
|
73
|
+
```
|
74
|
+
|
75
|
+
- Delete an attachment for a specific property
|
76
|
+
```ruby
|
77
|
+
Immobilienscout::API::Attachment.destroy(is24_id, attachment_id)
|
61
78
|
```
|
62
79
|
|
63
80
|
#### Report
|
@@ -30,6 +30,27 @@ module Immobilienscout
|
|
30
30
|
parsed_response
|
31
31
|
end
|
32
32
|
|
33
|
+
def retrieve_all(is24_id)
|
34
|
+
raise ArgumentError unless is24_id.present?
|
35
|
+
|
36
|
+
url = retrieve_all_url(is24_id)
|
37
|
+
parsed_response = Immobilienscout::Request.new(url).get
|
38
|
+
Immobilienscout::RequestErrorHandler.handle(parsed_response) unless parsed_response.success?
|
39
|
+
|
40
|
+
parsed_response
|
41
|
+
end
|
42
|
+
|
43
|
+
def destroy(is24_id, attachment_id)
|
44
|
+
raise ArgumentError unless is24_id.present?
|
45
|
+
raise ArgumentError unless attachment_id.present?
|
46
|
+
|
47
|
+
url = destroy_url(is24_id, attachment_id)
|
48
|
+
parsed_response = Immobilienscout::Request.new(url).delete
|
49
|
+
Immobilienscout::RequestErrorHandler.handle(parsed_response) unless parsed_response.success?
|
50
|
+
|
51
|
+
parsed_response
|
52
|
+
end
|
53
|
+
|
33
54
|
private
|
34
55
|
|
35
56
|
def create_metadata_file(params)
|
@@ -45,6 +66,16 @@ module Immobilienscout
|
|
45
66
|
"#{Immobilienscout::Client.api_url}/restapi/api/"\
|
46
67
|
"offer/v1.0/user/me/realestate/#{is24_id}/attachment/attachmentsorder"
|
47
68
|
end
|
69
|
+
|
70
|
+
def retrieve_all_url(is24_id)
|
71
|
+
"#{Immobilienscout::Client.api_url}/restapi/api/"\
|
72
|
+
"offer/v1.0/user/me/realestate/#{is24_id}/attachment"
|
73
|
+
end
|
74
|
+
|
75
|
+
def destroy_url(is24_id, attachment_id)
|
76
|
+
"#{Immobilienscout::Client.api_url}/restapi/api/"\
|
77
|
+
"offer/v1.0/user/me/realestate/#{is24_id}/attachment/#{attachment_id}"
|
78
|
+
end
|
48
79
|
end
|
49
80
|
end
|
50
81
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: immobilienscout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Homeday GmbH
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|