Class: OCI::OsManagementHub::Models::SysadminEventData

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/os_management_hub/models/sysadmin_event_data.rb

Overview

Data related to the sysadmin event.

Constant Summary collapse

RESOLUTION_STATUS_ENUM =
[
  RESOLUTION_STATUS_SUCCEEDED = 'SUCCEEDED'.freeze,
  RESOLUTION_STATUS_FAILED = 'FAILED'.freeze,
  RESOLUTION_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 = {}) ⇒ SysadminEventData

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# File 'lib/oci/os_management_hub/models/sysadmin_event_data.rb', line 88

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

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

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

  self.error_cause = attributes[:'errorCause'] if attributes[:'errorCause']

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

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

  self.error_log = attributes[:'errorLog'] if attributes[:'errorLog']

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

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

  self.attempted_resolutions = attributes[:'attemptedResolutions'] if attributes[:'attemptedResolutions']

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

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

  self.resolution_status = attributes[:'resolutionStatus'] if attributes[:'resolutionStatus']

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

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

  self.resolution_log = attributes[:'resolutionLog'] if attributes[:'resolutionLog']

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

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

  self.additional_details = attributes[:'additionalDetails'] if attributes[:'additionalDetails']

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

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

Instance Attribute Details

#additional_detailsOCI::OsManagementHub::Models::WorkRequestEventDataAdditionalDetails



43
44
45
# File 'lib/oci/os_management_hub/models/sysadmin_event_data.rb', line 43

def additional_details
  @additional_details
end

#attempted_resolutionsArray<String>

[Required] The actions used to attempt fixing the error.

Returns:

  • (Array<String>)


32
33
34
# File 'lib/oci/os_management_hub/models/sysadmin_event_data.rb', line 32

def attempted_resolutions
  @attempted_resolutions
end

#error_causeString

[Required] The commands executed by the agent that caused the error.

Returns:

  • (String)


24
25
26
# File 'lib/oci/os_management_hub/models/sysadmin_event_data.rb', line 24

def error_cause
  @error_cause
end

#error_logString

[Required] The output log of the error.

Returns:

  • (String)


28
29
30
# File 'lib/oci/os_management_hub/models/sysadmin_event_data.rb', line 28

def error_log
  @error_log
end

#error_summaryString

Brief description on how this error is categorized.

Returns:

  • (String)


20
21
22
# File 'lib/oci/os_management_hub/models/sysadmin_event_data.rb', line 20

def error_summary
  @error_summary
end

#resolution_logString

[Required] The log output after the resolutions.

Returns:

  • (String)


40
41
42
# File 'lib/oci/os_management_hub/models/sysadmin_event_data.rb', line 40

def resolution_log
  @resolution_log
end

#resolution_statusString

[Required] Indicates if the event succeeded.

Returns:

  • (String)


36
37
38
# File 'lib/oci/os_management_hub/models/sysadmin_event_data.rb', line 36

def resolution_status
  @resolution_status
end

Class Method Details

.attribute_mapObject

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



46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/oci/os_management_hub/models/sysadmin_event_data.rb', line 46

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'error_summary': :'errorSummary',
    'error_cause': :'errorCause',
    'error_log': :'errorLog',
    'attempted_resolutions': :'attemptedResolutions',
    'resolution_status': :'resolutionStatus',
    'resolution_log': :'resolutionLog',
    'additional_details': :'additionalDetails'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



61
62
63
64
65
66
67
68
69
70
71
72
73
# File 'lib/oci/os_management_hub/models/sysadmin_event_data.rb', line 61

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'error_summary': :'String',
    'error_cause': :'String',
    'error_log': :'String',
    'attempted_resolutions': :'Array<String>',
    'resolution_status': :'String',
    'resolution_log': :'String',
    'additional_details': :'OCI::OsManagementHub::Models::WorkRequestEventDataAdditionalDetails'
    # 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



157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/oci/os_management_hub/models/sysadmin_event_data.rb', line 157

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

  self.class == other.class &&
    error_summary == other.error_summary &&
    error_cause == other.error_cause &&
    error_log == other.error_log &&
    attempted_resolutions == other.attempted_resolutions &&
    resolution_status == other.resolution_status &&
    resolution_log == other.resolution_log &&
    additional_details == other.additional_details
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



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File 'lib/oci/os_management_hub/models/sysadmin_event_data.rb', line 193

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


173
174
175
# File 'lib/oci/os_management_hub/models/sysadmin_event_data.rb', line 173

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



182
183
184
# File 'lib/oci/os_management_hub/models/sysadmin_event_data.rb', line 182

def hash
  [error_summary, error_cause, error_log, attempted_resolutions, resolution_status, resolution_log, additional_details].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



226
227
228
229
230
231
232
233
234
235
# File 'lib/oci/os_management_hub/models/sysadmin_event_data.rb', line 226

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



220
221
222
# File 'lib/oci/os_management_hub/models/sysadmin_event_data.rb', line 220

def to_s
  to_hash.to_s
end