Class: StickyIoRestfulApiV2025731::DataGetVolumeDiscounts
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- StickyIoRestfulApiV2025731::DataGetVolumeDiscounts
- Defined in:
- lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb
Overview
DataGetVolumeDiscounts Model.
Instance Attribute Summary collapse
-
#apply_to_type_id ⇒ Integer
TODO: Write general description for this method.
-
#campaigns ⇒ Array[Object]
TODO: Write general description for this method.
-
#created_at ⇒ String
TODO: Write general description for this method.
-
#created_by ⇒ Integer
TODO: Write general description for this method.
-
#description ⇒ String
TODO: Write general description for this method.
-
#id ⇒ Integer
TODO: Write general description for this method.
-
#is_active ⇒ Integer
TODO: Write general description for this method.
-
#is_exclude_non_recurring ⇒ Integer
TODO: Write general description for this method.
-
#name ⇒ String
TODO: Write general description for this method.
-
#products ⇒ Array[Object]
TODO: Write general description for this method.
-
#quantities ⇒ Array[Object]
TODO: Write general description for this method.
-
#updated_at ⇒ String
TODO: Write general description for this method.
-
#updated_by ⇒ Object
TODO: Write general description for this method.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(id:, name:, description:, is_active:, created_at:, updated_at:, created_by:, updated_by:, is_exclude_non_recurring:, apply_to_type_id:, quantities:, products:, campaigns:, additional_properties: nil) ⇒ DataGetVolumeDiscounts
constructor
A new instance of DataGetVolumeDiscounts.
-
#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(id:, name:, description:, is_active:, created_at:, updated_at:, created_by:, updated_by:, is_exclude_non_recurring:, apply_to_type_id:, quantities:, products:, campaigns:, additional_properties: nil) ⇒ DataGetVolumeDiscounts
Returns a new instance of DataGetVolumeDiscounts.
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 95 def initialize(id:, name:, description:, is_active:, created_at:, updated_at:, created_by:, updated_by:, is_exclude_non_recurring:, apply_to_type_id:, quantities:, products:, campaigns:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @id = id @name = name @description = description @is_active = is_active @created_at = created_at @updated_at = updated_at @created_by = created_by @updated_by = updated_by @is_exclude_non_recurring = is_exclude_non_recurring @apply_to_type_id = apply_to_type_id @quantities = quantities @products = products @campaigns = campaigns @additional_properties = additional_properties end |
Instance Attribute Details
#apply_to_type_id ⇒ Integer
TODO: Write general description for this method
50 51 52 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 50 def apply_to_type_id @apply_to_type_id end |
#campaigns ⇒ Array[Object]
TODO: Write general description for this method
62 63 64 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 62 def campaigns @campaigns end |
#created_at ⇒ String
TODO: Write general description for this method
30 31 32 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 30 def created_at @created_at end |
#created_by ⇒ Integer
TODO: Write general description for this method
38 39 40 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 38 def created_by @created_by end |
#description ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 22 def description @description end |
#id ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 14 def id @id end |
#is_active ⇒ Integer
TODO: Write general description for this method
26 27 28 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 26 def is_active @is_active end |
#is_exclude_non_recurring ⇒ Integer
TODO: Write general description for this method
46 47 48 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 46 def is_exclude_non_recurring @is_exclude_non_recurring end |
#name ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 18 def name @name end |
#products ⇒ Array[Object]
TODO: Write general description for this method
58 59 60 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 58 def products @products end |
#quantities ⇒ Array[Object]
TODO: Write general description for this method
54 55 56 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 54 def quantities @quantities end |
#updated_at ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 34 def updated_at @updated_at end |
#updated_by ⇒ Object
TODO: Write general description for this method
42 43 44 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 42 def updated_by @updated_by end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 119 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil name = hash.key?('name') ? hash['name'] : nil description = hash.key?('description') ? hash['description'] : nil is_active = hash.key?('is_active') ? hash['is_active'] : nil created_at = hash.key?('created_at') ? hash['created_at'] : nil updated_at = hash.key?('updated_at') ? hash['updated_at'] : nil created_by = hash.key?('created_by') ? hash['created_by'] : nil updated_by = hash.key?('updated_by') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:DataGetVolumeDiscountsUpdatedBy), hash['updated_by'] ) : nil is_exclude_non_recurring = hash.key?('is_exclude_non_recurring') ? hash['is_exclude_non_recurring'] : nil apply_to_type_id = hash.key?('apply_to_type_id') ? hash['apply_to_type_id'] : nil quantities = hash.key?('quantities') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:DataGetVolumeDiscountsQuantities), hash['quantities'] ) : nil products = hash.key?('products') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:DataGetVolumeDiscountsProducts), hash['products'] ) : nil campaigns = hash.key?('campaigns') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:DataGetVolumeDiscountsCampaigns), hash['campaigns'] ) : nil # 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. DataGetVolumeDiscounts.new(id: id, name: name, description: description, is_active: is_active, created_at: created_at, updated_at: updated_at, created_by: created_by, updated_by: updated_by, is_exclude_non_recurring: is_exclude_non_recurring, apply_to_type_id: apply_to_type_id, quantities: quantities, products: products, campaigns: campaigns, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 65 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['name'] = 'name' @_hash['description'] = 'description' @_hash['is_active'] = 'is_active' @_hash['created_at'] = 'created_at' @_hash['updated_at'] = 'updated_at' @_hash['created_by'] = 'created_by' @_hash['updated_by'] = 'updated_by' @_hash['is_exclude_non_recurring'] = 'is_exclude_non_recurring' @_hash['apply_to_type_id'] = 'apply_to_type_id' @_hash['quantities'] = 'quantities' @_hash['products'] = 'products' @_hash['campaigns'] = 'campaigns' @_hash end |
.nullables ⇒ Object
An array for nullable fields
89 90 91 92 93 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 89 def self.nullables %w[ updated_by ] end |
.optionals ⇒ Object
An array for optional fields
84 85 86 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 84 def self.optionals [] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 173 def self.validate(value) if value.instance_of? self return ( APIHelper.valid_type?(value.id, ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value.name, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.description, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.is_active, ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value.created_at, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.updated_at, ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value.created_by, ->(val) { val.instance_of? Integer }) and UnionTypeLookUp.get(:DataGetVolumeDiscountsUpdatedBy) .validate(value.updated_by) and APIHelper.valid_type?(value.is_exclude_non_recurring, ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value.apply_to_type_id, ->(val) { val.instance_of? Integer }) and UnionTypeLookUp.get(:DataGetVolumeDiscountsQuantities) .validate(value.quantities) and UnionTypeLookUp.get(:DataGetVolumeDiscountsProducts) .validate(value.products) and UnionTypeLookUp.get(:DataGetVolumeDiscountsCampaigns) .validate(value.campaigns) ) end return false unless value.instance_of? Hash ( APIHelper.valid_type?(value['id'], ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value['name'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['description'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['is_active'], ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value['created_at'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['updated_at'], ->(val) { val.instance_of? String }) and APIHelper.valid_type?(value['created_by'], ->(val) { val.instance_of? Integer }) and UnionTypeLookUp.get(:DataGetVolumeDiscountsUpdatedBy) .validate(value['updated_by']) and APIHelper.valid_type?(value['is_exclude_non_recurring'], ->(val) { val.instance_of? Integer }) and APIHelper.valid_type?(value['apply_to_type_id'], ->(val) { val.instance_of? Integer }) and UnionTypeLookUp.get(:DataGetVolumeDiscountsQuantities) .validate(value['quantities']) and UnionTypeLookUp.get(:DataGetVolumeDiscountsProducts) .validate(value['products']) and UnionTypeLookUp.get(:DataGetVolumeDiscountsCampaigns) .validate(value['campaigns']) ) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
249 250 251 252 253 254 255 256 257 258 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 249 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, name: #{@name.inspect}, description:"\ " #{@description.inspect}, is_active: #{@is_active.inspect}, created_at:"\ " #{@created_at.inspect}, updated_at: #{@updated_at.inspect}, created_by:"\ " #{@created_by.inspect}, updated_by: #{@updated_by.inspect}, is_exclude_non_recurring:"\ " #{@is_exclude_non_recurring.inspect}, apply_to_type_id: #{@apply_to_type_id.inspect},"\ " quantities: #{@quantities.inspect}, products: #{@products.inspect}, campaigns:"\ " #{@campaigns.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
238 239 240 241 242 243 244 245 246 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_volume_discounts.rb', line 238 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, name: #{@name}, description: #{@description}, is_active:"\ " #{@is_active}, created_at: #{@created_at}, updated_at: #{@updated_at}, created_by:"\ " #{@created_by}, updated_by: #{@updated_by}, is_exclude_non_recurring:"\ " #{@is_exclude_non_recurring}, apply_to_type_id: #{@apply_to_type_id}, quantities:"\ " #{@quantities}, products: #{@products}, campaigns: #{@campaigns}, additional_properties:"\ " #{@additional_properties}>" end |