Class: Twilio::REST::Preview::Sync::ServiceContext::SyncListContext::SyncListPermissionContext
- Inherits:
-
InstanceContext
- Object
- InstanceContext
- Twilio::REST::Preview::Sync::ServiceContext::SyncListContext::SyncListPermissionContext
- Defined in:
- lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb
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
141 142 143 144 145 146 147 148 149 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 141 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
153 154 155 156 157 158 159 160 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 153 def delete headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) @version.delete('DELETE', @uri, headers: headers) end |
#fetch ⇒ SyncListPermissionInstance
Fetch the SyncListPermissionInstance
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 165 def fetch headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.fetch('GET', @uri, headers: headers) 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
227 228 229 230 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 227 def inspect context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.Sync.SyncListPermissionContext #{context}>" end |
#to_s ⇒ Object
Provide a user friendly representation
220 221 222 223 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 220 def to_s context = @solution.map{|k, v| "#{k}: #{v}"}.join(',') "#<Twilio.Preview.Sync.SyncListPermissionContext #{context}>" end |
#update(read: nil, write: nil, manage: nil) ⇒ SyncListPermissionInstance
Update the SyncListPermissionInstance
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 |
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb', line 189 def update( read: nil, write: nil, manage: nil ) data = Twilio::Values.of({ 'Read' => read, 'Write' => write, 'Manage' => manage, }) headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', }) payload = @version.update('POST', @uri, data: data, headers: headers) SyncListPermissionInstance.new( @version, payload, service_sid: @solution[:service_sid], list_sid: @solution[:list_sid], identity: @solution[:identity], ) end |