Class: Twilio::REST::Webhooks::V1::TestList

Inherits:
ListResource show all
Defined in:
lib/twilio-ruby/rest/webhooks/v1/test.rb

Defined Under Namespace

Classes: TestDeliveryResultResponse, TestDeliveryResultTiming, TestRequest

Instance Method Summary collapse

Constructor Details

#initialize(version) ⇒ TestList

Initialize the TestList

Parameters:

  • version (Version) —

    Version that contains the resource



75
76
77
78
79
80
81
82
83
# File 'lib/twilio-ruby/rest/webhooks/v1/test.rb', line 75

def initialize(version)
    
    apiV1Version = ApiV1Version.new version.domain, version
    super(apiV1Version)
    # Path Solution
    @solution = {  }
    @uri = "/Webhooks/Tests"
    
end

Instance Method Details

#create(test_request: nil) ⇒ TestInstance

Create the TestInstance

Parameters:

Returns:



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/twilio-ruby/rest/webhooks/v1/test.rb', line 88

def create(test_request: nil
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    headers['Content-Type'] = 'application/json'
    
    
    
     headers['Accept'] = '*/*'
    payload = @version.create('POST', @uri, headers: headers, data: test_request.to_json)
    TestInstance.new(
        @version,
        payload,
    )
end

#create_with_metadata(test_request: nil) ⇒ TestInstance

Create the TestInstanceMetadata

Parameters:

Returns:



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'lib/twilio-ruby/rest/webhooks/v1/test.rb', line 108

def (test_request: nil
)

    headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
    headers['Content-Type'] = 'application/json'
    
    
    
     headers['Accept'] = '*/*'
    response = @version.('POST', @uri, headers: headers, data: test_request.to_json)
    test_instance = TestInstance.new(
        @version,
        response.body,
    )
    TestInstanceMetadata.new(
        @version,
        test_instance,
        response.headers,
        response.status_code
    )
end

#to_s ⇒ Object

Provide a user friendly representation



134
135
136
# File 'lib/twilio-ruby/rest/webhooks/v1/test.rb', line 134

def to_s
    '#<Twilio.Webhooks.V1.TestList>'
end