class MyTankInfo::Client

Constants

BASE_URL

Attributes

api_key[R]

Public Class Methods

new(api_key:, adapter: Faraday.default_adapter, stubs: nil) click to toggle source
# File lib/my_tank_info/client.rb, line 11
def initialize(api_key:, adapter: Faraday.default_adapter, stubs: nil)
  @api_key = api_key
  @adapter = adapter
  @stubs = stubs
end

Public Instance Methods

active_alarms() click to toggle source
# File lib/my_tank_info/client.rb, line 21
def active_alarms
  ActiveAlarmsResource.new(self)
end
alarm_history() click to toggle source
# File lib/my_tank_info/client.rb, line 25
def alarm_history
  AlarmHistoryResource.new(self)
end
alarm_notes() click to toggle source
# File lib/my_tank_info/client.rb, line 29
def alarm_notes
  AlarmNotesResource.new(self)
end
connection() click to toggle source
# File lib/my_tank_info/client.rb, line 97
def connection
  @connection ||= Faraday.new do |conn|
    conn.url_prefix = BASE_URL
    conn.request :json
    conn.response :json, content_type: "application/json"
    conn.adapter @adapter, @stubs
  end
end
csld_results() click to toggle source
# File lib/my_tank_info/client.rb, line 41
def csld_results
  CsldResultsResource.new(self)
end
environmental_sitegroups() click to toggle source
# File lib/my_tank_info/client.rb, line 17
def environmental_sitegroups
  EnvironmentalSitegroupsResource.new(self)
end
generate_api_token(username:, password:) click to toggle source
# File lib/my_tank_info/client.rb, line 93
def generate_api_token(username:, password:)
  TokensResource.new(self).generate(username: username, password: password)
end
inventory_sitegroups() click to toggle source
# File lib/my_tank_info/client.rb, line 49
def inventory_sitegroups
  InventorySitegroupsResource.new(self)
end
line_leak_results() click to toggle source
# File lib/my_tank_info/client.rb, line 37
def line_leak_results
  LineLeakResultsResource.new(self)
end
notification_contacts() click to toggle source
# File lib/my_tank_info/client.rb, line 85
def notification_contacts
  NotificationContactsResource.new(self)
end
notification_rules() click to toggle source
# File lib/my_tank_info/client.rb, line 89
def notification_rules
  NotificationRulesResource.new(self)
end
sensor_status_results() click to toggle source
# File lib/my_tank_info/client.rb, line 45
def sensor_status_results
  SensorStatusResultsResource.new(self)
end
sitegroup_inventory_dashboards() click to toggle source
# File lib/my_tank_info/client.rb, line 57
def sitegroup_inventory_dashboards
  SitegroupInventoryDashboardsResource.new(self)
end
tank_daily_usage() click to toggle source
# File lib/my_tank_info/client.rb, line 61
def tank_daily_usage
  TankDailyUsageResource.new(self)
end
tank_deliveries() click to toggle source
# File lib/my_tank_info/client.rb, line 65
def tank_deliveries
  TankDeliveriesResource.new(self)
end
tank_inventory() click to toggle source
# File lib/my_tank_info/client.rb, line 69
def tank_inventory
  TankInventoryResource.new(self)
end
tank_leak_results() click to toggle source
# File lib/my_tank_info/client.rb, line 33
def tank_leak_results
  TankLeakResultsResource.new(self)
end
tank_reconciliation_records() click to toggle source
# File lib/my_tank_info/client.rb, line 81
def tank_reconciliation_records
  TankReconciliationRecordsResource.new(self)
end
tank_rules() click to toggle source
# File lib/my_tank_info/client.rb, line 77
def tank_rules
  TankRulesResource.new(self)
end
tank_runout() click to toggle source
# File lib/my_tank_info/client.rb, line 73
def tank_runout
  TankRunoutResource.new(self)
end
tanks() click to toggle source
# File lib/my_tank_info/client.rb, line 53
def tanks
  TanksResource.new(self)
end