Class: Twilio::REST::Preview::Sync::ServiceContext::SyncListInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/sync/service/sync_list.rb

Overview

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 [email protected]

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, service_sid: nil, sid: nil) ⇒ SyncListInstance

Initialize the SyncListInstance

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • service_sid (String) (defaults to: nil)

    The service_sid

  • sid (String) (defaults to: nil)

    The sid


266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list.rb', line 266

def initialize(version, payload, service_sid: nil, sid: nil)
  super(version)

  # Marshaled Properties
  @properties = {
      'sid' => payload['sid'],
      'unique_name' => payload['unique_name'],
      'account_sid' => payload['account_sid'],
      'service_sid' => payload['service_sid'],
      'url' => payload['url'],
      'links' => payload['links'],
      'revision' => payload['revision'],
      'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
      'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
      'created_by' => payload['created_by'],
  }

  # Context
  @instance_context = nil
  @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], }
end

Instance Method Details

#account_sidString

Returns The account_sid.

Returns:

  • (String)

    The account_sid


313
314
315
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list.rb', line 313

def 
  @properties['account_sid']
end

#contextSyncListContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:


292
293
294
295
296
297
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list.rb', line 292

def context
  unless @instance_context
    @instance_context = SyncListContext.new(@version, @params['service_sid'], @params['sid'], )
  end
  @instance_context
end

#created_byString

Returns The created_by.

Returns:

  • (String)

    The created_by


355
356
357
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list.rb', line 355

def created_by
  @properties['created_by']
end

#date_createdTime

Returns The date_created.

Returns:

  • (Time)

    The date_created


343
344
345
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list.rb', line 343

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The date_updated.

Returns:

  • (Time)

    The date_updated


349
350
351
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list.rb', line 349

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Delete the SyncListInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise


369
370
371
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list.rb', line 369

def delete
  context.delete
end

#fetchSyncListInstance

Fetch the SyncListInstance

Returns:


362
363
364
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list.rb', line 362

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation


396
397
398
399
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list.rb', line 396

def inspect
  values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Preview.Sync.SyncListInstance #{values}>"
end

Returns The links.

Returns:

  • (String)

    The links


331
332
333
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list.rb', line 331

def links
  @properties['links']
end

#revisionString

Returns The revision.

Returns:

  • (String)

    The revision


337
338
339
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list.rb', line 337

def revision
  @properties['revision']
end

#service_sidString

Returns The service_sid.

Returns:

  • (String)

    The service_sid


319
320
321
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list.rb', line 319

def service_sid
  @properties['service_sid']
end

#sidString

Returns The sid.

Returns:

  • (String)

    The sid


301
302
303
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list.rb', line 301

def sid
  @properties['sid']
end

#sync_list_itemssync_list_items

Access the sync_list_items

Returns:


376
377
378
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list.rb', line 376

def sync_list_items
  context.sync_list_items
end

#sync_list_permissionssync_list_permissions

Access the sync_list_permissions

Returns:


383
384
385
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list.rb', line 383

def sync_list_permissions
  context.sync_list_permissions
end

#to_sObject

Provide a user friendly representation


389
390
391
392
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list.rb', line 389

def to_s
  values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
  "<Twilio.Preview.Sync.SyncListInstance #{values}>"
end

#unique_nameString

Returns The unique_name.

Returns:

  • (String)

    The unique_name


307
308
309
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list.rb', line 307

def unique_name
  @properties['unique_name']
end

#urlString

Returns The url.

Returns:

  • (String)

    The url


325
326
327
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_list.rb', line 325

def url
  @properties['url']
end