Class: SimpleSpark::Endpoints::InboundDomains
- Inherits:
-
Object
- Object
- SimpleSpark::Endpoints::InboundDomains
- Defined in:
- lib/simple_spark/endpoints/inbound_domains.rb
Overview
Provides access to the /inbound-domains endpoint See: developers.sparkpost.com/api/#/reference/inbound-domains
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
-
#create(domain_name) ⇒ Object
Create an inbound domain.
-
#delete(domain_name) ⇒ Object
Delete an inbound domain.
-
#initialize(client) ⇒ InboundDomains
constructor
A new instance of InboundDomains.
-
#list ⇒ Array
Lists your inbound domains.
-
#retrieve(domain_name) ⇒ Hash
Retrieve an inbound domain.
Constructor Details
#initialize(client) ⇒ InboundDomains
Returns a new instance of InboundDomains.
8 9 10 |
# File 'lib/simple_spark/endpoints/inbound_domains.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/inbound_domains.rb', line 6 def client @client end |
Instance Method Details
#create(domain_name) ⇒ Object
Create an inbound domain
22 23 24 |
# File 'lib/simple_spark/endpoints/inbound_domains.rb', line 22 def create(domain_name) @client.call(method: :post, path: 'inbound-domains', query_values: { domain: domain_name }) end |
#delete(domain_name) ⇒ Object
Delete an inbound domain
38 39 40 41 |
# File 'lib/simple_spark/endpoints/inbound_domains.rb', line 38 def delete(domain_name) domain_name = @client.url_encode(domain_name) @client.call(method: :delete, path: "inbound-domains/#{domain_name}") end |
#list ⇒ Array
Lists your inbound domains
15 16 17 |
# File 'lib/simple_spark/endpoints/inbound_domains.rb', line 15 def list @client.call(method: :get, path: 'inbound-domains') end |
#retrieve(domain_name) ⇒ Hash
Retrieve an inbound domain
30 31 32 33 |
# File 'lib/simple_spark/endpoints/inbound_domains.rb', line 30 def retrieve(domain_name) domain_name = @client.url_encode(domain_name) @client.call(method: :get, path: "inbound-domains/#{domain_name}") end |