Class: OCI::StackMonitoring::Models::UpdateMonitoredResourceDetails
- Inherits:
-
Object
- Object
- OCI::StackMonitoring::Models::UpdateMonitoredResourceDetails
- Defined in:
- lib/oci/stack_monitoring/models/update_monitored_resource_details.rb
Overview
The information about updating a monitored resource.
Instance Attribute Summary collapse
- #aliases ⇒ OCI::StackMonitoring::Models::MonitoredResourceAliasCredential
- #credentials ⇒ OCI::StackMonitoring::Models::MonitoredResourceCredential
- #database_connection_details ⇒ OCI::StackMonitoring::Models::ConnectionDetails
-
#display_name ⇒ String
Monitored resource display name.
-
#host_name ⇒ String
Host name of the monitored resource.
-
#properties ⇒ Array<OCI::StackMonitoring::Models::MonitoredResourceProperty>
List of monitored resource properties.
-
#resource_time_zone ⇒ String
Time zone in the form of tz database canonical zone ID.
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 = {}) ⇒ UpdateMonitoredResourceDetails
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 = {}) ⇒ UpdateMonitoredResourceDetails
Initializes the object
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 |
# File 'lib/oci/stack_monitoring/models/update_monitored_resource_details.rb', line 78 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.display_name = attributes[:'displayName'] if attributes[:'displayName'] raise 'You cannot provide both :displayName and :display_name' if attributes.key?(:'displayName') && attributes.key?(:'display_name') self.display_name = attributes[:'display_name'] if attributes[:'display_name'] self.host_name = attributes[:'hostName'] if attributes[:'hostName'] raise 'You cannot provide both :hostName and :host_name' if attributes.key?(:'hostName') && attributes.key?(:'host_name') self.host_name = attributes[:'host_name'] if attributes[:'host_name'] self.resource_time_zone = attributes[:'resourceTimeZone'] if attributes[:'resourceTimeZone'] self.resource_time_zone = "Etc/UTC" if resource_time_zone.nil? && !attributes.key?(:'resourceTimeZone') # rubocop:disable Style/StringLiterals raise 'You cannot provide both :resourceTimeZone and :resource_time_zone' if attributes.key?(:'resourceTimeZone') && attributes.key?(:'resource_time_zone') self.resource_time_zone = attributes[:'resource_time_zone'] if attributes[:'resource_time_zone'] self.resource_time_zone = "Etc/UTC" if resource_time_zone.nil? && !attributes.key?(:'resourceTimeZone') && !attributes.key?(:'resource_time_zone') # rubocop:disable Style/StringLiterals self.properties = attributes[:'properties'] if attributes[:'properties'] self.database_connection_details = attributes[:'databaseConnectionDetails'] if attributes[:'databaseConnectionDetails'] raise 'You cannot provide both :databaseConnectionDetails and :database_connection_details' if attributes.key?(:'databaseConnectionDetails') && attributes.key?(:'database_connection_details') self.database_connection_details = attributes[:'database_connection_details'] if attributes[:'database_connection_details'] self.credentials = attributes[:'credentials'] if attributes[:'credentials'] self.aliases = attributes[:'aliases'] if attributes[:'aliases'] end |
Instance Attribute Details
#aliases ⇒ OCI::StackMonitoring::Models::MonitoredResourceAliasCredential
33 34 35 |
# File 'lib/oci/stack_monitoring/models/update_monitored_resource_details.rb', line 33 def aliases @aliases end |
#credentials ⇒ OCI::StackMonitoring::Models::MonitoredResourceCredential
30 31 32 |
# File 'lib/oci/stack_monitoring/models/update_monitored_resource_details.rb', line 30 def credentials @credentials end |
#database_connection_details ⇒ OCI::StackMonitoring::Models::ConnectionDetails
27 28 29 |
# File 'lib/oci/stack_monitoring/models/update_monitored_resource_details.rb', line 27 def database_connection_details @database_connection_details end |
#display_name ⇒ String
Monitored resource display name.
12 13 14 |
# File 'lib/oci/stack_monitoring/models/update_monitored_resource_details.rb', line 12 def display_name @display_name end |
#host_name ⇒ String
Host name of the monitored resource
16 17 18 |
# File 'lib/oci/stack_monitoring/models/update_monitored_resource_details.rb', line 16 def host_name @host_name end |
#properties ⇒ Array<OCI::StackMonitoring::Models::MonitoredResourceProperty>
List of monitored resource properties
24 25 26 |
# File 'lib/oci/stack_monitoring/models/update_monitored_resource_details.rb', line 24 def properties @properties end |
#resource_time_zone ⇒ String
Time zone in the form of tz database canonical zone ID.
20 21 22 |
# File 'lib/oci/stack_monitoring/models/update_monitored_resource_details.rb', line 20 def resource_time_zone @resource_time_zone end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/oci/stack_monitoring/models/update_monitored_resource_details.rb', line 36 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'display_name': :'displayName', 'host_name': :'hostName', 'resource_time_zone': :'resourceTimeZone', 'properties': :'properties', 'database_connection_details': :'databaseConnectionDetails', 'credentials': :'credentials', 'aliases': :'aliases' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/oci/stack_monitoring/models/update_monitored_resource_details.rb', line 51 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'display_name': :'String', 'host_name': :'String', 'resource_time_zone': :'String', 'properties': :'Array<OCI::StackMonitoring::Models::MonitoredResourceProperty>', 'database_connection_details': :'OCI::StackMonitoring::Models::ConnectionDetails', 'credentials': :'OCI::StackMonitoring::Models::MonitoredResourceCredential', 'aliases': :'OCI::StackMonitoring::Models::MonitoredResourceAliasCredential' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
124 125 126 127 128 129 130 131 132 133 134 135 |
# File 'lib/oci/stack_monitoring/models/update_monitored_resource_details.rb', line 124 def ==(other) return true if equal?(other) self.class == other.class && display_name == other.display_name && host_name == other.host_name && resource_time_zone == other.resource_time_zone && properties == other.properties && database_connection_details == other.database_connection_details && credentials == other.credentials && aliases == other.aliases end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/oci/stack_monitoring/models/update_monitored_resource_details.rb', line 160 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
140 141 142 |
# File 'lib/oci/stack_monitoring/models/update_monitored_resource_details.rb', line 140 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
149 150 151 |
# File 'lib/oci/stack_monitoring/models/update_monitored_resource_details.rb', line 149 def hash [display_name, host_name, resource_time_zone, properties, database_connection_details, credentials, aliases].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
193 194 195 196 197 198 199 200 201 202 |
# File 'lib/oci/stack_monitoring/models/update_monitored_resource_details.rb', line 193 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
187 188 189 |
# File 'lib/oci/stack_monitoring/models/update_monitored_resource_details.rb', line 187 def to_s to_hash.to_s end |