Class: Twilio::REST::Verify::V2::ServiceContext::EntityContext::NewFactorInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, service_sid: nil, identity: nil) ⇒ NewFactorInstance

Initialize the NewFactorInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • account_sid (String)

    The SID of the Account that created this NewFactor resource.

  • sid (String)

    The SID of the Call resource to fetch.



142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb', line 142

def initialize(version, payload , service_sid: nil, identity: 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'],
        'binding' => payload['binding'],
        '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'],
    }
end

Instance Method Details

#account_sidString

Returns The unique SID identifier of the Account.

Returns:

  • (String)

    The unique SID identifier of the Account.



173
174
175
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb', line 173

def 
    @properties['account_sid']
end

#bindingHash

Returns Contains the ‘factor_type` specific secret and metadata. For push, this is `binding.public_key` and `binding.alg`. For totp, this is `binding.secret` and `binding.uri`. The `binding.uri` property is generated following the [google authenticator key URI format](github.com/google/google-authenticator/wiki/Key-Uri-Format), and `Factor.friendly_name` is used for the “accountname” value and `Service.friendly_name` or `Service.totp.issuer` is used for the `issuer` value. The Binding property is ONLY returned upon Factor creation.

Returns:

  • (Hash)

    Contains the ‘factor_type` specific secret and metadata. For push, this is `binding.public_key` and `binding.alg`. For totp, this is `binding.secret` and `binding.uri`. The `binding.uri` property is generated following the [google authenticator key URI format](github.com/google/google-authenticator/wiki/Key-Uri-Format), and `Factor.friendly_name` is used for the “accountname” value and `Service.friendly_name` or `Service.totp.issuer` is used for the `issuer` value. The Binding property is ONLY returned upon Factor creation.



197
198
199
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb', line 197

def binding
    @properties['binding']
end

#configHash

Returns An object that contains configurations specific to a ‘factor_type`.

Returns:

  • (Hash)

    An object that contains configurations specific to a ‘factor_type`.



233
234
235
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb', line 233

def config
    @properties['config']
end

#date_createdTime

Returns The date that this Factor was created, given in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



203
204
205
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb', line 203

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns The date that this Factor was updated, given in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.

Returns:



209
210
211
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb', line 209

def date_updated
    @properties['date_updated']
end

#entity_sidString

Returns The unique SID identifier of the Entity.

Returns:

  • (String)

    The unique SID identifier of the Entity.



185
186
187
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb', line 185

def entity_sid
    @properties['entity_sid']
end

#factor_typeFactorTypes

Returns:

  • (FactorTypes)


227
228
229
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb', line 227

def factor_type
    @properties['factor_type']
end

#friendly_nameString

Returns The friendly name of this Factor. This can be any string up to 64 characters, meant for humans to distinguish between Factors. For ‘factor_type` `push`, this could be a device name. For `factor_type` `totp`, this value is used as the “account name” in constructing the `binding.uri` property. At the same time, we recommend avoiding providing PII.

Returns:

  • (String)

    The friendly name of this Factor. This can be any string up to 64 characters, meant for humans to distinguish between Factors. For ‘factor_type` `push`, this could be a device name. For `factor_type` `totp`, this value is used as the “account name” in constructing the `binding.uri` property. At the same time, we recommend avoiding providing PII.



215
216
217
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb', line 215

def friendly_name
    @properties['friendly_name']
end

#identityString

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.

Returns:

  • (String)

    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.



191
192
193
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb', line 191

def identity
    @properties['identity']
end

#inspectObject

Provide a detailed, user friendly representation



257
258
259
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb', line 257

def inspect
    "<Twilio.Verify.V2.NewFactorInstance>"
end

#metadataHash

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.

Returns:

  • (Hash)

    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.



239
240
241
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb', line 239

def 
    @properties['metadata']
end

#service_sidString

Returns The unique SID identifier of the Service.

Returns:

  • (String)

    The unique SID identifier of the Service.



179
180
181
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb', line 179

def service_sid
    @properties['service_sid']
end

#sidString

Returns A 34 character string that uniquely identifies this Factor.

Returns:

  • (String)

    A 34 character string that uniquely identifies this Factor.



167
168
169
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb', line 167

def sid
    @properties['sid']
end

#statusFactorStatuses

Returns:

  • (FactorStatuses)


221
222
223
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb', line 221

def status
    @properties['status']
end

#to_sObject

Provide a user friendly representation



251
252
253
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb', line 251

def to_s
    "<Twilio.Verify.V2.NewFactorInstance>"
end

#urlString

Returns The URL of this resource.

Returns:

  • (String)

    The URL of this resource.



245
246
247
# File 'lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb', line 245

def url
    @properties['url']
end