beyond_api 0.6.0.pre → 0.7.0.pre

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: 31b8f47b376a95d1575e48fb7661397aa5c4e374fc6ac680b44d16dcd7bb4e5d
4
- data.tar.gz: 5fb3e444da729827dee2f3ae336771b6ffc9d278150bcd371b115d9e7496dd7d
3
+ metadata.gz: 3f7a8343a55357062e3c00e229c0b16c1c88af900347165145739372d005cb99
4
+ data.tar.gz: 10ff509e60617197670305f7a0a6a32171018693f4100b8da9626ae636e492ec
5
5
  SHA512:
6
- metadata.gz: fcf18ac9f5037a904f630cef79698edfe2ab1d4a9bdc417cf27a1f9e354d0df760dd2ff18416790774dc451bba569c7227de8c5bee7644b42cce35796dccc82a
7
- data.tar.gz: 1126ed97396c7db4fdf721106a49471ba9c68c4f6c61f0a35f061b23e262acbdf78a9ea091a53eb8052a65ddb7edf9cb02a18a1920ae108fd949464745a1d692
6
+ metadata.gz: c3edbc6973b4f630cb38ca5c1eb7a4855df7deb85fa43a74315133a4e3df86695955fd5c461ff1d645ad79ea1d1aa296b245c42af2738d16cd0b9ec6fefd9980
7
+ data.tar.gz: bdf3dc796e6cbf47981daaf40b71ec83d937213e0640f24ad32c250e0a68ce842205289b9fb6b3290425bc849b334680054516eeda3e2b932c4cfc39f52d0788
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ### v0.7.0.pre
2
+
3
+ * features
4
+ * Add `Products#assign_variation_images_differentiator` method
5
+
6
+ * deprecations
7
+ * `Variations#adjust_stock_level` receives parameter `relative_amount` instead of `body`
8
+
1
9
  ### v0.6.0.pre
2
10
 
3
11
  * bug-fixes
data/GETTING_STARTED.md CHANGED
@@ -37,6 +37,8 @@ session.token.refresh
37
37
 
38
38
  ## Consuming the API
39
39
 
40
+ Check the [_rubydoc_ documentation](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client) for more information on the Beyond API Ruby Client.
41
+
40
42
  Here you can find a list with all available methods:
41
43
 
42
44
  * Carts
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- beyond_api (0.6.0.pre)
4
+ beyond_api (0.7.0.pre)
5
5
  faraday (~> 0.15)
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Beyond API Ruby Client
2
2
 
3
3
  ![Gem Version](https://img.shields.io/gem/v/beyond_api?label=gem%20version)
4
+ [![Docs](https://img.shields.io/badge/docs-rubydoc-blue)](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client)
4
5
  [![Maintainability](https://api.codeclimate.com/v1/badges/1d173fa0b393e8eaf2a2/maintainability)](https://codeclimate.com/github/ePages-de/beyond_api-ruby_client/maintainability)
5
6
  ![License](https://img.shields.io/github/license/ePages-de/beyond_api-ruby_client)
6
7
 
@@ -252,6 +252,33 @@ module BeyondApi
252
252
  handle_response(response, status)
253
253
  end
254
254
 
255
+ #
256
+ # A +PUT+ request is used to assign a variation images differentiator for a variation product. The differentiator can be one of the variation attributes defined by the merchant, e.g. name, size, or color.
257
+ #
258
+ # @beyond_api.scopes +prod:u+
259
+ #
260
+ # $ curl 'https://api-shop.beyondshop.cloud/api/products/30839efc-47f7-4d55-aa13-aac7532982b6/variation-images-differentiator' -i -X PUT \
261
+ # -H 'Content-Type: application/hal+json' \
262
+ # -H 'Accept: application/hal+json' \
263
+ # -H 'Authorization: Bearer <Access token>' \
264
+ # -d '{
265
+ # "differentiator" : "size"
266
+ # }'
267
+ #
268
+ # @param product_id [String] the product UUID
269
+ # @param differentiator [String] the differentiator
270
+ #
271
+ # @return [true]
272
+ #
273
+ # @example
274
+ # session.products.assign_variation_images_differentiator("30839efc-47f7-4d55-aa13-aac7532982b6", "size")
275
+ #
276
+ def assign_variation_images_differentiator(product_id, differentiator)
277
+ response, status = BeyondApi::Request.put(@session, "/products/#{product_id}/variation-images-differentiator", differentiator: differentiator)
278
+
279
+ handle_response(response, status, respond_with_true: true)
280
+ end
281
+
255
282
  alias_method :create_variation, :create
256
283
  alias_method :find_variation, :find
257
284
  alias_method :update_variation, :update
@@ -22,7 +22,7 @@ module BeyondApi
22
22
  # @return [OpenStruct]
23
23
  #
24
24
  # @example
25
- # @availability = session.products.adjust_stock_level("685f483e-cdda-40af-8091-d5bc31249409", { relativeAmount => -1 })
25
+ # @availability = session.products.adjust_stock_level("685f483e-cdda-40af-8091-d5bc31249409", -1)
26
26
  #
27
27
  def adjust_stock_level(product_id, relative_amount)
28
28
  response, status = BeyondApi::Request.post(@session, "/products/#{product_id}/availability/adjust-available-stock", { relative_amount: relative_amount })
@@ -18,15 +18,15 @@ module BeyondApi
18
18
  #
19
19
  # @param product_id [String] the product UUID
20
20
  # @param variation_id [String] the product variation UUID
21
- # @param body [Hash] the request body
21
+ # @param relative_amount [Integer] the relative amount
22
22
  #
23
23
  # @return [OpenStruct]
24
24
  #
25
25
  # @example
26
26
  # @availability = session.variations.adjust_stock_level(product_id, variation_id, { relativeAmount => -1 })
27
27
  #
28
- def adjust_stock_level(product_id, variation_id, body)
29
- response, status = BeyondApi::Request.post(@session, "/products/#{product_id}/variations/#{variation_id}/availability/adjust-available-stock", body)
28
+ def adjust_stock_level(product_id, variation_id, relative_amount)
29
+ response, status = BeyondApi::Request.post(@session, "/products/#{product_id}/variations/#{variation_id}/availability/adjust-available-stock", relative_amount: relative_amount)
30
30
 
31
31
  handle_response(response, status)
32
32
  end
@@ -139,7 +139,7 @@ module BeyondApi
139
139
  # "source" => "https://vimeo.com/7265982"
140
140
  # }
141
141
  #
142
- # session.variation.upload_image("4125b993-49fc-47c8-b9b3-76d8871e4e06", "d7fecf94-2e57-4122-8c94-a0acd840c111", "/home/epages/file.png", "file.png")
142
+ # session.variations.upload_image("4125b993-49fc-47c8-b9b3-76d8871e4e06", "d7fecf94-2e57-4122-8c94-a0acd840c111", "/home/epages/file.png", "file.png")
143
143
  #
144
144
  def upload_image(product_id, variation_id, image_path, image_name)
145
145
  content_type = case File.extname(image_path)
@@ -1,3 +1,3 @@
1
1
  module BeyondApi
2
- VERSION = "0.6.0.pre".freeze
2
+ VERSION = "0.7.0.pre".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beyond_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0.pre
4
+ version: 0.7.0.pre
5
5
  platform: ruby
6
6
  authors:
7
7
  - Unai Abrisketa
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2020-01-07 00:00:00.000000000 Z
13
+ date: 2020-02-13 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler