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
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 259 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.
298 299 300 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 298 def account_sid @properties['account_sid'] end |
#code_length ⇒ String
Returns Length of verification code. Valid values are 4-10.
310 311 312 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 310 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
283 284 285 286 287 288 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 283 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.
316 317 318 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 316 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this Service was updated.
322 323 324 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 322 def date_updated @properties['date_updated'] end |
#fetch ⇒ ServiceInstance
Fetch a ServiceInstance
341 342 343 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 341 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
378 379 380 381 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 378 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.AccSecurity.ServiceInstance #{values}>" end |
#links ⇒ String
Returns The links.
334 335 336 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 334 def links @properties['links'] end |
#name ⇒ String
Returns Friendly name of the service.
304 305 306 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 304 def name @properties['name'] end |
#sid ⇒ String
Returns A string that uniquely identifies this Service.
292 293 294 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 292 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
371 372 373 374 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 371 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
351 352 353 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 351 def update(name: :unset, code_length: :unset) context.update(name: name, code_length: code_length, ) end |
#url ⇒ String
Returns The url.
328 329 330 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 328 def url @properties['url'] end |
#verification_checks ⇒ verification_checks
Access the verification_checks
365 366 367 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 365 def verification_checks context.verification_checks end |
#verifications ⇒ verifications
Access the verifications
358 359 360 |
# File 'lib/twilio-ruby/rest/preview/acc_security/service.rb', line 358 def verifications context.verifications end |