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
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 268 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
307 308 309 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 307 def account_sid @properties['account_sid'] end |
#code_length ⇒ String
319 320 321 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 319 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
292 293 294 295 296 297 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 292 def context unless @instance_context @instance_context = ServiceContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
325 326 327 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 325 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
331 332 333 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 331 def date_updated @properties['date_updated'] end |
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance
350 351 352 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 350 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
387 388 389 390 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 387 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.AccSecurity.ServiceInstance #{values}>" end |
#links ⇒ String
343 344 345 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 343 def links @properties['links'] end |
#name ⇒ String
313 314 315 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 313 def name @properties['name'] end |
#sid ⇒ String
301 302 303 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 301 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
380 381 382 383 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 380 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
360 361 362 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 360 def update(name: :unset, code_length: :unset) context.update(name: name, code_length: code_length, ) end |
#url ⇒ String
337 338 339 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 337 def url @properties['url'] end |
#verification_checks ⇒ verification_checks
Access the verification_checks
374 375 376 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 374 def verification_checks context.verification_checks end |
#verifications ⇒ verifications
Access the verifications
367 368 369 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 367 def verifications context.verifications end |