Class: SimpleSpark::Endpoints::Account
- Inherits:
-
Object
- Object
- SimpleSpark::Endpoints::Account
- Defined in:
- lib/simple_spark/endpoints/account.rb
Overview
Provides access to the /account endpoint
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
-
#initialize(client) ⇒ Account
constructor
A new instance of Account.
-
#retrieve(include_values = nil) ⇒ Hash
Get your SparkPost account information, including subscription status and quota usage.
-
#update(values = {}) ⇒ results: { message: "Account has been updated" }
Update your SparkPost account information and account-level options.
Constructor Details
#initialize(client) ⇒ Account
Returns a new instance of Account.
8 9 10 |
# File 'lib/simple_spark/endpoints/account.rb', line 8 def initialize(client) @client = client end |
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
6 7 8 |
# File 'lib/simple_spark/endpoints/account.rb', line 6 def client @client end |
Instance Method Details
#retrieve(include_values = nil) ⇒ Hash
Get your SparkPost account information, including subscription status and quota usage.
18 19 20 21 |
# File 'lib/simple_spark/endpoints/account.rb', line 18 def retrieve(include_values = nil) query_params = include_values.nil? ? {} : { include: include_values } @client.call(method: :get, path: 'account', query_values: query_params) end |
#update(values = {}) ⇒ results: { message: "Account has been updated" }
Note:
Example: values = {
company_name: "SparkPost",
options: {
smtp_tracking_default: true
}
}
Update your SparkPost account information and account-level options.
40 41 42 |
# File 'lib/simple_spark/endpoints/account.rb', line 40 def update(values = {}) @client.call(method: :put, path: 'account', body_values: values) end |