Class: Twilio::REST::Events::V1::SchemaInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Events::V1::SchemaInstance
- Defined in:
- lib/twilio-ruby/rest/events/v1/schema.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#context ⇒ SchemaContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#fetch ⇒ SchemaInstance
Fetch the SchemaInstance.
-
#id ⇒ String
Schema Identifier.
-
#initialize(version, payload, id: nil) ⇒ SchemaInstance
constructor
Initialize the SchemaInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#latest_version ⇒ String
Latest schema version.
-
#latest_version_date_created ⇒ Time
The date that the latest schema version was created.
-
#links ⇒ String
Nested resource URLs.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The URL of this resource.
-
#versions ⇒ versions
Access the versions.
Constructor Details
#initialize(version, payload, id: nil) ⇒ SchemaInstance
Initialize the SchemaInstance
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
# File 'lib/twilio-ruby/rest/events/v1/schema.rb', line 137 def initialize(version, payload, id: nil) super(version) # Marshaled Properties @properties = { 'id' => payload['id'], 'url' => payload['url'], 'links' => payload['links'], 'latest_version_date_created' => Twilio.deserialize_iso8601_datetime(payload['latest_version_date_created']), 'latest_version' => payload['latest_version'].to_i, } # Context @instance_context = nil @params = {'id' => id || @properties['id'], } end |
Instance Method Details
#context ⇒ SchemaContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
158 159 160 161 162 163 |
# File 'lib/twilio-ruby/rest/events/v1/schema.rb', line 158 def context unless @instance_context @instance_context = SchemaContext.new(@version, @params['id'], ) end @instance_context end |
#fetch ⇒ SchemaInstance
Fetch the SchemaInstance
198 199 200 |
# File 'lib/twilio-ruby/rest/events/v1/schema.rb', line 198 def fetch context.fetch end |
#id ⇒ String
Returns Schema Identifier.
167 168 169 |
# File 'lib/twilio-ruby/rest/events/v1/schema.rb', line 167 def id @properties['id'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
218 219 220 221 |
# File 'lib/twilio-ruby/rest/events/v1/schema.rb', line 218 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Events.V1.SchemaInstance #{values}>" end |
#latest_version ⇒ String
Returns Latest schema version.
191 192 193 |
# File 'lib/twilio-ruby/rest/events/v1/schema.rb', line 191 def latest_version @properties['latest_version'] end |
#latest_version_date_created ⇒ Time
Returns The date that the latest schema version was created.
185 186 187 |
# File 'lib/twilio-ruby/rest/events/v1/schema.rb', line 185 def latest_version_date_created @properties['latest_version_date_created'] end |
#links ⇒ String
Returns Nested resource URLs.
179 180 181 |
# File 'lib/twilio-ruby/rest/events/v1/schema.rb', line 179 def links @properties['links'] end |
#to_s ⇒ Object
Provide a user friendly representation
211 212 213 214 |
# File 'lib/twilio-ruby/rest/events/v1/schema.rb', line 211 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Events.V1.SchemaInstance #{values}>" end |
#url ⇒ String
Returns The URL of this resource.
173 174 175 |
# File 'lib/twilio-ruby/rest/events/v1/schema.rb', line 173 def url @properties['url'] end |
#versions ⇒ versions
Access the versions
205 206 207 |
# File 'lib/twilio-ruby/rest/events/v1/schema.rb', line 205 def versions context.versions end |