Class: Twilio::REST::FlexApi::V2

Inherits:
Version
  • Object
show all
Defined in:
lib/twilio-ruby/rest/flex_api/v2.rb,
lib/twilio-ruby/rest/flex_api/v2/flex_user.rb,
lib/twilio-ruby/rest/flex_api/v2/web_channels.rb

Defined Under Namespace

Classes: FlexUserContext, FlexUserInstance, FlexUserList, FlexUserPage, WebChannelsInstance, WebChannelsList, WebChannelsPage

Instance Attribute Summary

Attributes inherited from Version

#domain

Instance Method Summary collapse

Methods inherited from Version

#absolute_url, #create, #delete, #exception, #fetch, #page, #read_limits, #relative_uri, #request, #stream, #update

Constructor Details

#initialize(domain) ⇒ V2

Initialize the V2 version of FlexApi



21
22
23
24
25
26
# File 'lib/twilio-ruby/rest/flex_api/v2.rb', line 21

def initialize(domain)
    super
    @version = 'v2'
    @flex_user = nil
    @web_channels = nil
end

Instance Method Details

#flex_user(instance_sid = :unset, flex_user_sid = :unset) ⇒ Twilio::REST::FlexApi::V2::FlexUserContext, Twilio::REST::FlexApi::V2::FlexUserList

Parameters:

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

    The unique ID created by Twilio to identify a Flex instance.

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

    The unique id for the flex user to be retrieved.

Returns:



33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/twilio-ruby/rest/flex_api/v2.rb', line 33

def flex_user(instance_sid=:unset, flex_user_sid=:unset)
    if instance_sid.nil?
        raise ArgumentError, 'instance_sid cannot be nil'
    end
    if flex_user_sid.nil?
        raise ArgumentError, 'flex_user_sid cannot be nil'
    end
    if instance_sid == :unset && flex_user_sid == :unset
        @flex_user ||= FlexUserList.new self
    else
        FlexUserContext.new(self, instance_sid, flex_user_sid)
    end
end

#to_sObject

Provide a user friendly representation



71
72
73
# File 'lib/twilio-ruby/rest/flex_api/v2.rb', line 71

def to_s
    '<Twilio::REST::FlexApi::V2>';
end

#web_channelsTwilio::REST::FlexApi::V2::WebChannelsList



66
67
68
# File 'lib/twilio-ruby/rest/flex_api/v2.rb', line 66

def web_channels
    @web_channels ||= WebChannelsList.new self
end