class Twilio::REST::Serverless::V1::ServiceContext::EnvironmentInstance

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, sid: nil) click to toggle source

Initialize the EnvironmentInstance @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 Environment resource

is associated with.

@param [String] sid The SID of the Environment resource to fetch. @return [EnvironmentInstance] EnvironmentInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/serverless/v1/service/environment.rb
301 def initialize(version, payload, service_sid: nil, sid: nil)
302   super(version)
303 
304   # Marshaled Properties
305   @properties = {
306       'sid' => payload['sid'],
307       'account_sid' => payload['account_sid'],
308       'service_sid' => payload['service_sid'],
309       'build_sid' => payload['build_sid'],
310       'unique_name' => payload['unique_name'],
311       'domain_suffix' => payload['domain_suffix'],
312       'domain_name' => payload['domain_name'],
313       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
314       'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
315       'url' => payload['url'],
316       'links' => payload['links'],
317   }
318 
319   # Context
320   @instance_context = nil
321   @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'], }
322 end

Public Instance Methods

account_sid() click to toggle source

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

    # File lib/twilio-ruby/rest/serverless/v1/service/environment.rb
343 def account_sid
344   @properties['account_sid']
345 end
build_sid() click to toggle source

@return [String] The SID of the build deployed in the environment

    # File lib/twilio-ruby/rest/serverless/v1/service/environment.rb
355 def build_sid
356   @properties['build_sid']
357 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 [EnvironmentContext] EnvironmentContext for this EnvironmentInstance

    # File lib/twilio-ruby/rest/serverless/v1/service/environment.rb
328 def context
329   unless @instance_context
330     @instance_context = EnvironmentContext.new(@version, @params['service_sid'], @params['sid'], )
331   end
332   @instance_context
333 end
date_created() click to toggle source

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

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

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

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

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

    # File lib/twilio-ruby/rest/serverless/v1/service/environment.rb
411 def delete
412   context.delete
413 end
deployments() click to toggle source

Access the deployments @return [deployments] deployments

    # File lib/twilio-ruby/rest/serverless/v1/service/environment.rb
425 def deployments
426   context.deployments
427 end
domain_name() click to toggle source

@return [String] The base domain name for all Functions and Assets deployed in the Environment

    # File lib/twilio-ruby/rest/serverless/v1/service/environment.rb
373 def domain_name
374   @properties['domain_name']
375 end
domain_suffix() click to toggle source

@return [String] A URL-friendly name that represents the environment

    # File lib/twilio-ruby/rest/serverless/v1/service/environment.rb
367 def domain_suffix
368   @properties['domain_suffix']
369 end
fetch() click to toggle source

Fetch the EnvironmentInstance @return [EnvironmentInstance] Fetched EnvironmentInstance

    # File lib/twilio-ruby/rest/serverless/v1/service/environment.rb
404 def fetch
405   context.fetch
406 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/serverless/v1/service/environment.rb
445 def inspect
446   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
447   "<Twilio.Serverless.V1.EnvironmentInstance #{values}>"
448 end
logs() click to toggle source

Access the logs @return [logs] logs

    # File lib/twilio-ruby/rest/serverless/v1/service/environment.rb
432 def logs
433   context.logs
434 end
service_sid() click to toggle source

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

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

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

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

Provide a user friendly representation

    # File lib/twilio-ruby/rest/serverless/v1/service/environment.rb
438 def to_s
439   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
440   "<Twilio.Serverless.V1.EnvironmentInstance #{values}>"
441 end
unique_name() click to toggle source

@return [String] A user-defined string that uniquely identifies the Environment resource

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

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

    # File lib/twilio-ruby/rest/serverless/v1/service/environment.rb
391 def url
392   @properties['url']
393 end
variables() click to toggle source

Access the variables @return [variables] variables

    # File lib/twilio-ruby/rest/serverless/v1/service/environment.rb
418 def variables
419   context.variables
420 end