Class: Solifyn::Product
- Inherits:
-
Object
- Object
- Solifyn::Product
- Defined in:
- lib/solifyn/models/product.rb
Overview
Represents a product item created under your business, containing core pricing, status, license behavior, subscription settings, and metadata details.
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#activation_limit ⇒ Object
Maximum number of simultaneous active instances/devices allowed per issued license key (applicable if hasLicenseKey is true).
-
#activation_message ⇒ Object
Custom message displayed when a license key is activated.
-
#billing_period ⇒ Object
The subscription billing cycle interval in days (for subscription products).
-
#brand_id ⇒ Object
Optional brand identifier.
-
#business_id ⇒ Object
The unique identifier of the business owning this product.
-
#created_at ⇒ Object
Timestamp indicating exactly when the product was created.
-
#currency ⇒ Object
The three-letter ISO currency code (e.g. USD, VND, EUR).
-
#custom_fields ⇒ Object
Custom form field questions to ask the customer during checkout.
-
#description ⇒ Object
A comprehensive rich text description of the product.
-
#digital_link ⇒ Object
Secure link for digital delivery.
-
#discount ⇒ Object
Discount value as a percentage or fixed amount.
-
#expiration_days ⇒ Object
Automatic expiration period in days for the subscription entitlement.
-
#expiry_hours ⇒ Object
Number of hours until the license key expires.
-
#has_digital_delivery ⇒ Object
Whether the product includes digital file downloads upon purchase.
-
#has_license_key ⇒ Object
Indicates if the product issues a cryptographically secure software license key upon checkout completion.
-
#id ⇒ Object
The unique identifier (ID) of the product.
-
#image_url ⇒ Object
URL of the product cover image.
-
#instructions ⇒ Object
Special instructions provided upon purchase.
-
#is_free ⇒ Object
Whether the product is free.
-
#is_listed ⇒ Object
Defines if the product is listed publicly on the merchant’s storefront template.
-
#is_permanently_deleted ⇒ Object
Indicates if the product has been permanently deleted.
-
#is_tax_inclusive ⇒ Object
Whether the product price already includes applicable sales taxes.
-
#metadata ⇒ Object
Custom developer metadata key-value pairs associated with the product.
-
#name ⇒ Object
The display name of the product.
-
#pay_what_you_want ⇒ Object
Indicates if customers are allowed to enter a custom pricing amount at checkout.
-
#price ⇒ Object
The price amount of the product (e.g. 29.00).
-
#pricing_type ⇒ Object
Pricing model of the product.
-
#statement_descriptor ⇒ Object
Custom text displayed on customer credit card statements for purchases of this product.
-
#status ⇒ Object
The lifecycle status of the product (e.g. ACTIVE, ARCHIVED).
-
#stock ⇒ Object
Available stock quantity, or null for unlimited inventory.
-
#tax_category ⇒ Object
The tax classification for the product.
-
#trial_period_days ⇒ Object
Trial duration in days for subscription products.
-
#updated_at ⇒ Object
Timestamp indicating when the product was last modified.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ Product
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ Product
Initializes the object
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 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 |
# File 'lib/solifyn/models/product.rb', line 231 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Solifyn::Product` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Solifyn::Product`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'id') self.id = attributes[:'id'] else self.id = nil end if attributes.key?(:'name') self.name = attributes[:'name'] else self.name = nil end if attributes.key?(:'price') self.price = attributes[:'price'] else self.price = nil end if attributes.key?(:'currency') self.currency = attributes[:'currency'] else self.currency = nil end if attributes.key?(:'description') self.description = attributes[:'description'] end if attributes.key?(:'status') self.status = attributes[:'status'] else self.status = nil end if attributes.key?(:'image_url') self.image_url = attributes[:'image_url'] else self.image_url = nil end if attributes.key?(:'tax_category') self.tax_category = attributes[:'tax_category'] else self.tax_category = nil end if attributes.key?(:'pricing_type') self.pricing_type = attributes[:'pricing_type'] else self.pricing_type = nil end if attributes.key?(:'discount') self.discount = attributes[:'discount'] else self.discount = nil end if attributes.key?(:'has_license_key') self.has_license_key = attributes[:'has_license_key'] else self.has_license_key = nil end if attributes.key?(:'has_digital_delivery') self.has_digital_delivery = attributes[:'has_digital_delivery'] else self.has_digital_delivery = nil end if attributes.key?(:'is_tax_inclusive') self.is_tax_inclusive = attributes[:'is_tax_inclusive'] else self.is_tax_inclusive = nil end if attributes.key?(:'billing_period') self.billing_period = attributes[:'billing_period'] else self.billing_period = nil end if attributes.key?(:'trial_period_days') self.trial_period_days = attributes[:'trial_period_days'] else self.trial_period_days = nil end if attributes.key?(:'expiration_days') self.expiration_days = attributes[:'expiration_days'] else self.expiration_days = nil end if attributes.key?(:'statement_descriptor') self.statement_descriptor = attributes[:'statement_descriptor'] else self.statement_descriptor = nil end if attributes.key?(:'pay_what_you_want') self.pay_what_you_want = attributes[:'pay_what_you_want'] else self.pay_what_you_want = nil end if attributes.key?(:'metadata') if (value = attributes[:'metadata']).is_a?(Hash) self. = value end else self. = nil end if attributes.key?(:'custom_fields') if (value = attributes[:'custom_fields']).is_a?(Array) self.custom_fields = value end else self.custom_fields = nil end if attributes.key?(:'stock') self.stock = attributes[:'stock'] else self.stock = nil end if attributes.key?(:'activation_limit') self.activation_limit = attributes[:'activation_limit'] else self.activation_limit = nil end if attributes.key?(:'is_listed') self.is_listed = attributes[:'is_listed'] else self.is_listed = nil end if attributes.key?(:'is_free') self.is_free = attributes[:'is_free'] else self.is_free = nil end if attributes.key?(:'created_at') self.created_at = attributes[:'created_at'] else self.created_at = nil end if attributes.key?(:'updated_at') self.updated_at = attributes[:'updated_at'] else self.updated_at = nil end if attributes.key?(:'is_permanently_deleted') self.is_permanently_deleted = attributes[:'is_permanently_deleted'] else self.is_permanently_deleted = nil end if attributes.key?(:'brand_id') self.brand_id = attributes[:'brand_id'] else self.brand_id = nil end if attributes.key?(:'digital_link') self.digital_link = attributes[:'digital_link'] else self.digital_link = nil end if attributes.key?(:'instructions') self.instructions = attributes[:'instructions'] else self.instructions = nil end if attributes.key?(:'activation_message') self. = attributes[:'activation_message'] else self. = nil end if attributes.key?(:'expiry_hours') self.expiry_hours = attributes[:'expiry_hours'] else self.expiry_hours = nil end if attributes.key?(:'business_id') self.business_id = attributes[:'business_id'] else self.business_id = nil end end |
Instance Attribute Details
#activation_limit ⇒ Object
Maximum number of simultaneous active instances/devices allowed per issued license key (applicable if hasLicenseKey is true).
83 84 85 |
# File 'lib/solifyn/models/product.rb', line 83 def activation_limit @activation_limit end |
#activation_message ⇒ Object
Custom message displayed when a license key is activated.
110 111 112 |
# File 'lib/solifyn/models/product.rb', line 110 def @activation_message end |
#billing_period ⇒ Object
The subscription billing cycle interval in days (for subscription products).
59 60 61 |
# File 'lib/solifyn/models/product.rb', line 59 def billing_period @billing_period end |
#brand_id ⇒ Object
Optional brand identifier.
101 102 103 |
# File 'lib/solifyn/models/product.rb', line 101 def brand_id @brand_id end |
#business_id ⇒ Object
The unique identifier of the business owning this product.
116 117 118 |
# File 'lib/solifyn/models/product.rb', line 116 def business_id @business_id end |
#created_at ⇒ Object
Timestamp indicating exactly when the product was created.
92 93 94 |
# File 'lib/solifyn/models/product.rb', line 92 def created_at @created_at end |
#currency ⇒ Object
The three-letter ISO currency code (e.g. USD, VND, EUR).
29 30 31 |
# File 'lib/solifyn/models/product.rb', line 29 def currency @currency end |
#custom_fields ⇒ Object
Custom form field questions to ask the customer during checkout.
77 78 79 |
# File 'lib/solifyn/models/product.rb', line 77 def custom_fields @custom_fields end |
#description ⇒ Object
A comprehensive rich text description of the product.
32 33 34 |
# File 'lib/solifyn/models/product.rb', line 32 def description @description end |
#digital_link ⇒ Object
Secure link for digital delivery.
104 105 106 |
# File 'lib/solifyn/models/product.rb', line 104 def digital_link @digital_link end |
#discount ⇒ Object
Discount value as a percentage or fixed amount.
47 48 49 |
# File 'lib/solifyn/models/product.rb', line 47 def discount @discount end |
#expiration_days ⇒ Object
Automatic expiration period in days for the subscription entitlement.
65 66 67 |
# File 'lib/solifyn/models/product.rb', line 65 def expiration_days @expiration_days end |
#expiry_hours ⇒ Object
Number of hours until the license key expires.
113 114 115 |
# File 'lib/solifyn/models/product.rb', line 113 def expiry_hours @expiry_hours end |
#has_digital_delivery ⇒ Object
Whether the product includes digital file downloads upon purchase.
53 54 55 |
# File 'lib/solifyn/models/product.rb', line 53 def has_digital_delivery @has_digital_delivery end |
#has_license_key ⇒ Object
Indicates if the product issues a cryptographically secure software license key upon checkout completion.
50 51 52 |
# File 'lib/solifyn/models/product.rb', line 50 def has_license_key @has_license_key end |
#id ⇒ Object
The unique identifier (ID) of the product.
20 21 22 |
# File 'lib/solifyn/models/product.rb', line 20 def id @id end |
#image_url ⇒ Object
URL of the product cover image.
38 39 40 |
# File 'lib/solifyn/models/product.rb', line 38 def image_url @image_url end |
#instructions ⇒ Object
Special instructions provided upon purchase.
107 108 109 |
# File 'lib/solifyn/models/product.rb', line 107 def instructions @instructions end |
#is_free ⇒ Object
Whether the product is free.
89 90 91 |
# File 'lib/solifyn/models/product.rb', line 89 def is_free @is_free end |
#is_listed ⇒ Object
Defines if the product is listed publicly on the merchant’s storefront template.
86 87 88 |
# File 'lib/solifyn/models/product.rb', line 86 def is_listed @is_listed end |
#is_permanently_deleted ⇒ Object
Indicates if the product has been permanently deleted.
98 99 100 |
# File 'lib/solifyn/models/product.rb', line 98 def is_permanently_deleted @is_permanently_deleted end |
#is_tax_inclusive ⇒ Object
Whether the product price already includes applicable sales taxes.
56 57 58 |
# File 'lib/solifyn/models/product.rb', line 56 def is_tax_inclusive @is_tax_inclusive end |
#metadata ⇒ Object
Custom developer metadata key-value pairs associated with the product.
74 75 76 |
# File 'lib/solifyn/models/product.rb', line 74 def @metadata end |
#name ⇒ Object
The display name of the product.
23 24 25 |
# File 'lib/solifyn/models/product.rb', line 23 def name @name end |
#pay_what_you_want ⇒ Object
Indicates if customers are allowed to enter a custom pricing amount at checkout.
71 72 73 |
# File 'lib/solifyn/models/product.rb', line 71 def pay_what_you_want @pay_what_you_want end |
#price ⇒ Object
The price amount of the product (e.g. 29.00).
26 27 28 |
# File 'lib/solifyn/models/product.rb', line 26 def price @price end |
#pricing_type ⇒ Object
Pricing model of the product.
44 45 46 |
# File 'lib/solifyn/models/product.rb', line 44 def pricing_type @pricing_type end |
#statement_descriptor ⇒ Object
Custom text displayed on customer credit card statements for purchases of this product.
68 69 70 |
# File 'lib/solifyn/models/product.rb', line 68 def statement_descriptor @statement_descriptor end |
#status ⇒ Object
The lifecycle status of the product (e.g. ACTIVE, ARCHIVED).
35 36 37 |
# File 'lib/solifyn/models/product.rb', line 35 def status @status end |
#stock ⇒ Object
Available stock quantity, or null for unlimited inventory.
80 81 82 |
# File 'lib/solifyn/models/product.rb', line 80 def stock @stock end |
#tax_category ⇒ Object
The tax classification for the product.
41 42 43 |
# File 'lib/solifyn/models/product.rb', line 41 def tax_category @tax_category end |
#trial_period_days ⇒ Object
Trial duration in days for subscription products.
62 63 64 |
# File 'lib/solifyn/models/product.rb', line 62 def trial_period_days @trial_period_days end |
#updated_at ⇒ Object
Timestamp indicating when the product was last modified.
95 96 97 |
# File 'lib/solifyn/models/product.rb', line 95 def updated_at @updated_at end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 |
# File 'lib/solifyn/models/product.rb', line 723 def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = Solifyn.const_get(type) klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
180 181 182 |
# File 'lib/solifyn/models/product.rb', line 180 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
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 170 171 172 173 174 175 176 177 |
# File 'lib/solifyn/models/product.rb', line 141 def self.attribute_map { :'id' => :'id', :'name' => :'name', :'price' => :'price', :'currency' => :'currency', :'description' => :'description', :'status' => :'status', :'image_url' => :'imageUrl', :'tax_category' => :'taxCategory', :'pricing_type' => :'pricingType', :'discount' => :'discount', :'has_license_key' => :'hasLicenseKey', :'has_digital_delivery' => :'hasDigitalDelivery', :'is_tax_inclusive' => :'isTaxInclusive', :'billing_period' => :'billingPeriod', :'trial_period_days' => :'trialPeriodDays', :'expiration_days' => :'expirationDays', :'statement_descriptor' => :'statementDescriptor', :'pay_what_you_want' => :'payWhatYouWant', :'metadata' => :'metadata', :'custom_fields' => :'customFields', :'stock' => :'stock', :'activation_limit' => :'activationLimit', :'is_listed' => :'isListed', :'is_free' => :'isFree', :'created_at' => :'createdAt', :'updated_at' => :'updatedAt', :'is_permanently_deleted' => :'isPermanentlyDeleted', :'brand_id' => :'brandId', :'digital_link' => :'digitalLink', :'instructions' => :'instructions', :'activation_message' => :'activationMessage', :'expiry_hours' => :'expiryHours', :'business_id' => :'businessId' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 |
# File 'lib/solifyn/models/product.rb', line 699 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
224 225 226 227 |
# File 'lib/solifyn/models/product.rb', line 224 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
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 |
# File 'lib/solifyn/models/product.rb', line 185 def self.openapi_types { :'id' => :'String', :'name' => :'String', :'price' => :'Float', :'currency' => :'String', :'description' => :'String', :'status' => :'String', :'image_url' => :'String', :'tax_category' => :'String', :'pricing_type' => :'String', :'discount' => :'Float', :'has_license_key' => :'Boolean', :'has_digital_delivery' => :'Boolean', :'is_tax_inclusive' => :'Boolean', :'billing_period' => :'Integer', :'trial_period_days' => :'Integer', :'expiration_days' => :'Integer', :'statement_descriptor' => :'String', :'pay_what_you_want' => :'Boolean', :'metadata' => :'Hash<String, String>', :'custom_fields' => :'Array<Object>', :'stock' => :'Integer', :'activation_limit' => :'Integer', :'is_listed' => :'Boolean', :'is_free' => :'Boolean', :'created_at' => :'Time', :'updated_at' => :'Time', :'is_permanently_deleted' => :'Boolean', :'brand_id' => :'String', :'digital_link' => :'String', :'instructions' => :'String', :'activation_message' => :'String', :'expiry_hours' => :'Integer', :'business_id' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 |
# File 'lib/solifyn/models/product.rb', line 646 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && name == o.name && price == o.price && currency == o.currency && description == o.description && status == o.status && image_url == o.image_url && tax_category == o.tax_category && pricing_type == o.pricing_type && discount == o.discount && has_license_key == o.has_license_key && has_digital_delivery == o.has_digital_delivery && is_tax_inclusive == o.is_tax_inclusive && billing_period == o.billing_period && trial_period_days == o.trial_period_days && expiration_days == o.expiration_days && statement_descriptor == o.statement_descriptor && pay_what_you_want == o.pay_what_you_want && == o. && custom_fields == o.custom_fields && stock == o.stock && activation_limit == o.activation_limit && is_listed == o.is_listed && is_free == o.is_free && created_at == o.created_at && updated_at == o.updated_at && is_permanently_deleted == o.is_permanently_deleted && brand_id == o.brand_id && digital_link == o.digital_link && instructions == o.instructions && == o. && expiry_hours == o.expiry_hours && business_id == o.business_id end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
794 795 796 797 798 799 800 801 802 803 804 805 806 |
# File 'lib/solifyn/models/product.rb', line 794 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#eql?(o) ⇒ Boolean
686 687 688 |
# File 'lib/solifyn/models/product.rb', line 686 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
692 693 694 |
# File 'lib/solifyn/models/product.rb', line 692 def hash [id, name, price, currency, description, status, image_url, tax_category, pricing_type, discount, has_license_key, has_digital_delivery, is_tax_inclusive, billing_period, trial_period_days, expiration_days, statement_descriptor, pay_what_you_want, , custom_fields, stock, activation_limit, is_listed, is_free, created_at, updated_at, is_permanently_deleted, brand_id, digital_link, instructions, , expiry_hours, business_id].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 |
# File 'lib/solifyn/models/product.rb', line 447 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new if @id.nil? invalid_properties.push('invalid value for "id", id cannot be nil.') end if @name.nil? invalid_properties.push('invalid value for "name", name cannot be nil.') end if @price.nil? invalid_properties.push('invalid value for "price", price cannot be nil.') end if @currency.nil? invalid_properties.push('invalid value for "currency", currency cannot be nil.') end if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') end if @image_url.nil? invalid_properties.push('invalid value for "image_url", image_url cannot be nil.') end if @tax_category.nil? invalid_properties.push('invalid value for "tax_category", tax_category cannot be nil.') end if @pricing_type.nil? invalid_properties.push('invalid value for "pricing_type", pricing_type cannot be nil.') end if @discount.nil? invalid_properties.push('invalid value for "discount", discount cannot be nil.') end if @has_license_key.nil? invalid_properties.push('invalid value for "has_license_key", has_license_key cannot be nil.') end if @has_digital_delivery.nil? invalid_properties.push('invalid value for "has_digital_delivery", has_digital_delivery cannot be nil.') end if @is_tax_inclusive.nil? invalid_properties.push('invalid value for "is_tax_inclusive", is_tax_inclusive cannot be nil.') end if @billing_period.nil? invalid_properties.push('invalid value for "billing_period", billing_period cannot be nil.') end if @trial_period_days.nil? invalid_properties.push('invalid value for "trial_period_days", trial_period_days cannot be nil.') end if @expiration_days.nil? invalid_properties.push('invalid value for "expiration_days", expiration_days cannot be nil.') end if @statement_descriptor.nil? invalid_properties.push('invalid value for "statement_descriptor", statement_descriptor cannot be nil.') end if @pay_what_you_want.nil? invalid_properties.push('invalid value for "pay_what_you_want", pay_what_you_want cannot be nil.') end if @metadata.nil? invalid_properties.push('invalid value for "metadata", metadata cannot be nil.') end if @custom_fields.nil? invalid_properties.push('invalid value for "custom_fields", custom_fields cannot be nil.') end if @stock.nil? invalid_properties.push('invalid value for "stock", stock cannot be nil.') end if @activation_limit.nil? invalid_properties.push('invalid value for "activation_limit", activation_limit cannot be nil.') end if @is_listed.nil? invalid_properties.push('invalid value for "is_listed", is_listed cannot be nil.') end if @is_free.nil? invalid_properties.push('invalid value for "is_free", is_free cannot be nil.') end if @created_at.nil? invalid_properties.push('invalid value for "created_at", created_at cannot be nil.') end if @updated_at.nil? invalid_properties.push('invalid value for "updated_at", updated_at cannot be nil.') end if @is_permanently_deleted.nil? invalid_properties.push('invalid value for "is_permanently_deleted", is_permanently_deleted cannot be nil.') end if @brand_id.nil? invalid_properties.push('invalid value for "brand_id", brand_id cannot be nil.') end if @digital_link.nil? invalid_properties.push('invalid value for "digital_link", digital_link cannot be nil.') end if @instructions.nil? invalid_properties.push('invalid value for "instructions", instructions cannot be nil.') end if @activation_message.nil? invalid_properties.push('invalid value for "activation_message", activation_message cannot be nil.') end if @expiry_hours.nil? invalid_properties.push('invalid value for "expiry_hours", expiry_hours cannot be nil.') end if @business_id.nil? invalid_properties.push('invalid value for "business_id", business_id cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
770 771 772 |
# File 'lib/solifyn/models/product.rb', line 770 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
776 777 778 779 780 781 782 783 784 785 786 787 788 |
# File 'lib/solifyn/models/product.rb', line 776 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
764 765 766 |
# File 'lib/solifyn/models/product.rb', line 764 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 |
# File 'lib/solifyn/models/product.rb', line 583 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' return false if @id.nil? return false if @name.nil? return false if @price.nil? return false if @currency.nil? return false if @status.nil? return false if @image_url.nil? return false if @tax_category.nil? tax_category_validator = EnumAttributeValidator.new('String', ["digital_products", "saas", "physical_products", "service"]) return false unless tax_category_validator.valid?(@tax_category) return false if @pricing_type.nil? pricing_type_validator = EnumAttributeValidator.new('String', ["usage_based", "one_time", "renewal"]) return false unless pricing_type_validator.valid?(@pricing_type) return false if @discount.nil? return false if @has_license_key.nil? return false if @has_digital_delivery.nil? return false if @is_tax_inclusive.nil? return false if @billing_period.nil? return false if @trial_period_days.nil? return false if @expiration_days.nil? return false if @statement_descriptor.nil? return false if @pay_what_you_want.nil? return false if @metadata.nil? return false if @custom_fields.nil? return false if @stock.nil? return false if @activation_limit.nil? return false if @is_listed.nil? return false if @is_free.nil? return false if @created_at.nil? return false if @updated_at.nil? return false if @is_permanently_deleted.nil? return false if @brand_id.nil? return false if @digital_link.nil? return false if @instructions.nil? return false if @activation_message.nil? return false if @expiry_hours.nil? return false if @business_id.nil? true end |