Class: Datadog::Lambda::AppSec::Response
- Inherits:
-
Object
- Object
- Datadog::Lambda::AppSec::Response
- Defined in:
- lib/datadog/lambda/appsec/response.rb
Overview
Minimal response object for AppSec event recording.
WARNING: It's a minimal data for interface compliance
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(status:, headers:, body:) ⇒ Response
constructor
A new instance of Response.
Constructor Details
#initialize(status:, headers:, body:) ⇒ Response
Returns a new instance of Response.
23 24 25 26 27 |
# File 'lib/datadog/lambda/appsec/response.rb', line 23 def initialize(status:, headers:, body:) @status = status @headers = headers @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
13 14 15 |
# File 'lib/datadog/lambda/appsec/response.rb', line 13 def body @body end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
13 14 15 |
# File 'lib/datadog/lambda/appsec/response.rb', line 13 def headers @headers end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
13 14 15 |
# File 'lib/datadog/lambda/appsec/response.rb', line 13 def status @status end |
Class Method Details
.from_normalized(normalized) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/datadog/lambda/appsec/response.rb', line 15 def self.from_normalized(normalized) new( status: normalized['status_code'].to_i, headers: normalized['headers'] || {}, body: normalized['body'] ) end |