Class: Twilio::REST::Preview::DeployedDevices::FleetContext::DeploymentInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Preview::DeployedDevices::FleetContext::DeploymentInstance
- Defined in:
- lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.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
-
#account_sid ⇒ String
The unique SID that identifies this Account.
-
#context ⇒ DeploymentContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date this Deployment was created.
-
#date_updated ⇒ Time
The date this Deployment was updated.
-
#delete ⇒ Boolean
Deletes the DeploymentInstance.
-
#fetch ⇒ DeploymentInstance
Fetch a DeploymentInstance.
-
#fleet_sid ⇒ String
The unique identifier of the Fleet.
-
#friendly_name ⇒ String
A human readable description for this Deployment.
-
#initialize(version, payload, fleet_sid: nil, sid: nil) ⇒ DeploymentInstance
constructor
Initialize the DeploymentInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
A string that uniquely identifies this Deployment.
-
#sync_service_sid ⇒ String
The unique identifier of the Sync service instance.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, sync_service_sid: :unset) ⇒ DeploymentInstance
Update the DeploymentInstance.
-
#url ⇒ String
URL of this Deployment.
Constructor Details
#initialize(version, payload, fleet_sid: nil, sid: nil) ⇒ DeploymentInstance
Initialize the DeploymentInstance
286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 286 def initialize(version, payload, fleet_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'url' => payload['url'], 'friendly_name' => payload['friendly_name'], 'fleet_sid' => payload['fleet_sid'], 'account_sid' => payload['account_sid'], 'sync_service_sid' => payload['sync_service_sid'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), } # Context @instance_context = nil @params = { 'fleet_sid' => fleet_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns The unique SID that identifies this Account.
350 351 352 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 350 def account_sid @properties['account_sid'] end |
#context ⇒ DeploymentContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
313 314 315 316 317 318 319 320 321 322 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 313 def context unless @instance_context @instance_context = DeploymentContext.new( @version, @params['fleet_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date this Deployment was created.
362 363 364 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 362 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns The date this Deployment was updated.
368 369 370 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 368 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Deletes the DeploymentInstance
382 383 384 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 382 def delete context.delete end |
#fetch ⇒ DeploymentInstance
Fetch a DeploymentInstance
375 376 377 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 375 def fetch context.fetch end |
#fleet_sid ⇒ String
Returns The unique identifier of the Fleet.
344 345 346 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 344 def fleet_sid @properties['fleet_sid'] end |
#friendly_name ⇒ String
Returns A human readable description for this Deployment.
338 339 340 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 338 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
410 411 412 413 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 410 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.DeployedDevices.DeploymentInstance #{values}>" end |
#sid ⇒ String
Returns A string that uniquely identifies this Deployment.
326 327 328 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 326 def sid @properties['sid'] end |
#sync_service_sid ⇒ String
Returns The unique identifier of the Sync service instance.
356 357 358 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 356 def sync_service_sid @properties['sync_service_sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
403 404 405 406 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 403 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.DeployedDevices.DeploymentInstance #{values}>" end |
#update(friendly_name: :unset, sync_service_sid: :unset) ⇒ DeploymentInstance
Update the DeploymentInstance
394 395 396 397 398 399 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 394 def update(friendly_name: :unset, sync_service_sid: :unset) context.update( friendly_name: friendly_name, sync_service_sid: sync_service_sid, ) end |
#url ⇒ String
Returns URL of this Deployment.
332 333 334 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 332 def url @properties['url'] end |