Class: Twilio::REST::Verify::V2::ServiceContext::EntityContext::FactorInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Verify::V2::ServiceContext::EntityContext::FactorInstance
- Defined in:
- lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
The unique SID identifier of the Account.
-
#config ⇒ Hash
An object that contains configurations specific to a ‘factor_type`.
-
#context ⇒ FactorContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date that this Factor was created, given in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#date_updated ⇒ Time
The date that this Factor was updated, given in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#delete ⇒ Boolean
Delete the FactorInstance.
-
#entity_sid ⇒ String
The unique SID identifier of the Entity.
- #factor_type ⇒ FactorTypes
-
#fetch ⇒ FactorInstance
Fetch the FactorInstance.
-
#friendly_name ⇒ String
A human readable description of this resource, up to 64 characters.
-
#identity ⇒ String
Customer unique identity for the Entity owner of the Factor.
-
#initialize(version, payload, service_sid: nil, identity: nil, sid: nil) ⇒ FactorInstance
constructor
Initialize the FactorInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#metadata ⇒ Hash
Custom metadata associated with the factor.
-
#service_sid ⇒ String
The unique SID identifier of the Service.
-
#sid ⇒ String
A 34 character string that uniquely identifies this Factor.
- #status ⇒ FactorStatuses
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(auth_payload: :unset, friendly_name: :unset, config_notification_token: :unset, config_sdk_version: :unset, config_time_step: :unset, config_skew: :unset, config_code_length: :unset, config_alg: :unset, config_notification_platform: :unset) ⇒ FactorInstance
Update the FactorInstance.
-
#url ⇒ String
The URL of this resource.
Constructor Details
#initialize(version, payload, service_sid: nil, identity: nil, sid: nil) ⇒ FactorInstance
Initialize the FactorInstance
289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 289 def initialize(version, payload , service_sid: nil, identity: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], 'entity_sid' => payload['entity_sid'], 'identity' => payload['identity'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'friendly_name' => payload['friendly_name'], 'status' => payload['status'], 'factor_type' => payload['factor_type'], 'config' => payload['config'], 'metadata' => payload['metadata'], 'url' => payload['url'], } # Context @instance_context = nil @params = { 'service_sid' => service_sid || @properties['service_sid'] ,'identity' => identity || @properties['identity'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique SID identifier of the Account.
333 334 335 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 333 def account_sid @properties['account_sid'] end |
#config ⇒ Hash
Returns An object that contains configurations specific to a ‘factor_type`.
387 388 389 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 387 def config @properties['config'] end |
#context ⇒ FactorContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
318 319 320 321 322 323 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 318 def context unless @instance_context @instance_context = FactorContext.new(@version , @params['service_sid'], @params['identity'], @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns The date that this Factor was created, given in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
357 358 359 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 357 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date that this Factor was updated, given in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
363 364 365 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 363 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the FactorInstance
406 407 408 409 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 406 def delete context.delete end |
#entity_sid ⇒ String
Returns The unique SID identifier of the Entity.
345 346 347 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 345 def entity_sid @properties['entity_sid'] end |
#factor_type ⇒ FactorTypes
381 382 383 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 381 def factor_type @properties['factor_type'] end |
#fetch ⇒ FactorInstance
Fetch the FactorInstance
414 415 416 417 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 414 def fetch context.fetch end |
#friendly_name ⇒ String
Returns A human readable description of this resource, up to 64 characters. For a push factor, this can be the device’s name.
369 370 371 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 369 def friendly_name @properties['friendly_name'] end |
#identity ⇒ String
Returns Customer unique identity for the Entity owner of the Factor. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user’s UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters.
351 352 353 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 351 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
465 466 467 468 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 465 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.FactorInstance #{values}>" end |
#metadata ⇒ Hash
Returns Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. ‘"Android"`. Can be up to 1024 characters in length.
393 394 395 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 393 def @properties['metadata'] end |
#service_sid ⇒ String
Returns The unique SID identifier of the Service.
339 340 341 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 339 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns A 34 character string that uniquely identifies this Factor.
327 328 329 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 327 def sid @properties['sid'] end |
#status ⇒ FactorStatuses
375 376 377 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 375 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
458 459 460 461 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 458 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V2.FactorInstance #{values}>" end |
#update(auth_payload: :unset, friendly_name: :unset, config_notification_token: :unset, config_sdk_version: :unset, config_time_step: :unset, config_skew: :unset, config_code_length: :unset, config_alg: :unset, config_notification_platform: :unset) ⇒ FactorInstance
Update the FactorInstance
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 431 def update( auth_payload: :unset, friendly_name: :unset, config_notification_token: :unset, config_sdk_version: :unset, config_time_step: :unset, config_skew: :unset, config_code_length: :unset, config_alg: :unset, config_notification_platform: :unset ) context.update( auth_payload: auth_payload, friendly_name: friendly_name, config_notification_token: config_notification_token, config_sdk_version: config_sdk_version, config_time_step: config_time_step, config_skew: config_skew, config_code_length: config_code_length, config_alg: config_alg, config_notification_platform: config_notification_platform, ) end |
#url ⇒ String
Returns The URL of this resource.
399 400 401 |
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/factor.rb', line 399 def url @properties['url'] end |