mason_hub_api 0.1.3 → 0.1.5
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 +8 -9
- data/lib/mason_hub_api/resource.rb +2 -0
- data/lib/mason_hub_api/resources/callback.rb +18 -3
- data/lib/mason_hub_api/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81c2db4ff9fd57f3159002058ac0405fedf74b74e33cc5997f045275dcb93679
|
4
|
+
data.tar.gz: 579e6412100571043c201b2c289097a2f18637a9cdca72161ab16163e76eb950
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e6b4f05b7fb73e644f925adf3de589f5da1342eeb527a5187dabfcdb3adc947e0f4b795559d638d1193c5d191fcd72061fda40e617c1d38cfee29c3a3f4752a
|
7
|
+
data.tar.gz: ec9a0673bc6d5d9c6083dc7a370a0b8638d7a47a4c383cfe38bf09ef3166243bff9eb08b3b88165d6409daba07efea9b6dd0efb43ccd3c02a9ddca0db746c8f7
|
data/Gemfile.lock
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
mason_hub_api (0.1.
|
4
|
+
mason_hub_api (0.1.3)
|
5
5
|
activesupport
|
6
6
|
faraday (~> 2.7.10)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activesupport (7.1.2)
|
11
|
+
activesupport (7.1.3.2)
|
12
12
|
base64
|
13
13
|
bigdecimal
|
14
14
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
@@ -20,25 +20,24 @@ GEM
|
|
20
20
|
tzinfo (~> 2.0)
|
21
21
|
ast (2.4.2)
|
22
22
|
base64 (0.2.0)
|
23
|
-
bigdecimal (3.1.
|
23
|
+
bigdecimal (3.1.6)
|
24
24
|
coderay (1.1.3)
|
25
|
-
concurrent-ruby (1.2.
|
25
|
+
concurrent-ruby (1.2.3)
|
26
26
|
connection_pool (2.4.1)
|
27
27
|
diff-lcs (1.5.0)
|
28
28
|
dotenv (2.8.1)
|
29
|
-
drb (2.2.
|
30
|
-
|
31
|
-
faraday (2.7.11)
|
29
|
+
drb (2.2.1)
|
30
|
+
faraday (2.7.12)
|
32
31
|
base64
|
33
32
|
faraday-net_http (>= 2.0, < 3.1)
|
34
33
|
ruby2_keywords (>= 0.0.4)
|
35
34
|
faraday-net_http (3.0.2)
|
36
|
-
i18n (1.14.
|
35
|
+
i18n (1.14.4)
|
37
36
|
concurrent-ruby (~> 1.0)
|
38
37
|
json (2.6.3)
|
39
38
|
language_server-protocol (3.17.0.3)
|
40
39
|
method_source (1.0.0)
|
41
|
-
minitest (5.
|
40
|
+
minitest (5.22.2)
|
42
41
|
mutex_m (0.2.0)
|
43
42
|
parallel (1.23.0)
|
44
43
|
parser (3.2.2.4)
|
@@ -2,6 +2,12 @@
|
|
2
2
|
|
3
3
|
module MasonHubAPI
|
4
4
|
class CallbackResource < Resource
|
5
|
+
def all(message_type: "all")
|
6
|
+
response = get_request("callbacks", params: { message_type: message_type })
|
7
|
+
|
8
|
+
response.body.map { |attributes| Callback.new(attributes) }
|
9
|
+
end
|
10
|
+
|
5
11
|
def create(attributes)
|
6
12
|
# accept either a single hash or an array of hashes
|
7
13
|
attributes = [attributes] if attributes.is_a?(Hash)
|
@@ -11,10 +17,19 @@ module MasonHubAPI
|
|
11
17
|
response
|
12
18
|
end
|
13
19
|
|
14
|
-
|
15
|
-
|
20
|
+
#
|
21
|
+
# Delete the registered callbacks
|
22
|
+
#
|
23
|
+
# @param [Array] message_types An array of message types to delete.
|
24
|
+
# Available type: "skuInventoryChange", "orderEvent", "orderCancelResolution", "orderUpdateResolution", "rmaEvent", "inboundShipmentEvent", "snapshotReady"
|
25
|
+
#
|
26
|
+
# @return [Response] An array of deleted callbacks
|
27
|
+
#
|
28
|
+
def delete(message_types)
|
29
|
+
message_types = [message_types] if message_types.is_a?(String)
|
30
|
+
raise ArgumentError, "message_types must be an array or string" unless message_types.is_a?(Array)
|
16
31
|
|
17
|
-
|
32
|
+
delete_request("callbacks", body: message_types).body
|
18
33
|
end
|
19
34
|
end
|
20
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mason_hub_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nickfarm27
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
130
130
|
- !ruby/object:Gem::Version
|
131
131
|
version: '0'
|
132
132
|
requirements: []
|
133
|
-
rubygems_version: 3.
|
133
|
+
rubygems_version: 3.2.33
|
134
134
|
signing_key:
|
135
135
|
specification_version: 4
|
136
136
|
summary: MasonHub API Wrapper
|