Class: Twilio::REST::Preview::AccSecurity::ServiceInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Preview::AccSecurity::ServiceInstance
- Defined in:
- lib/twilio-ruby/rest/preview/acc_security/service.rb
Overview
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].
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.
-
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance.
-
#initialize(version, payload, sid: nil) ⇒ ServiceInstance
constructor
Initialize the ServiceInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
The links.
-
#name ⇒ String
Friendly name of the service.
-
#sid ⇒ String
A string that uniquely identifies this Service.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(name: :unset, code_length: :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
294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 294 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'name' => payload['name'], 'code_length' => payload['code_length'].to_i, '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.
338 339 340 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 338 def account_sid @properties['account_sid'] end |
#code_length ⇒ String
Returns Length of verification code. Valid values are 4-10.
350 351 352 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 350 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
320 321 322 323 324 325 326 327 328 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 320 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.
356 357 358 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 356 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this Service was updated.
362 363 364 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 362 def date_updated @properties['date_updated'] end |
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance
381 382 383 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 381 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
421 422 423 424 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 421 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.AccSecurity.ServiceInstance #{values}>" end |
#links ⇒ String
Returns The links.
374 375 376 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 374 def links @properties['links'] end |
#name ⇒ String
Returns Friendly name of the service.
344 345 346 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 344 def name @properties['name'] end |
#sid ⇒ String
Returns A string that uniquely identifies this Service.
332 333 334 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 332 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
414 415 416 417 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 414 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.AccSecurity.ServiceInstance #{values}>" end |
#update(name: :unset, code_length: :unset) ⇒ ServiceInstance
Update the ServiceInstance
391 392 393 394 395 396 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 391 def update(name: :unset, code_length: :unset) context.update( name: name, code_length: code_length, ) end |
#url ⇒ String
Returns The url.
368 369 370 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 368 def url @properties['url'] end |
#verification_checks ⇒ verification_checks
Access the verification_checks
408 409 410 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 408 def verification_checks context.verification_checks end |
#verifications ⇒ verifications
Access the verifications
401 402 403 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 401 def verifications context.verifications end |