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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 11e1ff705d11d8a493b83fff1bf5d0cee946504d9f072d330aa2e846b8743aee
4
- data.tar.gz: 32e6c61e113c141ae8fb4d74803b5959d9e3215d96d7da26bc5554080331c310
3
+ metadata.gz: 7088e64b433baae893c02d9ac5d3845ec0ed2e66512deb5c881ca381ca2e7a5c
4
+ data.tar.gz: 9744cf7bb4d0fd051a3912fb5b40cbc6d8c448140bda4717528a8c0b78093721
5
5
  SHA512:
6
- metadata.gz: 0aeaa7f5f6deb29f1bdff81347a2eb070d8127fab79d5b7eb35fd99a291e8849d418f8cc119cc10f46f7f0cd2debb88d361e7123ea89cf7179b11d1245ff695e
7
- data.tar.gz: 1a41f9065dd1f6134c9a7eff4d9fb0c1f21cfe5e72fbe7d470baca26f5f24257bd0c7245ba15135d026936efc22ac989022f32e2780a1a5c95eec0a18cbed1d5
6
+ metadata.gz: 1d760a79dc5c852d8186b602b2cd81eab6d88e1b0cca3b3258ba854599dd36ebfaf490b44ebe38b227327e45c07e048def8d487ea5540853497e9c1b610bf6c9
7
+ data.tar.gz: 0d4e2caf14860b87ea5c911eab45f6cc11551b976cb8716a342dd81aa03f24320fb35bbb40fe0dbf19cdbd5101101c880f408704750e0ec3a278593a8b6ba98f
@@ -8,4 +8,6 @@ rvm:
8
8
  - 2.6.5
9
9
  script:
10
10
  - bundle exec rubocop
11
+ - bundle exec rspec
12
+
11
13
  before_install: gem install bundler -v 2.0.2
@@ -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
- ## [Unreleased]
8
- Improve error handling.
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- immobilienscout (0.0.7)
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.2)
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.2)
26
+ i18n (1.8.3)
27
27
  concurrent-ruby (~> 1.0)
28
28
  jaro_winkler (1.5.4)
29
- json (2.3.0)
30
- minitest (5.14.0)
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.6)
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.0.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
- _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._
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Immobilienscout
4
- VERSION = '0.0.7'
4
+ VERSION = '0.0.8'
5
5
  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.7
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-03-30 00:00:00.000000000 Z
11
+ date: 2020-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport