Class: OCI::ApmTraces::Models::AttributeUpdateResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/apm_traces/models/attribute_update_response.rb

Overview

Response of an individual attribute item in the bulk update attribute operation.

Constant Summary collapse

ATTRIBUTE_TYPE_ENUM =
[
  ATTRIBUTE_TYPE_NUMERIC = 'NUMERIC'.freeze,
  ATTRIBUTE_TYPE_STRING = 'STRING'.freeze,
  ATTRIBUTE_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
UNIT_ENUM =
[
  UNIT_NONE = 'NONE'.freeze,
  UNIT_EPOCH_TIME_MS = 'EPOCH_TIME_MS'.freeze,
  UNIT_BYTES = 'BYTES'.freeze,
  UNIT_COUNT = 'COUNT'.freeze,
  UNIT_DURATION_MS = 'DURATION_MS'.freeze,
  UNIT_TRACE_STATUS = 'TRACE_STATUS'.freeze,
  UNIT_PERCENTAGE = 'PERCENTAGE'.freeze,
  UNIT_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
OPERATION_TYPE_ENUM =
[
  OPERATION_TYPE_UPDATE_ATTRIBUTE_PROPERTIES = 'UPDATE_ATTRIBUTE_PROPERTIES'.freeze,
  OPERATION_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ATTRIBUTE_STATUS_ENUM =
[
  ATTRIBUTE_STATUS_ATTRIBUTE_UPDATED = 'ATTRIBUTE_UPDATED'.freeze,
  ATTRIBUTE_STATUS_DUPLICATE_ATTRIBUTE = 'DUPLICATE_ATTRIBUTE'.freeze,
  ATTRIBUTE_STATUS_INVALID_ATTRIBUTE = 'INVALID_ATTRIBUTE'.freeze,
  ATTRIBUTE_STATUS_ATTRIBUTE_NOT_PROCESSED = 'ATTRIBUTE_NOT_PROCESSED'.freeze,
  ATTRIBUTE_STATUS_ATTRIBUTE_DOES_NOT_EXIST = 'ATTRIBUTE_DOES_NOT_EXIST'.freeze,
  ATTRIBUTE_STATUS_ATTRIBUTE_UPDATE_NOT_ALLOWED = 'ATTRIBUTE_UPDATE_NOT_ALLOWED'.freeze,
  ATTRIBUTE_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ATTRIBUTE_NAME_SPACE_ENUM =
[
  ATTRIBUTE_NAME_SPACE_TRACES = 'TRACES'.freeze,
  ATTRIBUTE_NAME_SPACE_SYNTHETIC = 'SYNTHETIC'.freeze,
  ATTRIBUTE_NAME_SPACE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AttributeUpdateResponse

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :attribute_name (String)

    The value to assign to the #attribute_name property

  • :attribute_type (String)

    The value to assign to the #attribute_type property

  • :unit (String)

    The value to assign to the #unit property

  • :notes (String)

    The value to assign to the #notes property

  • :operation_type (String)

    The value to assign to the #operation_type property

  • :attribute_status (String)

    The value to assign to the #attribute_status property

  • :attribute_name_space (String)

    The value to assign to the #attribute_name_space property

  • :time_updated (DateTime)

    The value to assign to the #time_updated property



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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
# File 'lib/oci/apm_traces/models/attribute_update_response.rb', line 149

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.attribute_name = attributes[:'attributeName'] if attributes[:'attributeName']

  raise 'You cannot provide both :attributeName and :attribute_name' if attributes.key?(:'attributeName') && attributes.key?(:'attribute_name')

  self.attribute_name = attributes[:'attribute_name'] if attributes[:'attribute_name']

  self.attribute_type = attributes[:'attributeType'] if attributes[:'attributeType']

  raise 'You cannot provide both :attributeType and :attribute_type' if attributes.key?(:'attributeType') && attributes.key?(:'attribute_type')

  self.attribute_type = attributes[:'attribute_type'] if attributes[:'attribute_type']

  self.unit = attributes[:'unit'] if attributes[:'unit']

  self.notes = attributes[:'notes'] if attributes[:'notes']

  self.operation_type = attributes[:'operationType'] if attributes[:'operationType']

  raise 'You cannot provide both :operationType and :operation_type' if attributes.key?(:'operationType') && attributes.key?(:'operation_type')

  self.operation_type = attributes[:'operation_type'] if attributes[:'operation_type']

  self.attribute_status = attributes[:'attributeStatus'] if attributes[:'attributeStatus']

  raise 'You cannot provide both :attributeStatus and :attribute_status' if attributes.key?(:'attributeStatus') && attributes.key?(:'attribute_status')

  self.attribute_status = attributes[:'attribute_status'] if attributes[:'attribute_status']

  self.attribute_name_space = attributes[:'attributeNameSpace'] if attributes[:'attributeNameSpace']
  self.attribute_name_space = "TRACES" if attribute_name_space.nil? && !attributes.key?(:'attributeNameSpace') # rubocop:disable Style/StringLiterals

  raise 'You cannot provide both :attributeNameSpace and :attribute_name_space' if attributes.key?(:'attributeNameSpace') && attributes.key?(:'attribute_name_space')

  self.attribute_name_space = attributes[:'attribute_name_space'] if attributes[:'attribute_name_space']
  self.attribute_name_space = "TRACES" if attribute_name_space.nil? && !attributes.key?(:'attributeNameSpace') && !attributes.key?(:'attribute_name_space') # rubocop:disable Style/StringLiterals

  self.time_updated = attributes[:'timeUpdated'] if attributes[:'timeUpdated']

  raise 'You cannot provide both :timeUpdated and :time_updated' if attributes.key?(:'timeUpdated') && attributes.key?(:'time_updated')

  self.time_updated = attributes[:'time_updated'] if attributes[:'time_updated']
end

Instance Attribute Details

#attribute_nameString

[Required] Attribute for which properties were updated in this bulk operation.

Returns:

  • (String)


54
55
56
# File 'lib/oci/apm_traces/models/attribute_update_response.rb', line 54

def attribute_name
  @attribute_name
end

#attribute_name_spaceString

[Required] Namespace of the attribute whose properties were updated. The attributeNameSpace will default to TRACES if it is not passed in.

Returns:

  • (String)


96
97
98
# File 'lib/oci/apm_traces/models/attribute_update_response.rb', line 96

def attribute_name_space
  @attribute_name_space
end

#attribute_statusString

Status of the attribute after this operation. The attribute can have one of the following statuses after the update operation. The attribute can have either a success status or an error status. The status of the attribute must be correlated with the operation status property in the bulk operation metadata object. The bulk operation will be successful only when all attributes in the bulk request are processed successfully and they get a success status back. The following are successful status values of individual attribute items in a bulk update attribute operation. ATTRIBUTE_UPDATED - The attribute's properites have been updated with the given properties. DUPLICATE_ATTRIBUTE - The attribute is a duplicate of an attribute that was present in this bulk request. Note that we deduplicate the attribute collection, process only unique attributes, and call out duplicates. A duplicate attribute in a bulk request will not prevent the processing of further attributes in the bulk operation. The following values are error statuses and the bulk processing is stopped when the first error is encountered. INVALID_ATTRIBUTE - The attribute is invalid. ATTRIBUTE_NOT_PROCESSED - The attribute was not processed, as there was another attribute in this bulk request collection that resulted in a processing error. ATTRIBUTE_DOES_NOT_EXIST - Attribute was neither active nor pinned inactive. ATTRIBUTE_UPDATE_NOT_ALLOWED - Attribute update is not allowed as it is an in-built system attribute.

Returns:

  • (String)


90
91
92
# File 'lib/oci/apm_traces/models/attribute_update_response.rb', line 90

def attribute_status
  @attribute_status
end

#attribute_typeString

Type of the attribute.

Returns:

  • (String)


59
60
61
# File 'lib/oci/apm_traces/models/attribute_update_response.rb', line 59

def attribute_type
  @attribute_type
end

#notesString

Notes for the attribute.

Returns:

  • (String)


69
70
71
# File 'lib/oci/apm_traces/models/attribute_update_response.rb', line 69

def notes
  @notes
end

#operation_typeString

Type of operation - UPDATE_ATTRIBUTE_PROPERTIES.

Returns:

  • (String)


74
75
76
# File 'lib/oci/apm_traces/models/attribute_update_response.rb', line 74

def operation_type
  @operation_type
end

#time_updatedDateTime

[Required] Time when the attribute's properties were updated.

Returns:

  • (DateTime)


101
102
103
# File 'lib/oci/apm_traces/models/attribute_update_response.rb', line 101

def time_updated
  @time_updated
end

#unitString

Unit updated for this attribute.

Returns:

  • (String)


64
65
66
# File 'lib/oci/apm_traces/models/attribute_update_response.rb', line 64

def unit
  @unit
end

Class Method Details

.attribute_mapObject

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



104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/oci/apm_traces/models/attribute_update_response.rb', line 104

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'attribute_name': :'attributeName',
    'attribute_type': :'attributeType',
    'unit': :'unit',
    'notes': :'notes',
    'operation_type': :'operationType',
    'attribute_status': :'attributeStatus',
    'attribute_name_space': :'attributeNameSpace',
    'time_updated': :'timeUpdated'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



120
121
122
123
124
125
126
127
128
129
130
131
132
133
# File 'lib/oci/apm_traces/models/attribute_update_response.rb', line 120

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'attribute_name': :'String',
    'attribute_type': :'String',
    'unit': :'String',
    'notes': :'String',
    'operation_type': :'String',
    'attribute_status': :'String',
    'attribute_name_space': :'String',
    'time_updated': :'DateTime'
    # 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



270
271
272
273
274
275
276
277
278
279
280
281
282
# File 'lib/oci/apm_traces/models/attribute_update_response.rb', line 270

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    attribute_name == other.attribute_name &&
    attribute_type == other.attribute_type &&
    unit == other.unit &&
    notes == other.notes &&
    operation_type == other.operation_type &&
    attribute_status == other.attribute_status &&
    attribute_name_space == other.attribute_name_space &&
    time_updated == other.time_updated
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



307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
# File 'lib/oci/apm_traces/models/attribute_update_response.rb', line 307

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


287
288
289
# File 'lib/oci/apm_traces/models/attribute_update_response.rb', line 287

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



296
297
298
# File 'lib/oci/apm_traces/models/attribute_update_response.rb', line 296

def hash
  [attribute_name, attribute_type, unit, notes, operation_type, attribute_status, attribute_name_space, time_updated].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



340
341
342
343
344
345
346
347
348
349
# File 'lib/oci/apm_traces/models/attribute_update_response.rb', line 340

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



334
335
336
# File 'lib/oci/apm_traces/models/attribute_update_response.rb', line 334

def to_s
  to_hash.to_s
end