akeneo 1.3.0 → 1.4.0

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: 9f33e2c01c30f133a7a579f0f25bd8e2480cf395becaa2f579388fda468f521b
4
- data.tar.gz: 1f12002433db6e9e192dd7b531c7d3049e2b11bbbbd1fd7bcf72b213b1f05017
3
+ metadata.gz: 7e4514fbb5b3aac6c8793974f99c7142591612b8f512c90874da060cd6407a32
4
+ data.tar.gz: a77d97af639cd8197ab82023fb866c7dc2fe24ebd359b5580fdb4e9389b99614
5
5
  SHA512:
6
- metadata.gz: c13cb2bdce4e8f4312b5e000e04ec9d3867e728301583245f2c6539a6c1eb1f297f642ae142b0c77a2f23b4fe29ce244d2ebff26b18c030184a6dad58842fdf1
7
- data.tar.gz: 36065cd2c7051728716caa913dfb8369cfc4db7c5c446e5666ef6dc3b56b7014194958fe688b577d9cb51a9c82364d9571ff21a101242f7572eb761482a26a14
6
+ metadata.gz: 6ff483644030738a4b46fb73740073df4f6e8e8fb9346b7a8ec18eec2afccc7486924cfc2354100c1bbde0ad00bcf4cb99acefceab7b8dbf7f196af9614f1a5e
7
+ data.tar.gz: ab802e777759f4d7fbfd6711358e95a74dccab93e014b6a3516d2b096c1c077a326ed92d07c6b5fb14bed72debce0b13b01c91fca6f3f062429b59f8a264abdd
data/.gitignore CHANGED
@@ -11,3 +11,4 @@
11
11
 
12
12
  # rspec failure tracking
13
13
  .rspec_status
14
+ test.rb
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- akeneo (1.2.0)
4
+ akeneo (1.4.0)
5
5
  httparty
6
6
  redis
7
7
  semantic_logger
data/akeneo.gemspec CHANGED
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'akeneo'
8
- spec.version = '1.3.0'
8
+ spec.version = '1.4.0'
9
9
  spec.authors = ['AWN Dev Team']
10
10
  spec.email = ['edv@awn.de']
11
11
 
data/lib/akeneo/api.rb CHANGED
@@ -40,6 +40,14 @@ module Akeneo
40
40
  product_model_service.all(with_family: with_family)
41
41
  end
42
42
 
43
+ def create_or_update_product(code:, options:)
44
+ product_service.create_or_update(code, options)
45
+ end
46
+
47
+ def create_or_update_product_model(code:, options:)
48
+ product_model_service.create_or_update(code, options)
49
+ end
50
+
43
51
  def product_parent(code)
44
52
  product_model_service.find(code)
45
53
  end
@@ -24,6 +24,10 @@ module Akeneo
24
24
  end
25
25
  end
26
26
 
27
+ def create_or_update(code, options)
28
+ patch_request("/product-models/#{code}", body: options.to_json)
29
+ end
30
+
27
31
  private
28
32
 
29
33
  def search_with_family_param(family)
@@ -41,6 +41,10 @@ module Akeneo
41
41
  end
42
42
  end
43
43
 
44
+ def create_or_update(code, options)
45
+ patch_request("/products/#{code}", body: options.to_json)
46
+ end
47
+
44
48
  private
45
49
 
46
50
  def search_with_family_param(family)
@@ -38,6 +38,13 @@ module Akeneo
38
38
  )
39
39
  end
40
40
 
41
+ def patch_request(path, options = {})
42
+ HTTParty.patch(
43
+ "#{@url}/api/rest/v1#{path}",
44
+ options.merge(headers: default_request_headers)
45
+ )
46
+ end
47
+
41
48
  def pagination_param
42
49
  "pagination_type=#{DEFAULT_PAGINATION_TYPE}"
43
50
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: akeneo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - AWN Dev Team
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-01-24 00:00:00.000000000 Z
11
+ date: 2019-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake