Class: StickyIoRestfulApiV2025731::DataUpdateOffer
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- StickyIoRestfulApiV2025731::DataUpdateOffer
- Defined in:
- lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb
Overview
DataUpdateOffer Model.
Instance Attribute Summary collapse
-
#billing_models ⇒ Array[BillingModelData4]
TODO: Write general description for this method.
-
#created_at ⇒ CreatedAt
TODO: Write general description for this method.
-
#cycle_products ⇒ String
TODO: Write general description for this method.
-
#cycle_type ⇒ CycleType
TODO: Write general description for this method.
-
#cycle_type_id ⇒ Integer
TODO: Write general description for this method.
-
#expire_cycles ⇒ Integer
TODO: Write general description for this method.
-
#id ⇒ Integer
TODO: Write general description for this method.
-
#is_archived ⇒ Integer
TODO: Write general description for this method.
-
#is_prepaid ⇒ Integer
TODO: Write general description for this method.
-
#is_seasonal ⇒ Integer
TODO: Write general description for this method.
-
#name ⇒ String
TODO: Write general description for this method.
-
#prepaid_profile ⇒ PrepaidProfileData
TODO: Write general description for this method.
-
#products ⇒ Array[Product]
TODO: Write general description for this method.
-
#seasonal_products ⇒ String
TODO: Write general description for this method.
-
#template_id ⇒ Integer
TODO: Write general description for this method.
-
#terminating_cycle_type ⇒ TerminatingCycleType
TODO: Write general description for this method.
-
#trial ⇒ Array[String]
TODO: Write general description for this method.
-
#type ⇒ TypeData
TODO: Write general description for this method.
-
#updated_at ⇒ UpdatedAtData
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:, name:, template_id:, cycle_type_id:, expire_cycles:, is_seasonal:, created_at:, updated_at:, is_archived:, products:, billing_models:, is_prepaid:, type:, cycle_type:, terminating_cycle_type:, prepaid_profile:, trial:, cycle_products:, seasonal_products:, additional_properties: nil) ⇒ DataUpdateOffer
constructor
A new instance of DataUpdateOffer.
-
#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:, name:, template_id:, cycle_type_id:, expire_cycles:, is_seasonal:, created_at:, updated_at:, is_archived:, products:, billing_models:, is_prepaid:, type:, cycle_type:, terminating_cycle_type:, prepaid_profile:, trial:, cycle_products:, seasonal_products:, additional_properties: nil) ⇒ DataUpdateOffer
Returns a new instance of DataUpdateOffer.
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 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 126 def initialize(id:, name:, template_id:, cycle_type_id:, expire_cycles:, is_seasonal:, created_at:, updated_at:, is_archived:, products:, billing_models:, is_prepaid:, type:, cycle_type:, terminating_cycle_type:, prepaid_profile:, trial:, cycle_products:, seasonal_products:, 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 @expire_cycles = expire_cycles @is_seasonal = is_seasonal @created_at = created_at @updated_at = updated_at @is_archived = is_archived @products = products @billing_models = billing_models @is_prepaid = is_prepaid @type = type @cycle_type = cycle_type @terminating_cycle_type = terminating_cycle_type @prepaid_profile = prepaid_profile @trial = trial @cycle_products = cycle_products @seasonal_products = seasonal_products @additional_properties = additional_properties end |
Instance Attribute Details
#billing_models ⇒ Array[BillingModelData4]
TODO: Write general description for this method
54 55 56 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 54 def billing_models @billing_models end |
#created_at ⇒ CreatedAt
TODO: Write general description for this method
38 39 40 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 38 def created_at @created_at end |
#cycle_products ⇒ String
TODO: Write general description for this method
82 83 84 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 82 def cycle_products @cycle_products end |
#cycle_type ⇒ CycleType
TODO: Write general description for this method
66 67 68 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 66 def cycle_type @cycle_type end |
#cycle_type_id ⇒ Integer
TODO: Write general description for this method
26 27 28 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 26 def cycle_type_id @cycle_type_id end |
#expire_cycles ⇒ Integer
TODO: Write general description for this method
30 31 32 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 30 def expire_cycles @expire_cycles end |
#id ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 14 def id @id end |
#is_archived ⇒ Integer
TODO: Write general description for this method
46 47 48 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 46 def is_archived @is_archived end |
#is_prepaid ⇒ Integer
TODO: Write general description for this method
58 59 60 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 58 def is_prepaid @is_prepaid end |
#is_seasonal ⇒ Integer
TODO: Write general description for this method
34 35 36 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 34 def is_seasonal @is_seasonal end |
#name ⇒ String
TODO: Write general description for this method
18 19 20 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 18 def name @name end |
#prepaid_profile ⇒ PrepaidProfileData
TODO: Write general description for this method
74 75 76 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 74 def prepaid_profile @prepaid_profile end |
#products ⇒ Array[Product]
TODO: Write general description for this method
50 51 52 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 50 def products @products end |
#seasonal_products ⇒ String
TODO: Write general description for this method
86 87 88 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 86 def seasonal_products @seasonal_products end |
#template_id ⇒ Integer
TODO: Write general description for this method
22 23 24 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 22 def template_id @template_id end |
#terminating_cycle_type ⇒ TerminatingCycleType
TODO: Write general description for this method
70 71 72 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 70 def terminating_cycle_type @terminating_cycle_type end |
#trial ⇒ Array[String]
TODO: Write general description for this method
78 79 80 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 78 def trial @trial end |
#type ⇒ TypeData
TODO: Write general description for this method
62 63 64 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 62 def type @type end |
#updated_at ⇒ UpdatedAtData
TODO: Write general description for this method
42 43 44 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 42 def updated_at @updated_at end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 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 222 223 224 225 226 227 228 229 230 231 232 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 158 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 expire_cycles = hash.key?('expire_cycles') ? hash['expire_cycles'] : nil is_seasonal = hash.key?('is_seasonal') ? hash['is_seasonal'] : 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 # 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 << (BillingModelData4.from_hash(structure) if structure) end end billing_models = nil unless hash.key?('billing_models') is_prepaid = hash.key?('is_prepaid') ? hash['is_prepaid'] : nil type = TypeData.from_hash(hash['type']) if hash['type'] cycle_type = CycleType.from_hash(hash['cycle_type']) if hash['cycle_type'] terminating_cycle_type = TerminatingCycleType.from_hash(hash['terminating_cycle_type']) if hash['terminating_cycle_type'] prepaid_profile = PrepaidProfileData.from_hash(hash['prepaid_profile']) if hash['prepaid_profile'] trial = hash.key?('trial') ? hash['trial'] : nil cycle_products = hash.key?('cycle_products') ? hash['cycle_products'] : nil seasonal_products = hash.key?('seasonal_products') ? hash['seasonal_products'] : 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. DataUpdateOffer.new(id: id, name: name, template_id: template_id, cycle_type_id: cycle_type_id, expire_cycles: expire_cycles, is_seasonal: is_seasonal, created_at: created_at, updated_at: updated_at, is_archived: is_archived, products: products, billing_models: billing_models, is_prepaid: is_prepaid, type: type, cycle_type: cycle_type, terminating_cycle_type: terminating_cycle_type, prepaid_profile: prepaid_profile, trial: trial, cycle_products: cycle_products, seasonal_products: seasonal_products, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 89 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['expire_cycles'] = 'expire_cycles' @_hash['is_seasonal'] = 'is_seasonal' @_hash['created_at'] = 'created_at' @_hash['updated_at'] = 'updated_at' @_hash['is_archived'] = 'is_archived' @_hash['products'] = 'products' @_hash['billing_models'] = 'billing_models' @_hash['is_prepaid'] = 'is_prepaid' @_hash['type'] = 'type' @_hash['cycle_type'] = 'cycle_type' @_hash['terminating_cycle_type'] = 'terminating_cycle_type' @_hash['prepaid_profile'] = 'prepaid_profile' @_hash['trial'] = 'trial' @_hash['cycle_products'] = 'cycle_products' @_hash['seasonal_products'] = 'seasonal_products' @_hash end |
.nullables ⇒ Object
An array for nullable fields
119 120 121 122 123 124 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 119 def self.nullables %w[ cycle_products seasonal_products ] end |
.optionals ⇒ Object
An array for optional fields
114 115 116 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 114 def self.optionals [] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
248 249 250 251 252 253 254 255 256 257 258 259 260 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 248 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}, expire_cycles:"\ " #{@expire_cycles.inspect}, is_seasonal: #{@is_seasonal.inspect}, created_at:"\ " #{@created_at.inspect}, updated_at: #{@updated_at.inspect}, is_archived:"\ " #{@is_archived.inspect}, products: #{@products.inspect}, billing_models:"\ " #{@billing_models.inspect}, is_prepaid: #{@is_prepaid.inspect}, type: #{@type.inspect},"\ " cycle_type: #{@cycle_type.inspect}, terminating_cycle_type:"\ " #{@terminating_cycle_type.inspect}, prepaid_profile: #{@prepaid_profile.inspect}, trial:"\ " #{@trial.inspect}, cycle_products: #{@cycle_products.inspect}, seasonal_products:"\ " #{@seasonal_products.inspect}, additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
235 236 237 238 239 240 241 242 243 244 245 |
# File 'lib/sticky_io_restful_api_v2025731/models/data_update_offer.rb', line 235 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}, expire_cycles: #{@expire_cycles}, is_seasonal: #{@is_seasonal},"\ " created_at: #{@created_at}, updated_at: #{@updated_at}, is_archived: #{@is_archived},"\ " products: #{@products}, billing_models: #{@billing_models}, is_prepaid: #{@is_prepaid},"\ " type: #{@type}, cycle_type: #{@cycle_type}, terminating_cycle_type:"\ " #{@terminating_cycle_type}, prepaid_profile: #{@prepaid_profile}, trial: #{@trial},"\ " cycle_products: #{@cycle_products}, seasonal_products: #{@seasonal_products},"\ " additional_properties: #{@additional_properties}>" end |