Class: Supersaas::Schedules

Inherits:
BaseApi
  • Object
show all
Defined in:
lib/supersaas-api-client/api/schedules.rb

Constant Summary

Constants inherited from BaseApi

BaseApi::DATETIME_REGEX, BaseApi::INTEGER_REGEX, BaseApi::PROMOTION_REGEX

Instance Attribute Summary

Attributes inherited from BaseApi

#client

Instance Method Summary collapse

Methods inherited from BaseApi

#initialize

Constructor Details

This class inherits a constructor from Supersaas::BaseApi

Instance Method Details

#field_list(schedule_id) ⇒ Object



19
20
21
22
23
24
# File 'lib/supersaas-api-client/api/schedules.rb', line 19

def field_list(schedule_id)
  path = '/field_list'
  query = { schedule_id: validate_id(schedule_id) }
  res = client.get(path, query)
  res.map { |attributes| Supersaas::FieldList.new(attributes) }
end

#listObject



6
7
8
9
10
# File 'lib/supersaas-api-client/api/schedules.rb', line 6

def list
  path = '/schedules'
  res = client.get(path)
  res.map { |attributes| Supersaas::Schedule.new(attributes) }
end

#resources(schedule_id) ⇒ Object



12
13
14
15
16
17
# File 'lib/supersaas-api-client/api/schedules.rb', line 12

def resources(schedule_id)
  path = '/resources'
  query = { schedule_id: validate_id(schedule_id) }
  res = client.get(path, query)
  res.map { |attributes| Supersaas::Resource.new(attributes) }
end