Class: ApolloDeploySignalSdk::ProjectMetricsTimelineResponse
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdk::ProjectMetricsTimelineResponse
- Defined in:
- lib/apollo_deploy_signal_sdk/types.rb
Overview
Schema type: ProjectMetricsTimelineResponse
Instance Attribute Summary collapse
- #buckets ⇒ Array<ProjectTimelineBucketResponse>
- #format ⇒ String
- #granularity ⇒ String
- #project_id ⇒ String
- #window ⇒ MetricsWindowResponse
Class Method Summary collapse
-
.from_json(attributes) ⇒ ProjectMetricsTimelineResponse
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(project_id:, window:, granularity:, format:, buckets:) ⇒ ProjectMetricsTimelineResponse
constructor
A new instance of ProjectMetricsTimelineResponse.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(project_id:, window:, granularity:, format:, buckets:) ⇒ ProjectMetricsTimelineResponse
Returns a new instance of ProjectMetricsTimelineResponse.
1361 1362 1363 1364 1365 1366 1367 |
# File 'lib/apollo_deploy_signal_sdk/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
#buckets ⇒ Array<ProjectTimelineBucketResponse>
1358 1359 1360 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1358 def buckets @buckets end |
#format ⇒ String
1356 1357 1358 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1356 def format @format end |
#granularity ⇒ String
1354 1355 1356 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1354 def granularity @granularity end |
#project_id ⇒ String
1350 1351 1352 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1350 def project_id @project_id end |
#window ⇒ MetricsWindowResponse
1352 1353 1354 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1352 def window @window end |
Class Method Details
.from_json(attributes) ⇒ ProjectMetricsTimelineResponse
Create an instance from a parsed JSON hash.
1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 |
# File 'lib/apollo_deploy_signal_sdk/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_h ⇒ Hash
Returns a hash representation of this object.
1370 1371 1372 1373 1374 1375 1376 1377 1378 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 1370 def to_h { project_id: @project_id, window: @window, granularity: @granularity, format: @format, buckets: @buckets, }.compact end |