class Twilio::REST::Serverless::V1::ServiceContext::EnvironmentContext::VariableInstance

PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.

Public Class Methods

new(version, payload, service_sid: nil, environment_sid: nil, sid: nil) click to toggle source

Initialize the VariableInstance @param [Version] version Version that contains the resource @param [Hash] payload payload that contains response from Twilio @param [String] service_sid The SID of the Service that the Variable resource is

associated with.

@param [String] environment_sid The SID of the Environment in which the Variable

exists.

@param [String] sid The SID of the Variable resource to fetch. @return [VariableInstance] VariableInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb
268 def initialize(version, payload, service_sid: nil, environment_sid: nil, sid: nil)
269   super(version)
270 
271   # Marshaled Properties
272   @properties = {
273       'sid' => payload['sid'],
274       'account_sid' => payload['account_sid'],
275       'service_sid' => payload['service_sid'],
276       'environment_sid' => payload['environment_sid'],
277       'key' => payload['key'],
278       'value' => payload['value'],
279       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
280       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
281       'url' => payload['url'],
282   }
283 
284   # Context
285   @instance_context = nil
286   @params = {
287       'service_sid' => service_sid,
288       'environment_sid' => environment_sid,
289       'sid' => sid || @properties['sid'],
290   }
291 end

Public Instance Methods

account_sid() click to toggle source

@return [String] The SID of the Account that created the Variable resource

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb
317 def account_sid
318   @properties['account_sid']
319 end
context() click to toggle source

Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context @return [VariableContext] VariableContext for this VariableInstance

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb
297 def context
298   unless @instance_context
299     @instance_context = VariableContext.new(
300         @version,
301         @params['service_sid'],
302         @params['environment_sid'],
303         @params['sid'],
304     )
305   end
306   @instance_context
307 end
date_created() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the Variable resource was created

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb
347 def date_created
348   @properties['date_created']
349 end
date_updated() click to toggle source

@return [Time] The ISO 8601 date and time in GMT when the Variable resource was last updated

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb
353 def date_updated
354   @properties['date_updated']
355 end
delete() click to toggle source

Delete the VariableInstance @return [Boolean] true if delete succeeds, false otherwise

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb
384 def delete
385   context.delete
386 end
environment_sid() click to toggle source

@return [String] The SID of the Environment in which the Variable exists

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb
329 def environment_sid
330   @properties['environment_sid']
331 end
fetch() click to toggle source

Fetch the VariableInstance @return [VariableInstance] Fetched VariableInstance

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb
366 def fetch
367   context.fetch
368 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb
397 def inspect
398   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
399   "<Twilio.Serverless.V1.VariableInstance #{values}>"
400 end
key() click to toggle source

@return [String] A string by which the Variable resource can be referenced

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb
335 def key
336   @properties['key']
337 end
service_sid() click to toggle source

@return [String] The SID of the Service that the Variable resource is associated with

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb
323 def service_sid
324   @properties['service_sid']
325 end
sid() click to toggle source

@return [String] The unique string that identifies the Variable resource

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb
311 def sid
312   @properties['sid']
313 end
to_s() click to toggle source

Provide a user friendly representation

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb
390 def to_s
391   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
392   "<Twilio.Serverless.V1.VariableInstance #{values}>"
393 end
update(key: :unset, value: :unset) click to toggle source

Update the VariableInstance @param [String] key A string by which the Variable resource can be referenced.

It can be a maximum of 128 characters.

@param [String] value A string that contains the actual value of the Variable.

It can be a maximum of 450 bytes in size.

@return [VariableInstance] Updated VariableInstance

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb
377 def update(key: :unset, value: :unset)
378   context.update(key: key, value: value, )
379 end
url() click to toggle source

@return [String] The absolute URL of the Variable resource

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb
359 def url
360   @properties['url']
361 end
value() click to toggle source

@return [String] A string that contains the actual value of the Variable

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/variable.rb
341 def value
342   @properties['value']
343 end