Class: StickyIoRestfulApiV2025731::DataUpdateConfiguration

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

Overview

DataUpdateConfiguration 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:, name:, default_quantity:, price:, is_upsell:, step_number:, created_by:, updated_by:, created_at:, updated_at:, billing_model:, product:, trial_product:, additional_properties: nil) ⇒ DataUpdateConfiguration

Returns a new instance of DataUpdateConfiguration.



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_configuration.rb', line 93

def initialize(id:, name:, default_quantity:, price:, is_upsell:,
               step_number:, created_by:, updated_by:, created_at:,
               updated_at:, billing_model:, product:, trial_product:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @id = id
  @name = name
  @default_quantity = default_quantity
  @price = price
  @is_upsell = is_upsell
  @step_number = step_number
  @created_by = created_by
  @updated_by = updated_by
  @created_at = created_at
  @updated_at = updated_at
  @billing_model = billing_model
  @product = product
  @trial_product = trial_product
  @additional_properties = additional_properties
end

Instance Attribute Details

#billing_modelBillingModelData2

TODO: Write general description for this method

Returns:



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

def billing_model
  @billing_model
end

#created_atString

TODO: Write general description for this method

Returns:

  • (String)


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

def created_at
  @created_at
end

#created_byInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def created_by
  @created_by
end

#default_quantityInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def default_quantity
  @default_quantity
end

#idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def id
  @id
end

#is_upsellInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def is_upsell
  @is_upsell
end

#nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def name
  @name
end

#priceString

TODO: Write general description for this method

Returns:

  • (String)


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

def price
  @price
end

#productProductData2

TODO: Write general description for this method

Returns:



58
59
60
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_configuration.rb', line 58

def product
  @product
end

#step_numberInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def step_number
  @step_number
end

#trial_productTrialProduct

TODO: Write general description for this method

Returns:



62
63
64
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_configuration.rb', line 62

def trial_product
  @trial_product
end

#updated_atString

TODO: Write general description for this method

Returns:

  • (String)


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

def updated_at
  @updated_at
end

#updated_byInteger

TODO: Write general description for this method

Returns:

  • (Integer)


42
43
44
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_configuration.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.



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
146
147
148
149
150
151
152
153
154
155
156
157
158
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_configuration.rb', line 117

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
  default_quantity =
    hash.key?('default_quantity') ? hash['default_quantity'] : nil
  price = hash.key?('price') ? hash['price'] : nil
  is_upsell = hash.key?('is_upsell') ? hash['is_upsell'] : nil
  step_number = hash.key?('step_number') ? hash['step_number'] : nil
  created_by = hash.key?('created_by') ? hash['created_by'] : nil
  updated_by = hash.key?('updated_by') ? hash['updated_by'] : nil
  created_at = hash.key?('created_at') ? hash['created_at'] : nil
  updated_at = hash.key?('updated_at') ? hash['updated_at'] : nil
  billing_model = BillingModelData2.from_hash(hash['billing_model']) if hash['billing_model']
  product = ProductData2.from_hash(hash['product']) if hash['product']
  trial_product = TrialProduct.from_hash(hash['trial_product']) if hash['trial_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.
  DataUpdateConfiguration.new(id: id,
                              name: name,
                              default_quantity: default_quantity,
                              price: price,
                              is_upsell: is_upsell,
                              step_number: step_number,
                              created_by: created_by,
                              updated_by: updated_by,
                              created_at: created_at,
                              updated_at: updated_at,
                              billing_model: billing_model,
                              product: product,
                              trial_product: trial_product,
                              additional_properties: additional_properties)
end

.namesObject

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_update_configuration.rb', line 65

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['name'] = 'name'
  @_hash['default_quantity'] = 'default_quantity'
  @_hash['price'] = 'price'
  @_hash['is_upsell'] = 'is_upsell'
  @_hash['step_number'] = 'step_number'
  @_hash['created_by'] = 'created_by'
  @_hash['updated_by'] = 'updated_by'
  @_hash['created_at'] = 'created_at'
  @_hash['updated_at'] = 'updated_at'
  @_hash['billing_model'] = 'billing_model'
  @_hash['product'] = 'product'
  @_hash['trial_product'] = 'trial_product'
  @_hash
end

.nullablesObject

An array for nullable fields



89
90
91
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_configuration.rb', line 89

def self.nullables
  []
end

.optionalsObject

An array for optional fields



84
85
86
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_configuration.rb', line 84

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



171
172
173
174
175
176
177
178
179
180
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_configuration.rb', line 171

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, name: #{@name.inspect}, default_quantity:"\
  " #{@default_quantity.inspect}, price: #{@price.inspect}, is_upsell: #{@is_upsell.inspect},"\
  " step_number: #{@step_number.inspect}, created_by: #{@created_by.inspect}, updated_by:"\
  " #{@updated_by.inspect}, created_at: #{@created_at.inspect}, updated_at:"\
  " #{@updated_at.inspect}, billing_model: #{@billing_model.inspect}, product:"\
  " #{@product.inspect}, trial_product: #{@trial_product.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



161
162
163
164
165
166
167
168
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_configuration.rb', line 161

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, name: #{@name}, default_quantity: #{@default_quantity}, price:"\
  " #{@price}, is_upsell: #{@is_upsell}, step_number: #{@step_number}, created_by:"\
  " #{@created_by}, updated_by: #{@updated_by}, created_at: #{@created_at}, updated_at:"\
  " #{@updated_at}, billing_model: #{@billing_model}, product: #{@product}, trial_product:"\
  " #{@trial_product}, additional_properties: #{@additional_properties}>"
end