Class: ApolloDeploySignalSdk::MetricsWindowResponse
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdk::MetricsWindowResponse
- Defined in:
- lib/apollo_deploy_signal_sdk/types.rb
Overview
Schema type: MetricsWindowResponse
Instance Attribute Summary collapse
Class Method Summary collapse
-
.from_json(attributes) ⇒ MetricsWindowResponse
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(from:, to:, label:) ⇒ MetricsWindowResponse
constructor
A new instance of MetricsWindowResponse.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(from:, to:, label:) ⇒ MetricsWindowResponse
Returns a new instance of MetricsWindowResponse.
798 799 800 801 802 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 798 def initialize(from: , to: , label: ) @from = from @to = to @label = label end |
Instance Attribute Details
#from ⇒ String
791 792 793 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 791 def from @from end |
#label ⇒ String
795 796 797 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 795 def label @label end |
#to ⇒ String
793 794 795 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 793 def to @to end |
Class Method Details
.from_json(attributes) ⇒ MetricsWindowResponse
Create an instance from a parsed JSON hash.
816 817 818 819 820 821 822 823 824 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 816 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( from: attributes.key?("from") ? attributes["from"] : attributes[:from], to: attributes.key?("to") ? attributes["to"] : attributes[:to], label: attributes.key?("label") ? attributes["label"] : attributes[:label], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
805 806 807 808 809 810 811 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 805 def to_h { from: @from, to: @to, label: @label, }.compact end |