Class: Sendgrid::API::Newsletter::Categories::Services
- Includes:
- Utils
- Defined in:
- lib/sendgrid/api/newsletter/categories.rb
Instance Attribute Summary
Attributes inherited from Service
Instance Method Summary collapse
-
#add(marketing_email, category) ⇒ Entities::Response
Assign a Category to an existing Marketing Email.
-
#create(category) ⇒ Entities::Response
Create a new Category.
-
#list ⇒ Array<Entities::Category>
List all categories.
-
#remove(marketing_email, category) ⇒ Entities::Response
Remove specific categories, or all categories from a Marketing Email.
Methods inherited from Service
Constructor Details
This class inherits a constructor from Sendgrid::API::Service
Instance Method Details
#add(marketing_email, category) ⇒ Entities::Response
Assign a Category to an existing Marketing Email.
34 35 36 37 |
# File 'lib/sendgrid/api/newsletter/categories.rb', line 34 def add(marketing_email, category) params = { :name => extract_marketing_email(marketing_email), :category => extract_category(category) } perform_request(Entities::Response, 'newsletter/category/add.json', params) end |
#create(category) ⇒ Entities::Response
Create a new Category.
23 24 25 26 |
# File 'lib/sendgrid/api/newsletter/categories.rb', line 23 def create(category) params = { :category => extract_category(category) } perform_request(Entities::Response, 'newsletter/category/create.json', params) end |
#list ⇒ Array<Entities::Category>
List all categories.
54 55 56 |
# File 'lib/sendgrid/api/newsletter/categories.rb', line 54 def list perform_request(Entities::Category, 'newsletter/category/list.json') end |
#remove(marketing_email, category) ⇒ Entities::Response
Remove specific categories, or all categories from a Marketing Email.
45 46 47 48 |
# File 'lib/sendgrid/api/newsletter/categories.rb', line 45 def remove(marketing_email, category) params = { :name => extract_marketing_email(marketing_email), :category => extract_category(category) } perform_request(Entities::Response, 'newsletter/category/remove.json', params) end |