Class: Twilio::REST::Messaging::V1::DomainCertsInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/messaging/v1/domain_certs.rb

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, domain_sid: nil) ⇒ DomainCertsInstance

Initialize the DomainCertsInstance

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 DomainCerts resource.

  • sid (String)

    The SID of the Call resource to fetch.



356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 356

def initialize(version, payload , domain_sid: nil)
    super(version)
    
    
    # Marshaled Properties
    @properties = { 
        'domain_sid' => payload['domain_sid'],
        'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
        'date_expires' => Twilio.deserialize_iso8601_datetime(payload['date_expires']),
        'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'domain_name' => payload['domain_name'],
        'certificate_sid' => payload['certificate_sid'],
        'url' => payload['url'],
        'cert_in_validation' => payload['cert_in_validation'],
    }

    # Context
    @instance_context = nil
    @params = { 'domain_sid' => domain_sid  || @properties['domain_sid']  , }
end

Instance Method Details

#cert_in_validationHash

Returns Optional JSON field describing the status and upload date of a new certificate in the process of validation.

Returns:

  • (Hash)

    Optional JSON field describing the status and upload date of a new certificate in the process of validation



432
433
434
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 432

def cert_in_validation
    @properties['cert_in_validation']
end

#certificate_sidString

Returns The unique string that we created to identify this Certificate resource.

Returns:

  • (String)

    The unique string that we created to identify this Certificate resource.



420
421
422
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 420

def certificate_sid
    @properties['certificate_sid']
end

#contextDomainCertsContext

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context

Returns:



381
382
383
384
385
386
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 381

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

#date_createdTime

Returns Date that this Domain was registered to the Twilio platform to create a new Domain object.

Returns:

  • (Time)

    Date that this Domain was registered to the Twilio platform to create a new Domain object.



408
409
410
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 408

def date_created
    @properties['date_created']
end

#date_expiresTime

Returns Date that the private certificate associated with this domain expires. You will need to update the certificate before that date to ensure your shortened links will continue to work.

Returns:

  • (Time)

    Date that the private certificate associated with this domain expires. You will need to update the certificate before that date to ensure your shortened links will continue to work.



402
403
404
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 402

def date_expires
    @properties['date_expires']
end

#date_updatedTime

Returns Date that this Domain was last updated.

Returns:

  • (Time)

    Date that this Domain was last updated.



396
397
398
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 396

def date_updated
    @properties['date_updated']
end

#deleteBoolean

Delete the DomainCertsInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



439
440
441
442
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 439

def delete

    context.delete
end

#domain_nameString

Returns Full url path for this domain.

Returns:

  • (String)

    Full url path for this domain.



414
415
416
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 414

def domain_name
    @properties['domain_name']
end

#domain_sidString

Returns The unique string that we created to identify the Domain resource.

Returns:

  • (String)

    The unique string that we created to identify the Domain resource.



390
391
392
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 390

def domain_sid
    @properties['domain_sid']
end

#fetchDomainCertsInstance

Fetch the DomainCertsInstance

Returns:



447
448
449
450
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 447

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



474
475
476
477
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 474

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

#to_sObject

Provide a user friendly representation



467
468
469
470
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 467

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

#update(tls_cert: nil) ⇒ DomainCertsInstance

Update the DomainCertsInstance

Parameters:

  • tls_cert (String) (defaults to: nil)

    Contains the full TLS certificate and private for this domain in PEM format: en.wikipedia.org/wiki/Privacy-Enhanced_Mail. Twilio uses this information to process HTTPS traffic sent to your domain.

Returns:



456
457
458
459
460
461
462
463
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 456

def update(
    tls_cert: nil
)

    context.update(
        tls_cert: tls_cert, 
    )
end

#urlString

Returns:

  • (String)


426
427
428
# File 'lib/twilio-ruby/rest/messaging/v1/domain_certs.rb', line 426

def url
    @properties['url']
end