Class: Twilio::REST::Conversations::V1::ServiceContext::BindingContext

Inherits:
InstanceContext
  • Object
show all
Defined in:
lib/twilio-ruby/rest/conversations/v1/service/binding.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, chat_service_sid, sid) ⇒ BindingContext

Initialize the BindingContext

Parameters:

  • version (Version)

    Version that contains the resource

  • chat_service_sid (String)

    The SID of the Conversation Service the Binding resource is associated with.

  • sid (String)

    A 34 character string that uniquely identifies this resource.


193
194
195
196
197
198
199
# File 'lib/twilio-ruby/rest/conversations/v1/service/binding.rb', line 193

def initialize(version, chat_service_sid, sid)
  super(version)

  # Path Solution
  @solution = {chat_service_sid: chat_service_sid, sid: sid, }
  @uri = "/Services/#{@solution[:chat_service_sid]}/Bindings/#{@solution[:sid]}"
end

Instance Method Details

#deleteBoolean

Delete the BindingInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


204
205
206
# File 'lib/twilio-ruby/rest/conversations/v1/service/binding.rb', line 204

def delete
   @version.delete('DELETE', @uri)
end

#fetchBindingInstance

Fetch the BindingInstance

Returns:


211
212
213
214
215
216
217
218
219
220
# File 'lib/twilio-ruby/rest/conversations/v1/service/binding.rb', line 211

def fetch
  payload = @version.fetch('GET', @uri)

  BindingInstance.new(
      @version,
      payload,
      chat_service_sid: @solution[:chat_service_sid],
      sid: @solution[:sid],
  )
end

#inspectObject

Provide a detailed, user friendly representation


231
232
233
234
# File 'lib/twilio-ruby/rest/conversations/v1/service/binding.rb', line 231

def inspect
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Conversations.V1.BindingContext #{context}>"
end

#to_sObject

Provide a user friendly representation


224
225
226
227
# File 'lib/twilio-ruby/rest/conversations/v1/service/binding.rb', line 224

def to_s
  context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
  "#<Twilio.Conversations.V1.BindingContext #{context}>"
end