Class: Twilio::REST::Preview::Authy::ServiceContext::EntityInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Preview::Authy::ServiceContext::EntityInstance
- Defined in:
- lib/twilio-ruby/rest/preview/authy/service/entity.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.
-
#context ⇒ EntityContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date this Entity was created.
-
#date_updated ⇒ Time
The date this Entity was updated.
-
#fetch ⇒ EntityInstance
Fetch a EntityInstance.
-
#identity ⇒ String
Unique identity of the Entity.
-
#initialize(version, payload, service_sid: nil, identity: nil) ⇒ EntityInstance
constructor
Initialize the EntityInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#links ⇒ String
Nested resource URLs.
-
#service_sid ⇒ String
Service Sid.
-
#sid ⇒ String
A string that uniquely identifies this Entity.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The URL of this resource.
Constructor Details
#initialize(version, payload, service_sid: nil, identity: nil) ⇒ EntityInstance
Initialize the EntityInstance
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 |
# File 'lib/twilio-ruby/rest/preview/authy/service/entity.rb', line 222 def initialize(version, payload, service_sid: nil, identity: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'identity' => payload['identity'], 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], '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 = {'service_sid' => service_sid, 'identity' => identity || @properties['identity'], } end |
Instance Method Details
#account_sid ⇒ String
Returns Account Sid.
267 268 269 |
# File 'lib/twilio-ruby/rest/preview/authy/service/entity.rb', line 267 def account_sid @properties['account_sid'] end |
#context ⇒ EntityContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
246 247 248 249 250 251 |
# File 'lib/twilio-ruby/rest/preview/authy/service/entity.rb', line 246 def context unless @instance_context @instance_context = EntityContext.new(@version, @params['service_sid'], @params['identity'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date this Entity was created.
279 280 281 |
# File 'lib/twilio-ruby/rest/preview/authy/service/entity.rb', line 279 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this Entity was updated.
285 286 287 |
# File 'lib/twilio-ruby/rest/preview/authy/service/entity.rb', line 285 def date_updated @properties['date_updated'] end |
#fetch ⇒ EntityInstance
Fetch a EntityInstance
304 305 306 |
# File 'lib/twilio-ruby/rest/preview/authy/service/entity.rb', line 304 def fetch context.fetch end |
#identity ⇒ String
Returns Unique identity of the Entity.
261 262 263 |
# File 'lib/twilio-ruby/rest/preview/authy/service/entity.rb', line 261 def identity @properties['identity'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
317 318 319 320 |
# File 'lib/twilio-ruby/rest/preview/authy/service/entity.rb', line 317 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Authy.EntityInstance #{values}>" end |
#links ⇒ String
Returns Nested resource URLs.
297 298 299 |
# File 'lib/twilio-ruby/rest/preview/authy/service/entity.rb', line 297 def links @properties['links'] end |
#service_sid ⇒ String
Returns Service Sid.
273 274 275 |
# File 'lib/twilio-ruby/rest/preview/authy/service/entity.rb', line 273 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns A string that uniquely identifies this Entity.
255 256 257 |
# File 'lib/twilio-ruby/rest/preview/authy/service/entity.rb', line 255 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
310 311 312 313 |
# File 'lib/twilio-ruby/rest/preview/authy/service/entity.rb', line 310 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.Authy.EntityInstance #{values}>" end |
#url ⇒ String
Returns The URL of this resource.
291 292 293 |
# File 'lib/twilio-ruby/rest/preview/authy/service/entity.rb', line 291 def url @properties['url'] end |