Class: ApolloDeploySignalSdkRails::AdvisorReportResponse
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdkRails::AdvisorReportResponse
- Defined in:
- lib/apollo_deploy_signal_sdk_rails/types.rb
Overview
Schema type: AdvisorReportResponse
Instance Attribute Summary collapse
- #generated_at ⇒ String
- #project_id ⇒ String
- #recommendations ⇒ Array<AdvisorRecommendationResponse>
- #score ⇒ Integer
Class Method Summary collapse
-
.from_json(attributes) ⇒ AdvisorReportResponse
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(project_id:, generated_at:, score:, recommendations:) ⇒ AdvisorReportResponse
constructor
A new instance of AdvisorReportResponse.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(project_id:, generated_at:, score:, recommendations:) ⇒ AdvisorReportResponse
Returns a new instance of AdvisorReportResponse.
1611 1612 1613 1614 1615 1616 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1611 def initialize(project_id: , generated_at: , score: , recommendations: ) @project_id = project_id @generated_at = generated_at @score = score @recommendations = recommendations end |
Instance Attribute Details
#generated_at ⇒ String
1604 1605 1606 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1604 def generated_at @generated_at end |
#project_id ⇒ String
1602 1603 1604 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1602 def project_id @project_id end |
#recommendations ⇒ Array<AdvisorRecommendationResponse>
1608 1609 1610 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1608 def recommendations @recommendations end |
#score ⇒ Integer
1606 1607 1608 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1606 def score @score end |
Class Method Details
.from_json(attributes) ⇒ AdvisorReportResponse
Create an instance from a parsed JSON hash.
1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1631 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id], generated_at: attributes.key?("generatedAt") ? attributes["generatedAt"] : attributes[:generated_at], score: attributes.key?("score") ? attributes["score"] : attributes[:score], recommendations: attributes.key?("recommendations") ? attributes["recommendations"] : attributes[:recommendations], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
1619 1620 1621 1622 1623 1624 1625 1626 |
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1619 def to_h { project_id: @project_id, generated_at: @generated_at, score: @score, recommendations: @recommendations, }.compact end |