Class: Twilio::REST::Messaging::V1::RequestManagedCertInstance

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

Instance Method Summary collapse

Constructor Details

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

Initialize the RequestManagedCertInstance

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

  • sid (String)

    The SID of the Call resource to fetch.



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# File 'lib/twilio-ruby/rest/messaging/v1/request_managed_cert.rb', line 131

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_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
        'date_expires' => Twilio.deserialize_iso8601_datetime(payload['date_expires']),
        'domain_name' => payload['domain_name'],
        'certificate_sid' => payload['certificate_sid'],
        'url' => payload['url'],
        'managed' => payload['managed'],
        'requesting' => payload['requesting'],
    }

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

Instance Method Details

#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.



195
196
197
# File 'lib/twilio-ruby/rest/messaging/v1/request_managed_cert.rb', line 195

def certificate_sid
    @properties['certificate_sid']
end

#contextRequestManagedCertContext

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

Returns:



156
157
158
159
160
161
# File 'lib/twilio-ruby/rest/messaging/v1/request_managed_cert.rb', line 156

def context
    unless @instance_context
        @instance_context = RequestManagedCertContext.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.



177
178
179
# File 'lib/twilio-ruby/rest/messaging/v1/request_managed_cert.rb', line 177

def date_created
    @properties['date_created']
end

#date_expiresTime

Returns Date that the private certificate associated with this domain expires. This is the expiration date of your existing cert.

Returns:

  • (Time)

    Date that the private certificate associated with this domain expires. This is the expiration date of your existing cert.



183
184
185
# File 'lib/twilio-ruby/rest/messaging/v1/request_managed_cert.rb', line 183

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.



171
172
173
# File 'lib/twilio-ruby/rest/messaging/v1/request_managed_cert.rb', line 171

def date_updated
    @properties['date_updated']
end

#domain_nameString

Returns Full url path for this domain.

Returns:

  • (String)

    Full url path for this domain.



189
190
191
# File 'lib/twilio-ruby/rest/messaging/v1/request_managed_cert.rb', line 189

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.



165
166
167
# File 'lib/twilio-ruby/rest/messaging/v1/request_managed_cert.rb', line 165

def domain_sid
    @properties['domain_sid']
end

#inspectObject

Provide a detailed, user friendly representation



234
235
236
237
# File 'lib/twilio-ruby/rest/messaging/v1/request_managed_cert.rb', line 234

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

#managedBoolean

Returns A boolean flag indicating if the certificate is managed by Twilio.

Returns:

  • (Boolean)

    A boolean flag indicating if the certificate is managed by Twilio.



207
208
209
# File 'lib/twilio-ruby/rest/messaging/v1/request_managed_cert.rb', line 207

def managed
    @properties['managed']
end

#requestingBoolean

Returns A boolean flag indicating if a managed certificate needs to be fulfilled by Twilio.

Returns:

  • (Boolean)

    A boolean flag indicating if a managed certificate needs to be fulfilled by Twilio.



213
214
215
# File 'lib/twilio-ruby/rest/messaging/v1/request_managed_cert.rb', line 213

def requesting
    @properties['requesting']
end

#to_sObject

Provide a user friendly representation



227
228
229
230
# File 'lib/twilio-ruby/rest/messaging/v1/request_managed_cert.rb', line 227

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

#updateRequestManagedCertInstance

Update the RequestManagedCertInstance

Returns:



220
221
222
223
# File 'lib/twilio-ruby/rest/messaging/v1/request_managed_cert.rb', line 220

def update

    context.update
end

#urlString

Returns:

  • (String)


201
202
203
# File 'lib/twilio-ruby/rest/messaging/v1/request_managed_cert.rb', line 201

def url
    @properties['url']
end