Class: Twilio::REST::Preview::DeployedDevices::FleetContext::CertificateInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Preview::DeployedDevices::FleetContext::CertificateInstance
- Defined in:
- lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb
Instance Method Summary collapse
-
#account_sid ⇒ String
Specifies the unique string identifier of the Account responsible for this Certificate credential.
-
#context ⇒ CertificateContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
Specifies the date this Certificate credential was created, given in UTC ISO 8601 format.
-
#date_updated ⇒ Time
Specifies the date this Certificate credential was last updated, given in UTC ISO 8601 format.
-
#delete ⇒ Boolean
Delete the CertificateInstance.
-
#device_sid ⇒ String
Specifies the unique string identifier of a Device authenticated with this Certificate credential.
-
#fetch ⇒ CertificateInstance
Fetch the CertificateInstance.
-
#fleet_sid ⇒ String
Specifies the unique string identifier of the Fleet that the given Certificate credential belongs to.
-
#friendly_name ⇒ String
Contains a human readable descriptive text for this Certificate credential, up to 256 characters long.
-
#initialize(version, payload, fleet_sid: nil, sid: nil) ⇒ CertificateInstance
constructor
Initialize the CertificateInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#sid ⇒ String
Contains a 34 character string that uniquely identifies this Certificate credential resource.
-
#thumbprint ⇒ String
Contains a unique hash of the payload of this Certificate credential, used to authenticate the Device.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#update(friendly_name: :unset, device_sid: :unset) ⇒ CertificateInstance
Update the CertificateInstance.
-
#url ⇒ String
Contains an absolute URL for this Certificate credential resource.
Constructor Details
#initialize(version, payload, fleet_sid: nil, sid: nil) ⇒ CertificateInstance
Initialize the CertificateInstance
280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 280 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'], 'device_sid' => payload['device_sid'], 'thumbprint' => payload['thumbprint'], '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 Certificate credential.
338 339 340 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 338 def account_sid @properties['account_sid'] end |
#context ⇒ CertificateContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
305 306 307 308 309 310 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 305 def context unless @instance_context @instance_context = CertificateContext.new(@version , @params['fleet_sid'], @params['sid']) end @instance_context end |
#date_created ⇒ Time
Returns Specifies the date this Certificate credential was created, given in UTC ISO 8601 format.
356 357 358 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 356 def date_created @properties['date_created'] end |
#date_updated ⇒ Time
Returns Specifies the date this Certificate credential was last updated, given in UTC ISO 8601 format.
362 363 364 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 362 def date_updated @properties['date_updated'] end |
#delete ⇒ Boolean
Delete the CertificateInstance
369 370 371 372 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 369 def delete context.delete end |
#device_sid ⇒ String
Returns Specifies the unique string identifier of a Device authenticated with this Certificate credential.
344 345 346 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 344 def device_sid @properties['device_sid'] end |
#fetch ⇒ CertificateInstance
Fetch the CertificateInstance
377 378 379 380 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 377 def fetch context.fetch end |
#fleet_sid ⇒ String
Returns Specifies the unique string identifier of the Fleet that the given Certificate credential belongs to.
332 333 334 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 332 def fleet_sid @properties['fleet_sid'] end |
#friendly_name ⇒ String
Returns Contains a human readable descriptive text for this Certificate credential, up to 256 characters long.
326 327 328 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 326 def friendly_name @properties['friendly_name'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
407 408 409 410 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 407 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.DeployedDevices.CertificateInstance #{values}>" end |
#sid ⇒ String
Returns Contains a 34 character string that uniquely identifies this Certificate credential resource.
314 315 316 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 314 def sid @properties['sid'] end |
#thumbprint ⇒ String
Returns Contains a unique hash of the payload of this Certificate credential, used to authenticate the Device.
350 351 352 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 350 def thumbprint @properties['thumbprint'] end |
#to_s ⇒ Object
Provide a user friendly representation
400 401 402 403 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 400 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Preview.DeployedDevices.CertificateInstance #{values}>" end |
#update(friendly_name: :unset, device_sid: :unset) ⇒ CertificateInstance
Update the CertificateInstance
387 388 389 390 391 392 393 394 395 396 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 387 def update( friendly_name: :unset, device_sid: :unset ) context.update( friendly_name: friendly_name, device_sid: device_sid, ) end |
#url ⇒ String
Returns Contains an absolute URL for this Certificate credential resource.
320 321 322 |
# File 'lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb', line 320 def url @properties['url'] end |