Class: OCI::CapacityManagement::Models::OccmDemandSignalResourcePropertiesSummary
- Inherits:
-
Object
- Object
- OCI::CapacityManagement::Models::OccmDemandSignalResourcePropertiesSummary
- Defined in:
- lib/oci/capacity_management/models/occm_demand_signal_resource_properties_summary.rb
Overview
A summary model for the Occm demand signal resource properties.
Instance Attribute Summary collapse
-
#is_editable ⇒ BOOLEAN
[Required] This will indicate if demand signal resource's property is editable.
-
#property_max_value ⇒ Integer
The maximum value of demand signal resource's property.
-
#property_min_value ⇒ Integer
The minimum value of demand signal resource's property.
-
#property_name ⇒ String
[Required] The name of demand signal resource's property.
-
#property_options ⇒ Array<OCI::CapacityManagement::Models::OccmDemandSignalResourcePropertyOptionSummary>
Predefined options for demand signal resource's property.
-
#property_unit ⇒ String
Unit for demand signal resource's property.
-
#property_value ⇒ String
[Required] Default value of demand signal resource's property.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ OccmDemandSignalResourcePropertiesSummary
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ OccmDemandSignalResourcePropertiesSummary
Initializes the object
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 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 |
# File 'lib/oci/capacity_management/models/occm_demand_signal_resource_properties_summary.rb', line 90 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.property_name = attributes[:'propertyName'] if attributes[:'propertyName'] raise 'You cannot provide both :propertyName and :property_name' if attributes.key?(:'propertyName') && attributes.key?(:'property_name') self.property_name = attributes[:'property_name'] if attributes[:'property_name'] self.property_value = attributes[:'propertyValue'] if attributes[:'propertyValue'] raise 'You cannot provide both :propertyValue and :property_value' if attributes.key?(:'propertyValue') && attributes.key?(:'property_value') self.property_value = attributes[:'property_value'] if attributes[:'property_value'] self.property_min_value = attributes[:'propertyMinValue'] if attributes[:'propertyMinValue'] raise 'You cannot provide both :propertyMinValue and :property_min_value' if attributes.key?(:'propertyMinValue') && attributes.key?(:'property_min_value') self.property_min_value = attributes[:'property_min_value'] if attributes[:'property_min_value'] self.property_max_value = attributes[:'propertyMaxValue'] if attributes[:'propertyMaxValue'] raise 'You cannot provide both :propertyMaxValue and :property_max_value' if attributes.key?(:'propertyMaxValue') && attributes.key?(:'property_max_value') self.property_max_value = attributes[:'property_max_value'] if attributes[:'property_max_value'] self. = attributes[:'propertyOptions'] if attributes[:'propertyOptions'] raise 'You cannot provide both :propertyOptions and :property_options' if attributes.key?(:'propertyOptions') && attributes.key?(:'property_options') self. = attributes[:'property_options'] if attributes[:'property_options'] self.property_unit = attributes[:'propertyUnit'] if attributes[:'propertyUnit'] raise 'You cannot provide both :propertyUnit and :property_unit' if attributes.key?(:'propertyUnit') && attributes.key?(:'property_unit') self.property_unit = attributes[:'property_unit'] if attributes[:'property_unit'] self.is_editable = attributes[:'isEditable'] unless attributes[:'isEditable'].nil? raise 'You cannot provide both :isEditable and :is_editable' if attributes.key?(:'isEditable') && attributes.key?(:'is_editable') self.is_editable = attributes[:'is_editable'] unless attributes[:'is_editable'].nil? end |
Instance Attribute Details
#is_editable ⇒ BOOLEAN
[Required] This will indicate if demand signal resource's property is editable.
45 46 47 |
# File 'lib/oci/capacity_management/models/occm_demand_signal_resource_properties_summary.rb', line 45 def is_editable @is_editable end |
#property_max_value ⇒ Integer
The maximum value of demand signal resource's property. This is an optional parameter.
30 31 32 |
# File 'lib/oci/capacity_management/models/occm_demand_signal_resource_properties_summary.rb', line 30 def property_max_value @property_max_value end |
#property_min_value ⇒ Integer
The minimum value of demand signal resource's property. This is an optional parameter.
25 26 27 |
# File 'lib/oci/capacity_management/models/occm_demand_signal_resource_properties_summary.rb', line 25 def property_min_value @property_min_value end |
#property_name ⇒ String
[Required] The name of demand signal resource's property.
15 16 17 |
# File 'lib/oci/capacity_management/models/occm_demand_signal_resource_properties_summary.rb', line 15 def property_name @property_name end |
#property_options ⇒ Array<OCI::CapacityManagement::Models::OccmDemandSignalResourcePropertyOptionSummary>
Predefined options for demand signal resource's property. This is an optional parameter.
35 36 37 |
# File 'lib/oci/capacity_management/models/occm_demand_signal_resource_properties_summary.rb', line 35 def @property_options end |
#property_unit ⇒ String
Unit for demand signal resource's property.
40 41 42 |
# File 'lib/oci/capacity_management/models/occm_demand_signal_resource_properties_summary.rb', line 40 def property_unit @property_unit end |
#property_value ⇒ String
[Required] Default value of demand signal resource's property.
20 21 22 |
# File 'lib/oci/capacity_management/models/occm_demand_signal_resource_properties_summary.rb', line 20 def property_value @property_value end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/oci/capacity_management/models/occm_demand_signal_resource_properties_summary.rb', line 48 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'property_name': :'propertyName', 'property_value': :'propertyValue', 'property_min_value': :'propertyMinValue', 'property_max_value': :'propertyMaxValue', 'property_options': :'propertyOptions', 'property_unit': :'propertyUnit', 'is_editable': :'isEditable' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/oci/capacity_management/models/occm_demand_signal_resource_properties_summary.rb', line 63 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'property_name': :'String', 'property_value': :'String', 'property_min_value': :'Integer', 'property_max_value': :'Integer', 'property_options': :'Array<OCI::CapacityManagement::Models::OccmDemandSignalResourcePropertyOptionSummary>', 'property_unit': :'String', 'is_editable': :'BOOLEAN' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
146 147 148 149 150 151 152 153 154 155 156 157 |
# File 'lib/oci/capacity_management/models/occm_demand_signal_resource_properties_summary.rb', line 146 def ==(other) return true if equal?(other) self.class == other.class && property_name == other.property_name && property_value == other.property_value && property_min_value == other.property_min_value && property_max_value == other.property_max_value && == other. && property_unit == other.property_unit && is_editable == other.is_editable end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
# File 'lib/oci/capacity_management/models/occm_demand_signal_resource_properties_summary.rb', line 182 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]]) ) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other) ⇒ Boolean
162 163 164 |
# File 'lib/oci/capacity_management/models/occm_demand_signal_resource_properties_summary.rb', line 162 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
171 172 173 |
# File 'lib/oci/capacity_management/models/occm_demand_signal_resource_properties_summary.rb', line 171 def hash [property_name, property_value, property_min_value, property_max_value, , property_unit, is_editable].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
215 216 217 218 219 220 221 222 223 224 |
# File 'lib/oci/capacity_management/models/occm_demand_signal_resource_properties_summary.rb', line 215 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
209 210 211 |
# File 'lib/oci/capacity_management/models/occm_demand_signal_resource_properties_summary.rb', line 209 def to_s to_hash.to_s end |