Class: ApolloDeploySignalSdk::MetricsWindowResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/apollo_deploy_signal_sdk/types.rb

Overview

Schema type: MetricsWindowResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(from:, to:, label:) ⇒ MetricsWindowResponse

Returns a new instance of MetricsWindowResponse.

Parameters:

  • from (String)

    , to [String], label [String]



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

#fromString

Returns:

  • (String)


791
792
793
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 791

def from
  @from
end

#labelString

Returns:

  • (String)


795
796
797
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 795

def label
  @label
end

#toString

Returns:

  • (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.

Parameters:

  • attributes (Hash)

Returns:



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_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    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