Class: OCI::StackMonitoring::Models::CreateMonitoredResourceDetails
- Inherits:
-
Object
- Object
- OCI::StackMonitoring::Models::CreateMonitoredResourceDetails
- Defined in:
- lib/oci/stack_monitoring/models/create_monitored_resource_details.rb
Overview
The information about new monitored resource. The combination of monitored resource name and type should be unique across tenancy.
Instance Attribute Summary collapse
- #aliases ⇒ OCI::StackMonitoring::Models::MonitoredResourceAliasCredential
-
#compartment_id ⇒ String
**[Required]** Compartment Identifier [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm).
- #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.
-
#management_agent_id ⇒ String
Management Agent Identifier [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm).
-
#name ⇒ String
**[Required]** Monitored resource name.
-
#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.
-
#type ⇒ String
**[Required]** Monitored resource type.
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 = {}) ⇒ CreateMonitoredResourceDetails
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 = {}) ⇒ CreateMonitoredResourceDetails
Initializes the object
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 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 106 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.name = attributes[:'name'] if attributes[:'name'] 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.type = attributes[:'type'] if attributes[:'type'] self.compartment_id = attributes[:'compartmentId'] if attributes[:'compartmentId'] raise 'You cannot provide both :compartmentId and :compartment_id' if attributes.key?(:'compartmentId') && attributes.key?(:'compartment_id') self.compartment_id = attributes[:'compartment_id'] if attributes[:'compartment_id'] 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.management_agent_id = attributes[:'managementAgentId'] if attributes[:'managementAgentId'] raise 'You cannot provide both :managementAgentId and :management_agent_id' if attributes.key?(:'managementAgentId') && attributes.key?(:'management_agent_id') self.management_agent_id = attributes[:'management_agent_id'] if attributes[:'management_agent_id'] 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
49 50 51 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 49 def aliases @aliases end |
#compartment_id ⇒ String
**[Required]** Compartment Identifier [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm)
24 25 26 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 24 def compartment_id @compartment_id end |
#credentials ⇒ OCI::StackMonitoring::Models::MonitoredResourceCredential
46 47 48 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 46 def credentials @credentials end |
#database_connection_details ⇒ OCI::StackMonitoring::Models::ConnectionDetails
43 44 45 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 43 def database_connection_details @database_connection_details end |
#display_name ⇒ String
Monitored resource display name.
16 17 18 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 16 def display_name @display_name end |
#host_name ⇒ String
Host name of the monitored resource
28 29 30 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 28 def host_name @host_name end |
#management_agent_id ⇒ String
Management Agent Identifier [OCID](docs.cloud.oracle.com/Content/General/Concepts/identifiers.htm).
32 33 34 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 32 def management_agent_id @management_agent_id end |
#name ⇒ String
**[Required]** Monitored resource name
12 13 14 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 12 def name @name end |
#properties ⇒ Array<OCI::StackMonitoring::Models::MonitoredResourceProperty>
List of monitored resource properties
40 41 42 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 40 def properties @properties end |
#resource_time_zone ⇒ String
Time zone in the form of tz database canonical zone ID.
36 37 38 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 36 def resource_time_zone @resource_time_zone end |
#type ⇒ String
**[Required]** Monitored resource type
20 21 22 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 20 def type @type end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 52 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'name': :'name', 'display_name': :'displayName', 'type': :'type', 'compartment_id': :'compartmentId', 'host_name': :'hostName', 'management_agent_id': :'managementAgentId', '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.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 71 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'name': :'String', 'display_name': :'String', 'type': :'String', 'compartment_id': :'String', 'host_name': :'String', 'management_agent_id': :'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.
168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 168 def ==(other) return true if equal?(other) self.class == other.class && name == other.name && display_name == other.display_name && type == other.type && compartment_id == other.compartment_id && host_name == other.host_name && management_agent_id == other.management_agent_id && 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
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 208 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
188 189 190 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 188 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
197 198 199 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 197 def hash [name, display_name, type, compartment_id, host_name, management_agent_id, resource_time_zone, properties, database_connection_details, credentials, aliases].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
241 242 243 244 245 246 247 248 249 250 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 241 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
235 236 237 |
# File 'lib/oci/stack_monitoring/models/create_monitored_resource_details.rb', line 235 def to_s to_hash.to_s end |