Class: ApolloDeploySignalSdk::UsagePage
- Inherits:
-
Object
- Object
- ApolloDeploySignalSdk::UsagePage
- Defined in:
- lib/apollo_deploy_signal_sdk/types.rb
Overview
Schema type: UsagePage
Instance Attribute Summary collapse
Class Method Summary collapse
-
.from_json(attributes) ⇒ UsagePage
Create an instance from a parsed JSON hash.
Instance Method Summary collapse
-
#initialize(size:, total_pages:, has_more:) ⇒ UsagePage
constructor
A new instance of UsagePage.
-
#to_h ⇒ Hash
A hash representation of this object.
Constructor Details
#initialize(size:, total_pages:, has_more:) ⇒ UsagePage
Returns a new instance of UsagePage.
3866 3867 3868 3869 3870 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3866 def initialize(size: , total_pages: , has_more: ) @size = size @total_pages = total_pages @has_more = has_more end |
Instance Attribute Details
#has_more ⇒ Boolean
3863 3864 3865 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3863 def has_more @has_more end |
#size ⇒ Integer
3859 3860 3861 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3859 def size @size end |
#total_pages ⇒ Integer
3861 3862 3863 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3861 def total_pages @total_pages end |
Class Method Details
.from_json(attributes) ⇒ UsagePage
Create an instance from a parsed JSON hash.
3884 3885 3886 3887 3888 3889 3890 3891 3892 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3884 def self.from_json(attributes) return nil unless attributes.is_a?(Hash) new( size: attributes.key?("size") ? attributes["size"] : attributes[:size], total_pages: attributes.key?("totalPages") ? attributes["totalPages"] : attributes[:total_pages], has_more: attributes.key?("hasMore") ? attributes["hasMore"] : attributes[:has_more], ) end |
Instance Method Details
#to_h ⇒ Hash
Returns a hash representation of this object.
3873 3874 3875 3876 3877 3878 3879 |
# File 'lib/apollo_deploy_signal_sdk/types.rb', line 3873 def to_h { size: @size, total_pages: @total_pages, has_more: @has_more, }.compact end |