Class: ApolloDeploySignalSdkRails::AdvisorRecommendationResponse
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdkRails::AdvisorRecommendationResponse
- Defined in:
- lib/apollo_deploy_signal_sdk_rails/types.rb
Overview
Schema type: AdvisorRecommendationResponse
Instance Attribute Summary collapse
- #code ⇒ String
- #data ⇒ AdvisorRecommendationDataResponse?
- #message ⇒ String
- #severity ⇒ String
- #title ⇒ String
Class Method Summary collapse
-
.from_json(attributes) ⇒ AdvisorRecommendationResponse
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(code:, severity:, title:, message:, data: nil) ⇒ AdvisorRecommendationResponse
constructor
A new instance of AdvisorRecommendationResponse.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(code:, severity:, title:, message:, data: nil) ⇒ AdvisorRecommendationResponse
Returns a new instance of AdvisorRecommendationResponse.
1564 1565 1566 1567 1568 1569 1570 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1564 def initialize(code: , severity: , title: , message: , data: nil) @code = code @severity = severity @title = title @message = @data = data end |
Instance Attribute Details
#code ⇒ String
1553 1554 1555 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1553 def code @code end |
#data ⇒ AdvisorRecommendationDataResponse?
1561 1562 1563 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1561 def data @data end |
#message ⇒ String
1559 1560 1561 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1559 def @message end |
#severity ⇒ String
1555 1556 1557 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1555 def severity @severity end |
#title ⇒ String
1557 1558 1559 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1557 def title @title end |
Class Method Details
.from_json(attributes) ⇒ AdvisorRecommendationResponse
Create an instance from a parsed JSON hash.
1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1586 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( code: attributes.key?("code") ? attributes["code"] : attributes[:code], severity: attributes.key?("severity") ? attributes["severity"] : attributes[:severity], title: attributes.key?("title") ? attributes["title"] : attributes[:title], message: attributes.key?("message") ? attributes["message"] : attributes[:message], data: attributes.key?("data") ? attributes["data"] : attributes[:data], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
1573 1574 1575 1576 1577 1578 1579 1580 1581 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1573 def to_h { code: @code, severity: @severity, title: @title, message: @message, data: @data, }.compact end |