Class: Twilio::REST::Microvisor::V1::AccountSecretInstance

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

Instance Method Summary collapse

Constructor Details

#initialize(version, payload, key: nil) ⇒ AccountSecretInstance

Initialize the AccountSecretInstance

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

  • sid (String)

    The SID of the Call resource to fetch.



260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 260

def initialize(version, payload , key: nil)
    super(version)
    
    # Marshaled Properties
    @properties = { 
        'key' => payload['key'],
        'date_rotated' => Twilio.deserialize_iso8601_datetime(payload['date_rotated']),
        'url' => payload['url'],
    }

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

Instance Method Details

#contextAccountSecretContext

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

Returns:



279
280
281
282
283
284
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 279

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

#date_rotatedTime

Returns:

  • (Time)


294
295
296
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 294

def date_rotated
    @properties['date_rotated']
end

#deleteBoolean

Delete the AccountSecretInstance

Returns:

  • (Boolean)

    True if delete succeeds, false otherwise



307
308
309
310
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 307

def delete

    context.delete
end

#fetchAccountSecretInstance

Fetch the AccountSecretInstance

Returns:



315
316
317
318
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 315

def fetch

    context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



342
343
344
345
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 342

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

#keyString

Returns The secret key; up to 100 characters.

Returns:

  • (String)

    The secret key; up to 100 characters.



288
289
290
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 288

def key
    @properties['key']
end

#to_sObject

Provide a user friendly representation



335
336
337
338
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 335

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

#update(value: nil) ⇒ AccountSecretInstance

Update the AccountSecretInstance

Parameters:

  • value (String) (defaults to: nil)

    The secret value; up to 4096 characters.

Returns:



324
325
326
327
328
329
330
331
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 324

def update(
    value: nil
)

    context.update(
        value: value, 
    )
end

#urlString

Returns The absolute URL of the Secret.

Returns:

  • (String)

    The absolute URL of the Secret.



300
301
302
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 300

def url
    @properties['url']
end