Class: OCI::FleetAppsManagement::Models::BaseOutput
- Inherits:
-
Object
- Object
- OCI::FleetAppsManagement::Models::BaseOutput
- Defined in:
- lib/oci/fleet_apps_management/models/base_output.rb
Overview
Base output. This class has direct subclasses. If you are using this class as input to a service operations then you should favor using a subclass over the base class
Direct Known Subclasses
BoolOutput, CopyableStringOutput, CsvOutput, JsonOutput, LinkOutput, ListOutput, MapOutput, NumberOutput, OcidOutput, StringOutput
Constant Summary collapse
- TYPE_ENUM =
[ TYPE_ARRAY = 'ARRAY'.freeze, TYPE_BOOLEAN = 'BOOLEAN'.freeze, TYPE_NUMBER = 'NUMBER'.freeze, TYPE_STRING = 'STRING'.freeze, TYPE_COPYABLESTRING = 'COPYABLESTRING'.freeze, TYPE_MAP = 'MAP'.freeze, TYPE_LIST = 'LIST'.freeze, TYPE_JSON = 'JSON'.freeze, TYPE_CSV = 'CSV'.freeze, TYPE_LINK = 'LINK'.freeze, TYPE_OCID = 'OCID'.freeze, TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#description ⇒ String
Extended help or summary for understanding output.
-
#format ⇒ String
Hint about formatting or rendering the output value.
-
#is_sensitive ⇒ BOOLEAN
If true, marks this output as sensitive.
-
#title ⇒ String
Output label shown to the user.
-
#type ⇒ String
Data type of the output value (such as STRING, NUMBER, OCID, etc).
-
#visible ⇒ String
Expression to show/hide this output.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.get_subtype(object_hash) ⇒ Object
Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.
-
.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 = {}) ⇒ BaseOutput
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 = {}) ⇒ BaseOutput
Initializes the object
116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/oci/fleet_apps_management/models/base_output.rb', line 116 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.type = attributes[:'type'] if attributes[:'type'] self.title = attributes[:'title'] if attributes[:'title'] self.description = attributes[:'description'] if attributes[:'description'] self.is_sensitive = attributes[:'isSensitive'] unless attributes[:'isSensitive'].nil? self.is_sensitive = false if is_sensitive.nil? && !attributes.key?(:'isSensitive') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :isSensitive and :is_sensitive' if attributes.key?(:'isSensitive') && attributes.key?(:'is_sensitive') self.is_sensitive = attributes[:'is_sensitive'] unless attributes[:'is_sensitive'].nil? self.is_sensitive = false if is_sensitive.nil? && !attributes.key?(:'isSensitive') && !attributes.key?(:'is_sensitive') # rubocop:disable Style/StringLiterals self.format = attributes[:'format'] if attributes[:'format'] self.visible = attributes[:'visible'] if attributes[:'visible'] self.visible = "true" if visible.nil? && !attributes.key?(:'visible') # rubocop:disable Style/StringLiterals end |
Instance Attribute Details
#description ⇒ String
Extended help or summary for understanding output.
38 39 40 |
# File 'lib/oci/fleet_apps_management/models/base_output.rb', line 38 def description @description end |
#format ⇒ String
Hint about formatting or rendering the output value.
46 47 48 |
# File 'lib/oci/fleet_apps_management/models/base_output.rb', line 46 def format @format end |
#is_sensitive ⇒ BOOLEAN
If true, marks this output as sensitive.
42 43 44 |
# File 'lib/oci/fleet_apps_management/models/base_output.rb', line 42 def is_sensitive @is_sensitive end |
#title ⇒ String
Output label shown to the user.
34 35 36 |
# File 'lib/oci/fleet_apps_management/models/base_output.rb', line 34 def title @title end |
#type ⇒ String
Data type of the output value (such as STRING, NUMBER, OCID, etc).
30 31 32 |
# File 'lib/oci/fleet_apps_management/models/base_output.rb', line 30 def type @type end |
#visible ⇒ String
Expression to show/hide this output.
50 51 52 |
# File 'lib/oci/fleet_apps_management/models/base_output.rb', line 50 def visible @visible end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/oci/fleet_apps_management/models/base_output.rb', line 53 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'type': :'type', 'title': :'title', 'description': :'description', 'is_sensitive': :'isSensitive', 'format': :'format', 'visible': :'visible' # rubocop:enable Style/SymbolLiteral } end |
.get_subtype(object_hash) ⇒ Object
Given the hash representation of a subtype of this class, use the info in the hash to return the class of the subtype.
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/oci/fleet_apps_management/models/base_output.rb', line 85 def self.get_subtype(object_hash) type = object_hash[:'type'] # rubocop:disable Style/SymbolLiteral return 'OCI::FleetAppsManagement::Models::ListOutput' if type == 'LIST' return 'OCI::FleetAppsManagement::Models::OcidOutput' if type == 'OCID' return 'OCI::FleetAppsManagement::Models::CsvOutput' if type == 'CSV' return 'OCI::FleetAppsManagement::Models::CopyableStringOutput' if type == 'COPYABLESTRING' return 'OCI::FleetAppsManagement::Models::JsonOutput' if type == 'JSON' return 'OCI::FleetAppsManagement::Models::NumberOutput' if type == 'NUMBER' return 'OCI::FleetAppsManagement::Models::StringOutput' if type == 'STRING' return 'OCI::FleetAppsManagement::Models::MapOutput' if type == 'MAP' return 'OCI::FleetAppsManagement::Models::LinkOutput' if type == 'LINK' return 'OCI::FleetAppsManagement::Models::BoolOutput' if type == 'boolean' # TODO: Log a warning when the subtype is not found. 'OCI::FleetAppsManagement::Models::BaseOutput' end |
.swagger_types ⇒ Object
Attribute type mapping.
67 68 69 70 71 72 73 74 75 76 77 78 |
# File 'lib/oci/fleet_apps_management/models/base_output.rb', line 67 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'type': :'String', 'title': :'String', 'description': :'String', 'is_sensitive': :'BOOLEAN', 'format': :'String', 'visible': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
162 163 164 165 166 167 168 169 170 171 172 |
# File 'lib/oci/fleet_apps_management/models/base_output.rb', line 162 def ==(other) return true if equal?(other) self.class == other.class && type == other.type && title == other.title && description == other.description && is_sensitive == other.is_sensitive && format == other.format && visible == other.visible end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/oci/fleet_apps_management/models/base_output.rb', line 197 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
177 178 179 |
# File 'lib/oci/fleet_apps_management/models/base_output.rb', line 177 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
186 187 188 |
# File 'lib/oci/fleet_apps_management/models/base_output.rb', line 186 def hash [type, title, description, is_sensitive, format, visible].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
230 231 232 233 234 235 236 237 238 239 |
# File 'lib/oci/fleet_apps_management/models/base_output.rb', line 230 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
224 225 226 |
# File 'lib/oci/fleet_apps_management/models/base_output.rb', line 224 def to_s to_hash.to_s end |