Class: Twilio::REST::Events::V1::SinkContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Events::V1::SinkContext
- Defined in:
- lib/twilio-ruby/rest/events/v1/sink.rb,
lib/twilio-ruby/rest/events/v1/sink/sink_test.rb,
lib/twilio-ruby/rest/events/v1/sink/sink_validate.rb
Defined Under Namespace
Classes: SinkTestInstance, SinkTestList, SinkTestPage, SinkValidateInstance, SinkValidateList, SinkValidatePage
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the SinkInstance.
-
#fetch ⇒ SinkInstance
Fetch the SinkInstance.
-
#initialize(version, sid) ⇒ SinkContext
constructor
Initialize the SinkContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sink_test ⇒ SinkTestList, SinkTestContext
Access the sink_test.
-
#sink_validate ⇒ SinkValidateList, SinkValidateContext
Access the sink_validate.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(description: nil) ⇒ SinkInstance
Update the SinkInstance.
Constructor Details
#initialize(version, sid) ⇒ SinkContext
Initialize the SinkContext
179 180 181 182 183 184 185 186 187 188 189 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 179 def initialize(version, sid) super(version) # Path Solution @solution = { sid: sid, } @uri = "/Sinks/#{@solution[:sid]}" # Dependents @sink_test = nil @sink_validate = nil end |
Instance Method Details
#delete ⇒ Boolean
Delete the SinkInstance
193 194 195 196 197 198 199 200 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 193 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ SinkInstance
Fetch the SinkInstance
205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 205 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) SinkInstance.new( @version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
279 280 281 282 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 279 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Events.V1.SinkContext #{context}>" end |
#sink_test ⇒ SinkTestList, SinkTestContext
Access the sink_test
251 252 253 254 255 256 257 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 251 def sink_test unless @sink_test @sink_test = SinkTestList.new( @version, sid: @solution[:sid], ) end @sink_test end |
#sink_validate ⇒ SinkValidateList, SinkValidateContext
Access the sink_validate
262 263 264 265 266 267 268 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 262 def sink_validate unless @sink_validate @sink_validate = SinkValidateList.new( @version, sid: @solution[:sid], ) end @sink_validate end |
#to_s ⇒ Object
Provide a user friendly representation
272 273 274 275 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 272 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Events.V1.SinkContext #{context}>" end |
#update(description: nil) ⇒ SinkInstance
Update the SinkInstance
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/twilio-ruby/rest/events/v1/sink.rb', line 225 def update( description: nil ) data = Twilio::Values.of({ 'Description' => description, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) SinkInstance.new( @version, payload, sid: @solution[:sid], ) end |