Class: Unitpost::Resources::Segments
- Inherits:
-
Base
- Object
- Base
- Unitpost::Resources::Segments
show all
- Defined in:
- lib/unitpost/resources.rb
Instance Method Summary
collapse
Methods inherited from Base
#initialize
Instance Method Details
#add_member(id, body) ⇒ Object
206
207
208
|
# File 'lib/unitpost/resources.rb', line 206
def add_member(id, body)
@http.request("POST", "/segments/#{enc(id)}/contacts", body: body)
end
|
#create(body) ⇒ Object
186
187
188
|
# File 'lib/unitpost/resources.rb', line 186
def create(body)
@http.request("POST", "/segments", body: body)
end
|
#delete(id) ⇒ Object
198
199
200
|
# File 'lib/unitpost/resources.rb', line 198
def delete(id)
@http.request("DELETE", "/segments/#{enc(id)}")
end
|
#get(id) ⇒ Object
190
191
192
|
# File 'lib/unitpost/resources.rb', line 190
def get(id)
@http.request("GET", "/segments/#{enc(id)}")
end
|
#list(limit: nil, after: nil, before: nil) ⇒ Object
178
179
180
|
# File 'lib/unitpost/resources.rb', line 178
def list(limit: nil, after: nil, before: nil)
@http.request("GET", "/segments", query: list_params(limit: limit, after: after, before: before))
end
|
#list_all(**params) ⇒ Object
182
183
184
|
# File 'lib/unitpost/resources.rb', line 182
def list_all(**params)
paginate("/segments", params)
end
|
#list_members(id, limit: nil, after: nil, before: nil) ⇒ Object
202
203
204
|
# File 'lib/unitpost/resources.rb', line 202
def list_members(id, limit: nil, after: nil, before: nil)
@http.request("GET", "/segments/#{enc(id)}/contacts", query: list_params(limit: limit, after: after, before: before))
end
|
#remove_member(id, contact) ⇒ Object
210
211
212
|
# File 'lib/unitpost/resources.rb', line 210
def remove_member(id, contact)
@http.request("DELETE", "/segments/#{enc(id)}/contacts/#{enc(contact)}")
end
|
#update(id, body) ⇒ Object
194
195
196
|
# File 'lib/unitpost/resources.rb', line 194
def update(id, body)
@http.request("PATCH", "/segments/#{enc(id)}", body: body)
end
|