class Twilio::REST::IpMessaging::V2::CredentialInstance
Public Class Methods
Initialize the CredentialInstance
@param [Version] version Version
that contains the resource @param [Hash] payload payload that contains response from Twilio
@param [String] sid The sid @return [CredentialInstance] CredentialInstance
Twilio::REST::InstanceResource::new
# File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb 244 def initialize(version, payload, sid: nil) 245 super(version) 246 247 # Marshaled Properties 248 @properties = { 249 'sid' => payload['sid'], 250 'account_sid' => payload['account_sid'], 251 'friendly_name' => payload['friendly_name'], 252 'type' => payload['type'], 253 'sandbox' => payload['sandbox'], 254 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 255 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']), 256 'url' => payload['url'], 257 } 258 259 # Context 260 @instance_context = nil 261 @params = {'sid' => sid || @properties['sid'], } 262 end
Public Instance Methods
@return [String] The account_sid
# File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb 283 def account_sid 284 @properties['account_sid'] 285 end
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [CredentialContext] CredentialContext
for this CredentialInstance
# File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb 268 def context 269 unless @instance_context 270 @instance_context = CredentialContext.new(@version, @params['sid'], ) 271 end 272 @instance_context 273 end
@return [Time] The date_created
# File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb 307 def date_created 308 @properties['date_created'] 309 end
@return [Time] The date_updated
# File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb 313 def date_updated 314 @properties['date_updated'] 315 end
Delete the CredentialInstance
@return [Boolean] true if delete succeeds, false otherwise
# File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb 353 def delete 354 context.delete 355 end
Fetch the CredentialInstance
@return [CredentialInstance] Fetched CredentialInstance
# File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb 326 def fetch 327 context.fetch 328 end
@return [String] The friendly_name
# File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb 289 def friendly_name 290 @properties['friendly_name'] 291 end
Provide a detailed, user friendly representation
# File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb 366 def inspect 367 values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") 368 "<Twilio.IpMessaging.V2.CredentialInstance #{values}>" 369 end
@return [String] The sandbox
# File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb 301 def sandbox 302 @properties['sandbox'] 303 end
@return [String] The sid
# File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb 277 def sid 278 @properties['sid'] 279 end
Provide a user friendly representation
# File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb 359 def to_s 360 values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") 361 "<Twilio.IpMessaging.V2.CredentialInstance #{values}>" 362 end
@return [credential.PushService] The type
# File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb 295 def type 296 @properties['type'] 297 end
Update the CredentialInstance
@param [String] friendly_name
The friendly_name
@param [String] certificate The certificate @param [String] private_key The private_key @param [Boolean] sandbox The sandbox @param [String] api_key The api_key @param [String] secret The secret @return [CredentialInstance] Updated CredentialInstance
# File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb 339 def update(friendly_name: :unset, certificate: :unset, private_key: :unset, sandbox: :unset, api_key: :unset, secret: :unset) 340 context.update( 341 friendly_name: friendly_name, 342 certificate: certificate, 343 private_key: private_key, 344 sandbox: sandbox, 345 api_key: api_key, 346 secret: secret, 347 ) 348 end
@return [String] The url
# File lib/twilio-ruby/rest/ip_messaging/v2/credential.rb 319 def url 320 @properties['url'] 321 end