Class: Twilio::REST::Verify::V1::ServiceInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Verify::V1::ServiceInstance
- Defined in:
- lib/twilio-ruby/rest/verify/v1/service.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#account_sid ⇒ String
Account Sid.
-
#code_length ⇒ String
Length of verification code.
-
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date this Service was created.
-
#date_updated ⇒ Time
The date this Service was updated.
-
#delete ⇒ Boolean
Deletes the ServiceInstance.
-
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance.
-
#friendly_name ⇒ String
Friendly name of the service.
-
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
constructor
Initialize the ServiceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The links.
-
#lookup_enabled ⇒ Boolean
Indicates whether or not to perform a lookup with each verification started.
-
#sid ⇒ String
A string that uniquely identifies this Service.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset) ⇒ ServiceInstance
Update the ServiceInstance.
-
#url ⇒ String
The url.
-
#verification_checks ⇒ verification_checks
Access the verification_checks.
-
#verifications ⇒ verifications
Access the verifications.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
Initialize the ServiceInstance
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 |
# File 'lib/twilio-ruby/rest/verify/v1/service.rb', line 282 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'friendly_name' => payload['friendly_name'], 'code_length' => payload['code_length'].to_i, 'lookup_enabled' => payload['lookup_enabled'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], 'links' => payload['links'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns Account Sid.
322 323 324 |
# File 'lib/twilio-ruby/rest/verify/v1/service.rb', line 322 def account_sid @properties['account_sid'] end |
#code_length ⇒ String
Returns Length of verification code. Valid values are 4-10.
334 335 336 |
# File 'lib/twilio-ruby/rest/verify/v1/service.rb', line 334 def code_length @properties['code_length'] end |
#context ⇒ ServiceContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
307 308 309 310 311 312 |
# File 'lib/twilio-ruby/rest/verify/v1/service.rb', line 307 def context unless @instance_context @instance_context = ServiceContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date this Service was created.
346 347 348 |
# File 'lib/twilio-ruby/rest/verify/v1/service.rb', line 346 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this Service was updated.
352 353 354 |
# File 'lib/twilio-ruby/rest/verify/v1/service.rb', line 352 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the ServiceInstance
378 379 380 |
# File 'lib/twilio-ruby/rest/verify/v1/service.rb', line 378 def delete context.delete end |
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance
371 372 373 |
# File 'lib/twilio-ruby/rest/verify/v1/service.rb', line 371 def fetch context.fetch end |
#friendly_name ⇒ String
Returns Friendly name of the service.
328 329 330 |
# File 'lib/twilio-ruby/rest/verify/v1/service.rb', line 328 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
422 423 424 425 |
# File 'lib/twilio-ruby/rest/verify/v1/service.rb', line 422 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V1.ServiceInstance #{values}>" end |
#links ⇒ String
Returns The links.
364 365 366 |
# File 'lib/twilio-ruby/rest/verify/v1/service.rb', line 364 def links @properties['links'] end |
#lookup_enabled ⇒ Boolean
Returns Indicates whether or not to perform a lookup with each verification started.
340 341 342 |
# File 'lib/twilio-ruby/rest/verify/v1/service.rb', line 340 def lookup_enabled @properties['lookup_enabled'] end |
#sid ⇒ String
Returns A string that uniquely identifies this Service.
316 317 318 |
# File 'lib/twilio-ruby/rest/verify/v1/service.rb', line 316 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
415 416 417 418 |
# File 'lib/twilio-ruby/rest/verify/v1/service.rb', line 415 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Verify.V1.ServiceInstance #{values}>" end |
#update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset) ⇒ ServiceInstance
Update the ServiceInstance
391 392 393 394 395 396 397 |
# File 'lib/twilio-ruby/rest/verify/v1/service.rb', line 391 def update(friendly_name: :unset, code_length: :unset, lookup_enabled: :unset) context.update( friendly_name: friendly_name, code_length: code_length, lookup_enabled: lookup_enabled, ) end |
#url ⇒ String
Returns The url.
358 359 360 |
# File 'lib/twilio-ruby/rest/verify/v1/service.rb', line 358 def url @properties['url'] end |
#verification_checks ⇒ verification_checks
Access the verification_checks
409 410 411 |
# File 'lib/twilio-ruby/rest/verify/v1/service.rb', line 409 def verification_checks context.verification_checks end |
#verifications ⇒ verifications
Access the verifications
402 403 404 |
# File 'lib/twilio-ruby/rest/verify/v1/service.rb', line 402 def verifications context.verifications end |