Class: OCI::ApmTraces::Models::BulkUnpinMetadata

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

Overview

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

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_UNPIN = 'UNPIN'.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 = {}) ⇒ BulkUnpinMetadata

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_unpin_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_unpinned = attributes[:'attributesUnpinned'] if attributes[:'attributesUnpinned']

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

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

  self.synthetic_attributes_unpinned = attributes[:'syntheticAttributesUnpinned'] if attributes[:'syntheticAttributesUnpinned']

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

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

Instance Attribute Details

#attributes_unpinnedInteger

[Required] Total number attributes (both string and numeric) in TRACES namespace that were unpinned.

Returns:

  • (Integer)


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

def attributes_unpinned
  @attributes_unpinned
end

#operation_statusString

[Required] Operation status of the bulk unpin operation. SUCCESS - The bulk unpin operation has succeeded and all the attributes in the bulk unpin request have been unpinned by this operation. The following are error statuses for the bulk unpin operation. EMPTY_ATTRIBUTE_LIST - The bulk unpin request object was empty and did not contain any attributes to be unpinned. 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_unpin_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_unpin_metadata.rb', line 39

def operation_type
  @operation_type
end

#synthetic_attributes_unpinnedInteger

Total number attributes (both string and numeric) in SYNTHETIC namespace that were unpinned.

Returns:

  • (Integer)


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

def synthetic_attributes_unpinned
  @synthetic_attributes_unpinned
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_unpin_metadata.rb', line 52

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'operation_status': :'operationStatus',
    'operation_type': :'operationType',
    'attributes_unpinned': :'attributesUnpinned',
    'synthetic_attributes_unpinned': :'syntheticAttributesUnpinned'
    # 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_unpin_metadata.rb', line 64

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'operation_status': :'String',
    'operation_type': :'String',
    'attributes_unpinned': :'Integer',
    'synthetic_attributes_unpinned': :'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_unpin_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_unpinned == other.attributes_unpinned &&
    synthetic_attributes_unpinned == other.synthetic_attributes_unpinned
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_unpin_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_unpin_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_unpin_metadata.rb', line 171

def hash
  [operation_status, operation_type, attributes_unpinned, synthetic_attributes_unpinned].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_unpin_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_unpin_metadata.rb', line 209

def to_s
  to_hash.to_s
end