Module: Millionsend::Domains

Defined in:
lib/millionsend/domains.rb

Overview

Sending domains and their DNS records.

Class Method Summary collapse

Class Method Details

.create(params) ⇒ Object

POST /domains — name, region, custom_return_path, open_tracking, click_tracking, tracking_subdomain. Returns the records to publish.



9
10
11
# File 'lib/millionsend/domains.rb', line 9

def create(params)
  Millionsend::Request.new(method: :post, path: "/domains", body: params).perform
end

.get(id) ⇒ Object

GET /domains/:id — includes records with per-record status.



14
15
16
# File 'lib/millionsend/domains.rb', line 14

def get(id)
  Millionsend::Request.new(method: :get, path: member_path(id)).perform
end

.list(options = {}) ⇒ Object

GET /domains — accepts limit:/after:/before:.



19
20
21
# File 'lib/millionsend/domains.rb', line 19

def list(options = {})
  Millionsend::Request.new(method: :get, path: "/domains", query: Millionsend::Util.list_query(options)).perform
end

.remove(id) ⇒ Object

DELETE /domains/:id



35
36
37
# File 'lib/millionsend/domains.rb', line 35

def remove(id)
  Millionsend::Request.new(method: :delete, path: member_path(id)).perform
end

.update(id, params) ⇒ Object

PATCH /domains/:id — open_tracking, click_tracking, tracking_subdomain (nil or "" clears it).



25
26
27
# File 'lib/millionsend/domains.rb', line 25

def update(id, params)
  Millionsend::Request.new(method: :patch, path: member_path(id), body: params).perform
end

.verify(id) ⇒ Object

POST /domains/:id/verify — re-check DNS now.



30
31
32
# File 'lib/millionsend/domains.rb', line 30

def verify(id)
  Millionsend::Request.new(method: :post, path: "#{member_path(id)}/verify").perform
end