synnex 0.1.5 → 0.1.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f817c09b872ea741947e99c35e040db4f81e3de790e61922d4bb580ca1aff6c0
4
- data.tar.gz: a8f1e480b85be277c94c94a9a817b6fecbc5d77bdefab2889121242d23454f2c
3
+ metadata.gz: aa576758ae027bcaf6c94d641c798e86dc6d63c401e53d30c35cde4c7574bf21
4
+ data.tar.gz: 3761f7fe3841b1d2600df9762bac19512f971973a4bb4825dcfff118c096514d
5
5
  SHA512:
6
- metadata.gz: 927eb8a3a947df7345e335f53fa8af76815a875fd9c916deddfdd1f5c480f1e28d0514517f0b34643c8f7873c8f586be73d0b3d7240c1f39a96df851e3a8c1fa
7
- data.tar.gz: 6c3d1e082a742ca58236577dca86a5029ab8eb45e1eee931b7d0ed3e8ef61cb81a8ba2665e82ff47a3b9c0f52669956741da3d2a4615811aaa6e1474ffaf3b7c
6
+ metadata.gz: 1717a3ce99c2b16f2d5183a905c3236112a1db2e6c229bbd08e021ef4be8c0920f05f65192ada57df34d06f1dd512a25ff2496a939a93d4cbd6834b36a0cfa5d
7
+ data.tar.gz: fa57efaea9b7275a9e340a9d63178d1d9b57604164768bc8cb5e213685c22c4d211e731aa6ec191e2035e11eb3225c323f55db31fbff0e96d9cbf11cd17ed286
@@ -86,6 +86,16 @@ module Synnex
86
86
  .parsed_response
87
87
  end
88
88
 
89
+ def customer_users(cust_no)
90
+ HTTParty.post("#{@endpoint}/webservice/solutions/csp",
91
+ body: {
92
+ action_name: 'get_customer_users',
93
+ snx_eu_no: cust_no
94
+ }.to_json,
95
+ headers: @headers)
96
+ .parsed_response["items"]
97
+ end
98
+
89
99
 
90
100
 
91
101
  private
@@ -14,7 +14,7 @@ module Synnex
14
14
  @email = json["email"]
15
15
  @phone = json["phone"]
16
16
  @tenant_id = json["tenant_id"]
17
- @msp = msp
17
+ @api = msp.api
18
18
  end
19
19
 
20
20
  def subscriptions
@@ -22,6 +22,10 @@ module Synnex
22
22
  .map {|subscription| Synnex::Subscription.new(api.subscription(subscription["subscription_id"]), self)}
23
23
  end
24
24
 
25
+ def users
26
+ @users ||= api.customer_users(@snx_eu_no)
27
+ end
28
+
25
29
  # line_items is an array (optional) of the following hash {snx_sku_no: 12345, quantity: 1}
26
30
  # returns true for success
27
31
  def create_order(line_items, rs_po=nil , eu_po=nil , email=nil)
@@ -38,14 +42,8 @@ module Synnex
38
42
  response["status"] == "success" ? true : response["message"]
39
43
  end
40
44
 
41
- private
42
-
43
- def msp
44
- @msp
45
- end
46
-
47
45
  def api
48
- msp.api
46
+ @api
49
47
  end
50
48
  end
51
49
  end
@@ -11,7 +11,7 @@ module Synnex
11
11
  @po = json["rs_po_no"]
12
12
  @price = info["unit_price"]
13
13
  @msrp = info["msrp"]
14
- @customer = customer
14
+ @api = customer.api
15
15
  end
16
16
 
17
17
  def change_quantity(qty, email=nil)
@@ -28,7 +28,7 @@ module Synnex
28
28
  private
29
29
 
30
30
  def api
31
- customer.msp.api
31
+ @api
32
32
  end
33
33
 
34
34
  end
data/synnex.gemspec CHANGED
@@ -1,7 +1,7 @@
1
1
 
2
2
  Gem::Specification.new do |spec|
3
3
  spec.name = "synnex"
4
- spec.version = '0.1.5'
4
+ spec.version = '0.1.6'
5
5
  spec.authors = ["Andrew Gauger"]
6
6
  spec.email = ["andygauge@gmail.com"]
7
7
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: synnex
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Gauger
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-25 00:00:00.000000000 Z
11
+ date: 2021-05-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty