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
Instance Method Summary collapse
-
#account_sid ⇒ String
Specifies the unique string identifier of the Account responsible for this Deployment.
-
#context ⇒ DeploymentContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
Specifies the date this Deployment was created, given in UTC ISO 8601 format.
-
#date_updated ⇒ Time
Specifies the date this Deployment was last updated, given in UTC ISO 8601 format.
-
#delete ⇒ Boolean
Delete the DeploymentInstance.
-
#fetch ⇒ DeploymentInstance
Fetch the DeploymentInstance.
-
#fleet_sid ⇒ String
Specifies the unique string identifier of the Fleet that the given Deployment belongs to.
-
#friendly_name ⇒ String
Contains a human readable descriptive text for this Deployment, up to 64 characters long.
-
#initialize(version, payload, fleet_sid: nil, sid: nil) ⇒ DeploymentInstance
constructor
Initialize the DeploymentInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
Contains a 34 character string that uniquely identifies this Deployment resource.
-
#sync_service_sid ⇒ String
Specifies the unique string identifier of the Twilio Sync service instance linked to and accessible by this Deployment.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, sync_service_sid: :unset) ⇒ DeploymentInstance
Update the DeploymentInstance.
-
#url ⇒ String
Contains an absolute URL for this Deployment resource.
Constructor Details
#initialize(version, payload, fleet_sid: nil, sid: nil) ⇒ DeploymentInstance
Initialize the DeploymentInstance
272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 272 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 || @properties['fleet_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns Specifies the unique string identifier of the Account responsible for this Deployment.
329 330 331 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 329 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
296 297 298 299 300 301 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 296 def context unless @instance_context @instance_context = DeploymentContext.new(@version , @params['fleet_sid'], @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns Specifies the date this Deployment was created, given in UTC ISO 8601 format.
341 342 343 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 341 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns Specifies the date this Deployment was last updated, given in UTC ISO 8601 format.
347 348 349 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 347 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the DeploymentInstance
354 355 356 357 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 354 def delete context.delete end |
#fetch ⇒ DeploymentInstance
Fetch the DeploymentInstance
362 363 364 365 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 362 def fetch context.fetch end |
#fleet_sid ⇒ String
Returns Specifies the unique string identifier of the Fleet that the given Deployment belongs to.
323 324 325 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 323 def fleet_sid @properties['fleet_sid'] end |
#friendly_name ⇒ String
Returns Contains a human readable descriptive text for this Deployment, up to 64 characters long.
317 318 319 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 317 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
392 393 394 395 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 392 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.DeployedDevices.DeploymentInstance #{values}>" end |
#sid ⇒ String
Returns Contains a 34 character string that uniquely identifies this Deployment resource.
305 306 307 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 305 def sid @properties['sid'] end |
#sync_service_sid ⇒ String
Returns Specifies the unique string identifier of the Twilio Sync service instance linked to and accessible by this Deployment.
335 336 337 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 335 def sync_service_sid @properties['sync_service_sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
385 386 387 388 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 385 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
372 373 374 375 376 377 378 379 380 381 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 372 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 Contains an absolute URL for this Deployment resource.
311 312 313 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb', line 311 def url @properties['url'] end |