Class: ApolloDeploySignalSdkRails::CursorInfo

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

Overview

Schema type: CursorInfo

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(next_cursor:, previous_cursor:, has_next_page:, has_previous_page:) ⇒ CursorInfo

Returns a new instance of CursorInfo.

Parameters:

  • next_cursor (String, nil)

    , previous_cursor [String, nil], has_next_page [Boolean], has_previous_page [Boolean]



2065
2066
2067
2068
2069
2070
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2065

def initialize(next_cursor: , previous_cursor: , has_next_page: , has_previous_page: )
  @next_cursor = next_cursor
  @previous_cursor = previous_cursor
  @has_next_page = has_next_page
  @has_previous_page = has_previous_page
end

Instance Attribute Details

#has_next_pageBoolean

Returns:

  • (Boolean)


2060
2061
2062
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2060

def has_next_page
  @has_next_page
end

#has_previous_pageBoolean

Returns:

  • (Boolean)


2062
2063
2064
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2062

def has_previous_page
  @has_previous_page
end

#next_cursorString?

Returns:

  • (String, nil)


2056
2057
2058
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2056

def next_cursor
  @next_cursor
end

#previous_cursorString?

Returns:

  • (String, nil)


2058
2059
2060
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2058

def previous_cursor
  @previous_cursor
end

Class Method Details

.from_json(attributes) ⇒ CursorInfo

Create an instance from a parsed JSON hash.

Parameters:

  • attributes (Hash)

Returns:



2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2085

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

  new(
    next_cursor: attributes.key?("nextCursor") ? attributes["nextCursor"] : attributes[:next_cursor],
    previous_cursor: attributes.key?("previousCursor") ? attributes["previousCursor"] : attributes[:previous_cursor],
    has_next_page: attributes.key?("hasNextPage") ? attributes["hasNextPage"] : attributes[:has_next_page],
    has_previous_page: attributes.key?("hasPreviousPage") ? attributes["hasPreviousPage"] : attributes[:has_previous_page],
  )
end

Instance Method Details

#to_hHash

Returns a hash representation of this object.

Returns:

  • (Hash)

    a hash representation of this object



2073
2074
2075
2076
2077
2078
2079
2080
# File 'lib/apollo_deploy_signal_sdk_rails/types.rb', line 2073

def to_h
  {
    next_cursor: @next_cursor,
    previous_cursor: @previous_cursor,
    has_next_page: @has_next_page,
    has_previous_page: @has_previous_page,
  }.compact
end