Class: ShellDataReportingApIs::VolumeBasedPricingResponse
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ShellDataReportingApIs::VolumeBasedPricingResponse
- Defined in:
- lib/shell_data_reporting_ap_is/models/volume_based_pricing_response.rb
Overview
VolumeBasedPricingResponse Model.
Instance Attribute Summary collapse
-
#configuration ⇒ Array[BonusConfiguration]
TODO: Write general description for this method.
-
#current_period_consumption ⇒ Array[PricingCurrentVolume]
TODO: Write general description for this method.
-
#history ⇒ Array[PricingHistory]
TODO: Write general description for this method.
-
#warnings ⇒ Array[Warning]
A list of Warning entity.
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(configuration = SKIP, current_period_consumption = SKIP, history = SKIP, warnings = SKIP) ⇒ VolumeBasedPricingResponse
constructor
A new instance of VolumeBasedPricingResponse.
-
#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(configuration = SKIP, current_period_consumption = SKIP, history = SKIP, warnings = SKIP) ⇒ VolumeBasedPricingResponse
Returns a new instance of VolumeBasedPricingResponse.
58 59 60 61 62 63 64 65 66 67 |
# File 'lib/shell_data_reporting_ap_is/models/volume_based_pricing_response.rb', line 58 def initialize(configuration = SKIP, current_period_consumption = SKIP, history = SKIP, warnings = SKIP) @configuration = configuration unless configuration == SKIP unless current_period_consumption == SKIP @current_period_consumption = current_period_consumption end @history = history unless history == SKIP @warnings = warnings unless warnings == SKIP end |
Instance Attribute Details
#configuration ⇒ Array[BonusConfiguration]
TODO: Write general description for this method
14 15 16 |
# File 'lib/shell_data_reporting_ap_is/models/volume_based_pricing_response.rb', line 14 def configuration @configuration end |
#current_period_consumption ⇒ Array[PricingCurrentVolume]
TODO: Write general description for this method
18 19 20 |
# File 'lib/shell_data_reporting_ap_is/models/volume_based_pricing_response.rb', line 18 def current_period_consumption @current_period_consumption end |
#history ⇒ Array[PricingHistory]
TODO: Write general description for this method
22 23 24 |
# File 'lib/shell_data_reporting_ap_is/models/volume_based_pricing_response.rb', line 22 def history @history end |
#warnings ⇒ Array[Warning]
A list of Warning entity. This entity will hold the details of the scheduled System Outages of any dependent applications of this service. Note: If there is no scheduled outage information available, in the configuration in AMS, for this service, this parameter won’t be present in output.
31 32 33 |
# File 'lib/shell_data_reporting_ap_is/models/volume_based_pricing_response.rb', line 31 def warnings @warnings end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/shell_data_reporting_ap_is/models/volume_based_pricing_response.rb', line 70 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. # Parameter is an array, so we need to iterate through it configuration = nil unless hash['Configuration'].nil? configuration = [] hash['Configuration'].each do |structure| configuration << (BonusConfiguration.from_hash(structure) if structure) end end configuration = SKIP unless hash.key?('Configuration') # Parameter is an array, so we need to iterate through it current_period_consumption = nil unless hash['CurrentPeriodConsumption'].nil? current_period_consumption = [] hash['CurrentPeriodConsumption'].each do |structure| current_period_consumption << (PricingCurrentVolume.from_hash(structure) if structure) end end current_period_consumption = SKIP unless hash.key?('CurrentPeriodConsumption') # Parameter is an array, so we need to iterate through it history = nil unless hash['History'].nil? history = [] hash['History'].each do |structure| history << (PricingHistory.from_hash(structure) if structure) end end history = SKIP unless hash.key?('History') # Parameter is an array, so we need to iterate through it warnings = nil unless hash['Warnings'].nil? warnings = [] hash['Warnings'].each do |structure| warnings << (Warning.from_hash(structure) if structure) end end warnings = SKIP unless hash.key?('Warnings') # Create object from extracted values. VolumeBasedPricingResponse.new(configuration, current_period_consumption, history, warnings) end |
.names ⇒ Object
A mapping from model property names to API property names.
34 35 36 37 38 39 40 41 |
# File 'lib/shell_data_reporting_ap_is/models/volume_based_pricing_response.rb', line 34 def self.names @_hash = {} if @_hash.nil? @_hash['configuration'] = 'Configuration' @_hash['current_period_consumption'] = 'CurrentPeriodConsumption' @_hash['history'] = 'History' @_hash['warnings'] = 'Warnings' @_hash end |
.nullables ⇒ Object
An array for nullable fields
54 55 56 |
# File 'lib/shell_data_reporting_ap_is/models/volume_based_pricing_response.rb', line 54 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
44 45 46 47 48 49 50 51 |
# File 'lib/shell_data_reporting_ap_is/models/volume_based_pricing_response.rb', line 44 def self.optionals %w[ configuration current_period_consumption history warnings ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
130 131 132 133 134 135 |
# File 'lib/shell_data_reporting_ap_is/models/volume_based_pricing_response.rb', line 130 def inspect class_name = self.class.name.split('::').last "<#{class_name} configuration: #{@configuration.inspect}, current_period_consumption:"\ " #{@current_period_consumption.inspect}, history: #{@history.inspect}, warnings:"\ " #{@warnings.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
123 124 125 126 127 |
# File 'lib/shell_data_reporting_ap_is/models/volume_based_pricing_response.rb', line 123 def to_s class_name = self.class.name.split('::').last "<#{class_name} configuration: #{@configuration}, current_period_consumption:"\ " #{@current_period_consumption}, history: #{@history}, warnings: #{@warnings}>" end |