Class: Twilio::REST::Conversations::V1::UserContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Conversations::V1::UserContext
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/user.rb
Instance Method Summary collapse
-
#delete(x_twilio_webhook_enabled: :unset) ⇒ Boolean
Delete the UserInstance.
-
#fetch ⇒ UserInstance
Fetch the UserInstance.
-
#initialize(version, sid) ⇒ UserContext
constructor
Initialize the UserContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, attributes: :unset, role_sid: :unset, x_twilio_webhook_enabled: :unset) ⇒ UserInstance
Update the UserInstance.
Constructor Details
#initialize(version, sid) ⇒ UserContext
Initialize the UserContext
179 180 181 182 183 184 185 |
# File 'lib/twilio-ruby/rest/conversations/v1/user.rb', line 179 def initialize(version, sid) super(version) # Path Solution @solution = {sid: sid, } @uri = "/Users/#{@solution[:sid]}" end |
Instance Method Details
#delete(x_twilio_webhook_enabled: :unset) ⇒ Boolean
Delete the UserInstance
217 218 219 220 221 |
# File 'lib/twilio-ruby/rest/conversations/v1/user.rb', line 217 def delete(x_twilio_webhook_enabled: :unset) headers = Twilio::Values.of({'X-Twilio-Webhook-Enabled' => x_twilio_webhook_enabled, }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ UserInstance
Fetch the UserInstance
226 227 228 229 230 |
# File 'lib/twilio-ruby/rest/conversations/v1/user.rb', line 226 def fetch payload = @version.fetch('GET', @uri) UserInstance.new(@version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
241 242 243 244 |
# File 'lib/twilio-ruby/rest/conversations/v1/user.rb', line 241 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Conversations.V1.UserContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
234 235 236 237 |
# File 'lib/twilio-ruby/rest/conversations/v1/user.rb', line 234 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Conversations.V1.UserContext #{context}>" end |
#update(friendly_name: :unset, attributes: :unset, role_sid: :unset, x_twilio_webhook_enabled: :unset) ⇒ UserInstance
Update the UserInstance
199 200 201 202 203 204 205 206 207 208 209 210 |
# File 'lib/twilio-ruby/rest/conversations/v1/user.rb', line 199 def update(friendly_name: :unset, attributes: :unset, role_sid: :unset, x_twilio_webhook_enabled: :unset) data = Twilio::Values.of({ 'FriendlyName' => friendly_name, 'Attributes' => attributes, 'RoleSid' => role_sid, }) headers = Twilio::Values.of({'X-Twilio-Webhook-Enabled' => x_twilio_webhook_enabled, }) payload = @version.update('POST', @uri, data: data, headers: headers) UserInstance.new(@version, payload, sid: @solution[:sid], ) end |