Class: Twilio::REST::Preview::DeployedDevices::FleetInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/preview/deployed_devices/fleet.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, sid: nil) ⇒ FleetInstance

Initialize the FleetInstance



323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 323

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

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

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

Instance Method Details

#account_sidString



381
382
383
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 381

def 
  @properties['account_sid']
end

#certificatescertificates

Access the certificates



451
452
453
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 451

def certificates
  context.certificates
end

#contextFleetContext

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



348
349
350
351
352
353
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 348

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

#date_createdTime



393
394
395
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 393

def date_created
  @properties['date_created']
end

#date_updatedTime



399
400
401
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 399

def date_updated
  @properties['date_updated']
end

#default_deployment_sidString



387
388
389
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 387

def default_deployment_sid
  @properties['default_deployment_sid']
end

#deleteBoolean

Deletes the FleetInstance



419
420
421
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 419

def delete
  context.delete
end

#deploymentsdeployments

Access the deployments



444
445
446
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 444

def deployments
  context.deployments
end

#devicesdevices

Access the devices



437
438
439
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 437

def devices
  context.devices
end

#fetchFleetInstance

Fetch a FleetInstance



412
413
414
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 412

def fetch
  context.fetch
end

#friendly_nameString



375
376
377
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 375

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



471
472
473
474
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 471

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

#keyskeys

Access the keys



458
459
460
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 458

def keys
  context.keys
end


405
406
407
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 405

def links
  @properties['links']
end

#sidString



357
358
359
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 357

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



464
465
466
467
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 464

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

#unique_nameString



369
370
371
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 369

def unique_name
  @properties['unique_name']
end

#update(friendly_name: :unset, default_deployment_sid: :unset) ⇒ FleetInstance

Update the FleetInstance



430
431
432
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 430

def update(friendly_name: :unset, default_deployment_sid: :unset)
  context.update(friendly_name: friendly_name, default_deployment_sid: default_deployment_sid, )
end

#urlString



363
364
365
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 363

def url
  @properties['url']
end