Class: Twilio::REST::Preview::Sync::ServiceContext::SyncMapInstance

Inherits:
InstanceResource
  • Object
show all
Defined in:
lib/twilio-ruby/rest/preview/sync/service/sync_map.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) ⇒ SyncMapInstance

Initialize the SyncMapInstance



279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 279

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



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

def 
  @properties['account_sid']
end

#contextSyncMapContext

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



305
306
307
308
309
310
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 305

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

#created_byString



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

def created_by
  @properties['created_by']
end

#date_createdTime



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

def date_created
  @properties['date_created']
end

#date_updatedTime



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

def date_updated
  @properties['date_updated']
end

#deleteBoolean

Deletes the SyncMapInstance



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

def delete
  context.delete
end

#fetchSyncMapInstance

Fetch a SyncMapInstance



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

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



409
410
411
412
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 409

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


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

def links
  @properties['links']
end

#revisionString



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

def revision
  @properties['revision']
end

#service_sidString



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

def service_sid
  @properties['service_sid']
end

#sidString



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

def sid
  @properties['sid']
end

#sync_map_itemssync_map_items

Access the sync_map_items



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

def sync_map_items
  context.sync_map_items
end

#sync_map_permissionssync_map_permissions

Access the sync_map_permissions



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

def sync_map_permissions
  context.sync_map_permissions
end

#to_sObject

Provide a user friendly representation



402
403
404
405
# File 'lib/twilio-ruby/rest/preview/sync/service/sync_map.rb', line 402

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

#unique_nameString



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

def unique_name
  @properties['unique_name']
end

#urlString



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

def url
  @properties['url']
end