Class: Twilio::REST::FlexApi::V1::WebChannelInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the WebChannelInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • sid (String) (defaults to: nil)

    The SID of the WebChannel resource to fetch.


235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 235

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'],
      '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

Returns The SID of the Account that created the resource and owns this Workflow.

Returns:

  • (String)

    The SID of the Account that created the resource and owns this Workflow


266
267
268
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 266

def 
  @properties['account_sid']
end

#contextWebChannelContext

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

Returns:


257
258
259
260
261
262
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 257

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

#date_createdTime

Returns The ISO 8601 date and time in GMT when the resource was created.

Returns:

  • (Time)

    The ISO 8601 date and time in GMT when the resource was created


290
291
292
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 290

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The ISO 8601 date and time in GMT when the resource was last updated.

Returns:

  • (Time)

    The ISO 8601 date and time in GMT when the resource was last updated


296
297
298
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 296

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Delete the WebChannelInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


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

def delete
  context.delete
end

#fetchWebChannelInstance

Fetch the WebChannelInstance

Returns:


303
304
305
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 303

def fetch
  context.fetch
end

#flex_flow_sidString

Returns The SID of the Flex Flow.

Returns:

  • (String)

    The SID of the Flex Flow


272
273
274
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 272

def flex_flow_sid
  @properties['flex_flow_sid']
end

#inspectObject

Provide a detailed, user friendly representation


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

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

#sidString

Returns The unique string that identifies the WebChannel resource.

Returns:

  • (String)

    The unique string that identifies the WebChannel resource


278
279
280
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 278

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation


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

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

#update(chat_status: :unset, post_engagement_data: :unset) ⇒ WebChannelInstance

Update the WebChannelInstance

Parameters:

  • chat_status (web_channel.ChatStatus) (defaults to: :unset)

    The chat status. Can only be `inactive`.

  • post_engagement_data (String) (defaults to: :unset)

    The post-engagement data.

Returns:


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

def update(chat_status: :unset, post_engagement_data: :unset)
  context.update(chat_status: chat_status, post_engagement_data: post_engagement_data, )
end

#urlString

Returns The absolute URL of the WebChannel resource.

Returns:

  • (String)

    The absolute URL of the WebChannel resource


284
285
286
# File 'lib/twilio-ruby/rest/flex_api/v1/web_channel.rb', line 284

def url
  @properties['url']
end