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
Instance Method Summary collapse
-
#account_sid ⇒ String
The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Log resource.
-
#build_sid ⇒ String
The SID of the build that corresponds to the log.
-
#context ⇒ LogContext
Generate an instance context for the instance, the context is capable of performing various actions.
-
#date_created ⇒ Time
The date and time in GMT when the Log resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
-
#deployment_sid ⇒ String
The SID of the deployment that corresponds to the log.
-
#environment_sid ⇒ String
The SID of the environment in which the log occurred.
-
#fetch ⇒ LogInstance
Fetch the LogInstance.
-
#function_sid ⇒ String
The SID of the function whose invocation produced the log.
-
#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 ⇒ String
The log level.
-
#message ⇒ String
The log message.
-
#request_sid ⇒ String
The SID of the request associated with the log.
-
#service_sid ⇒ String
The SID of the Service that the Log resource is associated with.
-
#sid ⇒ String
The unique string that we created to identify the Log resource.
-
#to_s ⇒ Object
Provide a user friendly representation.
-
#url ⇒ String
The absolute URL of the Log resource.
Constructor Details
#initialize(version, payload, service_sid: nil, environment_sid: nil, sid: nil) ⇒ LogInstance
Initialize the LogInstance
408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 408 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'], 'build_sid' => payload['build_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 || @properties['service_sid'] ,'environment_sid' => environment_sid || @properties['environment_sid'] ,'sid' => sid || @properties['sid'] , } end |
Instance Method Details
#account_sid ⇒ String
Returns The SID of the [Account](www.twilio.com/docs/iam/api/account) that created the Log resource.
452 453 454 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 452 def account_sid @properties['account_sid'] end |
#build_sid ⇒ String
Returns The SID of the build that corresponds to the log.
470 471 472 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 470 def build_sid @properties['build_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
437 438 439 440 441 442 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 437 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 and time in GMT when the Log resource was created specified in [ISO 8601](en.wikipedia.org/wiki/ISO_8601) format.
506 507 508 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 506 def date_created @properties['date_created'] end |
#deployment_sid ⇒ String
Returns The SID of the deployment that corresponds to the log.
476 477 478 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 476 def deployment_sid @properties['deployment_sid'] end |
#environment_sid ⇒ String
Returns The SID of the environment in which the log occurred.
464 465 466 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 464 def environment_sid @properties['environment_sid'] end |
#fetch ⇒ LogInstance
Fetch the LogInstance
519 520 521 522 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 519 def fetch context.fetch end |
#function_sid ⇒ String
Returns The SID of the function whose invocation produced the log.
482 483 484 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 482 def function_sid @properties['function_sid'] end |
#inspect ⇒ Object
Provide a detailed, user friendly representation
533 534 535 536 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 533 def inspect values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.LogInstance #{values}>" end |
#level ⇒ String
Returns The log level.
494 495 496 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 494 def level @properties['level'] end |
#message ⇒ String
Returns The log message.
500 501 502 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 500 def @properties['message'] end |
#request_sid ⇒ String
Returns The SID of the request associated with the log.
488 489 490 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 488 def request_sid @properties['request_sid'] end |
#service_sid ⇒ String
Returns The SID of the Service that the Log resource is associated with.
458 459 460 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 458 def service_sid @properties['service_sid'] end |
#sid ⇒ String
Returns The unique string that we created to identify the Log resource.
446 447 448 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 446 def sid @properties['sid'] end |
#to_s ⇒ Object
Provide a user friendly representation
526 527 528 529 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 526 def to_s values = @params.map{|k, v| "#{k}: #{v}"}.join(" ") "<Twilio.Serverless.V1.LogInstance #{values}>" end |
#url ⇒ String
Returns The absolute URL of the Log resource.
512 513 514 |
# File 'lib/twilio-ruby/rest/serverless/v1/service/environment/log.rb', line 512 def url @properties['url'] end |