Class: Twilio::REST::Conversations::V1::RoleContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Conversations::V1::RoleContext
- Defined in:
- lib/twilio-ruby/rest/conversations/v1/role.rb
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the RoleInstance.
-
#fetch ⇒ RoleInstance
Fetch the RoleInstance.
-
#initialize(version, sid) ⇒ RoleContext
constructor
Initialize the RoleContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(permission: nil) ⇒ RoleInstance
Update the RoleInstance.
Constructor Details
#initialize(version, sid) ⇒ RoleContext
Initialize the RoleContext
173 174 175 176 177 178 179 |
# File 'lib/twilio-ruby/rest/conversations/v1/role.rb', line 173 def initialize(version, sid) super(version) # Path Solution @solution = {sid: sid, } @uri = "/Roles/#{@solution[:sid]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the RoleInstance
201 202 203 |
# File 'lib/twilio-ruby/rest/conversations/v1/role.rb', line 201 def delete @version.delete('DELETE', @uri) end |
#fetch ⇒ RoleInstance
Fetch the RoleInstance
208 209 210 211 212 |
# File 'lib/twilio-ruby/rest/conversations/v1/role.rb', line 208 def fetch payload = @version.fetch('GET', @uri) RoleInstance.new(@version, payload, sid: @solution[:sid], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
223 224 225 226 |
# File 'lib/twilio-ruby/rest/conversations/v1/role.rb', line 223 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Conversations.V1.RoleContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
216 217 218 219 |
# File 'lib/twilio-ruby/rest/conversations/v1/role.rb', line 216 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Conversations.V1.RoleContext #{context}>" end |
#update(permission: nil) ⇒ RoleInstance
Update the RoleInstance
190 191 192 193 194 195 196 |
# File 'lib/twilio-ruby/rest/conversations/v1/role.rb', line 190 def update(permission: nil) data = Twilio::Values.of({'Permission' => Twilio.serialize_list() { |e| e }, }) payload = @version.update('POST', @uri, data: data) RoleInstance.new(@version, payload, sid: @solution[:sid], ) end |