Class: Sendgrid::API::Newsletter::Lists::Services
- Includes:
- Utils
- Defined in:
- lib/sendgrid/api/newsletter/lists.rb
Instance Attribute Summary
Attributes inherited from Service
Instance Method Summary collapse
-
#add(list) ⇒ Entities::Response
Create a new Recipient List.
-
#delete(list) ⇒ Entities::Response
Remove a Recipient List from your account.
-
#edit(list, newlist) ⇒ Entities::Response
Rename a Recipient List.
-
#get(list = nil) ⇒ Array<Entities::List>
List all Recipient Lists on your account, or check if a particular List exists.
Methods inherited from Service
Constructor Details
This class inherits a constructor from Sendgrid::API::Service
Instance Method Details
#add(list) ⇒ Entities::Response
Create a new Recipient List.
23 24 25 26 |
# File 'lib/sendgrid/api/newsletter/lists.rb', line 23 def add(list) params = { :list => extract_listname(list) } perform_request(Entities::Response, 'newsletter/lists/add.json', params) end |
#delete(list) ⇒ Entities::Response
Remove a Recipient List from your account.
54 55 56 57 |
# File 'lib/sendgrid/api/newsletter/lists.rb', line 54 def delete(list) params = { :list => extract_listname(list) } perform_request(Entities::Response, 'newsletter/lists/delete.json', params) end |
#edit(list, newlist) ⇒ Entities::Response
Rename a Recipient List.
34 35 36 37 |
# File 'lib/sendgrid/api/newsletter/lists.rb', line 34 def edit(list, newlist) params = { :list => extract_listname(list), :newlist => extract_listname(newlist) } perform_request(Entities::Response, 'newsletter/lists/edit.json', params) end |
#get(list = nil) ⇒ Array<Entities::List>
List all Recipient Lists on your account, or check if a particular List exists.
44 45 46 47 |
# File 'lib/sendgrid/api/newsletter/lists.rb', line 44 def get(list = nil) params = { :list => extract_listname(list) } if list perform_request(Entities::List, 'newsletter/lists/get.json', params || {}) end |