Class: ApiReference::ReplacePlanPriceParams
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ApiReference::ReplacePlanPriceParams
- Defined in:
- lib/api_reference/models/replace_plan_price_params.rb
Overview
ReplacePlanPriceParams Model.
Instance Attribute Summary collapse
-
#allocation_price ⇒ NewAllocationPrice
The allocation price to add to the plan.
-
#license_allocation_price ⇒ NewLicenseAllocationUnitPrice
The license allocation price to add to the plan.
-
#plan_phase_order ⇒ Integer
The phase to replace this price from.
-
#price ⇒ Object
The price to add to the plan.
-
#replaces_price_id ⇒ String
The id of the price on the plan to replace in the plan.
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(replaces_price_id:, price: SKIP, allocation_price: SKIP, license_allocation_price: SKIP, plan_phase_order: SKIP) ⇒ ReplacePlanPriceParams
constructor
A new instance of ReplacePlanPriceParams.
-
#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(replaces_price_id:, price: SKIP, allocation_price: SKIP, license_allocation_price: SKIP, plan_phase_order: SKIP) ⇒ ReplacePlanPriceParams
Returns a new instance of ReplacePlanPriceParams.
63 64 65 66 67 68 69 70 |
# File 'lib/api_reference/models/replace_plan_price_params.rb', line 63 def initialize(replaces_price_id:, price: SKIP, allocation_price: SKIP, license_allocation_price: SKIP, plan_phase_order: SKIP) @price = price unless price == SKIP @allocation_price = allocation_price unless allocation_price == SKIP @license_allocation_price = license_allocation_price unless license_allocation_price == SKIP @replaces_price_id = replaces_price_id @plan_phase_order = plan_phase_order unless plan_phase_order == SKIP end |
Instance Attribute Details
#allocation_price ⇒ NewAllocationPrice
The allocation price to add to the plan.
18 19 20 |
# File 'lib/api_reference/models/replace_plan_price_params.rb', line 18 def allocation_price @allocation_price end |
#license_allocation_price ⇒ NewLicenseAllocationUnitPrice
The license allocation price to add to the plan.
22 23 24 |
# File 'lib/api_reference/models/replace_plan_price_params.rb', line 22 def license_allocation_price @license_allocation_price end |
#plan_phase_order ⇒ Integer
The phase to replace this price from.
30 31 32 |
# File 'lib/api_reference/models/replace_plan_price_params.rb', line 30 def plan_phase_order @plan_phase_order end |
#price ⇒ Object
The price to add to the plan
14 15 16 |
# File 'lib/api_reference/models/replace_plan_price_params.rb', line 14 def price @price end |
#replaces_price_id ⇒ String
The id of the price on the plan to replace in the plan.
26 27 28 |
# File 'lib/api_reference/models/replace_plan_price_params.rb', line 26 def replaces_price_id @replaces_price_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/api_reference/models/replace_plan_price_params.rb', line 73 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. replaces_price_id = hash.key?('replaces_price_id') ? hash['replaces_price_id'] : nil price = hash.key?('price') ? hash['price'] : SKIP allocation_price = NewAllocationPrice.from_hash(hash['allocation_price']) if hash['allocation_price'] if hash['license_allocation_price'] license_allocation_price = NewLicenseAllocationUnitPrice.from_hash(hash['license_allocation_price']) end plan_phase_order = hash.key?('plan_phase_order') ? hash['plan_phase_order'] : SKIP # Create object from extracted values. ReplacePlanPriceParams.new(replaces_price_id: replaces_price_id, price: price, allocation_price: allocation_price, license_allocation_price: license_allocation_price, plan_phase_order: plan_phase_order) end |
.names ⇒ Object
A mapping from model property names to API property names.
33 34 35 36 37 38 39 40 41 |
# File 'lib/api_reference/models/replace_plan_price_params.rb', line 33 def self.names @_hash = {} if @_hash.nil? @_hash['price'] = 'price' @_hash['allocation_price'] = 'allocation_price' @_hash['license_allocation_price'] = 'license_allocation_price' @_hash['replaces_price_id'] = 'replaces_price_id' @_hash['plan_phase_order'] = 'plan_phase_order' @_hash end |
.nullables ⇒ Object
An array for nullable fields
54 55 56 57 58 59 60 61 |
# File 'lib/api_reference/models/replace_plan_price_params.rb', line 54 def self.nullables %w[ price allocation_price license_allocation_price plan_phase_order ] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 51 |
# File 'lib/api_reference/models/replace_plan_price_params.rb', line 44 def self.optionals %w[ price allocation_price license_allocation_price plan_phase_order ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
105 106 107 108 109 110 |
# File 'lib/api_reference/models/replace_plan_price_params.rb', line 105 def inspect class_name = self.class.name.split('::').last "<#{class_name} price: #{@price.inspect}, allocation_price: #{@allocation_price.inspect},"\ " license_allocation_price: #{@license_allocation_price.inspect}, replaces_price_id:"\ " #{@replaces_price_id.inspect}, plan_phase_order: #{@plan_phase_order.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
97 98 99 100 101 102 |
# File 'lib/api_reference/models/replace_plan_price_params.rb', line 97 def to_s class_name = self.class.name.split('::').last "<#{class_name} price: #{@price}, allocation_price: #{@allocation_price},"\ " license_allocation_price: #{@license_allocation_price}, replaces_price_id:"\ " #{@replaces_price_id}, plan_phase_order: #{@plan_phase_order}>" end |