class Twilio::REST::Preview::Sync::ServiceContext::SyncListContext
PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
Public Class Methods
Initialize the SyncListContext
@param [Version] version Version
that contains the resource @param [String] service_sid The service_sid @param [String] sid The sid @return [SyncListContext] SyncListContext
Twilio::REST::InstanceContext::new
# File lib/twilio-ruby/rest/preview/sync/service/sync_list.rb 169 def initialize(version, service_sid, sid) 170 super(version) 171 172 # Path Solution 173 @solution = {service_sid: service_sid, sid: sid, } 174 @uri = "/Services/#{@solution[:service_sid]}/Lists/#{@solution[:sid]}" 175 176 # Dependents 177 @sync_list_items = nil 178 @sync_list_permissions = nil 179 end
Public Instance Methods
Delete the SyncListInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/preview/sync/service/sync_list.rb 193 def delete 194 @version.delete('DELETE', @uri) 195 end
Fetch the SyncListInstance
@return [SyncListInstance] Fetched SyncListInstance
# File lib/twilio-ruby/rest/preview/sync/service/sync_list.rb 184 def fetch 185 payload = @version.fetch('GET', @uri) 186 187 SyncListInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid], ) 188 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/preview/sync/service/sync_list.rb 250 def inspect 251 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 252 "#<Twilio.Preview.Sync.SyncListContext #{context}>" 253 end
Access the sync_list_items
@return [SyncListItemList] @return [SyncListItemContext] if index was passed.
# File lib/twilio-ruby/rest/preview/sync/service/sync_list.rb 201 def sync_list_items(index=:unset) 202 raise ArgumentError, 'index cannot be nil' if index.nil? 203 204 if index != :unset 205 return SyncListItemContext.new(@version, @solution[:service_sid], @solution[:sid], index, ) 206 end 207 208 unless @sync_list_items 209 @sync_list_items = SyncListItemList.new( 210 @version, 211 service_sid: @solution[:service_sid], 212 list_sid: @solution[:sid], 213 ) 214 end 215 216 @sync_list_items 217 end
Access the sync_list_permissions
@return [SyncListPermissionList] @return [SyncListPermissionContext] if identity was passed.
# File lib/twilio-ruby/rest/preview/sync/service/sync_list.rb 223 def sync_list_permissions(identity=:unset) 224 raise ArgumentError, 'identity cannot be nil' if identity.nil? 225 226 if identity != :unset 227 return SyncListPermissionContext.new(@version, @solution[:service_sid], @solution[:sid], identity, ) 228 end 229 230 unless @sync_list_permissions 231 @sync_list_permissions = SyncListPermissionList.new( 232 @version, 233 service_sid: @solution[:service_sid], 234 list_sid: @solution[:sid], 235 ) 236 end 237 238 @sync_list_permissions 239 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/preview/sync/service/sync_list.rb 243 def to_s 244 context = @solution.map {|k, v| "#{k}: #{v}"}.join(',') 245 "#<Twilio.Preview.Sync.SyncListContext #{context}>" 246 end