Class: SimpleSpark::Endpoints::InboundDomains

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#clientObject

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

Parameters:

  • domain_name (String)

    the domain name to create



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

Parameters:

  • domain_name (String)

    the domain name to delete



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

#listArray

Returns:

  • (Array)

    a list of Inbound Domain hash objects



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

Parameters:

  • domain_name (String)

    the domain name to retrieve

Returns:

  • (Hash)

    an Inbound Domain hash object



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