Class: OCI::LogAnalytics::Models::RecallArchivedDataDetails

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/log_analytics/models/recall_archived_data_details.rb

Overview

This is the input used to recall archived data

Constant Summary collapse

DATA_TYPE_ENUM =
[
  DATA_TYPE_LOG = 'LOG'.freeze,
  DATA_TYPE_LOOKUP = 'LOOKUP'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ RecallArchivedDataDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :compartment_id (String)

    The value to assign to the #compartment_id property

  • :time_data_ended (DateTime)

    The value to assign to the #time_data_ended property

  • :time_data_started (DateTime)

    The value to assign to the #time_data_started property

  • :data_type (String)

    The value to assign to the #data_type property

  • :log_sets (String)

    The value to assign to the #log_sets property

  • :query (String)

    The value to assign to the #query property

  • :purpose (String)

    The value to assign to the #purpose property

  • :is_recall_new_data_only (BOOLEAN)

    The value to assign to the #is_recall_new_data_only property



95
96
97
98
99
100
101
102
103
104
105
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
# File 'lib/oci/log_analytics/models/recall_archived_data_details.rb', line 95

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

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

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

  self.time_data_ended = attributes[:'timeDataEnded'] if attributes[:'timeDataEnded']

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

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

  self.time_data_started = attributes[:'timeDataStarted'] if attributes[:'timeDataStarted']

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

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

  self.data_type = attributes[:'dataType'] if attributes[:'dataType']

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

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

  self.log_sets = attributes[:'logSets'] if attributes[:'logSets']

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

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

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

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

  self.is_recall_new_data_only = attributes[:'isRecallNewDataOnly'] unless attributes[:'isRecallNewDataOnly'].nil?
  self.is_recall_new_data_only = false if is_recall_new_data_only.nil? && !attributes.key?(:'isRecallNewDataOnly') # rubocop:disable Style/StringLiterals

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

  self.is_recall_new_data_only = attributes[:'is_recall_new_data_only'] unless attributes[:'is_recall_new_data_only'].nil?
  self.is_recall_new_data_only = false if is_recall_new_data_only.nil? && !attributes.key?(:'isRecallNewDataOnly') && !attributes.key?(:'is_recall_new_data_only') # rubocop:disable Style/StringLiterals
end

Instance Attribute Details

#compartment_idString

[Required] This is the compartment OCID for permission checking

Returns:

  • (String)


19
20
21
# File 'lib/oci/log_analytics/models/recall_archived_data_details.rb', line 19

def compartment_id
  @compartment_id
end

#data_typeString

This is the type of the log data to be recalled

Returns:

  • (String)


31
32
33
# File 'lib/oci/log_analytics/models/recall_archived_data_details.rb', line 31

def data_type
  @data_type
end

#is_recall_new_data_onlyBOOLEAN

This indicates if only new data has to be recalled in this recall request

Returns:

  • (BOOLEAN)


47
48
49
# File 'lib/oci/log_analytics/models/recall_archived_data_details.rb', line 47

def is_recall_new_data_only
  @is_recall_new_data_only
end

#log_setsString

This is a list of comma-separated log sets that recalled data belongs to.

Returns:

  • (String)


35
36
37
# File 'lib/oci/log_analytics/models/recall_archived_data_details.rb', line 35

def log_sets
  @log_sets
end

#purposeString

This is the purpose of the recall

Returns:

  • (String)


43
44
45
# File 'lib/oci/log_analytics/models/recall_archived_data_details.rb', line 43

def purpose
  @purpose
end

#queryString

This is the query that identifies the recalled data.

Returns:

  • (String)


39
40
41
# File 'lib/oci/log_analytics/models/recall_archived_data_details.rb', line 39

def query
  @query
end

#time_data_endedDateTime

[Required] This is the end of the time interval

Returns:

  • (DateTime)


23
24
25
# File 'lib/oci/log_analytics/models/recall_archived_data_details.rb', line 23

def time_data_ended
  @time_data_ended
end

#time_data_startedDateTime

[Required] This is the start of the time interval

Returns:

  • (DateTime)


27
28
29
# File 'lib/oci/log_analytics/models/recall_archived_data_details.rb', line 27

def time_data_started
  @time_data_started
end

Class Method Details

.attribute_mapObject

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



50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/oci/log_analytics/models/recall_archived_data_details.rb', line 50

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'compartmentId',
    'time_data_ended': :'timeDataEnded',
    'time_data_started': :'timeDataStarted',
    'data_type': :'dataType',
    'log_sets': :'logSets',
    'query': :'query',
    'purpose': :'purpose',
    'is_recall_new_data_only': :'isRecallNewDataOnly'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



66
67
68
69
70
71
72
73
74
75
76
77
78
79
# File 'lib/oci/log_analytics/models/recall_archived_data_details.rb', line 66

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'compartment_id': :'String',
    'time_data_ended': :'DateTime',
    'time_data_started': :'DateTime',
    'data_type': :'String',
    'log_sets': :'String',
    'query': :'String',
    'purpose': :'String',
    'is_recall_new_data_only': :'BOOLEAN'
    # 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



159
160
161
162
163
164
165
166
167
168
169
170
171
# File 'lib/oci/log_analytics/models/recall_archived_data_details.rb', line 159

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

  self.class == other.class &&
    compartment_id == other.compartment_id &&
    time_data_ended == other.time_data_ended &&
    time_data_started == other.time_data_started &&
    data_type == other.data_type &&
    log_sets == other.log_sets &&
    query == other.query &&
    purpose == other.purpose &&
    is_recall_new_data_only == other.is_recall_new_data_only
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



196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/oci/log_analytics/models/recall_archived_data_details.rb', line 196

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


176
177
178
# File 'lib/oci/log_analytics/models/recall_archived_data_details.rb', line 176

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



185
186
187
# File 'lib/oci/log_analytics/models/recall_archived_data_details.rb', line 185

def hash
  [compartment_id, time_data_ended, time_data_started, data_type, log_sets, query, purpose, is_recall_new_data_only].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



229
230
231
232
233
234
235
236
237
238
# File 'lib/oci/log_analytics/models/recall_archived_data_details.rb', line 229

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



223
224
225
# File 'lib/oci/log_analytics/models/recall_archived_data_details.rb', line 223

def to_s
  to_hash.to_s
end