beyond_api 0.6.0.pre → 0.7.0.pre
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 +4 -4
- data/CHANGELOG.md +8 -0
- data/GETTING_STARTED.md +2 -0
- data/Gemfile.lock +1 -1
- data/README.md +1 -0
- data/lib/beyond_api/resources/products.rb +27 -0
- data/lib/beyond_api/resources/products/availability.rb +1 -1
- data/lib/beyond_api/resources/variations/availability.rb +3 -3
- data/lib/beyond_api/resources/variations/images.rb +1 -1
- data/lib/beyond_api/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: 3f7a8343a55357062e3c00e229c0b16c1c88af900347165145739372d005cb99
|
4
|
+
data.tar.gz: 10ff509e60617197670305f7a0a6a32171018693f4100b8da9626ae636e492ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3edbc6973b4f630cb38ca5c1eb7a4855df7deb85fa43a74315133a4e3df86695955fd5c461ff1d645ad79ea1d1aa296b245c42af2738d16cd0b9ec6fefd9980
|
7
|
+
data.tar.gz: bdf3dc796e6cbf47981daaf40b71ec83d937213e0640f24ad32c250e0a68ce842205289b9fb6b3290425bc849b334680054516eeda3e2b932c4cfc39f52d0788
|
data/CHANGELOG.md
CHANGED
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
data/README.md
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# Beyond API Ruby Client
|
2
2
|
|
3
3
|

|
4
|
+
[](https://rubydoc.info/github/ePages-de/beyond_api-ruby_client)
|
4
5
|
[](https://codeclimate.com/github/ePages-de/beyond_api-ruby_client/maintainability)
|
5
6
|

|
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",
|
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
|
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,
|
29
|
-
response, status = BeyondApi::Request.post(@session, "/products/#{product_id}/variations/#{variation_id}/availability/adjust-available-stock",
|
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.
|
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)
|
data/lib/beyond_api/version.rb
CHANGED
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.
|
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-
|
13
|
+
date: 2020-02-13 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|