Class: OCI::DataCatalog::Models::JobMetricSummary

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/data_catalog/models/job_metric_summary.rb

Overview

Job metric summary.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ JobMetricSummary

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :key (String)

    The value to assign to the #key property

  • :description (String)

    The value to assign to the #description property

  • :job_execution_key (String)

    The value to assign to the #job_execution_key property

  • :uri (String)

    The value to assign to the #uri property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :time_inserted (DateTime)

    The value to assign to the #time_inserted property

  • :category (String)

    The value to assign to the #category property

  • :display_name (String)

    The value to assign to the #display_name property

  • :sub_category (String)

    The value to assign to the #sub_category property

  • :unit (String)

    The value to assign to the #unit property

  • :value (String)

    The value to assign to the #value property

  • :batch_key (String)

    The value to assign to the #batch_key property



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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 123

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

Instance Attribute Details

#batch_keyString

Batch key for grouping, may be null.

Returns:

  • (String)


63
64
65
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 63

def batch_key
  @batch_key
end

#categoryString

Category of this metric.

Returns:

  • (String)


41
42
43
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 41

def category
  @category
end

#descriptionString

Detailed description of the metric.

Returns:

  • (String)


17
18
19
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 17

def description
  @description
end

#display_nameString

A user-friendly display name. Does not have to be unique, and it's changeable. Avoid entering confidential information.

Returns:

  • (String)


47
48
49
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 47

def display_name
  @display_name
end

#job_execution_keyString

The unique key of the parent job execution for which the job metric resource was created.

Returns:

  • (String)


21
22
23
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 21

def job_execution_key
  @job_execution_key
end

#keyString

[Required] Key of the job metric that is immutable.

Returns:

  • (String)


13
14
15
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 13

def key
  @key
end

#sub_categoryString

Sub category of this metric under the category. Used for aggregating values. May be null.

Returns:

  • (String)


51
52
53
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 51

def sub_category
  @sub_category
end

#time_createdDateTime

The date and time the job metric was created, in the format defined by RFC3339. Example: 2019-03-25T21:10:29.600Z

Returns:

  • (DateTime)


31
32
33
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 31

def time_created
  @time_created
end

#time_insertedDateTime

The time the metric was logged or captured in the system where the job executed. An RFC3339 formatted datetime string.

Returns:

  • (DateTime)


37
38
39
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 37

def time_inserted
  @time_inserted
end

#unitString

Unit of this metric.

Returns:

  • (String)


55
56
57
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 55

def unit
  @unit
end

#uriString

URI to the job metric instance in the API.

Returns:

  • (String)


25
26
27
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 25

def uri
  @uri
end

#valueString

Value of this metric.

Returns:

  • (String)


59
60
61
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 59

def value
  @value
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 66

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

.swagger_typesObject

Attribute type mapping.



86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 86

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

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 185

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

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 226

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

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


206
207
208
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 206

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



215
216
217
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 215

def hash
  [key, description, job_execution_key, uri, time_created, time_inserted, category, display_name, sub_category, unit, value, batch_key].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



259
260
261
262
263
264
265
266
267
268
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 259

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_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



253
254
255
# File 'lib/oci/data_catalog/models/job_metric_summary.rb', line 253

def to_s
  to_hash.to_s
end