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

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 LogInstance @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 Log resource is

associated with.

@param [String] environment_sid The SID of the environment in which the log

occurred.

@param [String] sid The SID of the Log resource to fetch. @return [LogInstance] LogInstance

Calls superclass method Twilio::REST::InstanceResource::new
    # File lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb
252 def initialize(version, payload, service_sid: nil, environment_sid: nil, sid: nil)
253   super(version)
254 
255   # Marshaled Properties
256   @properties = {
257       'sid' => payload['sid'],
258       'account_sid' => payload['account_sid'],
259       'service_sid' => payload['service_sid'],
260       'environment_sid' => payload['environment_sid'],
261       'build_sid' => payload['build_sid'],
262       'deployment_sid' => payload['deployment_sid'],
263       'function_sid' => payload['function_sid'],
264       'request_sid' => payload['request_sid'],
265       'level' => payload['level'],
266       'message' => payload['message'],
267       'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
268       'url' => payload['url'],
269   }
270 
271   # Context
272   @instance_context = nil
273   @params = {
274       'service_sid' => service_sid,
275       'environment_sid' => environment_sid,
276       'sid' => sid || @properties['sid'],
277   }
278 end

Public Instance Methods

account_sid() click to toggle source

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

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

@return [String] The SID of the build that corresponds to the log

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb
322 def build_sid
323   @properties['build_sid']
324 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 [LogContext] LogContext for this LogInstance

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb
284 def context
285   unless @instance_context
286     @instance_context = LogContext.new(
287         @version,
288         @params['service_sid'],
289         @params['environment_sid'],
290         @params['sid'],
291     )
292   end
293   @instance_context
294 end
date_created() click to toggle source

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

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb
358 def date_created
359   @properties['date_created']
360 end
deployment_sid() click to toggle source

@return [String] The SID of the deployment that corresponds to the log

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

@return [String] The SID of the environment in which the log occurred

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb
316 def environment_sid
317   @properties['environment_sid']
318 end
fetch() click to toggle source

Fetch the LogInstance @return [LogInstance] Fetched LogInstance

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb
371 def fetch
372   context.fetch
373 end
function_sid() click to toggle source

@return [String] The SID of the function whose invocation produced the log

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb
334 def function_sid
335   @properties['function_sid']
336 end
inspect() click to toggle source

Provide a detailed, user friendly representation

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb
384 def inspect
385   values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
386   "<Twilio.Serverless.V1.LogInstance #{values}>"
387 end
level() click to toggle source

@return [log.Level] The log level

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb
346 def level
347   @properties['level']
348 end
message() click to toggle source

@return [String] The log message

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb
352 def message
353   @properties['message']
354 end
request_sid() click to toggle source

@return [String] The SID of the request associated with the log

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb
340 def request_sid
341   @properties['request_sid']
342 end
service_sid() click to toggle source

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

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

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

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

Provide a user friendly representation

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb
377 def to_s
378   values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
379   "<Twilio.Serverless.V1.LogInstance #{values}>"
380 end
url() click to toggle source

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

    # File lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb
364 def url
365   @properties['url']
366 end