Class: NewStoreApi::SchemaForBulkCancelOrdersRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- NewStoreApi::SchemaForBulkCancelOrdersRequest
- Defined in:
- lib/new_store_api/models/schema_for_bulk_cancel_orders_request.rb
Overview
SchemaForBulkCancelOrdersRequest Model.
Instance Attribute Summary collapse
-
#note ⇒ String
Optional note for cancellation.
-
#order_ids ⇒ Array[String]
List of order IDs to cancel.
-
#reason ⇒ String
Reason for cancellation.
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(order_ids = nil, reason = nil, note = SKIP) ⇒ SchemaForBulkCancelOrdersRequest
constructor
A new instance of SchemaForBulkCancelOrdersRequest.
-
#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(order_ids = nil, reason = nil, note = SKIP) ⇒ SchemaForBulkCancelOrdersRequest
Returns a new instance of SchemaForBulkCancelOrdersRequest.
45 46 47 48 49 |
# File 'lib/new_store_api/models/schema_for_bulk_cancel_orders_request.rb', line 45 def initialize(order_ids = nil, reason = nil, note = SKIP) @note = note unless note == SKIP @order_ids = order_ids @reason = reason end |
Instance Attribute Details
#note ⇒ String
Optional note for cancellation
14 15 16 |
# File 'lib/new_store_api/models/schema_for_bulk_cancel_orders_request.rb', line 14 def note @note end |
#order_ids ⇒ Array[String]
List of order IDs to cancel
18 19 20 |
# File 'lib/new_store_api/models/schema_for_bulk_cancel_orders_request.rb', line 18 def order_ids @order_ids end |
#reason ⇒ String
Reason for cancellation
22 23 24 |
# File 'lib/new_store_api/models/schema_for_bulk_cancel_orders_request.rb', line 22 def reason @reason 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 |
# File 'lib/new_store_api/models/schema_for_bulk_cancel_orders_request.rb', line 52 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. order_ids = hash.key?('order_ids') ? hash['order_ids'] : nil reason = hash.key?('reason') ? hash['reason'] : nil note = hash.key?('note') ? hash['note'] : SKIP # Create object from extracted values. SchemaForBulkCancelOrdersRequest.new(order_ids, reason, note) 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/schema_for_bulk_cancel_orders_request.rb', line 25 def self.names @_hash = {} if @_hash.nil? @_hash['note'] = 'note' @_hash['order_ids'] = 'order_ids' @_hash['reason'] = 'reason' @_hash end |
.nullables ⇒ Object
An array for nullable fields
41 42 43 |
# File 'lib/new_store_api/models/schema_for_bulk_cancel_orders_request.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/schema_for_bulk_cancel_orders_request.rb', line 34 def self.optionals %w[ note ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
73 74 75 76 77 |
# File 'lib/new_store_api/models/schema_for_bulk_cancel_orders_request.rb', line 73 def inspect class_name = self.class.name.split('::').last "<#{class_name} note: #{@note.inspect}, order_ids: #{@order_ids.inspect}, reason:"\ " #{@reason.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
67 68 69 70 |
# File 'lib/new_store_api/models/schema_for_bulk_cancel_orders_request.rb', line 67 def to_s class_name = self.class.name.split('::').last "<#{class_name} note: #{@note}, order_ids: #{@order_ids}, reason: #{@reason}>" end |