class Meraki::Platform::ObjectMapper < Meraki::BaseApi
  def self.get_network_params ln
    hsh = {}
    hsh["name"] = ln.network_name
    hsh["timeZone"] = ActiveSupport::TimeZone.new(ln.timezone || 'UTC').tzinfo.name
    hsh["productTypes"] = ["appliance", "wireless", "switch"]
    if ln.network_configuration == "clone"
      hsh["copyFromNetworkId"] = LocationNetwork.where(:id => ln.cloned_network_id.to_i).first.vendor_network_id
    end
    hsh['notes'] = "Created from Pronto Cloud Controller"
    p hsh

    hsh
  end

  def self.get_updated_network_params ln
    Rails.logger.info ln.changes
    network_changes = ln.changes
    arr = ["network_name", "timezone"]
    hsh = {}
    if (network_changes.keys & arr).present?
      hsh["name"] = network_changes["network_name"].second unless network_changes["network_name"].blank?
    end
    
    hsh
  end
end