Sha256: 489183173b372ad875039d8f2bd6725e81d59917573812daddf9d92161a0ca96

Contents?: true

Size: 1.47 KB

Versions: 2

Compression:

Stored size: 1.47 KB

Contents

require 'eloqua/api'

module Eloqua

  class Api
    class Action

      cattr_reader :type_methods
      @@type_methods = [:list_external_action_steps_by_type, :get_member_count_in_step_by_status, :list_members_in_step_by_status, :set_member_status]

      class << self

        delegate :builder, :remote_type, :to => Eloqua::Api

        def get_member_count_in_step_by_status(stepId, status)
          xml_query = builder do |xml|
            xml.tag!(:stepId, stepId)
            xml.tag!(:status, status)
          end
          results = request(:get_member_count_in_step_by_status, xml_query)
          results = results.to_i
        end

        #still seems finicky, returns a funky hash table if there are no members in that step
        def list_members_in_step_by_status(stepId, status, pageNumber, pageSize)
          xml_query = builder do |xml|
            xml.tag!(:stepId, stepId)
            xml.tag!(:status, status)
            xml.tag!(:pageNumber, pageNumber)
            xml.tag!(:pageSize, pageSize)
          end
          results = request(:list_members_in_step_by_status, xml_query)
        end

        def set_member_status(arrayOfMember, status)
          xml_query = builder do |xml|
            xml.template(:member_array, arrayOfMember)
            xml.tag!(:status, status)
          end
          results = request(:set_member_status, xml_query)
        end

        def request(*args)
          Eloqua::Api.request(:action, *args)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
eloqua-1.1.3 lib/eloqua/api/action.rb
eloqua-1.1.2 lib/eloqua/api/action.rb