Class: Twilio::REST::Notify::V1::ServiceContext::BindingContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Notify::V1::ServiceContext::BindingContext
- Defined in:
- lib/twilio-ruby/rest/notify/v1/service/binding.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the BindingInstance.
-
#delete_with_metadata ⇒ Boolean
Delete the BindingInstanceMetadata.
-
#fetch ⇒ BindingInstance
Fetch the BindingInstance.
-
#fetch_with_metadata ⇒ BindingInstance
Fetch the BindingInstanceMetadata.
-
#initialize(version, service_sid, sid) ⇒ BindingContext
constructor
Initialize the BindingContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, service_sid, sid) ⇒ BindingContext
Initialize the BindingContext
292 293 294 295 296 297 298 299 300 301 |
# File 'lib/twilio-ruby/rest/notify/v1/service/binding.rb', line 292 def initialize(version, service_sid, sid) super(version) # Path Solution @solution = { service_sid: service_sid, sid: sid, } @uri = "/Services/#{@solution[:service_sid]}/Bindings/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the BindingInstance
305 306 307 308 309 310 311 312 313 |
# File 'lib/twilio-ruby/rest/notify/v1/service/binding.rb', line 305 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#delete_with_metadata ⇒ Boolean
Delete the BindingInstanceMetadata
318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 |
# File 'lib/twilio-ruby/rest/notify/v1/service/binding.rb', line 318 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('DELETE', @uri, headers: headers) binding_instance = BindingInstance.new( @version, response.body, account_sid: @solution[:account_sid], sid: @solution[:sid], ) BindingInstanceMetadata.new(@version, binding_instance, response.headers, response.status_code) end |
#fetch ⇒ BindingInstance
Fetch the BindingInstance
337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 |
# File 'lib/twilio-ruby/rest/notify/v1/service/binding.rb', line 337 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) BindingInstance.new( @version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid], ) end |
#fetch_with_metadata ⇒ BindingInstance
Fetch the BindingInstanceMetadata
357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 |
# File 'lib/twilio-ruby/rest/notify/v1/service/binding.rb', line 357 def headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) response = @version.('GET', @uri, headers: headers) binding_instance = BindingInstance.new( @version, response.body, service_sid: @solution[:service_sid], sid: @solution[:sid], ) BindingInstanceMetadata.new( @version, binding_instance, response.headers, response.status_code ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
390 391 392 393 |
# File 'lib/twilio-ruby/rest/notify/v1/service/binding.rb', line 390 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Notify.V1.BindingContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
383 384 385 386 |
# File 'lib/twilio-ruby/rest/notify/v1/service/binding.rb', line 383 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Notify.V1.BindingContext #{context}>" end |