require 'yardi/document_parser/prospects' require 'yardi/request_section/prospect' require_relative 'base' module Yardi module Request ## # Search Yardi for Prospects # # prospect = Yardi::Parameter::Prospect.new(...) # # request = Yardi::Request::GetYardiGuestActivity.new( # credential: credential, # params: { property_id: 'p263656', prospect: prospect } # ) # # request.perform # # => [#, #] # class GetYardiGuestActivity < Base ## # :method: initialize # # Create a new instance of GetYardiGuestActivity # # Required parameters: # * +property_id+ String # * +prospect+ Yardi::Parameter::Prospect # # request = Yardi::Request::GetYardiGuestActivity.new( # credential: credential, # params: { property_id: 'p263656', prospect: prospect } # ) ## # :method: perform # # Use #perform to send the actual HTTP request # # request.perform # # => [#, #] # # Returns an Array of Yardi::Model::Prospect records # ## # Private methods private attr_reader :property_id, :prospect, :params, :with_or, :send_prospect_events def after_initialize(params) @property_id = params[:property_id] @prospect = params[:prospect] @params = params @with_or = params[:with_or] || false @send_prospect_events = params[:send_prospect_events].nil? ? true : params[:send_prospect_events] raise ArgumentError, ':property_id and :prospect are required' unless property_id && prospect end def parser DocumentParser::Prospects.new(params) end def soap_body_sections [ RequestSection::Authentication.new(credential), RequestSection::Prospect.new( property_id: property_id, prospect: prospect ) ] end def soap_action if with_or 'GetYardiGuestActivity_SearchWithOR' else 'GetYardiGuestActivity_Search' end end def interface 'ItfILSGuestCard' end end end end