Class: ActiveCampaignWrapper::Core::ListGroupGateway

Inherits:
Object
  • Object
show all
Defined in:
lib/active_campaign_wrapper/core/list_group_gateway.rb

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ ListGroupGateway

Returns a new instance of ListGroupGateway.



6
7
8
9
# File 'lib/active_campaign_wrapper/core/list_group_gateway.rb', line 6

def initialize(client)
  @client = client
  @config = client.config
end

Instance Method Details

#all(**params) ⇒ Object



11
12
13
# File 'lib/active_campaign_wrapper/core/list_group_gateway.rb', line 11

def all(**params)
  @config.get('/listGroups', query: params)
end

#create(params) ⇒ Object



15
16
17
18
19
20
21
# File 'lib/active_campaign_wrapper/core/list_group_gateway.rb', line 15

def create(params)
  params = { list_group: params }
  @config.post(
    '/listGroups',
    body: ActiveCampaignWrapper::Helpers.normalize_body(params)
  )
end

#delete(list_group_id) ⇒ Object



23
24
25
# File 'lib/active_campaign_wrapper/core/list_group_gateway.rb', line 23

def delete(list_group_id)
  @config.delete("/listGroups/#{list_group_id}")
end

#find(list_group_id) ⇒ Object



27
28
29
# File 'lib/active_campaign_wrapper/core/list_group_gateway.rb', line 27

def find(list_group_id)
  @config.get("/listGroups/#{list_group_id}")
end