Class: ApolloDeploySignalSdkRails::TopicPageResponse

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

Overview

Schema type: TopicPageResponse

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data:, page:) ⇒ TopicPageResponse

Returns a new instance of TopicPageResponse.

Parameters:



2247
2248
2249
2250
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2247

def initialize(data: , page: )
  @data = data
  @page = page
end

Instance Attribute Details

#dataArray<TopicResponse>

Returns:



2242
2243
2244
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2242

def data
  @data
end

#pagePageInfo

Returns:



2244
2245
2246
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2244

def page
  @page
end

Class Method Details

.from_json(attributes) ⇒ TopicPageResponse

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



2263
2264
2265
2266
2267
2268
2269
2270
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2263

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

  new(
    data: attributes.key?("data") ? attributes["data"] : attributes[:data],
    page: attributes.key?("page") ? attributes["page"] : attributes[:page],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



2253
2254
2255
2256
2257
2258
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2253

def to_h
  {
    data: @data,
    page: @page,
  }.compact
end