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

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

Overview

PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact [email protected].

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

  • key (String) (defaults to: nil)

    The secret key; up to 100 characters.



227
228
229
230
231
232
233
234
235
236
237
238
239
240
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 227

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:



246
247
248
249
250
251
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 246

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

#date_rotatedTime

Returns The date_rotated.

Returns:

  • (Time)

    The date_rotated



261
262
263
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 261

def date_rotated
  @properties['date_rotated']
end

#deleteBoolean

Delete the AccountSecretInstance

Returns:

  • (Boolean)

    true if delete succeeds, false otherwise



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

def delete
  context.delete
end

#fetchAccountSecretInstance

Fetch the AccountSecretInstance

Returns:



274
275
276
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 274

def fetch
  context.fetch
end

#inspectObject

Provide a detailed, user friendly representation



302
303
304
305
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 302

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

#keyString

Returns The secret key.

Returns:

  • (String)

    The secret key.



255
256
257
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 255

def key
  @properties['key']
end

#to_sObject

Provide a user friendly representation



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

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:



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

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.



267
268
269
# File 'lib/twilio-ruby/rest/microvisor/v1/account_secret.rb', line 267

def url
  @properties['url']
end