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

Parameters:

  • version (Version)

    Version that contains the resource

  • payload (Hash)

    payload that contains response from Twilio

  • sid (String) (defaults to: nil)

    Provides a 34 character string that uniquely identifies the requested Fleet resource.



330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 330

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

Returns The unique SID that identifies this Account.

Returns:

  • (String)

    The unique SID that identifies this Account.



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

def 
  @properties['account_sid']
end

#certificatescertificates

Access the certificates

Returns:



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

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

Returns:



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

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

#date_createdTime

Returns The date this Fleet was created.

Returns:

  • (Time)

    The date this Fleet was created.



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

def date_created
  @properties['date_created']
end

#date_updatedTime

Returns The date this Fleet was updated.

Returns:

  • (Time)

    The date this Fleet was updated.



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

def date_updated
  @properties['date_updated']
end

#default_deployment_sidString

Returns The unique SID that identifies this Fleet’s default Deployment.

Returns:

  • (String)

    The unique SID that identifies this Fleet’s default Deployment.



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

def default_deployment_sid
  @properties['default_deployment_sid']
end

#deleteBoolean

Deletes the FleetInstance

Returns:

  • (Boolean)

    true if delete succeeds, true otherwise



426
427
428
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 426

def delete
  context.delete
end

#deploymentsdeployments

Access the deployments

Returns:



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

def deployments
  context.deployments
end

#devicesdevices

Access the devices

Returns:



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

def devices
  context.devices
end

#fetchFleetInstance

Fetch a FleetInstance

Returns:



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

def fetch
  context.fetch
end

#friendly_nameString

Returns A human readable description for this Fleet.

Returns:

  • (String)

    A human readable description for this Fleet.



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

def friendly_name
  @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



478
479
480
481
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 478

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

#keyskeys

Access the keys

Returns:



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

def keys
  context.keys
end

Returns Nested resource URLs.

Returns:

  • (String)

    Nested resource URLs.



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

def links
  @properties['links']
end

#sidString

Returns A string that uniquely identifies this Fleet.

Returns:

  • (String)

    A string that uniquely identifies this Fleet.



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

def sid
  @properties['sid']
end

#to_sObject

Provide a user friendly representation



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

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

#unique_nameString

Returns A unique, addressable name of this Fleet.

Returns:

  • (String)

    A unique, addressable name of this Fleet.



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

def unique_name
  @properties['unique_name']
end

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

Update the FleetInstance

Parameters:

  • friendly_name (String) (defaults to: :unset)

    Provides a human readable descriptive text for this Fleet, up to 256 characters long.

  • default_deployment_sid (String) (defaults to: :unset)

    Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet.

Returns:



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

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

#urlString

Returns URL of this Fleet.

Returns:

  • (String)

    URL of this Fleet.



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

def url
  @properties['url']
end