class Meraki::BaseApi
  extend WrapperApi

  # def self.get_API_url_endpoint
  #   "https://" + APPLICATION['defaults']['MERAKI']['HOSTNAME'] + API_PATH_PREFIX
  # end

  def self.mac_to_serialno mac_id
    mac_id.gsub(':', '').downcase
  end

  def get_integration_details ln, org=nil
    if ln.blank?
      int_type = org.integration_types.where(vendor_name: 'meraki').last
    else
      int_type = ln.integration_type
      int_type = ln.organisation.integration_types.where(vendor_name: 'meraki').last if int_type.blank?
    end

    raise "Meraki integration is not found. Please check the mearki integartion for location network - #{ln.network_name}" unless int_type

    int_type
  end
end