class Synnex::Msp

Attributes

api[R]

Public Class Methods

new(hash) click to toggle source

Pass the parameters to Synnex::Msp.new(user_name: 'user', password: 'pass', reseller: 12345) Pass the parameter {endpoint: 'production'} for the production endpoint

# File lib/synnex/synnex_msp.rb, line 6
def initialize(hash)
  @api = Synnex::API.new(hash)
end

Public Instance Methods

customers() click to toggle source
# File lib/synnex/synnex_msp.rb, line 10
def customers
  @customers ||= api.customers.map {|json| Synnex::Customer.new(json, self)}
end
find_customer(snx_eu_no) click to toggle source
# File lib/synnex/synnex_msp.rb, line 14
def find_customer(snx_eu_no)
  customers.find {|c| c.snx_eu_no == snx_eu_no}
end
find_subscription(id) click to toggle source
# File lib/synnex/synnex_msp.rb, line 18
def find_subscription(id)
  Synnex::Subscription.new(api.subscription(id), @api)
end