# frozen_string_literal: true

require_relative "../../response/inducement_response"

module ONEAccess
  module API
    module V3_0 # rubocop:disable Style/ClassAndModuleCamelCase
      class Providers < Base
        api_path "/providers"

        class << self
          def inducements(recipient_user_id:, sender_email:, subject:, email_body:, receive_date:)
            params = {
              recipientuserid: recipient_user_id,
              senderemail:     sender_email,
              subject:         subject,
              emailbody:       email_body,
              receivedate:     receive_date
            }.reject { |_, v| v.nil? }

            resp = send_post("inducements", inducements: params)

            Response::InducementResponse.from_json(resp.body)
          end
        end
      end
    end
  end
end