Class: Twilio::REST::Serverless::V1::ServiceContext::EnvironmentContext::LogInstance
- Inherits:
-
InstanceResource
- Object
- InstanceResource
- Twilio::REST::Serverless::V1::ServiceContext::EnvironmentContext::LogInstance
- Defined in:
- lib/twilio-ruby/rest/serverless/v1/service/environment/log.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
-
#account_sid ⇒ String
Account Sid.
-
#context ⇒ LogContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date that this Log was created.
-
#deployment_sid ⇒ String
Deployment Sid.
-
#environment_sid ⇒ String
Environment Sid.
-
#fetch ⇒ LogInstance
Fetch a LogInstance.
-
#function_sid ⇒ String
Function Sid.
-
#initialize(version, payload, service_sid: nil, environment_sid: nil, sid: nil) ⇒ LogInstance
constructor
Initialize the LogInstance.
-
#inspect ⇒ Object
Provide a detailed, user friendly representation.
-
#level ⇒ log.Level
The level.
-
#message ⇒ String
The message.
-
#request_sid ⇒ String
The request_sid.
-
#service_sid ⇒ String
Service Sid.
-
#sid ⇒ String
Log Sid.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The URL of this Log.
Constructor Details
#initialize(version, payload, service_sid: nil, environment_sid: nil, sid: nil) ⇒ LogInstance
Initialize the LogInstance
235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 235 def initialize(version, payload, service_sid: nil, environment_sid: nil, sid: nil) super(version) # Marshaled Properties @properties = { 'sid' => payload['sid'], 'account_sid' => payload['account_sid'], 'service_sid' => payload['service_sid'], 'environment_sid' => payload['environment_sid'], 'deployment_sid' => payload['deployment_sid'], 'function_sid' => payload['function_sid'], 'request_sid' => payload['request_sid'], 'level' => payload['level'], 'message' => payload['message'], 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']), 'url' => payload['url'], } # Context @instance_context = nil @params = { 'service_sid' => service_sid, 'environment_sid' => environment_sid, 'sid' => sid || @properties['sid'], } end |
Instance Method Details
#account_sid ⇒ String
Returns Account Sid.
286 287 288 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 286 def account_sid @properties['account_sid'] end |
#context ⇒ LogContext
Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context
266 267 268 269 270 271 272 273 274 275 276 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 266 def context unless @instance_context @instance_context = LogContext.new( @version, @params['service_sid'], @params['environment_sid'], @params['sid'], ) end @instance_context end |
#date_created ⇒ Time
Returns The date that this Log was created.
334 335 336 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 334 def date_created @properties['date_created'] end |
#deployment_sid ⇒ String
Returns Deployment Sid.
304 305 306 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 304 def deployment_sid @properties['deployment_sid'] end |
#environment_sid ⇒ String
Returns Environment Sid.
298 299 300 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 298 def environment_sid @properties['environment_sid'] end |
#fetch ⇒ LogInstance
Fetch a LogInstance
347 348 349 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 347 def fetch context.fetch end |
#function_sid ⇒ String
Returns Function Sid.
310 311 312 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 310 def function_sid @properties['function_sid'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
360 361 362 363 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 360 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.LogInstance #{values}>" end |
#level ⇒ log.Level
Returns The level.
322 323 324 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 322 def level @properties['level'] end |
#message ⇒ String
Returns The message.
328 329 330 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 328 def @properties['message'] end |
#request_sid ⇒ String
Returns The request_sid.
316 317 318 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 316 def request_sid @properties['request_sid'] end |
#service_sid ⇒ String
Returns Service Sid.
292 293 294 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 292 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns Log Sid.
280 281 282 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 280 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
353 354 355 356 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 353 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.LogInstance #{values}>" end |
#url ⇒ String
Returns The URL of this Log.
340 341 342 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 340 def url @properties['url'] end |