Class: Reach::REST::Api::Authentix::ConfigurationItemContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Reach::REST::Api::Authentix::ConfigurationItemContext
- Defined in:
- lib/reach-ruby/rest/api/authentix/configuration_item.rb,
lib/reach-ruby/rest/api/authentix/configuration_item/authentication_item.rb,
lib/reach-ruby/rest/api/authentix/configuration_item/authentication_control_item.rb
Defined Under Namespace
Classes: AuthenticationControlItemInstance, AuthenticationControlItemList, AuthenticationControlItemPage, AuthenticationItemContext, AuthenticationItemInstance, AuthenticationItemList, AuthenticationItemPage
Instance Method Summary collapse
-
#authentication_control_items ⇒ AuthenticationControlItemList, AuthenticationControlItemContext
Access the authentication_control_items.
-
#authentication_items(authentication_id = :unset) ⇒ AuthenticationItemList, AuthenticationItemContext
Access the authentication_items.
-
#delete ⇒ Boolean
Delete the ConfigurationItemInstance.
-
#fetch ⇒ ConfigurationItemInstance
Fetch the ConfigurationItemInstance.
-
#initialize(version, configuration_id) ⇒ ConfigurationItemContext
constructor
Initialize the ConfigurationItemContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(service_name: :unset, code_length: :unset, allow_custom_code: :unset, used_for_digital_payment: :unset, default_expiry_time: :unset, default_max_trials: :unset, default_max_controls: :unset, smtp_setting_id: :unset, email_template_id: :unset, sms_template_id: :unset) ⇒ ConfigurationItemInstance
Update the ConfigurationItemInstance.
Constructor Details
#initialize(version, configuration_id) ⇒ ConfigurationItemContext
Initialize the ConfigurationItemContext
184 185 186 187 188 189 190 191 192 193 194 |
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 184 def initialize(version, configuration_id) super(version) # Path Solution @solution = { configuration_id: configuration_id, } @uri = "/authentix/v1/configurations/#{@solution[:configuration_id]}" # Dependents @authentication_control_items = nil @authentication_items = nil end |
Instance Method Details
#authentication_control_items ⇒ AuthenticationControlItemList, AuthenticationControlItemContext
Access the authentication_control_items
279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 279 def authentication_control_items unless @authentication_control_items @authentication_control_items = AuthenticationControlItemList.new( @version, configuration_id: @solution[:configuration_id] ) end @authentication_control_items end |
#authentication_items(authentication_id = :unset) ⇒ AuthenticationItemList, AuthenticationItemContext
Access the authentication_items
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 294 def authentication_items(authentication_id=:unset) raise ArgumentError, 'authentication_id cannot be nil' if authentication_id.nil? if authentication_id != :unset return AuthenticationItemContext.new(@version, @solution[:configuration_id],authentication_id ) end unless @authentication_items @authentication_items = AuthenticationItemList.new( @version, configuration_id: @solution[:configuration_id] ) end @authentication_items end |
#delete ⇒ Boolean
Delete the ConfigurationItemInstance
198 199 200 201 202 203 204 205 |
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 198 def delete baseParams = { } @version.delete('DELETE', @uri) end |
#fetch ⇒ ConfigurationItemInstance
Fetch the ConfigurationItemInstance
210 211 212 213 214 215 216 217 218 219 220 221 222 |
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 210 def fetch baseParams = { } payload = @version.fetch('GET', @uri) ConfigurationItemInstance.new( @version, payload, configuration_id: @solution[:configuration_id], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
322 323 324 325 |
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 322 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Reach.Api.Authentix.ConfigurationItemContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
315 316 317 318 |
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 315 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Reach.Api.Authentix.ConfigurationItemContext #{context}>" end |
#update(service_name: :unset, code_length: :unset, allow_custom_code: :unset, used_for_digital_payment: :unset, default_expiry_time: :unset, default_max_trials: :unset, default_max_controls: :unset, smtp_setting_id: :unset, email_template_id: :unset, sms_template_id: :unset) ⇒ ConfigurationItemInstance
Update the ConfigurationItemInstance
237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 |
# File 'lib/reach-ruby/rest/api/authentix/configuration_item.rb', line 237 def update( service_name: :unset, code_length: :unset, allow_custom_code: :unset, used_for_digital_payment: :unset, default_expiry_time: :unset, default_max_trials: :unset, default_max_controls: :unset, smtp_setting_id: :unset, email_template_id: :unset, sms_template_id: :unset ) baseParams = { } data = Reach::Values.of(baseParams.merge({ 'serviceName' => service_name, 'codeLength' => code_length, 'allowCustomCode' => allow_custom_code, 'usedForDigitalPayment' => used_for_digital_payment, 'defaultExpiryTime' => default_expiry_time, 'defaultMaxTrials' => default_max_trials, 'defaultMaxControls' => default_max_controls, 'smtpSettingId' => smtp_setting_id, 'emailTemplateId' => email_template_id, 'smsTemplateId' => sms_template_id, })) payload = @version.update('POST', @uri, data: data) ConfigurationItemInstance.new( @version, payload, configuration_id: @solution[:configuration_id], ) end |