Class: Twilio::REST::Messaging::V2::DomainCertsInstance

Inherits:
InstanceResource show all
Defined in:
lib/twilio-ruby/rest/messaging/v2/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.



207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
# File 'lib/twilio-ruby/rest/messaging/v2/domain_certs.rb', line 207

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'],
        'managed' => payload['managed'],
        'requesting' => payload['requesting'],
        '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_validation ⇒ Hash

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



297
298
299
# File 'lib/twilio-ruby/rest/messaging/v2/domain_certs.rb', line 297

def cert_in_validation
    @properties['cert_in_validation']
end

#certificate_sid ⇒ String

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.



273
274
275
# File 'lib/twilio-ruby/rest/messaging/v2/domain_certs.rb', line 273

def certificate_sid
    @properties['certificate_sid']
end

#context ⇒ DomainCertsContext

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

Returns:



234
235
236
237
238
239
# File 'lib/twilio-ruby/rest/messaging/v2/domain_certs.rb', line 234

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

#date_created ⇒ Time

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.



261
262
263
# File 'lib/twilio-ruby/rest/messaging/v2/domain_certs.rb', line 261

def date_created
    @properties['date_created']
end

#date_expires ⇒ Time

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.



255
256
257
# File 'lib/twilio-ruby/rest/messaging/v2/domain_certs.rb', line 255

def date_expires
    @properties['date_expires']
end

#date_updated ⇒ Time

Returns Date that this Domain was last updated.

Returns:

  • (Time) —

    Date that this Domain was last updated.



249
250
251
# File 'lib/twilio-ruby/rest/messaging/v2/domain_certs.rb', line 249

def date_updated
    @properties['date_updated']
end

#domain_name ⇒ String

Returns Full url path for this domain.

Returns:

  • (String) —

    Full url path for this domain.



267
268
269
# File 'lib/twilio-ruby/rest/messaging/v2/domain_certs.rb', line 267

def domain_name
    @properties['domain_name']
end

#domain_sid ⇒ String

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.



243
244
245
# File 'lib/twilio-ruby/rest/messaging/v2/domain_certs.rb', line 243

def domain_sid
    @properties['domain_sid']
end

#fetch ⇒ DomainCertsInstance

Fetch the DomainCertsInstance

Returns:



304
305
306
307
# File 'lib/twilio-ruby/rest/messaging/v2/domain_certs.rb', line 304

def fetch

    context.fetch
end

#inspect ⇒ Object

Provide a detailed, user friendly representation



318
319
320
321
# File 'lib/twilio-ruby/rest/messaging/v2/domain_certs.rb', line 318

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

#managed ⇒ Boolean

Returns Boolean field that indicates whether the certificate is managed by Twilio or uploaded by the customer.

Returns:

  • (Boolean) —

    Boolean field that indicates whether the certificate is managed by Twilio or uploaded by the customer.



279
280
281
# File 'lib/twilio-ruby/rest/messaging/v2/domain_certs.rb', line 279

def managed
    @properties['managed']
end

#requesting ⇒ Boolean

Returns Boolean field that indicates whether a Twilio managed cert request is in progress or completed. True indicates a request is in progress and false indicates the request has completed or not requested yet.

Returns:

  • (Boolean) —

    Boolean field that indicates whether a Twilio managed cert request is in progress or completed. True indicates a request is in progress and false indicates the request has completed or not requested yet.



285
286
287
# File 'lib/twilio-ruby/rest/messaging/v2/domain_certs.rb', line 285

def requesting
    @properties['requesting']
end

#to_s ⇒ Object

Provide a user friendly representation



311
312
313
314
# File 'lib/twilio-ruby/rest/messaging/v2/domain_certs.rb', line 311

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

#url ⇒ String

Returns:

  • (String)


291
292
293
# File 'lib/twilio-ruby/rest/messaging/v2/domain_certs.rb', line 291

def url
    @properties['url']
end