Class: ApolloDeploySignalSdk::GetProjectMetricsTimelineQuery

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

Overview

Schema type: GetProjectMetricsTimelineQuery

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(window: nil, granularity: nil, format: nil, project_id: nil) ⇒ GetProjectMetricsTimelineQuery

Returns a new instance of GetProjectMetricsTimelineQuery.

Parameters:

  • window (String) (defaults to: nil)

    , granularity [String], format [String], project_id [String]



4822
4823
4824
4825
4826
4827
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 4822

def initialize(window: nil, granularity: nil, format: nil, project_id: nil)
  @window = window
  @granularity = granularity
  @format = format
  @project_id = project_id
end

Instance Attribute Details

#formatString

Returns compact or detailed.

Returns:

  • (String)

    compact or detailed.



4817
4818
4819
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 4817

def format
  @format
end

#granularityString

Returns hour or day.

Returns:

  • (String)

    hour or day.



4815
4816
4817
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 4815

def granularity
  @granularity
end

#project_idString

Returns Required for session auth; ignored for API key auth.

Returns:

  • (String)

    Required for session auth; ignored for API key auth.



4819
4820
4821
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 4819

def project_id
  @project_id
end

#windowString

Returns Metrics time window.

Returns:

  • (String)

    Metrics time window.



4813
4814
4815
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 4813

def window
  @window
end

Class Method Details

.from_json(attributes) ⇒ GetProjectMetricsTimelineQuery

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 4842

def self.from_json(attributes)
  return nil unless attributes.is_a?(Hash)

  new(
    window: attributes.key?("window") ? attributes["window"] : attributes[:window],
    granularity: attributes.key?("granularity") ? attributes["granularity"] : attributes[:granularity],
    format: attributes.key?("format") ? attributes["format"] : attributes[:format],
    project_id: attributes.key?("projectId") ? attributes["projectId"] : attributes[:project_id],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



4830
4831
4832
4833
4834
4835
4836
4837
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 4830

def to_h
  {
    window: @window,
    granularity: @granularity,
    format: @format,
    project_id: @project_id,
  }.compact
end