Class: Twilio::REST::Wireless::V1::CommandInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Wireless::V1::CommandInstance
- Defined in:
- lib/twilio-ruby/rest/wireless/v1/command.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#account_sid ⇒ String
The account_sid.
-
#command ⇒ String
The command.
-
#command_mode ⇒ command.CommandMode
The command_mode.
-
#context ⇒ CommandContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date_created.
-
#date_updated ⇒ Time
The date_updated.
-
#direction ⇒ command.Direction
The direction.
-
#fetch ⇒ CommandInstance
Fetch a CommandInstance.
-
#initialize(version, payload, sid: nil) ⇒ CommandInstance
constructor
Initialize the CommandInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
The sid.
-
#sim_sid ⇒ String
The sim_sid.
-
#status ⇒ command.Status
The status.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The url.
Constructor Details
#initialize(version, payload, sid: nil) ⇒ CommandInstance
Initialize the CommandInstance
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 243 def initialize(version, payload, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'sim_sid' => payload['sim_sid'], 'command' => payload['command'], 'command_mode' => payload['command_mode'], 'status' => payload['status'], 'direction' => payload['direction'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 'url' => payload['url'], } # Context @instance_context = nil @params = {'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The account_sid.
284 285 286 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 284 def account_sid @properties['account_sid'] end |
#command ⇒ String
Returns The command.
296 297 298 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 296 def command @properties['command'] end |
#command_mode ⇒ command.CommandMode
Returns The command_mode.
302 303 304 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 302 def command_mode @properties['command_mode'] end |
#context ⇒ CommandContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
269 270 271 272 273 274 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 269 def context unless @instance_context @instance_context = CommandContext.new(@version, @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date_created.
320 321 322 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 320 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date_updated.
326 327 328 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 326 def date_updated @properties['date_updated'] end |
#direction ⇒ command.Direction
Returns The direction.
314 315 316 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 314 def direction @properties['direction'] end |
#fetch ⇒ CommandInstance
Fetch a CommandInstance
339 340 341 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 339 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
352 353 354 355 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 352 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Wireless.V1.CommandInstance #{values}>" end |
#sid ⇒ String
Returns The sid.
278 279 280 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 278 def sid @properties['sid'] end |
#sim_sid ⇒ String
Returns The sim_sid.
290 291 292 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 290 def sim_sid @properties['sim_sid'] end |
#status ⇒ command.Status
Returns The status.
308 309 310 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 308 def status @properties['status'] end |
#to_s ⇒ Object
Provide a user friendly representation
345 346 347 348 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 345 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Wireless.V1.CommandInstance #{values}>" end |
#url ⇒ String
Returns The url.
332 333 334 |
# File 'lib/twilio-ruby/rest/wireless/v1/command.rb', line 332 def url @properties['url'] end |