Sha256: aef9c6f054ff618f845300af9039ad5d51672c928246a53dc62464d60cb3b98e

Contents?: true

Size: 744 Bytes

Versions: 5

Compression:

Stored size: 744 Bytes

Contents

# frozen_string_literal: true

module Supersaas
  class Schedules < BaseApi
    # REF: https://www.supersaas.com/info/dev/information_api
    def list
      path = '/schedules'
      res = client.get(path)
      res.map { |attributes| Supersaas::Schedule.new(attributes) }
    end

    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

    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
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
supersaas-api-client-2.0.4 lib/supersaas-api-client/api/schedules.rb
supersaas-api-client-2.0.3 lib/supersaas-api-client/api/schedules.rb
supersaas-api-client-2.0.2 lib/supersaas-api-client/api/schedules.rb
supersaas-api-client-2.0.1 lib/supersaas-api-client/api/schedules.rb
supersaas-api-client-2.0.0 lib/supersaas-api-client/api/schedules.rb