mason_hub_api 0.1.3 → 0.1.4

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: 89d45f831b2941b944dac6522cbad039fca9cbd7ba8d1b528bae7b098c3e40b3
4
- data.tar.gz: c44b069a37e75e7d520cf1909b6de134ef69f81d15a49b2d8af3a9db6331e437
3
+ metadata.gz: 5d9a5d474e64378e0e777212eb6fe486898e6d1de987a2c326d6e6faeba5dce7
4
+ data.tar.gz: e0090930f22093f4cc19caad4856f6aa79344a317024c845ff6faecc26a98456
5
5
  SHA512:
6
- metadata.gz: 32416fa9bd471ffcda821a150d791d8588d63af68a9000240333852db9b647d6c8b4531431c2dd87e5f326dbd561bb0c518b9442bf3ee56277b4efb1be30420a
7
- data.tar.gz: 8698cab1e8f1680610d4ecbd30e7961f10ee3f487c91f123fb8edb253a2f5dfb0624a2f0bafe1b95714d35959a598f31d4adf63cd7c0470362204949b2c14c51
6
+ metadata.gz: fc1f8a76f9f01088aa84be8d8f5432ff92e202b7717afa7f3146de83e22b573b777836608326e1b5413e19260ebb460f0b68c9f815bac00edaa243eafcebf9ec
7
+ data.tar.gz: 291c9355e537012a8d2f621cb088547587dffe90795591dca1f3a1d860135636a3b83535a506f7e5d1fc49cd0f41fdb48ae6df2ed62a127fd363aba2bc2a2c45
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- mason_hub_api (0.1.2)
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.4)
23
+ bigdecimal (3.1.6)
24
24
  coderay (1.1.3)
25
- concurrent-ruby (1.2.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.0)
30
- ruby2_keywords
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.1)
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.20.0)
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
- def all(message_type: "all")
15
- response = get_request("callbacks", params: { message_type: message_type })
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
- response.body.map { |attributes| Callback.new(attributes) }
32
+ delete_request("callbacks", body: message_types).body
18
33
  end
19
34
  end
20
35
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module MasonHubAPI
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  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.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - nickfarm27
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-11-20 00:00:00.000000000 Z
11
+ date: 2024-03-07 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.3.18
133
+ rubygems_version: 3.2.33
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: MasonHub API Wrapper