Class: Twilio::REST::IpMessaging::V2::ServiceContext::UserContext::UserBindingContext

Inherits:
Twilio::REST::InstanceContext show all
Defined in:
lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, service_sid, user_sid, sid) ⇒ UserBindingContext

Initialize the UserBindingContext

Parameters:

  • version (Version)

    Version that contains the resource

  • service_sid (String)

    The service_sid

  • user_sid (String)

    The user_sid

  • sid (String)

    The sid


163
164
165
166
167
168
169
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb', line 163

def initialize(version, service_sid, user_sid, sid)
  super(version)

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

Instance Method Details

#deleteBoolean

Delete the UserBindingInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


189
190
191
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb', line 189

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

#fetchUserBindingInstance

Fetch the UserBindingInstance

Returns:


174
175
176
177
178
179
180
181
182
183
184
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb', line 174

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

  UserBindingInstance.new(
      @version,
      payload,
      service_sid: @solution[:service_sid],
      user_sid: @solution[:user_sid],
      sid: @solution[:sid],
  )
end

#inspectObject

Provide a detailed, user friendly representation


202
203
204
205
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb', line 202

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

#to_sObject

Provide a user friendly representation


195
196
197
198
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb', line 195

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