beyond_api 0.24.3.pre → 0.24.4.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/Gemfile.lock +1 -1
- data/lib/beyond_api/resources/customer_groups.rb +50 -0
- data/lib/beyond_api/session.rb +5 -0
- data/lib/beyond_api/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a8afb7efc6603d13612c778fc5434ffb10d0681219e19fe492e6f97edf72ca16
|
4
|
+
data.tar.gz: c8b32ac06053d8df1a5cf5966b98354eb4693636fe5390183dd1ee7a2f903eab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac544f672b62235e98090b1554d252345763122eb742e085b330ccec4654dceaa4aae58d5c1cd941a25e2cf4a5d15faab9ea67328f5b89be737133f0999c4f9c
|
7
|
+
data.tar.gz: 3037052be3fd2a48ed80b64ce7672e3108499791d5eded18969f88c21418f90402adc8620db9997fe0a8ce25090bdd764cacaff5a643750a14cc9f40e5749054
|
data/Gemfile.lock
CHANGED
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "beyond_api/utils"
|
4
|
+
|
5
|
+
module BeyondApi
|
6
|
+
class CustomerGroups < Base
|
7
|
+
include BeyondApi::Utils
|
8
|
+
#
|
9
|
+
# A +GET+ request is used to list all customer groups of a shop in a paged way. Each item in the response represents a summary of the customer group data.
|
10
|
+
#
|
11
|
+
# $ curl 'https://api-shop.beyondshop.cloud/api/customer-groups' -i -X POST \
|
12
|
+
# -H 'Authorization: Bearer <Access token>'
|
13
|
+
#
|
14
|
+
# @beyond_api.scopes +cugr:r+
|
15
|
+
#
|
16
|
+
# @return [OpenStruct]
|
17
|
+
#
|
18
|
+
# @example
|
19
|
+
# @customer_groups = session.customer_groups.all
|
20
|
+
#
|
21
|
+
def all(params = {})
|
22
|
+
response, status = BeyondApi::Request.get(@session, "/customer-groups", params)
|
23
|
+
|
24
|
+
handle_response(response, status)
|
25
|
+
end
|
26
|
+
|
27
|
+
#
|
28
|
+
# A +POST+ request is used to add a customer to a provided list of groups.
|
29
|
+
#
|
30
|
+
# $ curl 'https://api-shop.beyondshop.cloud/api/customers/fb5f14ac-f274-4673-ad40-6712dfeea1ba/customer-groups' -i -X POST \
|
31
|
+
# -H 'Content-Type: application/json' \
|
32
|
+
# -H 'Authorization: Bearer <Access token>'
|
33
|
+
# -d '["5d94fa06-f58c-4379-9714-5dc57877c186"]'
|
34
|
+
#
|
35
|
+
# @beyond_api.scopes +cugr:r+
|
36
|
+
#
|
37
|
+
# @return [OpenStruct]
|
38
|
+
#
|
39
|
+
# @example
|
40
|
+
# @customer_groups = session.add_customer("fb5f14ac-f274-4673-ad40-6712dfeea1ba", ["5d94fa06-f58c-4379-9714-5dc57877c186"])
|
41
|
+
#
|
42
|
+
def add_customer(customer_id, customer_group_ids)
|
43
|
+
response, status = BeyondApi::Request.post(@session,
|
44
|
+
"/customers/#{customer_id}/customer-groups",
|
45
|
+
customer_group_ids)
|
46
|
+
|
47
|
+
handle_response(response, status)
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
data/lib/beyond_api/session.rb
CHANGED
@@ -7,6 +7,7 @@ module BeyondApi
|
|
7
7
|
autoload :Categories, "beyond_api/resources/categories"
|
8
8
|
autoload :CheckoutSettings, "beyond_api/resources/checkout_settings"
|
9
9
|
autoload :Customers, "beyond_api/resources/customers"
|
10
|
+
autoload :CustomerGroups, "beyond_api/resources/customer_groups"
|
10
11
|
autoload :NewsletterTarget, "beyond_api/resources/newsletter_target"
|
11
12
|
autoload :OrderSettings, "beyond_api/resources/order_settings"
|
12
13
|
autoload :Orders, "beyond_api/resources/orders"
|
@@ -57,6 +58,10 @@ module BeyondApi
|
|
57
58
|
BeyondApi::CheckoutSettings.new(self)
|
58
59
|
end
|
59
60
|
|
61
|
+
def customer_groups
|
62
|
+
BeyondApi::CustomerGroups.new(self)
|
63
|
+
end
|
64
|
+
|
60
65
|
def customers
|
61
66
|
BeyondApi::Customers.new(self)
|
62
67
|
end
|
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.24.
|
4
|
+
version: 0.24.4.pre
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Unai Abrisketa
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: exe
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2025-10-13 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: bundler
|
@@ -187,6 +187,7 @@ files:
|
|
187
187
|
- lib/beyond_api/resources/categories.rb
|
188
188
|
- lib/beyond_api/resources/categories_view.rb
|
189
189
|
- lib/beyond_api/resources/checkout_settings.rb
|
190
|
+
- lib/beyond_api/resources/customer_groups.rb
|
190
191
|
- lib/beyond_api/resources/customers.rb
|
191
192
|
- lib/beyond_api/resources/newsletter_target.rb
|
192
193
|
- lib/beyond_api/resources/order_settings.rb
|