Sha256: ebc6c701508d321196333ebd67c1e4188959cde0015a715d2a7018804cc85950

Contents?: true

Size: 840 Bytes

Versions: 2

Compression:

Stored size: 840 Bytes

Contents

module Mrkt
  module CrudProgramMembers
    def describe_program_members
      get('/rest/v1/programs/members/describe.json')
    end

    def createupdate_program_members(program_id, lead_ids, status)
      post_json("/rest/v1/programs/#{program_id}/members/status.json") do
        {
          statusName: status,
          input: lead_ids.map { |lead_id| { leadId: lead_id } }
        }
      end
    end

    def get_program_members(program_id, filter_type, filter_values, fields: nil, batch_size: nil, next_page_token: nil)
      params = {
        filterType: filter_type,
        filterValues: filter_values
      }

      optional = {
        fields: fields,
        batchSize: batch_size,
        nextPageToken: next_page_token
      }

      get("/rest/v1/programs/#{program_id}/members.json", params, optional)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
mrkt-1.2.2 lib/mrkt/concerns/crud_program_members.rb
mrkt-1.2.1 lib/mrkt/concerns/crud_program_members.rb