class SimpleSpark::Endpoints::InboundDomains

Provides access to the /inbound-domains endpoint See: developers.sparkpost.com/api/#/reference/inbound-domains

Attributes

client[RW]

Public Class Methods

new(client) click to toggle source
# File lib/simple_spark/endpoints/inbound_domains.rb, line 8
def initialize(client)
  @client = client
end

Public Instance Methods

create(domain_name) click to toggle source

Create an inbound domain @param domain_name [String] the domain name to create @note See: developers.sparkpost.com/api/#/reference/inbound-domains/create-and-list

# File lib/simple_spark/endpoints/inbound_domains.rb, line 22
def create(domain_name)
  @client.call(method: :post, path: 'inbound-domains', body_values: { domain: domain_name })
end
delete(domain_name) click to toggle source

Delete an inbound domain @param domain_name [String] the domain name to delete @note See: developers.sparkpost.com/api/#/reference/inbound-domains/retrieve-and-delete

# 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() click to toggle source

Lists your inbound domains @return [Array] a list of Inbound Domain hash objects @note See: developers.sparkpost.com/api/#/reference/inbound-domains/create-and-list

# File lib/simple_spark/endpoints/inbound_domains.rb, line 15
def list
  @client.call(method: :get, path: 'inbound-domains')
end
retrieve(domain_name) click to toggle source

Retrieve an inbound domain @param domain_name [String] the domain name to retrieve @return [Hash] an Inbound Domain hash object @note See: developers.sparkpost.com/api/#/reference/inbound-domains/retrieve-and-delete

# 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