Class: Operto::StaffTaskTimes::Index

Inherits:
Object
  • Object
show all
Includes:
FilteredPagination, Operation
Defined in:
lib/operto/staff_task_times/index.rb,
sig/operto.rbs

Constant Summary collapse

FILTER_MAPPINGS =
{
  task_id: 'TaskID',
  staff_id: 'StaffID',
  property_id: 'PropertyID',
  start_date: 'StartDate',
  end_date: 'EndDate'
}.freeze
DATE_KEYS =
%i[start_date end_date].freeze
DEFAULT_SORT =
'StaffTaskTimeID desc'.freeze

Instance Method Summary collapse

Methods included from Operation

#call!, included

Instance Method Details

#call(attributes: {}, skip: 0, take: 50) ⇒ ::Dry::Monads::Result[::Hash[::Symbol, untyped]]

RBS:

  • (?attributes: ::Hash[::Symbol, untyped], ?skip: ::Integer, ?take: ::Integer) -> Dry::Monads::Result[::Hash[::Symbol, untyped]]

Parameters:

  • attributes: (::Hash[::Symbol, untyped]) (defaults to: {})
  • skip: (::Integer) (defaults to: 0)
  • take: (::Integer) (defaults to: 50)

Returns:

  • (::Dry::Monads::Result[::Hash[::Symbol, untyped]])


19
20
21
22
23
24
25
26
27
28
# File 'lib/operto/staff_task_times/index.rb', line 19

def call(attributes: {}, skip: 0, take: 50)
  validate_arguments!(attributes)

  query_params = build_query_params(attributes, skip, take)
  response = Operto::Client.connection.get('stafftasktimes', query_params)

  Operto::Client.handle_response(response) { |body| format_results(body) }
rescue StandardError => e
  Failure(e)
end