Class: StickyIoRestfulApiV2025731::DataCreateProductCouponProfile
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- StickyIoRestfulApiV2025731::DataCreateProductCouponProfile
- Defined in:
- lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb
Overview
DataCreateProductCouponProfile Model.
Instance Attribute Summary collapse
-
#created_at ⇒ CreatedAt
TODO: Write general description for this method.
-
#creator ⇒ CreatorData1
TODO: Write general description for this method.
-
#description ⇒ String
TODO: Write general description for this method.
-
#discount_amount ⇒ String
TODO: Write general description for this method.
-
#discount_amt ⇒ String
TODO: Write general description for this method.
-
#discount_pct ⇒ String
TODO: Write general description for this method.
-
#discount_percent ⇒ String
TODO: Write general description for this method.
-
#expires_at ⇒ ExpiresAt
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_bogo ⇒ Integer
TODO: Write general description for this method.
-
#is_free_shipping ⇒ Integer
TODO: Write general description for this method.
-
#is_lifetime ⇒ Integer
TODO: Write general description for this method.
-
#limits ⇒ LimitsData
TODO: Write general description for this method.
-
#max_qty ⇒ Integer
TODO: Write general description for this method.
-
#maximum_quantity ⇒ Integer
TODO: Write general description for this method.
-
#min_qty ⇒ Integer
TODO: Write general description for this method.
-
#minimum_purchase ⇒ String
TODO: Write general description for this method.
-
#minimum_quantity ⇒ Integer
TODO: Write general description for this method.
-
#name ⇒ String
TODO: Write general description for this method.
-
#product_id ⇒ Integer
TODO: Write general description for this method.
-
#promo_code_count ⇒ Integer
TODO: Write general description for this method.
-
#type_id ⇒ Integer
TODO: Write general description for this method.
-
#updated_at ⇒ UpdatedAtData
TODO: Write general description for this method.
-
#updator ⇒ UpdatorData2
TODO: Write general description for this method.
-
#use_count ⇒ Integer
TODO: Write general description for this method.
-
#variant_id ⇒ Integer
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.
Instance Method Summary collapse
-
#initialize(id:, type_id:, name:, description:, use_count:, discount_amt:, discount_pct:, minimum_purchase:, is_lifetime:, product_id:, variant_id:, min_qty:, max_qty:, is_bogo:, discount_amount:, discount_percent:, minimum_quantity:, maximum_quantity:, is_active:, created_at:, updated_at:, expires_at:, is_free_shipping:, promo_code_count:, limits:, creator:, updator:, additional_properties: nil) ⇒ DataCreateProductCouponProfile
constructor
A new instance of DataCreateProductCouponProfile.
-
#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:, type_id:, name:, description:, use_count:, discount_amt:, discount_pct:, minimum_purchase:, is_lifetime:, product_id:, variant_id:, min_qty:, max_qty:, is_bogo:, discount_amount:, discount_percent:, minimum_quantity:, maximum_quantity:, is_active:, created_at:, updated_at:, expires_at:, is_free_shipping:, promo_code_count:, limits:, creator:, updator:, additional_properties: nil) ⇒ DataCreateProductCouponProfile
Returns a new instance of DataCreateProductCouponProfile.
163 164 165 166 167 168 169 170 171 172 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 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 163 def initialize(id:, type_id:, name:, description:, use_count:, discount_amt:, discount_pct:, minimum_purchase:, is_lifetime:, product_id:, variant_id:, min_qty:, max_qty:, is_bogo:, discount_amount:, discount_percent:, minimum_quantity:, maximum_quantity:, is_active:, created_at:, updated_at:, expires_at:, is_free_shipping:, promo_code_count:, limits:, creator:, updator:, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @id = id @type_id = type_id @name = name @description = description @use_count = use_count @discount_amt = discount_amt @discount_pct = discount_pct @minimum_purchase = minimum_purchase @is_lifetime = is_lifetime @product_id = product_id @variant_id = variant_id @min_qty = min_qty @max_qty = max_qty @is_bogo = is_bogo @discount_amount = discount_amount @discount_percent = discount_percent @minimum_quantity = minimum_quantity @maximum_quantity = maximum_quantity @is_active = is_active @created_at = created_at @updated_at = updated_at @expires_at = expires_at @is_free_shipping = is_free_shipping @promo_code_count = promo_code_count @limits = limits @creator = creator @updator = updator @additional_properties = additional_properties end |
Instance Attribute Details
#created_at ⇒ CreatedAt
TODO: Write general description for this method
90 91 92 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 90 def created_at @created_at end |
#creator ⇒ CreatorData1
TODO: Write general description for this method
114 115 116 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 114 def creator @creator end |
#description ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 26 def description @description end |
#discount_amount ⇒ String
TODO: Write general description for this method
70 71 72 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 70 def discount_amount @discount_amount end |
#discount_amt ⇒ String
TODO: Write general description for this method
34 35 36 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 34 def discount_amt @discount_amt end |
#discount_pct ⇒ String
TODO: Write general description for this method
38 39 40 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 38 def discount_pct @discount_pct end |
#discount_percent ⇒ String
TODO: Write general description for this method
74 75 76 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 74 def discount_percent @discount_percent end |
#expires_at ⇒ ExpiresAt
TODO: Write general description for this method
98 99 100 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 98 def expires_at @expires_at end |
#id ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 14 def id @id end |
#is_active ⇒ Integer
TODO: Write general description for this method
86 87 88 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 86 def is_active @is_active end |
#is_bogo ⇒ Integer
TODO: Write general description for this method
66 67 68 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 66 def is_bogo @is_bogo end |
#is_free_shipping ⇒ Integer
TODO: Write general description for this method
102 103 104 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 102 def is_free_shipping @is_free_shipping end |
#is_lifetime ⇒ Integer
TODO: Write general description for this method
46 47 48 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 46 def is_lifetime @is_lifetime end |
#limits ⇒ LimitsData
TODO: Write general description for this method
110 111 112 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 110 def limits @limits end |
#max_qty ⇒ Integer
TODO: Write general description for this method
62 63 64 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 62 def max_qty @max_qty end |
#maximum_quantity ⇒ Integer
TODO: Write general description for this method
82 83 84 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 82 def maximum_quantity @maximum_quantity end |
#min_qty ⇒ Integer
TODO: Write general description for this method
58 59 60 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 58 def min_qty @min_qty end |
#minimum_purchase ⇒ String
TODO: Write general description for this method
42 43 44 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 42 def minimum_purchase @minimum_purchase end |
#minimum_quantity ⇒ Integer
TODO: Write general description for this method
78 79 80 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 78 def minimum_quantity @minimum_quantity end |
#name ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 22 def name @name end |
#product_id ⇒ Integer
TODO: Write general description for this method
50 51 52 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 50 def product_id @product_id end |
#promo_code_count ⇒ Integer
TODO: Write general description for this method
106 107 108 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 106 def promo_code_count @promo_code_count end |
#type_id ⇒ Integer
TODO: Write general description for this method
18 19 20 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 18 def type_id @type_id end |
#updated_at ⇒ UpdatedAtData
TODO: Write general description for this method
94 95 96 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 94 def updated_at @updated_at end |
#updator ⇒ UpdatorData2
TODO: Write general description for this method
118 119 120 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 118 def updator @updator end |
#use_count ⇒ Integer
TODO: Write general description for this method
30 31 32 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 30 def use_count @use_count end |
#variant_id ⇒ Integer
TODO: Write general description for this method
54 55 56 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 54 def variant_id @variant_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 205 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil type_id = hash.key?('type_id') ? hash['type_id'] : nil name = hash.key?('name') ? hash['name'] : nil description = hash.key?('description') ? hash['description'] : nil use_count = hash.key?('use_count') ? hash['use_count'] : nil discount_amt = hash.key?('discount_amt') ? hash['discount_amt'] : nil discount_pct = hash.key?('discount_pct') ? hash['discount_pct'] : nil minimum_purchase = hash.key?('minimum_purchase') ? hash['minimum_purchase'] : nil is_lifetime = hash.key?('is_lifetime') ? hash['is_lifetime'] : nil product_id = hash.key?('product_id') ? hash['product_id'] : nil variant_id = hash.key?('variant_id') ? hash['variant_id'] : nil min_qty = hash.key?('min_qty') ? hash['min_qty'] : nil max_qty = hash.key?('max_qty') ? hash['max_qty'] : nil is_bogo = hash.key?('is_bogo') ? hash['is_bogo'] : nil discount_amount = hash.key?('discount_amount') ? hash['discount_amount'] : nil discount_percent = hash.key?('discount_percent') ? hash['discount_percent'] : nil minimum_quantity = hash.key?('minimum_quantity') ? hash['minimum_quantity'] : nil maximum_quantity = hash.key?('maximum_quantity') ? hash['maximum_quantity'] : nil is_active = hash.key?('is_active') ? hash['is_active'] : nil created_at = CreatedAt.from_hash(hash['created_at']) if hash['created_at'] updated_at = UpdatedAtData.from_hash(hash['updated_at']) if hash['updated_at'] expires_at = ExpiresAt.from_hash(hash['expires_at']) if hash['expires_at'] is_free_shipping = hash.key?('is_free_shipping') ? hash['is_free_shipping'] : nil promo_code_count = hash.key?('promo_code_count') ? hash['promo_code_count'] : nil limits = LimitsData.from_hash(hash['limits']) if hash['limits'] creator = CreatorData1.from_hash(hash['creator']) if hash['creator'] updator = UpdatorData2.from_hash(hash['updator']) if hash['updator'] # 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. DataCreateProductCouponProfile.new(id: id, type_id: type_id, name: name, description: description, use_count: use_count, discount_amt: discount_amt, discount_pct: discount_pct, minimum_purchase: minimum_purchase, is_lifetime: is_lifetime, product_id: product_id, variant_id: variant_id, min_qty: min_qty, max_qty: max_qty, is_bogo: is_bogo, discount_amount: discount_amount, discount_percent: discount_percent, minimum_quantity: minimum_quantity, maximum_quantity: maximum_quantity, is_active: is_active, created_at: created_at, updated_at: updated_at, expires_at: expires_at, is_free_shipping: is_free_shipping, promo_code_count: promo_code_count, limits: limits, creator: creator, updator: updator, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
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 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 121 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['type_id'] = 'type_id' @_hash['name'] = 'name' @_hash['description'] = 'description' @_hash['use_count'] = 'use_count' @_hash['discount_amt'] = 'discount_amt' @_hash['discount_pct'] = 'discount_pct' @_hash['minimum_purchase'] = 'minimum_purchase' @_hash['is_lifetime'] = 'is_lifetime' @_hash['product_id'] = 'product_id' @_hash['variant_id'] = 'variant_id' @_hash['min_qty'] = 'min_qty' @_hash['max_qty'] = 'max_qty' @_hash['is_bogo'] = 'is_bogo' @_hash['discount_amount'] = 'discount_amount' @_hash['discount_percent'] = 'discount_percent' @_hash['minimum_quantity'] = 'minimum_quantity' @_hash['maximum_quantity'] = 'maximum_quantity' @_hash['is_active'] = 'is_active' @_hash['created_at'] = 'created_at' @_hash['updated_at'] = 'updated_at' @_hash['expires_at'] = 'expires_at' @_hash['is_free_shipping'] = 'is_free_shipping' @_hash['promo_code_count'] = 'promo_code_count' @_hash['limits'] = 'limits' @_hash['creator'] = 'creator' @_hash['updator'] = 'updator' @_hash end |
.nullables ⇒ Object
An array for nullable fields
159 160 161 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 159 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
154 155 156 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 154 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 298 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, type_id: #{@type_id.inspect}, name: #{@name.inspect},"\ " description: #{@description.inspect}, use_count: #{@use_count.inspect}, discount_amt:"\ " #{@discount_amt.inspect}, discount_pct: #{@discount_pct.inspect}, minimum_purchase:"\ " #{@minimum_purchase.inspect}, is_lifetime: #{@is_lifetime.inspect}, product_id:"\ " #{@product_id.inspect}, variant_id: #{@variant_id.inspect}, min_qty: #{@min_qty.inspect},"\ " max_qty: #{@max_qty.inspect}, is_bogo: #{@is_bogo.inspect}, discount_amount:"\ " #{@discount_amount.inspect}, discount_percent: #{@discount_percent.inspect},"\ " minimum_quantity: #{@minimum_quantity.inspect}, maximum_quantity:"\ " #{@maximum_quantity.inspect}, is_active: #{@is_active.inspect}, created_at:"\ " #{@created_at.inspect}, updated_at: #{@updated_at.inspect}, expires_at:"\ " #{@expires_at.inspect}, is_free_shipping: #{@is_free_shipping.inspect}, promo_code_count:"\ " #{@promo_code_count.inspect}, limits: #{@limits.inspect}, creator: #{@creator.inspect},"\ " updator: #{@updator.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_create_product_coupon_profile.rb', line 283 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, type_id: #{@type_id}, name: #{@name}, description:"\ " #{@description}, use_count: #{@use_count}, discount_amt: #{@discount_amt}, discount_pct:"\ " #{@discount_pct}, minimum_purchase: #{@minimum_purchase}, is_lifetime: #{@is_lifetime},"\ " product_id: #{@product_id}, variant_id: #{@variant_id}, min_qty: #{@min_qty}, max_qty:"\ " #{@max_qty}, is_bogo: #{@is_bogo}, discount_amount: #{@discount_amount}, discount_percent:"\ " #{@discount_percent}, minimum_quantity: #{@minimum_quantity}, maximum_quantity:"\ " #{@maximum_quantity}, is_active: #{@is_active}, created_at: #{@created_at}, updated_at:"\ " #{@updated_at}, expires_at: #{@expires_at}, is_free_shipping: #{@is_free_shipping},"\ " promo_code_count: #{@promo_code_count}, limits: #{@limits}, creator: #{@creator}, updator:"\ " #{@updator}, additional_properties: #{@additional_properties}>" end |