immobilienscout 0.0.5 → 0.0.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 57f34d7a68110485b5a07d4b36e5232f1422199a80d592eefbdc10f326704627
4
- data.tar.gz: 6d75ad272e6232fef423e911f6f11f7d85edd70f24cfe43ce7bad4a9e8ccae63
3
+ metadata.gz: 8e8f0abea819ff2c7b1d778f3bf030a43144f64a6fe7e8798f0784ccd8fab08f
4
+ data.tar.gz: ba8baca86a75ea2616ad5d89c6f5d75705dedd46252e4be2c765c7b508dc2fd9
5
5
  SHA512:
6
- metadata.gz: cdd687dd9618b57efbeccb0b0dd943726d153127ed63e4cea78564ece2f21589869fe6482d0f4215726fc0c054323d63b6c7e92a6c6dae3d0bcfbde48f729dbe
7
- data.tar.gz: 321fb5718b7365d9429d4a100397b8314503bd8ef43b3d1b666d1876f3ddc2e3471c75683080aad4c163932adf9777ed3652ca2cbe8c65b5484b6d4b25b5b75f
6
+ metadata.gz: b26da3ad4e1b863d7786878832c7fac80435087787c395f611a4e7e9e4765a29fcacaf14ce2d244307561e16c8f50b62cdbf4e4c2dde7248b60cb51e04b6de3e
7
+ data.tar.gz: 8226a4ed2e777a9a0537fd07c28212b8734be7786ce6cbce3b931f1f0c2cf2a10fc21f9bc49e59bc212da252e2b47b8d0fa32068157bace45db1603f864b0122
data/CHANGELOG.md CHANGED
@@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.0.6] - 2020-02-18
10
+ Adding update endpoint to update a property
11
+
9
12
  ## [0.0.5] - 2020-02-06
10
13
  Adding show endpoint to retrieve a single property
11
14
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- immobilienscout (0.0.5)
4
+ immobilienscout (0.0.6)
5
5
  activesupport
6
6
  json
7
7
  multipart-post
data/README.md CHANGED
@@ -32,6 +32,13 @@ Immobilienscout::API::Property.create({params})
32
32
  Immobilienscout::API::Property.publish({params})
33
33
  ```
34
34
 
35
+ - Update property
36
+ ```ruby
37
+ Immobilienscout::API::Property.update(is24_id, {params})
38
+ ```
39
+
40
+ _Note: 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._
41
+
35
42
  - Delete property
36
43
  ```ruby
37
44
  Immobilienscout::API::Property.destroy(is24_id)
@@ -8,6 +8,14 @@ module Immobilienscout
8
8
  execute_post_request(create_url, params)
9
9
  end
10
10
 
11
+ def update(is24_id, params)
12
+ raise ArgumentError unless params.present?
13
+
14
+ update_url = update_url(is24_id)
15
+
16
+ execute_put_request(update_url, params)
17
+ end
18
+
11
19
  def publish(params)
12
20
  raise ArgumentError unless params.present?
13
21
 
@@ -39,6 +47,13 @@ module Immobilienscout
39
47
  parsed_response
40
48
  end
41
49
 
50
+ def execute_put_request(url, params)
51
+ parsed_response = Immobilienscout::Request.new(url, params).put
52
+ raise Immobilienscout::Errors::InvalidRequest, parsed_response.messages.map(&:messages) unless parsed_response.success?
53
+
54
+ parsed_response
55
+ end
56
+
42
57
  def execute_delete_request(url)
43
58
  parsed_response = Immobilienscout::Request.new(url).delete
44
59
  raise Immobilienscout::Errors::InvalidRequest, parsed_response.messages.map(&:messages) unless parsed_response.success?
@@ -57,6 +72,10 @@ module Immobilienscout
57
72
  "#{Immobilienscout::Client.api_url}/restapi/api/offer/v1.0/user/me/realestate"
58
73
  end
59
74
 
75
+ def update_url(is24_id)
76
+ "#{Immobilienscout::Client.api_url}/restapi/api/offer/v1.0/user/me/realestate/#{is24_id}"
77
+ end
78
+
60
79
  def publish_url
61
80
  "#{Immobilienscout::Client.api_url}/restapi/api/offer/v1.0/publish"
62
81
  end
@@ -1,3 +1,3 @@
1
1
  module Immobilienscout
2
- VERSION = '0.0.5'.freeze
2
+ VERSION = '0.0.6'.freeze
3
3
  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.5
4
+ version: 0.0.6
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-02-06 00:00:00.000000000 Z
11
+ date: 2020-02-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json