Class: StickyIoRestfulApiV2025731::ChildCreateConfigurationRequest

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

Overview

ChildCreateConfigurationRequest 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(name:, billing_model_id:, product_id:, default_quantity:, price:, trial_product_id:, is_upsell:, step_number:, additional_properties: nil) ⇒ ChildCreateConfigurationRequest

Returns a new instance of ChildCreateConfigurationRequest.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/sticky_io_restful_api_v2025731/models/child_create_configuration_request.rb', line 68

def initialize(name:, billing_model_id:, product_id:, default_quantity:,
               price:, trial_product_id:, is_upsell:, step_number:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @name = name
  @billing_model_id = billing_model_id
  @product_id = product_id
  @default_quantity = default_quantity
  @price = price
  @trial_product_id = trial_product_id
  @is_upsell = is_upsell
  @step_number = step_number
  @additional_properties = additional_properties
end

Instance Attribute Details

#billing_model_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def billing_model_id
  @billing_model_id
end

#default_quantityInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def default_quantity
  @default_quantity
end

#is_upsellInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def is_upsell
  @is_upsell
end

#nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def name
  @name
end

#priceFloat

TODO: Write general description for this method

Returns:

  • (Float)


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

def price
  @price
end

#product_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def product_id
  @product_id
end

#step_numberInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def step_number
  @step_number
end

#trial_product_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def trial_product_id
  @trial_product_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'lib/sticky_io_restful_api_v2025731/models/child_create_configuration_request.rb', line 86

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : nil
  billing_model_id =
    hash.key?('billing_model_id') ? hash['billing_model_id'] : nil
  product_id = hash.key?('product_id') ? hash['product_id'] : nil
  default_quantity =
    hash.key?('default_quantity') ? hash['default_quantity'] : nil
  price = hash.key?('price') ? hash['price'] : nil
  trial_product_id =
    hash.key?('trial_product_id') ? hash['trial_product_id'] : nil
  is_upsell = hash.key?('is_upsell') ? hash['is_upsell'] : nil
  step_number = hash.key?('step_number') ? hash['step_number'] : 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.
  ChildCreateConfigurationRequest.new(name: name,
                                      billing_model_id: billing_model_id,
                                      product_id: product_id,
                                      default_quantity: default_quantity,
                                      price: price,
                                      trial_product_id: trial_product_id,
                                      is_upsell: is_upsell,
                                      step_number: step_number,
                                      additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/sticky_io_restful_api_v2025731/models/child_create_configuration_request.rb', line 45

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['name'] = 'name'
  @_hash['billing_model_id'] = 'billing_model_id'
  @_hash['product_id'] = 'product_id'
  @_hash['default_quantity'] = 'default_quantity'
  @_hash['price'] = 'price'
  @_hash['trial_product_id'] = 'trial_product_id'
  @_hash['is_upsell'] = 'is_upsell'
  @_hash['step_number'] = 'step_number'
  @_hash
end

.nullablesObject

An array for nullable fields



64
65
66
# File 'lib/sticky_io_restful_api_v2025731/models/child_create_configuration_request.rb', line 64

def self.nullables
  []
end

.optionalsObject

An array for optional fields



59
60
61
# File 'lib/sticky_io_restful_api_v2025731/models/child_create_configuration_request.rb', line 59

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



131
132
133
134
135
136
137
138
# File 'lib/sticky_io_restful_api_v2025731/models/child_create_configuration_request.rb', line 131

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} name: #{@name.inspect}, billing_model_id: #{@billing_model_id.inspect},"\
  " product_id: #{@product_id.inspect}, default_quantity: #{@default_quantity.inspect}, price:"\
  " #{@price.inspect}, trial_product_id: #{@trial_product_id.inspect}, is_upsell:"\
  " #{@is_upsell.inspect}, step_number: #{@step_number.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



122
123
124
125
126
127
128
# File 'lib/sticky_io_restful_api_v2025731/models/child_create_configuration_request.rb', line 122

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} name: #{@name}, billing_model_id: #{@billing_model_id}, product_id:"\
  " #{@product_id}, default_quantity: #{@default_quantity}, price: #{@price},"\
  " trial_product_id: #{@trial_product_id}, is_upsell: #{@is_upsell}, step_number:"\
  " #{@step_number}, additional_properties: #{@additional_properties}>"
end