Class: Sendgrid::API::Newsletter::SenderAddresses::Services
- Defined in:
- lib/sendgrid/api/newsletter/sender_addresses.rb
Instance Attribute Summary
Attributes inherited from Service
Instance Method Summary collapse
-
#add(sender_address) ⇒ Entities::Response
Create a new Sender Address.
-
#delete(sender_address) ⇒ Entities::Response
Remove a Sender Address from your account.
-
#edit(sender_address, new_identity = nil) ⇒ Entities::Response
Edit an existing Sender Address.
-
#get(sender_address) ⇒ Entities::SenderAddress
Retrieve information associated with a particular Sender Address.
-
#list ⇒ Array<Entities::SenderAddress>
List all Sender Addresses on your account.
Methods inherited from Service
Constructor Details
This class inherits a constructor from Sendgrid::API::Service
Instance Method Details
#add(sender_address) ⇒ Entities::Response
Create a new Sender Address.
20 21 22 |
# File 'lib/sendgrid/api/newsletter/sender_addresses.rb', line 20 def add(sender_address) perform_request(Entities::Response, 'newsletter/identity/add.json', sender_address.as_json) end |
#delete(sender_address) ⇒ Entities::Response
Remove a Sender Address from your account.
59 60 61 62 |
# File 'lib/sendgrid/api/newsletter/sender_addresses.rb', line 59 def delete(sender_address) params = { :identity => extract_identity(sender_address) } perform_request(Entities::Response, 'newsletter/identity/delete.json', params) end |
#edit(sender_address, new_identity = nil) ⇒ Entities::Response
Edit an existing Sender Address.
30 31 32 33 34 |
# File 'lib/sendgrid/api/newsletter/sender_addresses.rb', line 30 def edit(sender_address, new_identity = nil) params = sender_address.as_json params[:newidentity] = new_identity if new_identity perform_request(Entities::Response, 'newsletter/identity/edit.json', params) end |
#get(sender_address) ⇒ Entities::SenderAddress
Retrieve information associated with a particular Sender Address.
41 42 43 44 |
# File 'lib/sendgrid/api/newsletter/sender_addresses.rb', line 41 def get(sender_address) params = { :identity => extract_identity(sender_address) } perform_request(Entities::SenderAddress, 'newsletter/identity/get.json', params) end |
#list ⇒ Array<Entities::SenderAddress>
List all Sender Addresses on your account.
50 51 52 |
# File 'lib/sendgrid/api/newsletter/sender_addresses.rb', line 50 def list perform_request(Entities::SenderAddress, 'newsletter/identity/list.json') end |