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
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
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
@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
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
@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
@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 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
@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 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
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
@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
@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
@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
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 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
@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
@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