reach-ruby 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.dockerignore +1 -0
- data/.gitignore +18 -0
- data/.rubocop.yml +58 -0
- data/.rubocop_todo.yml +193 -0
- data/AUTHORS.md +52 -0
- data/CHANGES.md +3 -0
- data/CODE_OF_CONDUCT.md +73 -0
- data/CONTRIBUTING.md +163 -0
- data/Dockerfile +9 -0
- data/Gemfile +3 -0
- data/ISSUE_TEMPLATE.md +30 -0
- data/LICENSE +21 -0
- data/Makefile +34 -0
- data/PULL_REQUEST_TEMPLATE.md +31 -0
- data/README.md +237 -0
- data/Rakefile +10 -0
- data/UPGRADE.md +5 -0
- data/VERSIONS.md +35 -0
- data/advanced-examples/custom-http-client.md +166 -0
- data/examples/examples.rb +23 -0
- data/githooks/pre-commit +1 -0
- data/lib/rack/reach_webhook_authentication.rb +72 -0
- data/lib/reach-ruby/framework/reach_response.rb +19 -0
- data/lib/reach-ruby/framework/request.rb +41 -0
- data/lib/reach-ruby/framework/response.rb +18 -0
- data/lib/reach-ruby/framework/rest/domain.rb +39 -0
- data/lib/reach-ruby/framework/rest/error.rb +51 -0
- data/lib/reach-ruby/framework/rest/helper.rb +11 -0
- data/lib/reach-ruby/framework/rest/page.rb +144 -0
- data/lib/reach-ruby/framework/rest/resource.rb +23 -0
- data/lib/reach-ruby/framework/rest/version.rb +240 -0
- data/lib/reach-ruby/framework/serialize.rb +81 -0
- data/lib/reach-ruby/framework/values.rb +9 -0
- data/lib/reach-ruby/http/http_client.rb +82 -0
- data/lib/reach-ruby/http.rb +5 -0
- data/lib/reach-ruby/rest/api/authentix/.openapi-generator/FILES +10 -0
- data/lib/reach-ruby/rest/api/authentix/.openapi-generator/VERSION +1 -0
- data/lib/reach-ruby/rest/api/authentix/.openapi-generator-ignore +23 -0
- data/lib/reach-ruby/rest/api/authentix/authentication_trial_item.rb +418 -0
- data/lib/reach-ruby/rest/api/authentix/authentication_trial_stat_item.rb +279 -0
- data/lib/reach-ruby/rest/api/authentix/configuration_item/authentication_control_item.rb +214 -0
- data/lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb +449 -0
- data/lib/reach-ruby/rest/api/authentix/configuration_item.rb +583 -0
- data/lib/reach-ruby/rest/api/authentix.rb +72 -0
- data/lib/reach-ruby/rest/api/messaging/.openapi-generator/FILES +2 -0
- data/lib/reach-ruby/rest/api/messaging/.openapi-generator/VERSION +1 -0
- data/lib/reach-ruby/rest/api/messaging/.openapi-generator-ignore +23 -0
- data/lib/reach-ruby/rest/api/messaging/messaging_item.rb +582 -0
- data/lib/reach-ruby/rest/api/messaging.rb +51 -0
- data/lib/reach-ruby/rest/api.rb +50 -0
- data/lib/reach-ruby/rest/client.rb +130 -0
- data/lib/reach-ruby/rest.rb +13 -0
- data/lib/reach-ruby/security/request_validator.rb +149 -0
- data/lib/reach-ruby/util/configuration.rb +25 -0
- data/lib/reach-ruby/version.rb +3 -0
- data/lib/reach-ruby.rb +44 -0
- data/reach-ruby.gemspec +38 -0
- data/sonar-project.properties +13 -0
- metadata +267 -0
@@ -0,0 +1,23 @@
|
|
1
|
+
# OpenAPI Generator Ignore
|
2
|
+
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
|
3
|
+
|
4
|
+
# Use this file to prevent files from being overwritten by the generator.
|
5
|
+
# The patterns follow closely to .gitignore or .dockerignore.
|
6
|
+
|
7
|
+
# As an example, the C# client generator defines ApiClient.cs.
|
8
|
+
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
|
9
|
+
#ApiClient.cs
|
10
|
+
|
11
|
+
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
|
12
|
+
#foo/*/qux
|
13
|
+
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
|
14
|
+
|
15
|
+
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
|
16
|
+
#foo/**/qux
|
17
|
+
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
|
18
|
+
|
19
|
+
# You can also negate patterns with an exclamation (!).
|
20
|
+
# For example, you can ignore all files in a docs folder with the file extension .md:
|
21
|
+
#docs/*.md
|
22
|
+
# Then explicitly reverse the ignore rule for a single file:
|
23
|
+
#!docs/README.md
|
@@ -0,0 +1,418 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# ___ ___ _ ___ _ _ _____ _ _ _ ___ ___ _ ___ ___ ___ _ ___ ___ ___ _ _ ___ ___ _ _____ ___ ___
|
4
|
+
# | _ \ __| /_\ / __| || |__|_ _/_\ | | | |/ | \ / / | /_\ | _ ) __|___ / _ \ /_\ |_ _|__ / __| __| \| | __| _ \ /_\_ _/ _ \| _ \
|
5
|
+
# | / _| / _ \ (__| __ |___|| |/ _ \| |__| ' < \ V /| |__ / _ \| _ \__ \___| (_) / _ \ | |___| (_ | _|| .` | _|| / / _ \| || (_) | /
|
6
|
+
# |_|_\___/_/ \_\___|_||_| |_/_/ \_\____|_|\_\ |_| |____/_/ \_\___/___/ \___/_/ \_\___| \___|___|_|\_|___|_|_\/_/ \_\_| \___/|_|_\
|
7
|
+
#
|
8
|
+
# Reach Authentix API
|
9
|
+
# Reach Authentix API helps you easily integrate user authentification in your application. The authentification allows to verify that a user is indeed at the origin of a request from your application. At the moment, the Reach Authentix API supports the following channels: * SMS * Email We are continuously working to add additionnal channels. ## Base URL All endpoints described in this documentation are relative to the following base URL: ``` https://api.reach.talkylabs.com/rest/authentix/v1/ ``` The API is provided over HTTPS protocol to ensure data privacy. ## API Authentication Requests made to the API must be authenticated. You need to provide the `ApiUser` and `ApiKey` associated with your applet. This information could be found in the settings of the applet. ```curl curl -X GET [BASE_URL]/configurations -H \"ApiUser:[Your_Api_User]\" -H \"ApiKey:[Your_Api_Key]\" ``` ## Reach Authentix API Workflow Three steps are needed in order to authenticate a given user using the Reach Authentix API. ### Step 1: Create an Authentix configuration A configuration is a set of settings used to define and send an authentication code to a user. This includes, for example: ``` - the length of the authentication code, - the message template, - and so on... ``` A configuaration could be created via the web application or directly using the Reach Authentix API. This step does not need to be performed every time one wants to use the Reach Authentix API. Indeed, once created, a configuartion could be used to authenticate several users in the future. ### Step 2: Send an authentication code A configuration is used to send an authentication code via a selected channel to a user. For now, the supported channels are `sms`, and `email`. We are working hard to support additional channels. Newly created authentications will have a status of `awaiting`. ### Step 3: Verify the authentication code This step allows to verify that the code submitted by the user matched the one sent previously. If, there is a match, then the status of the authentication changes from `awaiting` to `passed`. Otherwise, the status remains `awaiting` until either it is verified or it expires. In the latter case, the status becomes `expired`.
|
10
|
+
#
|
11
|
+
# NOTE: This class is auto generated by OpenAPI Generator.
|
12
|
+
# https://openapi-generator.tech
|
13
|
+
# Do not edit the class manually.
|
14
|
+
#
|
15
|
+
|
16
|
+
|
17
|
+
module Reach
|
18
|
+
module REST
|
19
|
+
class Api
|
20
|
+
class Authentix < Version
|
21
|
+
class AuthenticationTrialItemList < ListResource
|
22
|
+
##
|
23
|
+
# Initialize the AuthenticationTrialItemList
|
24
|
+
# @param [Version] version Version that contains the resource
|
25
|
+
# @return [AuthenticationTrialItemList] AuthenticationTrialItemList
|
26
|
+
def initialize(version)
|
27
|
+
super(version)
|
28
|
+
# Path Solution
|
29
|
+
@solution = { }
|
30
|
+
@uri = "/authentix/v1/authenticationTrials"
|
31
|
+
|
32
|
+
end
|
33
|
+
|
34
|
+
##
|
35
|
+
# Lists AuthenticationTrialItemInstance records from the API as a list.
|
36
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
37
|
+
# memory before returning.
|
38
|
+
# @param [String] dest Retrieve authentication trials sent only to this phone number or email. The phone number must be in the E.164 format.
|
39
|
+
# @param [String] trial_status Retrieve authentication trials with the specified status.
|
40
|
+
# @param [String] channel Retrieve authentication trials sent via the specified channel.
|
41
|
+
# @param [String] configuration_id Retrieve authentication trials from the configuration whose ID matches the specified one.
|
42
|
+
# @param [String] authentication_id Retrieve authentication trials from the authentication whose ID matches the specified one.
|
43
|
+
# @param [String] country Retrieve authentication trials sent to the specified destination country (in ISO 3166-1 alpha-2). Only possible when `dest` is a phone number.
|
44
|
+
# @param [Time] sent_at Retrieve only authentication trials created at the specified date. Must be in ISO 8601 format.
|
45
|
+
# @param [Time] sent_after Retrieve only authentication trials created after the specified datetime. Must be in ISO 8601 format.
|
46
|
+
# @param [Time] sent_before Retrieve only authentication trials created before the specified datetime. Must be in ISO 8601 format.
|
47
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
48
|
+
# guarantees to never return more than limit. Default is no limit
|
49
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
50
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
51
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
52
|
+
# efficient page size, i.e. min(limit, 1000)
|
53
|
+
# @return [Array] Array of up to limit results
|
54
|
+
def list(dest: :unset, trial_status: :unset, channel: :unset, configuration_id: :unset, authentication_id: :unset, country: :unset, sent_at: :unset, sent_after: :unset, sent_before: :unset, limit: nil, page_size: nil)
|
55
|
+
self.stream(
|
56
|
+
dest: dest,
|
57
|
+
trial_status: trial_status,
|
58
|
+
channel: channel,
|
59
|
+
configuration_id: configuration_id,
|
60
|
+
authentication_id: authentication_id,
|
61
|
+
country: country,
|
62
|
+
sent_at: sent_at,
|
63
|
+
sent_after: sent_after,
|
64
|
+
sent_before: sent_before,
|
65
|
+
limit: limit,
|
66
|
+
page_size: page_size
|
67
|
+
).entries
|
68
|
+
end
|
69
|
+
|
70
|
+
##
|
71
|
+
# Streams Instance records from the API as an Enumerable.
|
72
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
73
|
+
# is reached.
|
74
|
+
# @param [String] dest Retrieve authentication trials sent only to this phone number or email. The phone number must be in the E.164 format.
|
75
|
+
# @param [String] trial_status Retrieve authentication trials with the specified status.
|
76
|
+
# @param [String] channel Retrieve authentication trials sent via the specified channel.
|
77
|
+
# @param [String] configuration_id Retrieve authentication trials from the configuration whose ID matches the specified one.
|
78
|
+
# @param [String] authentication_id Retrieve authentication trials from the authentication whose ID matches the specified one.
|
79
|
+
# @param [String] country Retrieve authentication trials sent to the specified destination country (in ISO 3166-1 alpha-2). Only possible when `dest` is a phone number.
|
80
|
+
# @param [Time] sent_at Retrieve only authentication trials created at the specified date. Must be in ISO 8601 format.
|
81
|
+
# @param [Time] sent_after Retrieve only authentication trials created after the specified datetime. Must be in ISO 8601 format.
|
82
|
+
# @param [Time] sent_before Retrieve only authentication trials created before the specified datetime. Must be in ISO 8601 format.
|
83
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
84
|
+
# guarantees to never return more than limit. Default is no limit
|
85
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
86
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
87
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
88
|
+
# efficient page size, i.e. min(limit, 1000)
|
89
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
90
|
+
def stream(dest: :unset, trial_status: :unset, channel: :unset, configuration_id: :unset, authentication_id: :unset, country: :unset, sent_at: :unset, sent_after: :unset, sent_before: :unset, limit: nil, page_size: nil)
|
91
|
+
limits = @version.read_limits(limit, page_size)
|
92
|
+
|
93
|
+
page = self.page(
|
94
|
+
dest: dest,
|
95
|
+
trial_status: trial_status,
|
96
|
+
channel: channel,
|
97
|
+
configuration_id: configuration_id,
|
98
|
+
authentication_id: authentication_id,
|
99
|
+
country: country,
|
100
|
+
sent_at: sent_at,
|
101
|
+
sent_after: sent_after,
|
102
|
+
sent_before: sent_before,
|
103
|
+
page_size: limits[:page_size], )
|
104
|
+
|
105
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
106
|
+
end
|
107
|
+
|
108
|
+
##
|
109
|
+
# When passed a block, yields AuthenticationTrialItemInstance records from the API.
|
110
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
111
|
+
# is reached.
|
112
|
+
def each
|
113
|
+
limits = @version.read_limits
|
114
|
+
|
115
|
+
page = self.page(page_size: limits[:page_size], )
|
116
|
+
|
117
|
+
@version.stream(page,
|
118
|
+
limit: limits[:limit],
|
119
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
120
|
+
end
|
121
|
+
|
122
|
+
##
|
123
|
+
# Retrieve a single page of AuthenticationTrialItemInstance records from the API.
|
124
|
+
# Request is executed immediately.
|
125
|
+
# @param [String] dest Retrieve authentication trials sent only to this phone number or email. The phone number must be in the E.164 format.
|
126
|
+
# @param [String] trial_status Retrieve authentication trials with the specified status.
|
127
|
+
# @param [String] channel Retrieve authentication trials sent via the specified channel.
|
128
|
+
# @param [String] configuration_id Retrieve authentication trials from the configuration whose ID matches the specified one.
|
129
|
+
# @param [String] authentication_id Retrieve authentication trials from the authentication whose ID matches the specified one.
|
130
|
+
# @param [String] country Retrieve authentication trials sent to the specified destination country (in ISO 3166-1 alpha-2). Only possible when `dest` is a phone number.
|
131
|
+
# @param [Time] sent_at Retrieve only authentication trials created at the specified date. Must be in ISO 8601 format.
|
132
|
+
# @param [Time] sent_after Retrieve only authentication trials created after the specified datetime. Must be in ISO 8601 format.
|
133
|
+
# @param [Time] sent_before Retrieve only authentication trials created before the specified datetime. Must be in ISO 8601 format.
|
134
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
135
|
+
# @param [Integer] page_size Number of records to return, defaults to 20
|
136
|
+
# @return [Page] Page of AuthenticationTrialItemInstance
|
137
|
+
def page(dest: :unset, trial_status: :unset, channel: :unset, configuration_id: :unset, authentication_id: :unset, country: :unset, sent_at: :unset, sent_after: :unset, sent_before: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
138
|
+
params = Reach::Values.of({
|
139
|
+
|
140
|
+
'dest' => dest,
|
141
|
+
|
142
|
+
'trialStatus' => trial_status,
|
143
|
+
|
144
|
+
'channel' => channel,
|
145
|
+
|
146
|
+
'configurationId' => configuration_id,
|
147
|
+
|
148
|
+
'authenticationId' => authentication_id,
|
149
|
+
|
150
|
+
'country' => country,
|
151
|
+
|
152
|
+
'sentAt' => Reach.serialize_iso8601_datetime(sent_at),
|
153
|
+
|
154
|
+
'sentAfter' => Reach.serialize_iso8601_datetime(sent_after),
|
155
|
+
|
156
|
+
'sentBefore' => Reach.serialize_iso8601_datetime(sent_before),
|
157
|
+
|
158
|
+
'page' => page_number,
|
159
|
+
'pageSize' => page_size,
|
160
|
+
})
|
161
|
+
|
162
|
+
baseUrl = @version.url_without_pagination_info(@version.absolute_url(@uri), params)
|
163
|
+
response = @version.page('GET', @uri, params: params)
|
164
|
+
|
165
|
+
AuthenticationTrialItemPage.new(baseUrl, @version, response, @solution)
|
166
|
+
end
|
167
|
+
|
168
|
+
##
|
169
|
+
# Retrieve a single page of AuthenticationTrialItemInstance records from the API.
|
170
|
+
# Request is executed immediately.
|
171
|
+
# @param [String] target_url API-generated URL for the requested results page
|
172
|
+
# @return [Page] Page of AuthenticationTrialItemInstance
|
173
|
+
def get_page(target_url)
|
174
|
+
baseUrl = @version.url_without_pagination_info(target_url)
|
175
|
+
response = @version.domain.request(
|
176
|
+
'GET',
|
177
|
+
target_url
|
178
|
+
)
|
179
|
+
AuthenticationTrialItemPage.new(baseUrl, @version, response, @solution)
|
180
|
+
end
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
# Provide a user friendly representation
|
185
|
+
def to_s
|
186
|
+
'#<Reach.Api.Authentix.AuthenticationTrialItemList>'
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
|
191
|
+
class AuthenticationTrialItemContext < InstanceContext
|
192
|
+
##
|
193
|
+
# Initialize the AuthenticationTrialItemContext
|
194
|
+
# @param [Version] version Version that contains the resource
|
195
|
+
# @param [String] trial_id The identifier of the authentication trial to be fetched.
|
196
|
+
# @return [AuthenticationTrialItemContext] AuthenticationTrialItemContext
|
197
|
+
def initialize(version, trial_id)
|
198
|
+
super(version)
|
199
|
+
|
200
|
+
# Path Solution
|
201
|
+
@solution = { trial_id: trial_id, }
|
202
|
+
@uri = "/authentix/v1/authenticationTrials/#{@solution[:trial_id]}"
|
203
|
+
|
204
|
+
|
205
|
+
end
|
206
|
+
##
|
207
|
+
# Fetch the AuthenticationTrialItemInstance
|
208
|
+
# @return [AuthenticationTrialItemInstance] Fetched AuthenticationTrialItemInstance
|
209
|
+
def fetch
|
210
|
+
|
211
|
+
baseParams = {
|
212
|
+
}
|
213
|
+
|
214
|
+
|
215
|
+
payload = @version.fetch('GET', @uri)
|
216
|
+
AuthenticationTrialItemInstance.new(
|
217
|
+
@version,
|
218
|
+
payload,
|
219
|
+
trial_id: @solution[:trial_id],
|
220
|
+
)
|
221
|
+
end
|
222
|
+
|
223
|
+
|
224
|
+
##
|
225
|
+
# Provide a user friendly representation
|
226
|
+
def to_s
|
227
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
228
|
+
"#<Reach.Api.Authentix.AuthenticationTrialItemContext #{context}>"
|
229
|
+
end
|
230
|
+
|
231
|
+
##
|
232
|
+
# Provide a detailed, user friendly representation
|
233
|
+
def inspect
|
234
|
+
context = @solution.map{|k, v| "#{k}: #{v}"}.join(',')
|
235
|
+
"#<Reach.Api.Authentix.AuthenticationTrialItemContext #{context}>"
|
236
|
+
end
|
237
|
+
end
|
238
|
+
|
239
|
+
class AuthenticationTrialItemPage < Page
|
240
|
+
##
|
241
|
+
# Initialize the AuthenticationTrialItemPage
|
242
|
+
# @param [String] baseUrl url without pagination info
|
243
|
+
# @param [Version] version Version that contains the resource
|
244
|
+
# @param [Response] response Response from the API
|
245
|
+
# @param [Hash] solution Path solution for the resource
|
246
|
+
# @return [AuthenticationTrialItemPage] AuthenticationTrialItemPage
|
247
|
+
def initialize(baseUrl, version, response, solution)
|
248
|
+
super(baseUrl, version, response)
|
249
|
+
|
250
|
+
# Path Solution
|
251
|
+
@solution = solution
|
252
|
+
end
|
253
|
+
|
254
|
+
##
|
255
|
+
# Build an instance of AuthenticationTrialItemInstance
|
256
|
+
# @param [Hash] payload Payload response from the API
|
257
|
+
# @return [AuthenticationTrialItemInstance] AuthenticationTrialItemInstance
|
258
|
+
def get_instance(payload)
|
259
|
+
AuthenticationTrialItemInstance.new(@version, payload)
|
260
|
+
end
|
261
|
+
|
262
|
+
##
|
263
|
+
# Provide a user friendly representation
|
264
|
+
def to_s
|
265
|
+
'<Reach.Api.Authentix.AuthenticationTrialItemPage>'
|
266
|
+
end
|
267
|
+
end
|
268
|
+
class AuthenticationTrialItemInstance < InstanceResource
|
269
|
+
##
|
270
|
+
# Initialize the AuthenticationTrialItemInstance
|
271
|
+
# @param [Version] version Version that contains the resource
|
272
|
+
# @param [Hash] payload payload that contains response from Reach(TalkyLabs)
|
273
|
+
# @param [String] account_sid The SID of the
|
274
|
+
# Account that created this AuthenticationTrialItem
|
275
|
+
# resource.
|
276
|
+
# @param [String] sid The SID of the Call resource to fetch.
|
277
|
+
# @return [AuthenticationTrialItemInstance] AuthenticationTrialItemInstance
|
278
|
+
def initialize(version, payload , trial_id: nil)
|
279
|
+
super(version)
|
280
|
+
|
281
|
+
# Marshaled Properties
|
282
|
+
@properties = {
|
283
|
+
'appletId' => payload['appletId'],
|
284
|
+
'apiVersion' => payload['apiVersion'],
|
285
|
+
'configurationId' => payload['configurationId'],
|
286
|
+
'authenticationId' => payload['authenticationId'],
|
287
|
+
'trialId' => payload['trialId'],
|
288
|
+
'trialStatus' => payload['trialStatus'],
|
289
|
+
'channel' => payload['channel'],
|
290
|
+
'paymentInfo' => payload['paymentInfo'],
|
291
|
+
'dateCreated' => Reach.deserialize_iso8601_datetime(payload['dateCreated']),
|
292
|
+
'dateUpdated' => Reach.deserialize_iso8601_datetime(payload['dateUpdated']),
|
293
|
+
'price' => payload['price'],
|
294
|
+
'priceUnit' => payload['priceUnit'],
|
295
|
+
'channelInfo' => payload['channelInfo'],
|
296
|
+
}
|
297
|
+
|
298
|
+
# Context
|
299
|
+
@instance_context = nil
|
300
|
+
@params = { 'trial_id' => trial_id || @properties['trialId'] , }
|
301
|
+
end
|
302
|
+
|
303
|
+
##
|
304
|
+
# Generate an instance context for the instance, the context is capable of
|
305
|
+
# performing various actions. All instance actions are proxied to the context
|
306
|
+
# @return [AuthenticationTrialItemContext] CallContext for this CallInstance
|
307
|
+
def context
|
308
|
+
unless @instance_context
|
309
|
+
@instance_context = AuthenticationTrialItemContext.new(@version , @params['trial_id'])
|
310
|
+
end
|
311
|
+
@instance_context
|
312
|
+
end
|
313
|
+
|
314
|
+
##
|
315
|
+
# @return [String] The identifier of the applet.
|
316
|
+
def appletId
|
317
|
+
@properties['appletId']
|
318
|
+
end
|
319
|
+
|
320
|
+
##
|
321
|
+
# @return [String] The API version.
|
322
|
+
def apiVersion
|
323
|
+
@properties['apiVersion']
|
324
|
+
end
|
325
|
+
|
326
|
+
##
|
327
|
+
# @return [String] The identifier of the configuration.
|
328
|
+
def configurationId
|
329
|
+
@properties['configurationId']
|
330
|
+
end
|
331
|
+
|
332
|
+
##
|
333
|
+
# @return [String] The identifier of the authentication.
|
334
|
+
def authenticationId
|
335
|
+
@properties['authenticationId']
|
336
|
+
end
|
337
|
+
|
338
|
+
##
|
339
|
+
# @return [String] The identifier of the authentication trial.
|
340
|
+
def trialId
|
341
|
+
@properties['trialId']
|
342
|
+
end
|
343
|
+
|
344
|
+
##
|
345
|
+
# @return [String] The status of the authentication.
|
346
|
+
def trialStatus
|
347
|
+
@properties['trialStatus']
|
348
|
+
end
|
349
|
+
|
350
|
+
##
|
351
|
+
# @return [String] The channel used.
|
352
|
+
def channel
|
353
|
+
@properties['channel']
|
354
|
+
end
|
355
|
+
|
356
|
+
##
|
357
|
+
# @return [PaymentInfo]
|
358
|
+
def paymentInfo
|
359
|
+
@properties['paymentInfo']
|
360
|
+
end
|
361
|
+
|
362
|
+
##
|
363
|
+
# @return [Time] The date and time in GMT that the authentication trial was created.
|
364
|
+
def dateCreated
|
365
|
+
@properties['dateCreated']
|
366
|
+
end
|
367
|
+
|
368
|
+
##
|
369
|
+
# @return [Time] The date and time in GMT that the authentication trial was last updated.
|
370
|
+
def dateUpdated
|
371
|
+
@properties['dateUpdated']
|
372
|
+
end
|
373
|
+
|
374
|
+
##
|
375
|
+
# @return [Float] The cost billed for the authentication trial, in the currency specified by `priceUnit`. This cost does not include the cost for checking the correctness of the code.
|
376
|
+
def price
|
377
|
+
@properties['price']
|
378
|
+
end
|
379
|
+
|
380
|
+
##
|
381
|
+
# @return [String] The currency, in ISO 4127 format, in which price is measured. for example, usd, xaf, eur, cad.
|
382
|
+
def priceUnit
|
383
|
+
@properties['priceUnit']
|
384
|
+
end
|
385
|
+
|
386
|
+
##
|
387
|
+
# @return [Hash<String, Object>] channel specific information related to a trial.
|
388
|
+
def channelInfo
|
389
|
+
@properties['channelInfo']
|
390
|
+
end
|
391
|
+
|
392
|
+
##
|
393
|
+
# Fetch the AuthenticationTrialItemInstance
|
394
|
+
# @return [AuthenticationTrialItemInstance] Fetched AuthenticationTrialItemInstance
|
395
|
+
def fetch
|
396
|
+
|
397
|
+
context.fetch
|
398
|
+
end
|
399
|
+
|
400
|
+
##
|
401
|
+
# Provide a user friendly representation
|
402
|
+
def to_s
|
403
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
404
|
+
"<Reach.Api.Authentix.AuthenticationTrialItemInstance #{values}>"
|
405
|
+
end
|
406
|
+
|
407
|
+
##
|
408
|
+
# Provide a detailed, user friendly representation
|
409
|
+
def inspect
|
410
|
+
values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
|
411
|
+
"<Reach.Api.Authentix.AuthenticationTrialItemInstance #{values}>"
|
412
|
+
end
|
413
|
+
end
|
414
|
+
|
415
|
+
end
|
416
|
+
end
|
417
|
+
end
|
418
|
+
end
|