Class: OCI::ApmTraces::Models::AttributeUpdateNotesResponse

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

Overview

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

Constant Summary collapse

OPERATION_TYPE_ENUM =
[
  OPERATION_TYPE_UPDATE_NOTES = 'UPDATE_NOTES'.freeze,
  OPERATION_TYPE_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
ATTRIBUTE_STATUS_ENUM =
[
  ATTRIBUTE_STATUS_ATTRIBUTE_NOTES_UPDATED = 'ATTRIBUTE_NOTES_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_NOTES_TOO_LONG = 'NOTES_TOO_LONG'.freeze,
  ATTRIBUTE_STATUS_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AttributeUpdateNotesResponse

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

  • :notes (String)

    The value to assign to the #notes property

  • :operation_type (String)

    The value to assign to the #operation_type property

  • :attribute_name_space (String)

    The value to assign to the #attribute_name_space property

  • :attribute_status (String)

    The value to assign to the #attribute_status property

  • :time_updated (DateTime)

    The value to assign to the #time_updated property



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
# File 'lib/oci/apm_traces/models/attribute_update_notes_response.rb', line 116

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.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_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.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.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 notes were added to or edited in this bulk operation.

Returns:

  • (String)


37
38
39
# File 'lib/oci/apm_traces/models/attribute_update_notes_response.rb', line 37

def attribute_name
  @attribute_name
end

#attribute_name_spaceString

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

Returns:

  • (String)


53
54
55
# File 'lib/oci/apm_traces/models/attribute_update_notes_response.rb', line 53

def attribute_name_space
  @attribute_name_space
end

#attribute_statusString

[Required] Status of the attribute after this operation. The attribute can have one of the following statuses after the update notes 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 notes operation. ATTRIBUTE_NOTES_UPDATED - The attribute's notes have been updated with the given notes. 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. The length of the notes is more than a 1000 characters. 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. NOTES_TOO_LONG - Attribute notes were too long (more than 1000 chars).

Returns:

  • (String)


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

def attribute_status
  @attribute_status
end

#notesString

[Required] Notes added to or edited for this attribute.

Returns:

  • (String)


42
43
44
# File 'lib/oci/apm_traces/models/attribute_update_notes_response.rb', line 42

def notes
  @notes
end

#operation_typeString

[Required] Type of operation - UPDATE_NOTES.

Returns:

  • (String)


47
48
49
# File 'lib/oci/apm_traces/models/attribute_update_notes_response.rb', line 47

def operation_type
  @operation_type
end

#time_updatedDateTime

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

Returns:

  • (DateTime)


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

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

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



77
78
79
80
81
82
83
84
85
86
87
88
# File 'lib/oci/apm_traces/models/attribute_update_notes_response.rb', line 77

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

.swagger_typesObject

Attribute type mapping.



91
92
93
94
95
96
97
98
99
100
101
102
# File 'lib/oci/apm_traces/models/attribute_update_notes_response.rb', line 91

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



203
204
205
206
207
208
209
210
211
212
213
# File 'lib/oci/apm_traces/models/attribute_update_notes_response.rb', line 203

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

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



238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
# File 'lib/oci/apm_traces/models/attribute_update_notes_response.rb', line 238

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


218
219
220
# File 'lib/oci/apm_traces/models/attribute_update_notes_response.rb', line 218

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



227
228
229
# File 'lib/oci/apm_traces/models/attribute_update_notes_response.rb', line 227

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

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



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

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



265
266
267
# File 'lib/oci/apm_traces/models/attribute_update_notes_response.rb', line 265

def to_s
  to_hash.to_s
end