Class: ApiReference::AddPlanPriceParams

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/api_reference/models/add_plan_price_params.rb

Overview

AddPlanPriceParams 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(price: SKIP, allocation_price: SKIP, license_allocation_price: SKIP, plan_phase_order: SKIP) ⇒ AddPlanPriceParams

Returns a new instance of AddPlanPriceParams.



58
59
60
61
62
63
64
# File 'lib/api_reference/models/add_plan_price_params.rb', line 58

def initialize(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
  @plan_phase_order = plan_phase_order unless plan_phase_order == SKIP
end

Instance Attribute Details

#allocation_priceNewAllocationPrice

The allocation price to add to the plan.

Returns:



18
19
20
# File 'lib/api_reference/models/add_plan_price_params.rb', line 18

def allocation_price
  @allocation_price
end

#license_allocation_priceNewLicenseAllocationUnitPrice

The license allocation price to add to the plan.



22
23
24
# File 'lib/api_reference/models/add_plan_price_params.rb', line 22

def license_allocation_price
  @license_allocation_price
end

#plan_phase_orderInteger

The phase to add this price to.

Returns:

  • (Integer)


26
27
28
# File 'lib/api_reference/models/add_plan_price_params.rb', line 26

def plan_phase_order
  @plan_phase_order
end

#priceObject

The price to add to the plan

Returns:

  • (Object)


14
15
16
# File 'lib/api_reference/models/add_plan_price_params.rb', line 14

def price
  @price
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/api_reference/models/add_plan_price_params.rb', line 67

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  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.
  AddPlanPriceParams.new(price: price,
                         allocation_price: allocation_price,
                         license_allocation_price: license_allocation_price,
                         plan_phase_order: plan_phase_order)
end

.namesObject

A mapping from model property names to API property names.



29
30
31
32
33
34
35
36
# File 'lib/api_reference/models/add_plan_price_params.rb', line 29

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['price'] = 'price'
  @_hash['allocation_price'] = 'allocation_price'
  @_hash['license_allocation_price'] = 'license_allocation_price'
  @_hash['plan_phase_order'] = 'plan_phase_order'
  @_hash
end

.nullablesObject

An array for nullable fields



49
50
51
52
53
54
55
56
# File 'lib/api_reference/models/add_plan_price_params.rb', line 49

def self.nullables
  %w[
    price
    allocation_price
    license_allocation_price
    plan_phase_order
  ]
end

.optionalsObject

An array for optional fields



39
40
41
42
43
44
45
46
# File 'lib/api_reference/models/add_plan_price_params.rb', line 39

def self.optionals
  %w[
    price
    allocation_price
    license_allocation_price
    plan_phase_order
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



96
97
98
99
100
101
# File 'lib/api_reference/models/add_plan_price_params.rb', line 96

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}, plan_phase_order:"\
  " #{@plan_phase_order.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



88
89
90
91
92
93
# File 'lib/api_reference/models/add_plan_price_params.rb', line 88

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} price: #{@price}, allocation_price: #{@allocation_price},"\
  " license_allocation_price: #{@license_allocation_price}, plan_phase_order:"\
  " #{@plan_phase_order}>"
end