Class: MailinatorClient::Authenticators

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

Overview

Class containing all the actions for the Authenticators Resource

Instance Method Summary collapse

Constructor Details

#initialize(client) ⇒ Authenticators

Returns a new instance of Authenticators.



30
31
32
# File 'lib/mailinator_client/authenticators.rb', line 30

def initialize(client)
  @client = client
end

Instance Method Details

#get_authenticatorObject

Fetch Authenticator

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

Responses:



121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/mailinator_client/authenticators.rb', line 121

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

  path = "/authenticator"

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

#get_authenticator_by_id(params = {}) ⇒ Object

Fetch Authenticator By Id

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

Parameters:

  • string id - authenticator id

Responses:

Raises:

  • (ArgumentError)


147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/mailinator_client/authenticators.rb', line 147

def get_authenticator_by_id(params = {})
  query_params = {}
  headers = {}
  body = nil

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

  path = "/authenticator/#{params[:id]}"

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

#get_authenticatorsObject

Fetch Authenticators

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

Responses:



70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/mailinator_client/authenticators.rb', line 70

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

  path = "/authenticators"

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

#get_authenticators_by_id(params = {}) ⇒ Object

Fetch the TOTP 2FA code from one of your saved Keys

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

Parameters:

  • string id - authenticator id

Responses:

Raises:

  • (ArgumentError)


96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/mailinator_client/authenticators.rb', line 96

def get_authenticators_by_id(params = {})
  query_params = {}
  headers = {}
  body = nil

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

  path = "/authenticators/#{params[:id]}"

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

#instant_totp_2fa_code(params = {}) ⇒ Object

Instant TOTP 2FA code

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

Parameters:

  • string totpSecretKey - totp secret key

Responses:

Raises:

  • (ArgumentError)


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

def instant_totp_2fa_code(params = {})
  query_params = {}
  headers = {}
  body = nil

  raise ArgumentError.new("totpSecretKey is required") unless params.has_key?(:totpSecretKey)

  path = "/totp/#{params[:totpSecretKey]}"

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