Class: Twilio::REST::Events::V1::SchemaContext::SchemaVersionInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Events::V1::SchemaContext::SchemaVersionInstance
- Defined in:
- lib/twilio-ruby/rest/events/v1/schema/schema_version.rb
Instance Method Summary collapse
-
#context ⇒ SchemaVersionContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date the schema version was created, given in ISO 8601 format.
-
#fetch ⇒ SchemaVersionInstance
Fetch the SchemaVersionInstance.
-
#id ⇒ String
The unique identifier of the schema.
-
#initialize(version, payload, id: nil, schema_version: nil) ⇒ SchemaVersionInstance
constructor
Initialize the SchemaVersionInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
- #raw ⇒ String
-
#schema_version ⇒ String
The version of this schema.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The URL of this resource.
Constructor Details
#initialize(version, payload, id: nil, schema_version: nil) ⇒ SchemaVersionInstance
Initialize the SchemaVersionInstance
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 |
# File 'lib/twilio-ruby/rest/events/v1/schema/schema_version.rb', line 388 def initialize(version, payload , id: nil, schema_version: nil) super(version) # Marshaled Properties @properties = { 'id' => payload['id'], 'schema_version' => payload['schema_version'] == nil ? payload['schema_version'] : payload['schema_version'].to_i, 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'url' => payload['url'], 'raw' => payload['raw'], } # Context @instance_context = nil @params = { 'id' => id || @properties['id'] ,'schema_version' => schema_version || @properties['schema_version'] , } end |
Instance Method Details
#context ⇒ SchemaVersionContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
410 411 412 413 414 415 |
# File 'lib/twilio-ruby/rest/events/v1/schema/schema_version.rb', line 410 def context unless @instance_context @instance_context = SchemaVersionContext.new(@version , @params['id'], @params['schema_version']) end @instance_context end |
#date_created ⇒ Time
Returns The date the schema version was created, given in ISO 8601 format.
431 432 433 |
# File 'lib/twilio-ruby/rest/events/v1/schema/schema_version.rb', line 431 def date_created @properties['date_created'] end |
#fetch ⇒ SchemaVersionInstance
Fetch the SchemaVersionInstance
450 451 452 453 |
# File 'lib/twilio-ruby/rest/events/v1/schema/schema_version.rb', line 450 def fetch context.fetch end |
#id ⇒ String
Returns The unique identifier of the schema. Each schema can have multiple versions, that share the same id.
419 420 421 |
# File 'lib/twilio-ruby/rest/events/v1/schema/schema_version.rb', line 419 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
464 465 466 467 |
# File 'lib/twilio-ruby/rest/events/v1/schema/schema_version.rb', line 464 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Events.V1.SchemaVersionInstance #{values}>" end |
#raw ⇒ String
443 444 445 |
# File 'lib/twilio-ruby/rest/events/v1/schema/schema_version.rb', line 443 def raw @properties['raw'] end |
#schema_version ⇒ String
Returns The version of this schema.
425 426 427 |
# File 'lib/twilio-ruby/rest/events/v1/schema/schema_version.rb', line 425 def schema_version @properties['schema_version'] end |
#to_s ⇒ Object
Provide a user friendly representation
457 458 459 460 |
# File 'lib/twilio-ruby/rest/events/v1/schema/schema_version.rb', line 457 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Events.V1.SchemaVersionInstance #{values}>" end |
#url ⇒ String
Returns The URL of this resource.
437 438 439 |
# File 'lib/twilio-ruby/rest/events/v1/schema/schema_version.rb', line 437 def url @properties['url'] end |