Class: Locaweb::Emailmarketing::Client
- Inherits:
-
Object
- Object
- Locaweb::Emailmarketing::Client
- Defined in:
- lib/locaweb-emailmarketing/client.rb
Instance Method Summary collapse
- #accounts ⇒ Object
- #campaigns ⇒ Object
- #contact_imports ⇒ Object
- #contacts ⇒ Object
- #custom_fields ⇒ Object
- #domains ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #lists ⇒ Object
- #messages ⇒ Object
- #reports ⇒ Object
- #senders ⇒ Object
- #templates ⇒ Object
- #unsubscribe_reasons ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
4 5 6 7 8 9 |
# File 'lib/locaweb-emailmarketing/client.rb', line 4 def initialize( = {}) .assert_required_keys(required: [:account_id, :auth_token, :base_url]) @account_id = [:account_id] .delete(:account_id) @http_request_adapter = HttpRequestAdapter.new end |
Instance Method Details
#accounts ⇒ Object
11 12 13 |
# File 'lib/locaweb-emailmarketing/client.rb', line 11 def accounts @account ||= AccountClient.new @http_request_adapter end |
#campaigns ⇒ Object
19 20 21 |
# File 'lib/locaweb-emailmarketing/client.rb', line 19 def campaigns @campaigns ||= CampaignClient.new @http_request_adapter, @account_id end |
#contact_imports ⇒ Object
23 24 25 |
# File 'lib/locaweb-emailmarketing/client.rb', line 23 def contact_imports @contact_imports ||= ContactImportClient.new @http_request_adapter, @account_id end |
#contacts ⇒ Object
31 32 33 |
# File 'lib/locaweb-emailmarketing/client.rb', line 31 def contacts @contacts ||= ContactClient.new @http_request_adapter, @account_id end |
#custom_fields ⇒ Object
15 16 17 |
# File 'lib/locaweb-emailmarketing/client.rb', line 15 def custom_fields @custom_fields ||= CustomFieldClient.new @http_request_adapter, @account_id end |
#domains ⇒ Object
35 36 37 |
# File 'lib/locaweb-emailmarketing/client.rb', line 35 def domains @domains ||= DomainClient.new @http_request_adapter, @account_id end |
#lists ⇒ Object
27 28 29 |
# File 'lib/locaweb-emailmarketing/client.rb', line 27 def lists @lists ||= ListClient.new @http_request_adapter, @account_id end |
#messages ⇒ Object
39 40 41 |
# File 'lib/locaweb-emailmarketing/client.rb', line 39 def ||= MessageClient.new @http_request_adapter, @account_id end |
#reports ⇒ Object
43 44 45 |
# File 'lib/locaweb-emailmarketing/client.rb', line 43 def reports @reports ||= ReportClient.new @http_request_adapter, @account_id end |
#senders ⇒ Object
47 48 49 |
# File 'lib/locaweb-emailmarketing/client.rb', line 47 def senders @senders ||= SenderClient.new @http_request_adapter, @account_id end |
#templates ⇒ Object
55 56 57 |
# File 'lib/locaweb-emailmarketing/client.rb', line 55 def templates @templates ||= TemplateClient.new @http_request_adapter, @account_id end |
#unsubscribe_reasons ⇒ Object
51 52 53 |
# File 'lib/locaweb-emailmarketing/client.rb', line 51 def unsubscribe_reasons @unsubscribe_reasons ||= UnsubscribeReasonClient.new @http_request_adapter, @account_id end |