Module: Mrkt::CrudProgramMembers

Included in:
Client
Defined in:
lib/mrkt/concerns/crud_program_members.rb

Instance Method Summary collapse

Instance Method Details

#createupdate_program_members(program_id, lead_ids, status) ⇒ Object


7
8
9
10
11
12
13
14
# File 'lib/mrkt/concerns/crud_program_members.rb', line 7

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

#describe_program_membersObject


3
4
5
# File 'lib/mrkt/concerns/crud_program_members.rb', line 3

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

#get_program_members(program_id, filter_type, filter_values, fields: nil, batch_size: nil, next_page_token: nil) ⇒ Object


16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/mrkt/concerns/crud_program_members.rb', line 16

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