Class: OCI::ApmTraces::Models::AttributeUnpinResponse

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

Overview

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

Constant Summary collapse

OPERATION_TYPE_ENUM =
[
  OPERATION_TYPE_UNPIN = 'UNPIN'.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_UNPINNED = 'ATTRIBUTE_UNPINNED'.freeze,
  ATTRIBUTE_STATUS_DUPLICATE_ATTRIBUTE = 'DUPLICATE_ATTRIBUTE'.freeze,
  ATTRIBUTE_STATUS_INVALID_ATTRIBUTE = 'INVALID_ATTRIBUTE'.freeze,
  ATTRIBUTE_STATUS_ATTRIBUTE_NOT_FOUND = 'ATTRIBUTE_NOT_FOUND'.freeze,
  ATTRIBUTE_STATUS_ATTRIBUTE_NOT_PROCESSED = 'ATTRIBUTE_NOT_PROCESSED'.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 = {}) ⇒ AttributeUnpinResponse

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

  • :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



106
107
108
109
110
111
112
113
114
115
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
# File 'lib/oci/apm_traces/models/attribute_unpin_response.rb', line 106

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.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 that was unpinned by this bulk operation.

Returns:

  • (String)


36
37
38
# File 'lib/oci/apm_traces/models/attribute_unpin_response.rb', line 36

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)


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

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 unpin 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 attribute unpin operation. ATTRIBUTE_UNPINNED - The attribute is marked unpinned and associated notes have been cleared. 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 size of the attribute is more than a 1000 chars. ATTRIBUTE_NOT_FOUND - The attribute was not found in the set of pinned attributes. ATTRIBUTE_NOT_PROCESSED - The attribute was not processed, as there was another attribute in this bulk request collection that resulted in a processing error.

Returns:

  • (String)


62
63
64
# File 'lib/oci/apm_traces/models/attribute_unpin_response.rb', line 62

def attribute_status
  @attribute_status
end

#operation_typeString

[Required] Type of operation - unpin.

Returns:

  • (String)


41
42
43
# File 'lib/oci/apm_traces/models/attribute_unpin_response.rb', line 41

def operation_type
  @operation_type
end

#time_updatedDateTime

[Required] Time when the attribute was activated or deactivated. Note that ingest might not have picked up the changes even if this time has elapsed.

Returns:

  • (DateTime)


67
68
69
# File 'lib/oci/apm_traces/models/attribute_unpin_response.rb', line 67

def time_updated
  @time_updated
end

Class Method Details

.attribute_mapObject

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



70
71
72
73
74
75
76
77
78
79
80
# File 'lib/oci/apm_traces/models/attribute_unpin_response.rb', line 70

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

.swagger_typesObject

Attribute type mapping.



83
84
85
86
87
88
89
90
91
92
93
# File 'lib/oci/apm_traces/models/attribute_unpin_response.rb', line 83

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'attribute_name': :'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



191
192
193
194
195
196
197
198
199
200
# File 'lib/oci/apm_traces/models/attribute_unpin_response.rb', line 191

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

  self.class == other.class &&
    attribute_name == other.attribute_name &&
    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



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/apm_traces/models/attribute_unpin_response.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/apm_traces/models/attribute_unpin_response.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/apm_traces/models/attribute_unpin_response.rb', line 214

def hash
  [attribute_name, 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



258
259
260
261
262
263
264
265
266
267
# File 'lib/oci/apm_traces/models/attribute_unpin_response.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/apm_traces/models/attribute_unpin_response.rb', line 252

def to_s
  to_hash.to_s
end