Class: NewStoreApi::StoreConfigListDto
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::StoreConfigListDto
- Defined in:
- lib/new_store_api/models/store_config_list_dto.rb
Overview
StoreConfigListDto Model.
Instance Attribute Summary collapse
-
#items ⇒ Array[StoreConfigDto]
List of tax configurations of stores.
-
#next_page_key ⇒ String
Key for retrieving the next page of results.
-
#scan_count ⇒ Integer
Number of database scans performed to populate the list.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(items = nil, scan_count = nil, next_page_key = SKIP) ⇒ StoreConfigListDto
constructor
A new instance of StoreConfigListDto.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(items = nil, scan_count = nil, next_page_key = SKIP) ⇒ StoreConfigListDto
Returns a new instance of StoreConfigListDto.
45 46 47 48 49 |
# File 'lib/new_store_api/models/store_config_list_dto.rb', line 45 def initialize(items = nil, scan_count = nil, next_page_key = SKIP) @items = items @next_page_key = next_page_key unless next_page_key == SKIP @scan_count = scan_count end |
Instance Attribute Details
#items ⇒ Array[StoreConfigDto]
List of tax configurations of stores.
14 15 16 |
# File 'lib/new_store_api/models/store_config_list_dto.rb', line 14 def items @items end |
#next_page_key ⇒ String
Key for retrieving the next page of results.
18 19 20 |
# File 'lib/new_store_api/models/store_config_list_dto.rb', line 18 def next_page_key @next_page_key end |
#scan_count ⇒ Integer
Number of database scans performed to populate the list.
22 23 24 |
# File 'lib/new_store_api/models/store_config_list_dto.rb', line 22 def scan_count @scan_count end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
# File 'lib/new_store_api/models/store_config_list_dto.rb', line 52 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it items = nil unless hash['items'].nil? items = [] hash['items'].each do |structure| items << (StoreConfigDto.from_hash(structure) if structure) end end items = nil unless hash.key?('items') scan_count = hash.key?('scan_count') ? hash['scan_count'] : nil next_page_key = hash.key?('next_page_key') ? hash['next_page_key'] : SKIP # Create object from extracted values. StoreConfigListDto.new(items, scan_count, next_page_key) end |
.names ⇒ Object
A mapping from model property names to API property names.
25 26 27 28 29 30 31 |
# File 'lib/new_store_api/models/store_config_list_dto.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['items'] = 'items' @_hash['next_page_key'] = 'next_page_key' @_hash['scan_count'] = 'scan_count' @_hash end |
.nullables ⇒ Object
An array for nullable fields
41 42 43 |
# File 'lib/new_store_api/models/store_config_list_dto.rb', line 41 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
34 35 36 37 38 |
# File 'lib/new_store_api/models/store_config_list_dto.rb', line 34 def self.optionals %w[ next_page_key ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
83 84 85 86 87 |
# File 'lib/new_store_api/models/store_config_list_dto.rb', line 83 def inspect class_name = self.class.name.split('::').last "<#{class_name} items: #{@items.inspect}, next_page_key: #{@next_page_key.inspect},"\ " scan_count: #{@scan_count.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
76 77 78 79 80 |
# File 'lib/new_store_api/models/store_config_list_dto.rb', line 76 def to_s class_name = self.class.name.split('::').last "<#{class_name} items: #{@items}, next_page_key: #{@next_page_key}, scan_count:"\ " #{@scan_count}>" end |