Class: OCI::ApmTraces::Models::BulkUpdateAttributeMetadata

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

Overview

Metadata about the bulk attribute update operation. The bulk attribute update operation is atomic and binary. If the processing of any of the attributes in the bulk attribute update request results in a processing or validation error, then none of the attributes updated.

Constant Summary collapse

OPERATION_STATUS_ENUM =
[
  OPERATION_STATUS_SUCCESS = 'SUCCESS'.freeze,
  OPERATION_STATUS_EMPTY_ATTRIBUTE_LIST = 'EMPTY_ATTRIBUTE_LIST'.freeze,
  OPERATION_STATUS_INVALID_BULK_REQUEST = 'INVALID_BULK_REQUEST'.freeze,
  OPERATION_STATUS_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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ BulkUpdateAttributeMetadata

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/oci/apm_traces/models/bulk_update_attribute_metadata.rb', line 85

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

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

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

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

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

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

  self.synthetic_attributes_updated = attributes[:'syntheticAttributesUpdated'] if attributes[:'syntheticAttributesUpdated']

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

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

Instance Attribute Details

#attributes_updatedInteger

[Required] Total number attributes (both string and numeric) in TRACES namespace for which properties were updated.

Returns:

  • (Integer)


44
45
46
# File 'lib/oci/apm_traces/models/bulk_update_attribute_metadata.rb', line 44

def attributes_updated
  @attributes_updated
end

#operation_statusString

[Required] Operation status of the bulk update attribute operation. SUCCESS - The bulk attribute update request has succeeded and all the attributes in the request have been updated. The following are error statuses for the bulk update attributes operation. EMPTY_ATTRIBUTE_LIST - The bulk update attributes request object was empty and did not contain any attributes for which properties had to be updated. INVALID_BULK_REQUEST - The bulk request contains invalid attribute(s), or attribute(s) that resulted in a validation error, or an attribute that resulted in a processing error.

Returns:

  • (String)


34
35
36
# File 'lib/oci/apm_traces/models/bulk_update_attribute_metadata.rb', line 34

def operation_status
  @operation_status
end

#operation_typeString

[Required] Type of operation.

Returns:

  • (String)


39
40
41
# File 'lib/oci/apm_traces/models/bulk_update_attribute_metadata.rb', line 39

def operation_type
  @operation_type
end

#synthetic_attributes_updatedInteger

Total number attributes (both string and numeric) in SYNTHETIC namespace for which properties were updated.

Returns:

  • (Integer)


49
50
51
# File 'lib/oci/apm_traces/models/bulk_update_attribute_metadata.rb', line 49

def synthetic_attributes_updated
  @synthetic_attributes_updated
end

Class Method Details

.attribute_mapObject

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



52
53
54
55
56
57
58
59
60
61
# File 'lib/oci/apm_traces/models/bulk_update_attribute_metadata.rb', line 52

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'operation_status': :'operationStatus',
    'operation_type': :'operationType',
    'attributes_updated': :'attributesUpdated',
    'synthetic_attributes_updated': :'syntheticAttributesUpdated'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



64
65
66
67
68
69
70
71
72
73
# File 'lib/oci/apm_traces/models/bulk_update_attribute_metadata.rb', line 64

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'operation_status': :'String',
    'operation_type': :'String',
    'attributes_updated': :'Integer',
    'synthetic_attributes_updated': :'Integer'
    # 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



149
150
151
152
153
154
155
156
157
# File 'lib/oci/apm_traces/models/bulk_update_attribute_metadata.rb', line 149

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

  self.class == other.class &&
    operation_status == other.operation_status &&
    operation_type == other.operation_type &&
    attributes_updated == other.attributes_updated &&
    synthetic_attributes_updated == other.synthetic_attributes_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



182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
# File 'lib/oci/apm_traces/models/bulk_update_attribute_metadata.rb', line 182

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


162
163
164
# File 'lib/oci/apm_traces/models/bulk_update_attribute_metadata.rb', line 162

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



171
172
173
# File 'lib/oci/apm_traces/models/bulk_update_attribute_metadata.rb', line 171

def hash
  [operation_status, operation_type, attributes_updated, synthetic_attributes_updated].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



215
216
217
218
219
220
221
222
223
224
# File 'lib/oci/apm_traces/models/bulk_update_attribute_metadata.rb', line 215

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



209
210
211
# File 'lib/oci/apm_traces/models/bulk_update_attribute_metadata.rb', line 209

def to_s
  to_hash.to_s
end