Class: Twilio::REST::IpMessaging::V2::ServiceContext::UserContext::UserBindingContext
- Inherits:
-
Twilio::REST::InstanceContext
- Object
- Twilio::REST::InstanceContext
- Twilio::REST::IpMessaging::V2::ServiceContext::UserContext::UserBindingContext
- Defined in:
- lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the UserBindingInstance.
-
#fetch ⇒ UserBindingInstance
Fetch the UserBindingInstance.
-
#initialize(version, service_sid, user_sid, sid) ⇒ UserBindingContext
constructor
Initialize the UserBindingContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
Constructor Details
#initialize(version, service_sid, user_sid, sid) ⇒ UserBindingContext
Initialize the UserBindingContext
148 149 150 151 152 153 154 155 156 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb', line 148 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
#delete ⇒ Boolean
Delete the UserBindingInstance
160 161 162 163 164 165 166 167 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb', line 160 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ UserBindingInstance
Fetch the UserBindingInstance
172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb', line 172 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) UserBindingInstance.new( @version, payload, service_sid: @solution[:service_sid], user_sid: @solution[:user_sid], sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
200 201 202 203 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb', line 200 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.IpMessaging.V2.UserBindingContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
193 194 195 196 |
# File 'lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb', line 193 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.IpMessaging.V2.UserBindingContext #{context}>" end |