Skip to content

Commit 8800b05

Browse files
authored
Release v0.14.0.pre (#33)
1 parent 6162730 commit 8800b05

File tree

5 files changed

+43
-38
lines changed

5 files changed

+43
-38
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
### v0.14.0.pre
2+
3+
* deprecations
4+
* Remove `Products#assign_variation_images_differentiator`
5+
6+
* features
7+
* Add `Products#assign_variation_attribute_as_differentiator`
8+
19
### v0.13.0.pre
210

311
* features

Gemfile.lock

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,42 @@
11
PATH
22
remote: .
33
specs:
4-
beyond_api (0.13.0.pre)
4+
beyond_api (0.14.0.pre)
55
faraday (~> 0.15)
66

77
GEM
88
remote: https://rubygems.org/
99
specs:
10-
coderay (1.1.2)
11-
concurrent-ruby (1.1.5)
12-
diff-lcs (1.3)
13-
dotenv (2.7.5)
14-
faker (2.4.0)
15-
i18n (~> 1.6.0)
16-
faraday (0.17.3)
10+
coderay (1.1.3)
11+
concurrent-ruby (1.1.8)
12+
diff-lcs (1.4.4)
13+
dotenv (2.7.6)
14+
faker (2.17.0)
15+
i18n (>= 1.6, < 2)
16+
faraday (0.17.4)
1717
multipart-post (>= 1.2, < 3)
18-
i18n (1.6.0)
18+
i18n (1.8.10)
1919
concurrent-ruby (~> 1.0)
20-
method_source (0.9.2)
20+
method_source (1.0.0)
2121
multipart-post (2.1.1)
22-
pry (0.12.2)
23-
coderay (~> 1.1.0)
24-
method_source (~> 0.9.0)
22+
pry (0.14.0)
23+
coderay (~> 1.1)
24+
method_source (~> 1.0)
2525
rake (10.5.0)
26-
rspec (3.8.0)
27-
rspec-core (~> 3.8.0)
28-
rspec-expectations (~> 3.8.0)
29-
rspec-mocks (~> 3.8.0)
30-
rspec-core (3.8.2)
31-
rspec-support (~> 3.8.0)
32-
rspec-expectations (3.8.4)
26+
rspec (3.10.0)
27+
rspec-core (~> 3.10.0)
28+
rspec-expectations (~> 3.10.0)
29+
rspec-mocks (~> 3.10.0)
30+
rspec-core (3.10.1)
31+
rspec-support (~> 3.10.0)
32+
rspec-expectations (3.10.1)
3333
diff-lcs (>= 1.2.0, < 2.0)
34-
rspec-support (~> 3.8.0)
35-
rspec-mocks (3.8.1)
34+
rspec-support (~> 3.10.0)
35+
rspec-mocks (3.10.2)
3636
diff-lcs (>= 1.2.0, < 2.0)
37-
rspec-support (~> 3.8.0)
38-
rspec-support (3.8.2)
39-
yard (0.9.20)
37+
rspec-support (~> 3.10.0)
38+
rspec-support (3.10.2)
39+
yard (0.9.26)
4040

4141
PLATFORMS
4242
ruby

lib/beyond_api/resources/products.rb

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -253,28 +253,25 @@ def update(product_id, body)
253253
end
254254

255255
#
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.
256+
# A +POST+ request is used to assign a variation attribute as the variation images differentiator for a variation product.
257257
#
258258
# @beyond_api.scopes +prod:u+
259259
#
260-
# $ curl 'https://api-shop.beyondshop.cloud/api/products/30839efc-47f7-4d55-aa13-aac7532982b6/variation-images-differentiator' -i -X PUT \
260+
# $ curl 'https://api-shop.beyondshop.cloud/api/products/f205294b-17dc-4f75-8b5e-5df72abb96df/variation-attributes/491fedf4-37a9-4bcf-98b8-cff2f82879b7/make-differentiator' -i -X POST \
261261
# -H 'Content-Type: application/hal+json' \
262262
# -H 'Accept: application/hal+json' \
263-
# -H 'Authorization: Bearer <Access token>' \
264-
# -d '{
265-
# "differentiator" : "size"
266-
# }'
263+
# -H 'Authorization: Bearer <Access token>'
267264
#
268265
# @param product_id [String] the product UUID
269-
# @param differentiator [String] the differentiator
266+
# @param variation_attribute_id [String] the variation attribute UUID
270267
#
271268
# @return [true]
272269
#
273270
# @example
274-
# session.products.assign_variation_images_differentiator("30839efc-47f7-4d55-aa13-aac7532982b6", "size")
271+
# session.products.assign_variation_images_differentiator("f205294b-17dc-4f75-8b5e-5df72abb96df", "491fedf4-37a9-4bcf-98b8-cff2f82879b7")
275272
#
276-
def assign_variation_images_differentiator(product_id, differentiator)
277-
response, status = BeyondApi::Request.put(@session, "/products/#{product_id}/variation-images-differentiator", differentiator: differentiator)
273+
def assign_variation_attribute_as_differentiator(product_id, variation_attribute_id)
274+
response, status = BeyondApi::Request.post(@session, "/products/#{product_id}/variation-attributes/#{variation_attribute_id}/make-differentiator")
278275

279276
handle_response(response, status, respond_with_true: true)
280277
end

lib/beyond_api/resources/variations.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
require "beyond_api/utils"
44

55
module BeyondApi
6-
autoload :Images, "beyond_api/resources/variations/images"
7-
autoload :Availability, "beyond_api/resources/variations/availability"
6+
autoload :VariationImages, "beyond_api/resources/variations/images"
7+
autoload :VariationAvailability, "beyond_api/resources/variations/availability"
88

99
class Variations < Base
1010
include BeyondApi::VariationImages

lib/beyond_api/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module BeyondApi
2-
VERSION = "0.13.0.pre".freeze
2+
VERSION = "0.14.0.pre".freeze
33
end

0 commit comments

Comments
 (0)