Class: NewStoreApi::StockProductAvailabilityRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::StockProductAvailabilityRequest
- Defined in:
- lib/new_store_api/models/stock_product_availability_request.rb
Overview
Use this API to fetch ATP information, filtered by products. The response will be paginated, with a max page size of 2000 items
Instance Attribute Summary collapse
-
#page_number ⇒ Float
The page number of paginated response.
-
#page_size ⇒ Float
The max size of the paginated response.
-
#products ⇒ Array[String]
The max size of the paginated response.
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(page_number = nil, page_size = nil, products = nil) ⇒ StockProductAvailabilityRequest
constructor
A new instance of StockProductAvailabilityRequest.
-
#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(page_number = nil, page_size = nil, products = nil) ⇒ StockProductAvailabilityRequest
Returns a new instance of StockProductAvailabilityRequest.
46 47 48 49 50 |
# File 'lib/new_store_api/models/stock_product_availability_request.rb', line 46 def initialize(page_number = nil, page_size = nil, products = nil) @page_number = page_number @page_size = page_size @products = products end |
Instance Attribute Details
#page_number ⇒ Float
The page number of paginated response. The page number starts at 1
15 16 17 |
# File 'lib/new_store_api/models/stock_product_availability_request.rb', line 15 def page_number @page_number end |
#page_size ⇒ Float
The max size of the paginated response. This value should not be more than 2000.
20 21 22 |
# File 'lib/new_store_api/models/stock_product_availability_request.rb', line 20 def page_size @page_size end |
#products ⇒ Array[String]
The max size of the paginated response. This value should not be more than 2000.
25 26 27 |
# File 'lib/new_store_api/models/stock_product_availability_request.rb', line 25 def products @products end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/new_store_api/models/stock_product_availability_request.rb', line 53 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. page_number = hash.key?('page_number') ? hash['page_number'] : nil page_size = hash.key?('page_size') ? hash['page_size'] : nil products = hash.key?('products') ? hash['products'] : nil # Create object from extracted values. StockProductAvailabilityRequest.new(page_number, page_size, products) end |
.names ⇒ Object
A mapping from model property names to API property names.
28 29 30 31 32 33 34 |
# File 'lib/new_store_api/models/stock_product_availability_request.rb', line 28 def self.names @_hash = {} if @_hash.nil? @_hash['page_number'] = 'page_number' @_hash['page_size'] = 'page_size' @_hash['products'] = 'products' @_hash end |
.nullables ⇒ Object
An array for nullable fields
42 43 44 |
# File 'lib/new_store_api/models/stock_product_availability_request.rb', line 42 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
37 38 39 |
# File 'lib/new_store_api/models/stock_product_availability_request.rb', line 37 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
75 76 77 78 79 |
# File 'lib/new_store_api/models/stock_product_availability_request.rb', line 75 def inspect class_name = self.class.name.split('::').last "<#{class_name} page_number: #{@page_number.inspect}, page_size: #{@page_size.inspect},"\ " products: #{@products.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
68 69 70 71 72 |
# File 'lib/new_store_api/models/stock_product_availability_request.rb', line 68 def to_s class_name = self.class.name.split('::').last "<#{class_name} page_number: #{@page_number}, page_size: #{@page_size}, products:"\ " #{@products}>" end |