Class: Twilio::REST::Api::V2010::AccountContext::QueueContext::MemberInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Api::V2010::AccountContext::QueueContext::MemberInstance
- Defined in:
- lib/twilio-ruby/rest/api/v2010/account/queue/member.rb
Instance Method Summary collapse
-
#call_sid ⇒ String
The SID of the Call the resource is associated with.
-
#context ⇒ MemberContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_enqueued ⇒ Time
The date the member was enqueued.
-
#fetch ⇒ MemberInstance
Fetch the MemberInstance.
-
#initialize(version, payload, account_sid: nil, queue_sid: nil, call_sid: nil) ⇒ MemberInstance
constructor
Initialize the MemberInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#position ⇒ String
This member's current position in the queue.
-
#queue_sid ⇒ String
The SID of the Queue the member is in.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(url: nil, method: :unset) ⇒ MemberInstance
Update the MemberInstance.
-
#uri ⇒ String
The URI of the resource, relative to `api.twilio.com`.
-
#wait_time ⇒ String
The number of seconds the member has been in the queue.
Constructor Details
#initialize(version, payload, account_sid: nil, queue_sid: nil, call_sid: nil) ⇒ MemberInstance
Initialize the MemberInstance
238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 238 def initialize(version, payload, account_sid: nil, queue_sid: nil, call_sid: nil) super(version) # Marshaled Properties @properties = { 'call_sid' => payload['call_sid'], 'date_enqueued' => Twilio.deserialize_rfc2822(payload['date_enqueued']), 'position' => payload['position'].to_i, 'uri' => payload['uri'], 'wait_time' => payload['wait_time'].to_i, 'queue_sid' => payload['queue_sid'], } # Context @instance_context = nil @params = { 'account_sid' => account_sid, 'queue_sid' => queue_sid, 'call_sid' => call_sid || @properties['call_sid'], } end |
Instance Method Details
#call_sid ⇒ String
Returns The SID of the Call the resource is associated with.
278 279 280 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 278 def call_sid @properties['call_sid'] end |
#context ⇒ MemberContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
264 265 266 267 268 269 270 271 272 273 274 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 264 def context unless @instance_context @instance_context = MemberContext.new( @version, @params['account_sid'], @params['queue_sid'], @params['call_sid'], ) end @instance_context end |
#date_enqueued ⇒ Time
Returns The date the member was enqueued.
284 285 286 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 284 def date_enqueued @properties['date_enqueued'] end |
#fetch ⇒ MemberInstance
Fetch the MemberInstance
315 316 317 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 315 def fetch context.fetch end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
339 340 341 342 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 339 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.MemberInstance #{values}>" end |
#position ⇒ String
Returns This member's current position in the queue.
290 291 292 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 290 def position @properties['position'] end |
#queue_sid ⇒ String
Returns The SID of the Queue the member is in.
308 309 310 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 308 def queue_sid @properties['queue_sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
332 333 334 335 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 332 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Api.V2010.MemberInstance #{values}>" end |
#update(url: nil, method: :unset) ⇒ MemberInstance
Update the MemberInstance
326 327 328 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 326 def update(url: nil, method: :unset) context.update(url: url, method: method, ) end |
#uri ⇒ String
Returns The URI of the resource, relative to `api.twilio.com`.
296 297 298 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 296 def uri @properties['uri'] end |
#wait_time ⇒ String
Returns The number of seconds the member has been in the queue.
302 303 304 |
# File 'lib/twilio-ruby/rest/api/v2010/account/queue/member.rb', line 302 def wait_time @properties['wait_time'] end |