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



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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
# 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

Instance Attribute Details

#batch_keyString

Batch key for grouping, may be null.

Returns:

  • (String)


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

def batch_key
  @batch_key
end

#categoryString

Category of this metric.

Returns:

  • (String)


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

def category
  @category
end

#descriptionString

Detailed description of the metric.

Returns:

  • (String)


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

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)


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

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)


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

def job_execution_key
  @job_execution_key
end

#keyString

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

Returns:

  • (String)


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

def key
  @key
end

#sub_categoryString

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

Returns:

  • (String)


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

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)


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

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)


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

def time_inserted
  @time_inserted
end

#unitString

Unit of this metric.

Returns:

  • (String)


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

def unit
  @unit
end

#uriString

URI to the job metric instance in the API.

Returns:

  • (String)


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

def uri
  @uri
end

#valueString

Value of this metric.

Returns:

  • (String)


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

def value
  @value
end

Class Method Details

.attribute_mapObject

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



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# 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

.swagger_typesObject

Attribute type mapping.



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
# 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

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
# 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

#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



225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
# 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

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


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

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



214
215
216
# 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

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



258
259
260
261
262
263
264
265
266
267
# 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

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



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

def to_s
  to_hash.to_s
end