Class: StickyIoRestfulApiV2025731::DataGetOffer

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

Overview

DataGetOffer 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:, template_id:, cycle_type_id:, created_by:, updated_by:, terminating_cycle_type_id:, terminating_product_id:, expire_cycles:, trial_days:, trial_price:, delayed_billing_days:, is_seasonal:, delayed_billing_price:, is_delayed_email_suppressed:, created_at:, updated_at:, is_archived:, is_trial:, is_trial_custom_price:, is_delayed_billing:, is_delayed_billing_custom_price:, is_trial_custom_duration:, products:, billing_models:, additional_properties: nil) ⇒ DataGetOffer

Returns a new instance of DataGetOffer.



154
155
156
157
158
159
160
161
162
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
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_offer.rb', line 154

def initialize(id:, name:, template_id:, cycle_type_id:, created_by:,
               updated_by:, terminating_cycle_type_id:,
               terminating_product_id:, expire_cycles:, trial_days:,
               trial_price:, delayed_billing_days:, is_seasonal:,
               delayed_billing_price:, is_delayed_email_suppressed:,
               created_at:, updated_at:, is_archived:, is_trial:,
               is_trial_custom_price:, is_delayed_billing:,
               is_delayed_billing_custom_price:, is_trial_custom_duration:,
               products:, billing_models:, additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @id = id
  @name = name
  @template_id = template_id
  @cycle_type_id = cycle_type_id
  @created_by = created_by
  @updated_by = updated_by
  @terminating_cycle_type_id = terminating_cycle_type_id
  @terminating_product_id = terminating_product_id
  @expire_cycles = expire_cycles
  @trial_days = trial_days
  @trial_price = trial_price
  @delayed_billing_days = delayed_billing_days
  @is_seasonal = is_seasonal
  @delayed_billing_price = delayed_billing_price
  @is_delayed_email_suppressed = is_delayed_email_suppressed
  @created_at = created_at
  @updated_at = updated_at
  @is_archived = is_archived
  @is_trial = is_trial
  @is_trial_custom_price = is_trial_custom_price
  @is_delayed_billing = is_delayed_billing
  @is_delayed_billing_custom_price = is_delayed_billing_custom_price
  @is_trial_custom_duration = is_trial_custom_duration
  @products = products
  @billing_models = billing_models
  @additional_properties = additional_properties
end

Instance Attribute Details

#billing_modelsArray[BillingModelData3]

TODO: Write general description for this method

Returns:



110
111
112
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_offer.rb', line 110

def billing_models
  @billing_models
end

#created_atCreatedAt

TODO: Write general description for this method

Returns:



74
75
76
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_offer.rb', line 74

def created_at
  @created_at
end

#created_byInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def created_by
  @created_by
end

#cycle_type_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def cycle_type_id
  @cycle_type_id
end

#delayed_billing_daysInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def delayed_billing_days
  @delayed_billing_days
end

#delayed_billing_priceString

TODO: Write general description for this method

Returns:

  • (String)


66
67
68
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_offer.rb', line 66

def delayed_billing_price
  @delayed_billing_price
end

#expire_cyclesInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def expire_cycles
  @expire_cycles
end

#idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def id
  @id
end

#is_archivedInteger

TODO: Write general description for this method

Returns:

  • (Integer)


82
83
84
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_offer.rb', line 82

def is_archived
  @is_archived
end

#is_delayed_billingInteger

TODO: Write general description for this method

Returns:

  • (Integer)


94
95
96
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_offer.rb', line 94

def is_delayed_billing
  @is_delayed_billing
end

#is_delayed_billing_custom_priceInteger

TODO: Write general description for this method

Returns:

  • (Integer)


98
99
100
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_offer.rb', line 98

def is_delayed_billing_custom_price
  @is_delayed_billing_custom_price
end

#is_delayed_email_suppressedInteger

TODO: Write general description for this method

Returns:

  • (Integer)


70
71
72
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_offer.rb', line 70

def is_delayed_email_suppressed
  @is_delayed_email_suppressed
end

#is_seasonalInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def is_seasonal
  @is_seasonal
end

#is_trialInteger

TODO: Write general description for this method

Returns:

  • (Integer)


86
87
88
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_offer.rb', line 86

def is_trial
  @is_trial
end

#is_trial_custom_durationInteger

TODO: Write general description for this method

Returns:

  • (Integer)


102
103
104
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_offer.rb', line 102

def is_trial_custom_duration
  @is_trial_custom_duration
end

#is_trial_custom_priceInteger

TODO: Write general description for this method

Returns:

  • (Integer)


90
91
92
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_offer.rb', line 90

def is_trial_custom_price
  @is_trial_custom_price
end

#nameString

TODO: Write general description for this method

Returns:

  • (String)


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

def name
  @name
end

#productsArray[Product]

TODO: Write general description for this method

Returns:



106
107
108
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_offer.rb', line 106

def products
  @products
end

#template_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def template_id
  @template_id
end

#terminating_cycle_type_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def terminating_cycle_type_id
  @terminating_cycle_type_id
end

#terminating_product_idInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def terminating_product_id
  @terminating_product_id
end

#trial_daysInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def trial_days
  @trial_days
end

#trial_priceString

TODO: Write general description for this method

Returns:

  • (String)


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

def trial_price
  @trial_price
end

#updated_atUpdatedAtData

TODO: Write general description for this method

Returns:



78
79
80
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_offer.rb', line 78

def updated_at
  @updated_at
end

#updated_byInteger

TODO: Write general description for this method

Returns:

  • (Integer)


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

def updated_by
  @updated_by
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
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
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_offer.rb', line 195

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
  template_id = hash.key?('template_id') ? hash['template_id'] : nil
  cycle_type_id = hash.key?('cycle_type_id') ? hash['cycle_type_id'] : nil
  created_by = hash.key?('created_by') ? hash['created_by'] : nil
  updated_by = hash.key?('updated_by') ? hash['updated_by'] : nil
  terminating_cycle_type_id =
    hash.key?('terminating_cycle_type_id') ? hash['terminating_cycle_type_id'] : nil
  terminating_product_id =
    hash.key?('terminating_product_id') ? hash['terminating_product_id'] : nil
  expire_cycles = hash.key?('expire_cycles') ? hash['expire_cycles'] : nil
  trial_days = hash.key?('trial_days') ? hash['trial_days'] : nil
  trial_price = hash.key?('trial_price') ? hash['trial_price'] : nil
  delayed_billing_days =
    hash.key?('delayed_billing_days') ? hash['delayed_billing_days'] : nil
  is_seasonal = hash.key?('is_seasonal') ? hash['is_seasonal'] : nil
  delayed_billing_price =
    hash.key?('delayed_billing_price') ? hash['delayed_billing_price'] : nil
  is_delayed_email_suppressed =
    hash.key?('is_delayed_email_suppressed') ? hash['is_delayed_email_suppressed'] : 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']
  is_archived = hash.key?('is_archived') ? hash['is_archived'] : nil
  is_trial = hash.key?('is_trial') ? hash['is_trial'] : nil
  is_trial_custom_price =
    hash.key?('is_trial_custom_price') ? hash['is_trial_custom_price'] : nil
  is_delayed_billing =
    hash.key?('is_delayed_billing') ? hash['is_delayed_billing'] : nil
  is_delayed_billing_custom_price =
    hash.key?('is_delayed_billing_custom_price') ? hash['is_delayed_billing_custom_price'] : nil
  is_trial_custom_duration =
    hash.key?('is_trial_custom_duration') ? hash['is_trial_custom_duration'] : nil
  # Parameter is an array, so we need to iterate through it
  products = nil
  unless hash['products'].nil?
    products = []
    hash['products'].each do |structure|
      products << (Product.from_hash(structure) if structure)
    end
  end

  products = nil unless hash.key?('products')
  # Parameter is an array, so we need to iterate through it
  billing_models = nil
  unless hash['billing_models'].nil?
    billing_models = []
    hash['billing_models'].each do |structure|
      billing_models << (BillingModelData3.from_hash(structure) if structure)
    end
  end

  billing_models = nil unless hash.key?('billing_models')

  # 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.
  DataGetOffer.new(id: id,
                   name: name,
                   template_id: template_id,
                   cycle_type_id: cycle_type_id,
                   created_by: created_by,
                   updated_by: updated_by,
                   terminating_cycle_type_id: terminating_cycle_type_id,
                   terminating_product_id: terminating_product_id,
                   expire_cycles: expire_cycles,
                   trial_days: trial_days,
                   trial_price: trial_price,
                   delayed_billing_days: delayed_billing_days,
                   is_seasonal: is_seasonal,
                   delayed_billing_price: delayed_billing_price,
                   is_delayed_email_suppressed: is_delayed_email_suppressed,
                   created_at: created_at,
                   updated_at: updated_at,
                   is_archived: is_archived,
                   is_trial: is_trial,
                   is_trial_custom_price: is_trial_custom_price,
                   is_delayed_billing: is_delayed_billing,
                   is_delayed_billing_custom_price: is_delayed_billing_custom_price,
                   is_trial_custom_duration: is_trial_custom_duration,
                   products: products,
                   billing_models: billing_models,
                   additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



113
114
115
116
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
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_offer.rb', line 113

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['id'] = 'id'
  @_hash['name'] = 'name'
  @_hash['template_id'] = 'template_id'
  @_hash['cycle_type_id'] = 'cycle_type_id'
  @_hash['created_by'] = 'created_by'
  @_hash['updated_by'] = 'updated_by'
  @_hash['terminating_cycle_type_id'] = 'terminating_cycle_type_id'
  @_hash['terminating_product_id'] = 'terminating_product_id'
  @_hash['expire_cycles'] = 'expire_cycles'
  @_hash['trial_days'] = 'trial_days'
  @_hash['trial_price'] = 'trial_price'
  @_hash['delayed_billing_days'] = 'delayed_billing_days'
  @_hash['is_seasonal'] = 'is_seasonal'
  @_hash['delayed_billing_price'] = 'delayed_billing_price'
  @_hash['is_delayed_email_suppressed'] = 'is_delayed_email_suppressed'
  @_hash['created_at'] = 'created_at'
  @_hash['updated_at'] = 'updated_at'
  @_hash['is_archived'] = 'is_archived'
  @_hash['is_trial'] = 'is_trial'
  @_hash['is_trial_custom_price'] = 'is_trial_custom_price'
  @_hash['is_delayed_billing'] = 'is_delayed_billing'
  @_hash['is_delayed_billing_custom_price'] =
    'is_delayed_billing_custom_price'
  @_hash['is_trial_custom_duration'] = 'is_trial_custom_duration'
  @_hash['products'] = 'products'
  @_hash['billing_models'] = 'billing_models'
  @_hash
end

.nullablesObject

An array for nullable fields



150
151
152
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_offer.rb', line 150

def self.nullables
  []
end

.optionalsObject

An array for optional fields



145
146
147
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_offer.rb', line 145

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_offer.rb', line 307

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id.inspect}, name: #{@name.inspect}, template_id:"\
  " #{@template_id.inspect}, cycle_type_id: #{@cycle_type_id.inspect}, created_by:"\
  " #{@created_by.inspect}, updated_by: #{@updated_by.inspect}, terminating_cycle_type_id:"\
  " #{@terminating_cycle_type_id.inspect}, terminating_product_id:"\
  " #{@terminating_product_id.inspect}, expire_cycles: #{@expire_cycles.inspect}, trial_days:"\
  " #{@trial_days.inspect}, trial_price: #{@trial_price.inspect}, delayed_billing_days:"\
  " #{@delayed_billing_days.inspect}, is_seasonal: #{@is_seasonal.inspect},"\
  " delayed_billing_price: #{@delayed_billing_price.inspect}, is_delayed_email_suppressed:"\
  " #{@is_delayed_email_suppressed.inspect}, created_at: #{@created_at.inspect}, updated_at:"\
  " #{@updated_at.inspect}, is_archived: #{@is_archived.inspect}, is_trial:"\
  " #{@is_trial.inspect}, is_trial_custom_price: #{@is_trial_custom_price.inspect},"\
  " is_delayed_billing: #{@is_delayed_billing.inspect}, is_delayed_billing_custom_price:"\
  " #{@is_delayed_billing_custom_price.inspect}, is_trial_custom_duration:"\
  " #{@is_trial_custom_duration.inspect}, products: #{@products.inspect}, billing_models:"\
  " #{@billing_models.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
# File 'lib/sticky_io_restful_api_v2025731/models/data_get_offer.rb', line 289

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} id: #{@id}, name: #{@name}, template_id: #{@template_id}, cycle_type_id:"\
  " #{@cycle_type_id}, created_by: #{@created_by}, updated_by: #{@updated_by},"\
  " terminating_cycle_type_id: #{@terminating_cycle_type_id}, terminating_product_id:"\
  " #{@terminating_product_id}, expire_cycles: #{@expire_cycles}, trial_days: #{@trial_days},"\
  " trial_price: #{@trial_price}, delayed_billing_days: #{@delayed_billing_days}, is_seasonal:"\
  " #{@is_seasonal}, delayed_billing_price: #{@delayed_billing_price},"\
  " is_delayed_email_suppressed: #{@is_delayed_email_suppressed}, created_at: #{@created_at},"\
  " updated_at: #{@updated_at}, is_archived: #{@is_archived}, is_trial: #{@is_trial},"\
  " is_trial_custom_price: #{@is_trial_custom_price}, is_delayed_billing:"\
  " #{@is_delayed_billing}, is_delayed_billing_custom_price:"\
  " #{@is_delayed_billing_custom_price}, is_trial_custom_duration:"\
  " #{@is_trial_custom_duration}, products: #{@products}, billing_models: #{@billing_models},"\
  " additional_properties: #{@additional_properties}>"
end