Class: StickyIoRestfulApiV2025731::DataSkipNextShipmentPositions

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/sticky_io_restful_api_v2025731/models/data_skip_next_shipment_positions.rb

Overview

DataSkipNextShipmentPositions Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(id:, collection_offer_id:, product_id:, product_unit_price:, product_qty:, position_id:, is_locked:, updated_at:, created_at:, deleted_at:, product:, additional_properties: nil) ⇒ DataSkipNextShipmentPositions

Returns a new instance of DataSkipNextShipmentPositions.



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'lib/sticky_io_restful_api_v2025731/models/data_skip_next_shipment_positions.rb', line 85

def initialize(id:, collection_offer_id:, product_id:, product_unit_price:,
               product_qty:, position_id:, is_locked:, updated_at:,
               created_at:, deleted_at:, product:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @id = id
  @collection_offer_id = collection_offer_id
  @product_id = product_id
  @product_unit_price = product_unit_price
  @product_qty = product_qty
  @position_id = position_id
  @is_locked = is_locked
  @updated_at = updated_at
  @created_at = created_at
  @deleted_at = deleted_at
  @product = product
  @additional_properties = additional_properties
end

Instance Attribute Details

#collection_offer_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


18
19
20
# File 'lib/sticky_io_restful_api_v2025731/models/data_skip_next_shipment_positions.rb', line 18

def collection_offer_id
  @collection_offer_id
end

#created_atString

TODO: Write general description for this method

Returns:

  • (String)


46
47
48
# File 'lib/sticky_io_restful_api_v2025731/models/data_skip_next_shipment_positions.rb', line 46

def created_at
  @created_at
end

#deleted_atString

TODO: Write general description for this method

Returns:

  • (String)


50
51
52
# File 'lib/sticky_io_restful_api_v2025731/models/data_skip_next_shipment_positions.rb', line 50

def deleted_at
  @deleted_at
end

#idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


14
15
16
# File 'lib/sticky_io_restful_api_v2025731/models/data_skip_next_shipment_positions.rb', line 14

def id
  @id
end

#is_lockedInteger

TODO: Write general description for this method

Returns:

  • (Integer)


38
39
40
# File 'lib/sticky_io_restful_api_v2025731/models/data_skip_next_shipment_positions.rb', line 38

def is_locked
  @is_locked
end

#position_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


34
35
36
# File 'lib/sticky_io_restful_api_v2025731/models/data_skip_next_shipment_positions.rb', line 34

def position_id
  @position_id
end

#productProductData3

TODO: Write general description for this method

Returns:



54
55
56
# File 'lib/sticky_io_restful_api_v2025731/models/data_skip_next_shipment_positions.rb', line 54

def product
  @product
end

#product_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


22
23
24
# File 'lib/sticky_io_restful_api_v2025731/models/data_skip_next_shipment_positions.rb', line 22

def product_id
  @product_id
end

#product_qtyInteger

TODO: Write general description for this method

Returns:

  • (Integer)


30
31
32
# File 'lib/sticky_io_restful_api_v2025731/models/data_skip_next_shipment_positions.rb', line 30

def product_qty
  @product_qty
end

#product_unit_priceString

TODO: Write general description for this method

Returns:

  • (String)


26
27
28
# File 'lib/sticky_io_restful_api_v2025731/models/data_skip_next_shipment_positions.rb', line 26

def product_unit_price
  @product_unit_price
end

#updated_atString

TODO: Write general description for this method

Returns:

  • (String)


42
43
44
# File 'lib/sticky_io_restful_api_v2025731/models/data_skip_next_shipment_positions.rb', line 42

def updated_at
  @updated_at
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
# File 'lib/sticky_io_restful_api_v2025731/models/data_skip_next_shipment_positions.rb', line 107

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  id = hash.key?('id') ? hash['id'] : nil
  collection_offer_id =
    hash.key?('collection_offer_id') ? hash['collection_offer_id'] : nil
  product_id = hash.key?('product_id') ? hash['product_id'] : nil
  product_unit_price =
    hash.key?('product_unit_price') ? hash['product_unit_price'] : nil
  product_qty = hash.key?('product_qty') ? hash['product_qty'] : nil
  position_id = hash.key?('position_id') ? hash['position_id'] : nil
  is_locked = hash.key?('is_locked') ? hash['is_locked'] : nil
  updated_at = hash.key?('updated_at') ? hash['updated_at'] : nil
  created_at = hash.key?('created_at') ? hash['created_at'] : nil
  deleted_at = hash.key?('deleted_at') ? hash['deleted_at'] : nil
  product = ProductData3.from_hash(hash['product']) if hash['product']

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  DataSkipNextShipmentPositions.new(id: id,
                                    collection_offer_id: collection_offer_id,
                                    product_id: product_id,
                                    product_unit_price: product_unit_price,
                                    product_qty: product_qty,
                                    position_id: position_id,
                                    is_locked: is_locked,
                                    updated_at: updated_at,
                                    created_at: created_at,
                                    deleted_at: deleted_at,
                                    product: product,
                                    additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/sticky_io_restful_api_v2025731/models/data_skip_next_shipment_positions.rb', line 57

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['collection_offer_id'] = 'collection_offer_id'
  @_hash['product_id'] = 'product_id'
  @_hash['product_unit_price'] = 'product_unit_price'
  @_hash['product_qty'] = 'product_qty'
  @_hash['position_id'] = 'position_id'
  @_hash['is_locked'] = 'is_locked'
  @_hash['updated_at'] = 'updated_at'
  @_hash['created_at'] = 'created_at'
  @_hash['deleted_at'] = 'deleted_at'
  @_hash['product'] = 'product'
  @_hash
end

.nullablesObject

An array for nullable fields



79
80
81
82
83
# File 'lib/sticky_io_restful_api_v2025731/models/data_skip_next_shipment_positions.rb', line 79

def self.nullables
  %w[
    deleted_at
  ]
end

.optionalsObject

An array for optional fields



74
75
76
# File 'lib/sticky_io_restful_api_v2025731/models/data_skip_next_shipment_positions.rb', line 74

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



158
159
160
161
162
163
164
165
166
# File 'lib/sticky_io_restful_api_v2025731/models/data_skip_next_shipment_positions.rb', line 158

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, collection_offer_id: #{@collection_offer_id.inspect},"\
  " product_id: #{@product_id.inspect}, product_unit_price: #{@product_unit_price.inspect},"\
  " product_qty: #{@product_qty.inspect}, position_id: #{@position_id.inspect}, is_locked:"\
  " #{@is_locked.inspect}, updated_at: #{@updated_at.inspect}, created_at:"\
  " #{@created_at.inspect}, deleted_at: #{@deleted_at.inspect}, product: #{@product.inspect},"\
  " additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



148
149
150
151
152
153
154
155
# File 'lib/sticky_io_restful_api_v2025731/models/data_skip_next_shipment_positions.rb', line 148

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, collection_offer_id: #{@collection_offer_id}, product_id:"\
  " #{@product_id}, product_unit_price: #{@product_unit_price}, product_qty: #{@product_qty},"\
  " position_id: #{@position_id}, is_locked: #{@is_locked}, updated_at: #{@updated_at},"\
  " created_at: #{@created_at}, deleted_at: #{@deleted_at}, product: #{@product},"\
  " additional_properties: #{@additional_properties}>"
end