Class: Twilio::REST::FlexApi::V1::ChannelInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/flex_api/v1/channel.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, sid: nil) ⇒ ChannelInstance

Initialize the ChannelInstance



230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 230

def initialize(version, payload, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'account_sid' => payload['account_sid'],
      'flex_flow_sid' => payload['flex_flow_sid'],
      'sid' => payload['sid'],
      'user_sid' => payload['user_sid'],
      'task_sid' => payload['task_sid'],
      'url' => payload['url'],
      'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
      'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
  }

  # Context
  @instance_context = nil
  @params = {'sid' => sid || @properties['sid'], }
end

Instance Method Details

#account_sidString



263
264
265
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 263

def 
  @properties['account_sid']
end

#contextChannelContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context



254
255
256
257
258
259
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 254

def context
  unless @instance_context
    @instance_context = ChannelContext.new(@version, @params['sid'], )
  end
  @instance_context
end

#date_createdTime



299
300
301
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 299

def date_created
  @properties['date_created']
end

#date_updatedTime



305
306
307
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 305

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Delete the ChannelInstance



319
320
321
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 319

def delete
  context.delete
end

#fetchChannelInstance

Fetch the ChannelInstance



312
313
314
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 312

def fetch
  context.fetch
end

#flex_flow_sidString



269
270
271
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 269

def flex_flow_sid
  @properties['flex_flow_sid']
end

#inspectObject

Provide a detailed, user friendly representation



332
333
334
335
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 332

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.FlexApi.V1.ChannelInstance #{values}>"
end

#sidString



275
276
277
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 275

def sid
  @properties['sid']
end

#task_sidString



287
288
289
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 287

def task_sid
  @properties['task_sid']
end

#to_sObject

Provide a user friendly representation



325
326
327
328
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 325

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.FlexApi.V1.ChannelInstance #{values}>"
end

#urlString



293
294
295
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 293

def url
  @properties['url']
end

#user_sidString



281
282
283
# File 'lib/twilio-ruby/rest/flex_api/v1/channel.rb', line 281

def user_sid
  @properties['user_sid']
end