Class: MailinatorClient::Domains

Inherits:
Object
  • Object
show all
Defined in:
lib/mailinator_client/domains.rb

Overview

Class containing all the actions for the Domains Resource

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Domains

Returns a new instance of Domains.



8
9
10
# File 'lib/mailinator_client/domains.rb', line 8

def initialize(client)
  @client = client
end

Instance Method Details

#create_domain(params = {}) ⇒ Object

Deprecated.

Create Domain is deprecated in this client.

This endpoint creates a private domain attached to your account. Note, the domain must be unique to the system and you must have not reached your maximum number of Private Domains.

Authentication: The client must be configured with a valid api access token to call this action.

Parameters:

  • string domainId - The Domain name

Responses:

Raises:

  • (ArgumentError)


77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/mailinator_client/domains.rb', line 77

def create_domain(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { }
  headers = {}
  body = nil

  raise ArgumentError.new("domain id is required") unless params.has_key?(:domainId)

  path = "/domains/#{params[:domainId]}"

  @client.request(
    method: :post,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#delete_domain(params = {}) ⇒ Object

Deprecated.

Delete Domain is deprecated in this client.

This endpoint deletes a Private Domain

Authentication: The client must be configured with a valid api access token to call this action.

Parameters:

  • string domainId - The Domain name or simply 'private'

Responses:

Raises:

  • (ArgumentError)


107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/mailinator_client/domains.rb', line 107

def delete_domain(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { }
  headers = {}
  body = nil

  raise ArgumentError.new("domain id is required") unless params.has_key?(:domainId)

  path = "/domains/#{params[:domainId]}"

  @client.request(
    method: :delete,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#get_domain(params = {}) ⇒ Object

Fetches a specific domain

Authentication: The client must be configured with a valid api access token to call this action.

Parameters:

  • string domainId - The Domain name or simply 'private'

Responses:

Raises:

  • (ArgumentError)


46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/mailinator_client/domains.rb', line 46

def get_domain(params = {})
  params = Utils.symbolize_hash_keys(params)
  query_params = { }
  headers = {}
  body = nil

  raise ArgumentError.new("domain id is required") unless params.has_key?(:domainId)

  path = "/domains/#{params[:domainId]}"

  @client.request(
    method: :get,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end

#get_domainsObject

Fetches a list of all your domains.

Authentication: The client must be configured with a valid api access token to call this action.

Responses:



20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/mailinator_client/domains.rb', line 20

def get_domains()
  query_params = {}
  headers = {}
  body = nil

  path = "/domains"

  response = @client.request(
    method: :get,
    path: path,
    query: query_params,
    headers: headers,
    body: body)
end