class OCI::DataCatalog::Models::JobMetricSummary
Job metric summary.
Attributes
Batch key for grouping, may be null. @return [String]
Category of this metric. @return [String]
Detailed description of the metric. @return [String]
A user-friendly display name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
@return [String]
The unique key of the parent job execution for which the job metric resource was created. @return [String]
[Required] Key of the job metric that is immutable. @return [String]
Sub category of this metric under the category. Used for aggregating values. May be null. @return [String]
The date and time the job metric was created, in the format defined by [RFC3339](tools.ietf.org/html/rfc3339). Example: `2019-03-25T21:10:29.600Z`
@return [DateTime]
The time the metric was logged or captured in the system where the job executed. An [RFC3339](tools.ietf.org/html/rfc3339) formatted datetime string.
@return [DateTime]
Unit of this metric. @return [String]
URI to the job metric instance in the API. @return [String]
Value of this metric. @return [String]
Public Class Methods
Attribute mapping from ruby-style variable name to JSON key.
# File lib/oci/data_catalog/models/job_metric_summary.rb, line 65 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'key': :'key', 'description': :'description', 'job_execution_key': :'jobExecutionKey', 'uri': :'uri', 'time_created': :'timeCreated', 'time_inserted': :'timeInserted', 'category': :'category', 'display_name': :'displayName', 'sub_category': :'subCategory', 'unit': :'unit', 'value': :'value', 'batch_key': :'batchKey' # rubocop:enable Style/SymbolLiteral } end
Initializes the object @param [Hash] attributes Model attributes in the form of hash @option attributes [String] :key The value to assign to the {#key} property @option attributes [String] :description The value to assign to the {#description} property @option attributes [String] :job_execution_key The value to assign to the {#job_execution_key} property @option attributes [String] :uri The value to assign to the {#uri} property @option attributes [DateTime] :time_created The value to assign to the {#time_created} property @option attributes [DateTime] :time_inserted The value to assign to the {#time_inserted} property @option attributes [String] :category The value to assign to the {#category} property @option attributes [String] :display_name The value to assign to the {#display_name} property @option attributes [String] :sub_category The value to assign to the {#sub_category} property @option attributes [String] :unit The value to assign to the {#unit} property @option attributes [String] :value The value to assign to the {#value} property @option attributes [String] :batch_key The value to assign to the {#batch_key} property
# File lib/oci/data_catalog/models/job_metric_summary.rb, line 122 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.key = attributes[:'key'] if attributes[:'key'] self.description = attributes[:'description'] if attributes[:'description'] self.job_execution_key = attributes[:'jobExecutionKey'] if attributes[:'jobExecutionKey'] raise 'You cannot provide both :jobExecutionKey and :job_execution_key' if attributes.key?(:'jobExecutionKey') && attributes.key?(:'job_execution_key') self.job_execution_key = attributes[:'job_execution_key'] if attributes[:'job_execution_key'] self.uri = attributes[:'uri'] if attributes[:'uri'] self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated'] raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created') self.time_created = attributes[:'time_created'] if attributes[:'time_created'] self.time_inserted = attributes[:'timeInserted'] if attributes[:'timeInserted'] raise 'You cannot provide both :timeInserted and :time_inserted' if attributes.key?(:'timeInserted') && attributes.key?(:'time_inserted') self.time_inserted = attributes[:'time_inserted'] if attributes[:'time_inserted'] self.category = attributes[:'category'] if attributes[:'category'] 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.sub_category = attributes[:'subCategory'] if attributes[:'subCategory'] raise 'You cannot provide both :subCategory and :sub_category' if attributes.key?(:'subCategory') && attributes.key?(:'sub_category') self.sub_category = attributes[:'sub_category'] if attributes[:'sub_category'] self.unit = attributes[:'unit'] if attributes[:'unit'] self.value = attributes[:'value'] if attributes[:'value'] self.batch_key = attributes[:'batchKey'] if attributes[:'batchKey'] raise 'You cannot provide both :batchKey and :batch_key' if attributes.key?(:'batchKey') && attributes.key?(:'batch_key') self.batch_key = attributes[:'batch_key'] if attributes[:'batch_key'] end
Attribute type mapping.
# File lib/oci/data_catalog/models/job_metric_summary.rb, line 85 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'key': :'String', 'description': :'String', 'job_execution_key': :'String', 'uri': :'String', 'time_created': :'DateTime', 'time_inserted': :'DateTime', 'category': :'String', 'display_name': :'String', 'sub_category': :'String', 'unit': :'String', 'value': :'String', 'batch_key': :'String' # rubocop:enable Style/SymbolLiteral } end
Public Instance Methods
Checks equality by comparing each attribute. @param [Object] other the other object to be compared
# File lib/oci/data_catalog/models/job_metric_summary.rb, line 184 def ==(other) return true if equal?(other) self.class == other.class && key == other.key && description == other.description && job_execution_key == other.job_execution_key && uri == other.uri && time_created == other.time_created && time_inserted == other.time_inserted && category == other.category && display_name == other.display_name && sub_category == other.sub_category && unit == other.unit && value == other.value && batch_key == other.batch_key end
Builds the object from hash @param [Hash] attributes Model attributes in the form of hash @return [Object] Returns the model itself
# File lib/oci/data_catalog/models/job_metric_summary.rb, line 225 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
@see the `==` method @param [Object] other the other object to be compared
# File lib/oci/data_catalog/models/job_metric_summary.rb, line 205 def eql?(other) self == other end
Calculates hash code according to all attributes. @return [Fixnum] Hash code
# File lib/oci/data_catalog/models/job_metric_summary.rb, line 214 def hash [key, description, job_execution_key, uri, time_created, time_inserted, category, display_name, sub_category, unit, value, batch_key].hash end
Returns the object in the form of hash @return [Hash] Returns the object in the form of hash
# File lib/oci/data_catalog/models/job_metric_summary.rb, line 258 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
Returns the string representation of the object @return [String] String presentation of the object
# File lib/oci/data_catalog/models/job_metric_summary.rb, line 252 def to_s to_hash.to_s end
Private Instance Methods
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value @param [Object] value Any valid value @return [Hash] Returns the value in the form of hash
# File lib/oci/data_catalog/models/job_metric_summary.rb, line 275 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end