Class: ApolloDeploySignalSdkRails::ProjectTimelineBucketResponse

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

Overview

Schema type: ProjectTimelineBucketResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(bucket:, type:, count:) ⇒ ProjectTimelineBucketResponse

Returns a new instance of ProjectTimelineBucketResponse.

Parameters:

  • bucket (String)

    , type [String], count [Integer]



1318
1319
1320
1321
1322
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1318

def initialize(bucket: , type: , count: )
  @bucket = bucket
  @type = type
  @count = count
end

Instance Attribute Details

#bucketString

Returns:

  • (String)


1311
1312
1313
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1311

def bucket
  @bucket
end

#countInteger

Returns:

  • (Integer)


1315
1316
1317
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1315

def count
  @count
end

#typeString

Returns:

  • (String)


1313
1314
1315
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1313

def type
  @type
end

Class Method Details

.from_json(attributes) ⇒ ProjectTimelineBucketResponse

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



1336
1337
1338
1339
1340
1341
1342
1343
1344
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1336

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

  new(
    bucket: attributes.key?("bucket") ? attributes["bucket"] : attributes[:bucket],
    type: attributes.key?("type") ? attributes["type"] : attributes[:type],
    count: attributes.key?("count") ? attributes["count"] : attributes[:count],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



1325
1326
1327
1328
1329
1330
1331
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 1325

def to_h
  {
    bucket: @bucket,
    type: @type,
    count: @count,
  }.compact
end