Class: ApolloDeploySignalSdkRails::ProjectMetricsTimelineResponse

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

Overview

Schema type: ProjectMetricsTimelineResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(project_id:, window:, granularity:, format:, buckets:) ⇒ ProjectMetricsTimelineResponse

Returns a new instance of ProjectMetricsTimelineResponse.

Parameters:

  • project_id (String)

    , window [MetricsWindowResponse], granularity [String], format [String], buckets [Array]



1361
1362
1363
1364
1365
1366
1367
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1361

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

Instance Attribute Details

#bucketsArray<ProjectTimelineBucketResponse>

Returns:



1358
1359
1360
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1358

def buckets
  @buckets
end

#formatString

Returns:

  • (String)


1356
1357
1358
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1356

def format
  @format
end

#granularityString

Returns:

  • (String)


1354
1355
1356
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1354

def granularity
  @granularity
end

#project_idString

Returns:

  • (String)


1350
1351
1352
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1350

def project_id
  @project_id
end

#windowMetricsWindowResponse



1352
1353
1354
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1352

def window
  @window
end

Class Method Details

.from_json(attributes) ⇒ ProjectMetricsTimelineResponse

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1383

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

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

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



1370
1371
1372
1373
1374
1375
1376
1377
1378
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1370

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