Class: Operto::StaffTasks::Create
- Inherits:
-
Object
- Object
- Operto::StaffTasks::Create
- Includes:
- Operation
- Defined in:
- lib/operto/staff_tasks/create.rb,
sig/operto.rbs
Instance Method Summary collapse
Methods included from Operation
Instance Method Details
#call(task_id:, staff_id:, property_id:) ⇒ ::Dry::Monads::Result[::Hash[::Symbol, untyped]]
7 8 9 10 11 12 13 14 |
# File 'lib/operto/staff_tasks/create.rb', line 7 def call(task_id:, staff_id:, property_id:) validate_arguments!(task_id, staff_id, property_id) response = Operto::Client.connection.post('stafftasks', request_attributes(task_id, staff_id, property_id)) Operto::Client.handle_response(response) { |body| { staff_task_id: body[:StaffTaskID] } } rescue StandardError => e Failure(e) end |