Class: AdvancedBilling::SubscriptionComponent
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- AdvancedBilling::SubscriptionComponent
- Defined in:
- lib/advanced_billing/models/subscription_component.rb
Overview
SubscriptionComponent Model.
Instance Attribute Summary collapse
-
#allocated_quantity ⇒ Object
For Quantity-based components: The current allocation for the component on the given subscription.
-
#allow_fractional_quantities ⇒ TrueClass | FalseClass
The type of credit to be created when upgrading/downgrading.
-
#archived_at ⇒ DateTime
The type of credit to be created when upgrading/downgrading.
-
#component_handle ⇒ String
For Quantity-based components: The current allocation for the component on the given subscription.
-
#component_id ⇒ Integer
For Quantity-based components: The current allocation for the component on the given subscription.
-
#created_at ⇒ DateTime
The type of credit to be created when upgrading/downgrading.
-
#currency ⇒ String
(for on/off components) indicates if the component is enabled for the subscription.
-
#description ⇒ String
The type of credit to be created when upgrading/downgrading.
-
#display_on_hosted_page ⇒ TrueClass | FalseClass
An optional object, will be returned if provided ‘include=subscription` query param.
-
#downgrade_credit ⇒ CreditType
The type of credit to be created when upgrading/downgrading.
-
#enabled ⇒ TrueClass | FalseClass
(for on/off components) indicates if the component is enabled for the subscription.
-
#historic_usages ⇒ Array[HistoricUsage]
An optional object, will be returned if provided ‘include=subscription` query param.
-
#id ⇒ Integer
TODO: Write general description for this method.
-
#interval ⇒ Integer
The numerical interval.
-
#interval_unit ⇒ IntervalUnit
A string representing the interval unit for this component price point, either month or day.
-
#kind ⇒ ComponentKind
A handle for the component type.
-
#name ⇒ String
TODO: Write general description for this method.
-
#price_point_handle ⇒ String
The type of credit to be created when upgrading/downgrading.
-
#price_point_id ⇒ Integer
The type of credit to be created when upgrading/downgrading.
-
#price_point_name ⇒ String
The type of credit to be created when upgrading/downgrading.
-
#price_point_type ⇒ PricePointType
The type of credit to be created when upgrading/downgrading.
-
#pricing_scheme ⇒ PricingScheme
For Quantity-based components: The current allocation for the component on the given subscription.
-
#product_family_handle ⇒ String
The type of credit to be created when upgrading/downgrading.
-
#product_family_id ⇒ Integer
The type of credit to be created when upgrading/downgrading.
-
#recurring ⇒ TrueClass | FalseClass
For Quantity-based components: The current allocation for the component on the given subscription.
-
#subscription ⇒ SubscriptionComponentSubscription
An optional object, will be returned if provided ‘include=subscription` query param.
-
#subscription_id ⇒ Integer
For Quantity-based components: The current allocation for the component on the given subscription.
-
#unit_balance ⇒ Integer
(for on/off components) indicates if the component is enabled for the subscription.
-
#unit_name ⇒ String
A handle for the component type.
-
#updated_at ⇒ DateTime
The type of credit to be created when upgrading/downgrading.
-
#upgrade_charge ⇒ CreditType
The type of credit to be created when upgrading/downgrading.
-
#use_site_exchange_rate ⇒ TrueClass | FalseClass
The type of credit to be created when upgrading/downgrading.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(id: SKIP, name: SKIP, kind: SKIP, unit_name: SKIP, enabled: SKIP, unit_balance: SKIP, currency: SKIP, allocated_quantity: SKIP, pricing_scheme: SKIP, component_id: SKIP, component_handle: SKIP, subscription_id: SKIP, recurring: SKIP, upgrade_charge: SKIP, downgrade_credit: SKIP, archived_at: SKIP, price_point_id: SKIP, price_point_handle: SKIP, price_point_type: SKIP, price_point_name: SKIP, product_family_id: SKIP, product_family_handle: SKIP, created_at: SKIP, updated_at: SKIP, use_site_exchange_rate: SKIP, description: SKIP, allow_fractional_quantities: SKIP, subscription: SKIP, historic_usages: SKIP, display_on_hosted_page: SKIP, interval: SKIP, interval_unit: SKIP, additional_properties: {}) ⇒ SubscriptionComponent
constructor
A new instance of SubscriptionComponent.
- #to_custom_archived_at ⇒ Object
- #to_custom_created_at ⇒ Object
- #to_custom_updated_at ⇒ 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: SKIP, name: SKIP, kind: SKIP, unit_name: SKIP, enabled: SKIP, unit_balance: SKIP, currency: SKIP, allocated_quantity: SKIP, pricing_scheme: SKIP, component_id: SKIP, component_handle: SKIP, subscription_id: SKIP, recurring: SKIP, upgrade_charge: SKIP, downgrade_credit: SKIP, archived_at: SKIP, price_point_id: SKIP, price_point_handle: SKIP, price_point_type: SKIP, price_point_name: SKIP, product_family_id: SKIP, product_family_handle: SKIP, created_at: SKIP, updated_at: SKIP, use_site_exchange_rate: SKIP, description: SKIP, allow_fractional_quantities: SKIP, subscription: SKIP, historic_usages: SKIP, display_on_hosted_page: SKIP, interval: SKIP, interval_unit: SKIP, additional_properties: {}) ⇒ SubscriptionComponent
Returns a new instance of SubscriptionComponent.
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 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 286 def initialize(id: SKIP, name: SKIP, kind: SKIP, unit_name: SKIP, enabled: SKIP, unit_balance: SKIP, currency: SKIP, allocated_quantity: SKIP, pricing_scheme: SKIP, component_id: SKIP, component_handle: SKIP, subscription_id: SKIP, recurring: SKIP, upgrade_charge: SKIP, downgrade_credit: SKIP, archived_at: SKIP, price_point_id: SKIP, price_point_handle: SKIP, price_point_type: SKIP, price_point_name: SKIP, product_family_id: SKIP, product_family_handle: SKIP, created_at: SKIP, updated_at: SKIP, use_site_exchange_rate: SKIP, description: SKIP, allow_fractional_quantities: SKIP, subscription: SKIP, historic_usages: SKIP, display_on_hosted_page: SKIP, interval: SKIP, interval_unit: SKIP, additional_properties: {}) # Add additional model properties to the instance. additional_properties.each do |_name, _value| instance_variable_set("@#{_name}", _value) end @id = id unless id == SKIP @name = name unless name == SKIP @kind = kind unless kind == SKIP @unit_name = unit_name unless unit_name == SKIP @enabled = enabled unless enabled == SKIP @unit_balance = unit_balance unless unit_balance == SKIP @currency = currency unless currency == SKIP @allocated_quantity = allocated_quantity unless allocated_quantity == SKIP @pricing_scheme = pricing_scheme unless pricing_scheme == SKIP @component_id = component_id unless component_id == SKIP @component_handle = component_handle unless component_handle == SKIP @subscription_id = subscription_id unless subscription_id == SKIP @recurring = recurring unless recurring == SKIP @upgrade_charge = upgrade_charge unless upgrade_charge == SKIP @downgrade_credit = downgrade_credit unless downgrade_credit == SKIP @archived_at = archived_at unless archived_at == SKIP @price_point_id = price_point_id unless price_point_id == SKIP @price_point_handle = price_point_handle unless price_point_handle == SKIP @price_point_type = price_point_type unless price_point_type == SKIP @price_point_name = price_point_name unless price_point_name == SKIP @product_family_id = product_family_id unless product_family_id == SKIP @product_family_handle = product_family_handle unless product_family_handle == SKIP @created_at = created_at unless created_at == SKIP @updated_at = updated_at unless updated_at == SKIP @use_site_exchange_rate = use_site_exchange_rate unless use_site_exchange_rate == SKIP @description = description unless description == SKIP unless allow_fractional_quantities == SKIP @allow_fractional_quantities = allow_fractional_quantities end @subscription = subscription unless subscription == SKIP @historic_usages = historic_usages unless historic_usages == SKIP @display_on_hosted_page = display_on_hosted_page unless display_on_hosted_page == SKIP @interval = interval unless interval == SKIP @interval_unit = interval_unit unless interval_unit == SKIP end |
Instance Attribute Details
#allocated_quantity ⇒ Object
For Quantity-based components: The current allocation for the component on the given subscription. For On/Off components: Use 1 for on. Use 0 for off.
48 49 50 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 48 def allocated_quantity @allocated_quantity end |
#allow_fractional_quantities ⇒ TrueClass | FalseClass
The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: ‘full`, `prorated`, `none`.
162 163 164 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 162 def allow_fractional_quantities @allow_fractional_quantities end |
#archived_at ⇒ DateTime
The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: ‘full`, `prorated`, `none`.
96 97 98 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 96 def archived_at @archived_at end |
#component_handle ⇒ String
For Quantity-based components: The current allocation for the component on the given subscription. For On/Off components: Use 1 for on. Use 0 for off.
66 67 68 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 66 def component_handle @component_handle end |
#component_id ⇒ Integer
For Quantity-based components: The current allocation for the component on the given subscription. For On/Off components: Use 1 for on. Use 0 for off.
60 61 62 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 60 def component_id @component_id end |
#created_at ⇒ DateTime
The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: ‘full`, `prorated`, `none`.
138 139 140 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 138 def created_at @created_at end |
#currency ⇒ String
(for on/off components) indicates if the component is enabled for the subscription
42 43 44 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 42 def currency @currency end |
#description ⇒ String
The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: ‘full`, `prorated`, `none`.
156 157 158 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 156 def description @description end |
#display_on_hosted_page ⇒ TrueClass | FalseClass
An optional object, will be returned if provided ‘include=subscription` query param.
177 178 179 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 177 def display_on_hosted_page @display_on_hosted_page end |
#downgrade_credit ⇒ CreditType
The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: ‘full`, `prorated`, `none`.
90 91 92 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 90 def downgrade_credit @downgrade_credit end |
#enabled ⇒ TrueClass | FalseClass
(for on/off components) indicates if the component is enabled for the subscription
32 33 34 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 32 def enabled @enabled end |
#historic_usages ⇒ Array[HistoricUsage]
An optional object, will be returned if provided ‘include=subscription` query param.
172 173 174 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 172 def historic_usages @historic_usages end |
#id ⇒ Integer
TODO: Write general description for this method
15 16 17 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 15 def id @id end |
#interval ⇒ Integer
The numerical interval. i.e. an interval of ‘30’ coupled with an interval_unit of day would mean this component price point would renew every 30 days. This property is only available for sites with Multifrequency enabled.
184 185 186 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 184 def interval @interval end |
#interval_unit ⇒ IntervalUnit
A string representing the interval unit for this component price point, either month or day. This property is only available for sites with Multifrequency enabled.
190 191 192 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 190 def interval_unit @interval_unit end |
#kind ⇒ ComponentKind
A handle for the component type
23 24 25 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 23 def kind @kind end |
#name ⇒ String
TODO: Write general description for this method
19 20 21 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 19 def name @name end |
#price_point_handle ⇒ String
The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: ‘full`, `prorated`, `none`.
108 109 110 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 108 def price_point_handle @price_point_handle end |
#price_point_id ⇒ Integer
The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: ‘full`, `prorated`, `none`.
102 103 104 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 102 def price_point_id @price_point_id end |
#price_point_name ⇒ String
The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: ‘full`, `prorated`, `none`.
120 121 122 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 120 def price_point_name @price_point_name end |
#price_point_type ⇒ PricePointType
The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: ‘full`, `prorated`, `none`.
114 115 116 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 114 def price_point_type @price_point_type end |
#pricing_scheme ⇒ PricingScheme
For Quantity-based components: The current allocation for the component on the given subscription. For On/Off components: Use 1 for on. Use 0 for off.
54 55 56 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 54 def pricing_scheme @pricing_scheme end |
#product_family_handle ⇒ String
The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: ‘full`, `prorated`, `none`.
132 133 134 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 132 def product_family_handle @product_family_handle end |
#product_family_id ⇒ Integer
The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: ‘full`, `prorated`, `none`.
126 127 128 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 126 def product_family_id @product_family_id end |
#recurring ⇒ TrueClass | FalseClass
For Quantity-based components: The current allocation for the component on the given subscription. For On/Off components: Use 1 for on. Use 0 for off.
78 79 80 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 78 def recurring @recurring end |
#subscription ⇒ SubscriptionComponentSubscription
An optional object, will be returned if provided ‘include=subscription` query param.
167 168 169 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 167 def subscription @subscription end |
#subscription_id ⇒ Integer
For Quantity-based components: The current allocation for the component on the given subscription. For On/Off components: Use 1 for on. Use 0 for off.
72 73 74 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 72 def subscription_id @subscription_id end |
#unit_balance ⇒ Integer
(for on/off components) indicates if the component is enabled for the subscription
37 38 39 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 37 def unit_balance @unit_balance end |
#unit_name ⇒ String
A handle for the component type
27 28 29 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 27 def unit_name @unit_name end |
#updated_at ⇒ DateTime
The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: ‘full`, `prorated`, `none`.
144 145 146 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 144 def updated_at @updated_at end |
#upgrade_charge ⇒ CreditType
The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: ‘full`, `prorated`, `none`.
84 85 86 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 84 def upgrade_charge @upgrade_charge end |
#use_site_exchange_rate ⇒ TrueClass | FalseClass
The type of credit to be created when upgrading/downgrading. Defaults to the component and then site setting if one is not provided. Available values: ‘full`, `prorated`, `none`.
150 151 152 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 150 def use_site_exchange_rate @use_site_exchange_rate end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 444 445 446 447 448 449 450 451 452 453 454 455 456 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 344 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : SKIP name = hash.key?('name') ? hash['name'] : SKIP kind = hash.key?('kind') ? hash['kind'] : SKIP unit_name = hash.key?('unit_name') ? hash['unit_name'] : SKIP enabled = hash.key?('enabled') ? hash['enabled'] : SKIP unit_balance = hash.key?('unit_balance') ? hash['unit_balance'] : SKIP currency = hash.key?('currency') ? hash['currency'] : SKIP allocated_quantity = hash.key?('allocated_quantity') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:SubscriptionComponentAllocatedQuantity), hash['allocated_quantity'] ) : SKIP pricing_scheme = hash.key?('pricing_scheme') ? hash['pricing_scheme'] : SKIP component_id = hash.key?('component_id') ? hash['component_id'] : SKIP component_handle = hash.key?('component_handle') ? hash['component_handle'] : SKIP subscription_id = hash.key?('subscription_id') ? hash['subscription_id'] : SKIP recurring = hash.key?('recurring') ? hash['recurring'] : SKIP upgrade_charge = hash.key?('upgrade_charge') ? hash['upgrade_charge'] : SKIP downgrade_credit = hash.key?('downgrade_credit') ? hash['downgrade_credit'] : SKIP archived_at = if hash.key?('archived_at') (DateTimeHelper.from_rfc3339(hash['archived_at']) if hash['archived_at']) else SKIP end price_point_id = hash.key?('price_point_id') ? hash['price_point_id'] : SKIP price_point_handle = hash.key?('price_point_handle') ? hash['price_point_handle'] : SKIP price_point_type = hash.key?('price_point_type') ? hash['price_point_type'] : SKIP price_point_name = hash.key?('price_point_name') ? hash['price_point_name'] : SKIP product_family_id = hash.key?('product_family_id') ? hash['product_family_id'] : SKIP product_family_handle = hash.key?('product_family_handle') ? hash['product_family_handle'] : SKIP created_at = if hash.key?('created_at') (DateTimeHelper.from_rfc3339(hash['created_at']) if hash['created_at']) else SKIP end updated_at = if hash.key?('updated_at') (DateTimeHelper.from_rfc3339(hash['updated_at']) if hash['updated_at']) else SKIP end use_site_exchange_rate = hash.key?('use_site_exchange_rate') ? hash['use_site_exchange_rate'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP allow_fractional_quantities = hash.key?('allow_fractional_quantities') ? hash['allow_fractional_quantities'] : SKIP subscription = SubscriptionComponentSubscription.from_hash(hash['subscription']) if hash['subscription'] # Parameter is an array, so we need to iterate through it historic_usages = nil unless hash['historic_usages'].nil? historic_usages = [] hash['historic_usages'].each do |structure| historic_usages << (HistoricUsage.from_hash(structure) if structure) end end historic_usages = SKIP unless hash.key?('historic_usages') display_on_hosted_page = hash.key?('display_on_hosted_page') ? hash['display_on_hosted_page'] : SKIP interval = hash.key?('interval') ? hash['interval'] : SKIP interval_unit = hash.key?('interval_unit') ? hash['interval_unit'] : SKIP # Clean out expected properties from Hash. additional_properties = hash.reject { |k, _| names.value?(k) } # Create object from extracted values. SubscriptionComponent.new(id: id, name: name, kind: kind, unit_name: unit_name, enabled: enabled, unit_balance: unit_balance, currency: currency, allocated_quantity: allocated_quantity, pricing_scheme: pricing_scheme, component_id: component_id, component_handle: component_handle, subscription_id: subscription_id, recurring: recurring, upgrade_charge: upgrade_charge, downgrade_credit: downgrade_credit, archived_at: archived_at, price_point_id: price_point_id, price_point_handle: price_point_handle, price_point_type: price_point_type, price_point_name: price_point_name, product_family_id: product_family_id, product_family_handle: product_family_handle, created_at: created_at, updated_at: updated_at, use_site_exchange_rate: use_site_exchange_rate, description: description, allow_fractional_quantities: allow_fractional_quantities, subscription: subscription, historic_usages: historic_usages, display_on_hosted_page: display_on_hosted_page, interval: interval, interval_unit: interval_unit, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
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 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 193 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['name'] = 'name' @_hash['kind'] = 'kind' @_hash['unit_name'] = 'unit_name' @_hash['enabled'] = 'enabled' @_hash['unit_balance'] = 'unit_balance' @_hash['currency'] = 'currency' @_hash['allocated_quantity'] = 'allocated_quantity' @_hash['pricing_scheme'] = 'pricing_scheme' @_hash['component_id'] = 'component_id' @_hash['component_handle'] = 'component_handle' @_hash['subscription_id'] = 'subscription_id' @_hash['recurring'] = 'recurring' @_hash['upgrade_charge'] = 'upgrade_charge' @_hash['downgrade_credit'] = 'downgrade_credit' @_hash['archived_at'] = 'archived_at' @_hash['price_point_id'] = 'price_point_id' @_hash['price_point_handle'] = 'price_point_handle' @_hash['price_point_type'] = 'price_point_type' @_hash['price_point_name'] = 'price_point_name' @_hash['product_family_id'] = 'product_family_id' @_hash['product_family_handle'] = 'product_family_handle' @_hash['created_at'] = 'created_at' @_hash['updated_at'] = 'updated_at' @_hash['use_site_exchange_rate'] = 'use_site_exchange_rate' @_hash['description'] = 'description' @_hash['allow_fractional_quantities'] = 'allow_fractional_quantities' @_hash['subscription'] = 'subscription' @_hash['historic_usages'] = 'historic_usages' @_hash['display_on_hosted_page'] = 'display_on_hosted_page' @_hash['interval'] = 'interval' @_hash['interval_unit'] = 'interval_unit' @_hash end |
.nullables ⇒ Object
An array for nullable fields
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 269 def self.nullables %w[ pricing_scheme component_handle upgrade_charge downgrade_credit archived_at price_point_id price_point_handle price_point_type price_point_name use_site_exchange_rate description interval_unit ] end |
.optionals ⇒ Object
An array for optional fields
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 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 231 def self.optionals %w[ id name kind unit_name enabled unit_balance currency allocated_quantity pricing_scheme component_id component_handle subscription_id recurring upgrade_charge downgrade_credit archived_at price_point_id price_point_handle price_point_type price_point_name product_family_id product_family_handle created_at updated_at use_site_exchange_rate description allow_fractional_quantities subscription historic_usages display_on_hosted_page interval interval_unit ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
472 473 474 475 476 477 478 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 472 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#to_custom_archived_at ⇒ Object
458 459 460 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 458 def to_custom_archived_at DateTimeHelper.to_rfc3339(archived_at) end |
#to_custom_created_at ⇒ Object
462 463 464 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 462 def to_custom_created_at DateTimeHelper.to_rfc3339(created_at) end |
#to_custom_updated_at ⇒ Object
466 467 468 |
# File 'lib/advanced_billing/models/subscription_component.rb', line 466 def to_custom_updated_at DateTimeHelper.to_rfc3339(updated_at) end |