Class: Twilio::REST::Sync::V1::ServiceContext::SyncListContext::SyncListPermissionContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Sync::V1::ServiceContext::SyncListContext::SyncListPermissionContext
- Defined in:
- lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb
Overview
PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
Instance Method Summary collapse
-
#delete ⇒ Boolean
Delete the SyncListPermissionInstance.
-
#fetch ⇒ SyncListPermissionInstance
Fetch the SyncListPermissionInstance.
-
#initialize(version, service_sid, list_sid, identity) ⇒ SyncListPermissionContext
constructor
Initialize the SyncListPermissionContext.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(read: nil, write: nil, manage: nil) ⇒ SyncListPermissionInstance
Update the SyncListPermissionInstance.
Constructor Details
#initialize(version, service_sid, list_sid, identity) ⇒ SyncListPermissionContext
Initialize the SyncListPermissionContext
172 173 174 175 176 177 178 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 172 def initialize(version, service_sid, list_sid, identity) super(version) # Path Solution @solution = {service_sid: service_sid, list_sid: list_sid, identity: identity, } @uri = "/Services/#{@solution[:service_sid]}/Lists/#{@solution[:list_sid]}/Permissions/#{@solution[:identity]}" end |
Instance Method Details
#delete ⇒ Boolean
Delete the SyncListPermissionInstance
198 199 200 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 198 def delete @version.delete('DELETE', @uri) end |
#fetch ⇒ SyncListPermissionInstance
Fetch the SyncListPermissionInstance
183 184 185 186 187 188 189 190 191 192 193 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 183 def fetch payload = @version.fetch('GET', @uri) SyncListPermissionInstance.new( @version, payload, service_sid: @solution[:service_sid], list_sid: @solution[:list_sid], identity: @solution[:identity], ) end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
234 235 236 237 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 234 def inspect context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Sync.V1.SyncListPermissionContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
227 228 229 230 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 227 def to_s context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Sync.V1.SyncListPermissionContext #{context}>" end |
#update(read: nil, write: nil, manage: nil) ⇒ SyncListPermissionInstance
Update the SyncListPermissionInstance
211 212 213 214 215 216 217 218 219 220 221 222 223 |
# File 'lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb', line 211 def update(read: nil, write: nil, manage: nil) data = Twilio::Values.of({'Read' => read, 'Write' => write, 'Manage' => manage, }) payload = @version.update('POST', @uri, data: data) SyncListPermissionInstance.new( @version, payload, service_sid: @solution[:service_sid], list_sid: @solution[:list_sid], identity: @solution[:identity], ) end |