Class: Twilio::REST::FlexApi::V1::InteractionList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/flex_api/v1/interaction.rb

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ InteractionList

Initialize the InteractionList

Parameters:

  • version (Version)

    Version that contains the resource



26
27
28
29
30
31
32
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction.rb', line 26

def initialize(version)
    super(version)
    # Path Solution
    @solution = {  }
    @uri = "/Interactions"
    
end

Instance Method Details

#create(channel: nil, routing: :unset, interaction_context_sid: :unset) ⇒ InteractionInstance

Create the InteractionInstance

Parameters:

  • channel (Object) (defaults to: nil)

    The Interaction’s channel.

  • routing (Object) (defaults to: :unset)

    The Interaction’s routing logic.

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

    The Interaction context sid is used for adding a context lookup sid

Returns:



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction.rb', line 39

def create(
    channel: nil, 
    routing: :unset, 
    interaction_context_sid: :unset
)

    data = Twilio::Values.of({
        'Channel' => Twilio.serialize_object(channel),
        'Routing' => Twilio.serialize_object(routing),
        'InteractionContextSid' => interaction_context_sid,
    })

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    
    
    
    
    
    payload = @version.create('POST', @uri, data: data, headers: headers)
    InteractionInstance.new(
        @version,
        payload,
    )
end

#to_sObject

Provide a user friendly representation



68
69
70
# File 'lib/twilio-ruby/rest/flex_api/v1/interaction.rb', line 68

def to_s
    '#<Twilio.FlexApi.V1.InteractionList>'
end