Class: Twilio::REST::Events::V1::SinkContext::SinkTestList

Inherits:
ListResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/events/v1/sink/sink_test.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, sid: nil) ⇒ SinkTestList

Initialize the SinkTestList

Parameters:

  • version (Version)

    Version that contains the resource



28
29
30
31
32
33
34
# File 'lib/twilio-ruby/rest/events/v1/sink/sink_test.rb', line 28

def initialize(version, sid: nil)
    super(version)
    # Path Solution
    @solution = { sid: sid }
    @uri = "/Sinks/#{@solution[:sid]}/Test"
    
end

Instance Method Details

#createSinkTestInstance

Create the SinkTestInstance

Returns:



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# File 'lib/twilio-ruby/rest/events/v1/sink/sink_test.rb', line 38

def create

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

#to_sObject

Provide a user friendly representation



58
59
60
# File 'lib/twilio-ruby/rest/events/v1/sink/sink_test.rb', line 58

def to_s
    '#<Twilio.Events.V1.SinkTestList>'
end