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

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb

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

  • account_sid (String)

    The SID of the Account that created this Fleet resource.

  • sid (String) (defaults to: nil)

    The SID of the Call resource to fetch.



345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 345

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 Speicifies the unique string identifier of the Account responsible for this Fleet.

Returns:

  • (String)

    Speicifies the unique string identifier of the Account responsible for this Fleet.



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

def 
    @properties['account_sid']
end

#certificatescertificates

Access the certificates

Returns:



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

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:



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

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

#date_createdTime

Returns Specifies the date this Fleet was created, given in UTC ISO 8601 format.

Returns:

  • (Time)

    Specifies the date this Fleet was created, given in UTC ISO 8601 format.



415
416
417
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 415

def date_created
    @properties['date_created']
end

#date_updatedTime

Returns Specifies the date this Fleet was last updated, given in UTC ISO 8601 format.

Returns:

  • (Time)

    Specifies the date this Fleet was last updated, given in UTC ISO 8601 format.



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

def date_updated
    @properties['date_updated']
end

#default_deployment_sidString

Returns Contains the string identifier of the automatically provisioned default Deployment of this Fleet.

Returns:

  • (String)

    Contains the string identifier of the automatically provisioned default Deployment of this Fleet.



409
410
411
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 409

def default_deployment_sid
    @properties['default_deployment_sid']
end

#deleteBoolean

Delete the FleetInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



434
435
436
437
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 434

def delete

    context.delete
end

#deploymentsdeployments

Access the deployments

Returns:



487
488
489
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 487

def deployments
    context.deployments
end

#devicesdevices

Access the devices

Returns:



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

def devices
    context.devices
end

#fetchFleetInstance

Fetch the FleetInstance

Returns:



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

def fetch

    context.fetch
end

#friendly_nameString

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

Returns:

  • (String)

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



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

def friendly_name
    @properties['friendly_name']
end

#inspectObject

Provide a detailed, user friendly representation



500
501
502
503
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 500

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

#keyskeys

Access the keys

Returns:



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

def keys
    context.keys
end

Returns Contains a dictionary of URL links to nested resources of this Fleet.

Returns:

  • (Hash)

    Contains a dictionary of URL links to nested resources of this Fleet.



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

def links
    @properties['links']
end

#sidString

Returns Contains a 34 character string that uniquely identifies this Fleet resource.

Returns:

  • (String)

    Contains a 34 character string that uniquely identifies this Fleet resource.



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

def sid
    @properties['sid']
end

#to_sObject

Provide a user friendly representation



493
494
495
496
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 493

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

#unique_nameString

Returns Contains a unique and addressable name of this Fleet, e.g. ‘default’, up to 128 characters long.

Returns:

  • (String)

    Contains a unique and addressable name of this Fleet, e.g. ‘default’, up to 128 characters long.



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

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:



452
453
454
455
456
457
458
459
460
461
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb', line 452

def update(
    friendly_name: :unset, 
    default_deployment_sid: :unset
)

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

#urlString

Returns Contains an absolute URL for this Fleet resource.

Returns:

  • (String)

    Contains an absolute URL for this Fleet resource.



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

def url
    @properties['url']
end