Class: OCI::DatabaseMigration::Models::AdvisorReport

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database_migration/models/advisor_report.rb

Overview

Pre-Migration advisor report details.

Constant Summary collapse

RESULT_ENUM =
[
  RESULT_FATAL = 'FATAL'.freeze,
  RESULT_BLOCKER = 'BLOCKER'.freeze,
  RESULT_WARNING = 'WARNING'.freeze,
  RESULT_INFORMATIONAL = 'INFORMATIONAL'.freeze,
  RESULT_PASS = 'PASS'.freeze,
  RESULT_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ AdvisorReport

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
# File 'lib/oci/database_migration/models/advisor_report.rb', line 90

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

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

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

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

  self.number_of_fatal = attributes[:'numberOfFatal'] if attributes[:'numberOfFatal']

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

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

  self.number_of_fatal_blockers = attributes[:'numberOfFatalBlockers'] if attributes[:'numberOfFatalBlockers']

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

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

  self.number_of_warnings = attributes[:'numberOfWarnings'] if attributes[:'numberOfWarnings']

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

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

  self.number_of_informational_results = attributes[:'numberOfInformationalResults'] if attributes[:'numberOfInformationalResults']

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

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

Instance Attribute Details

#number_of_fatalInteger

[Required] Number of Fatal results in the advisor report.

Returns:

  • (Integer)


33
34
35
# File 'lib/oci/database_migration/models/advisor_report.rb', line 33

def number_of_fatal
  @number_of_fatal
end

#number_of_fatal_blockersInteger

[Required] Number of Fatal Blocker results in the advisor report.

Returns:

  • (Integer)


38
39
40
# File 'lib/oci/database_migration/models/advisor_report.rb', line 38

def number_of_fatal_blockers
  @number_of_fatal_blockers
end

#number_of_informational_resultsInteger

[Required] Number of Informational results in the advisor report.

Returns:

  • (Integer)


48
49
50
# File 'lib/oci/database_migration/models/advisor_report.rb', line 48

def number_of_informational_results
  @number_of_informational_results
end

#number_of_warningsInteger

[Required] Number of Warning results in the advisor report.

Returns:

  • (Integer)


43
44
45
# File 'lib/oci/database_migration/models/advisor_report.rb', line 43

def number_of_warnings
  @number_of_warnings
end

#report_location_detailsOCI::DatabaseMigration::Models::AdvisorReportLocationDetails



23
24
25
# File 'lib/oci/database_migration/models/advisor_report.rb', line 23

def report_location_details
  @report_location_details
end

#resultString

[Required] Pre-Migration advisor result.

Returns:

  • (String)


28
29
30
# File 'lib/oci/database_migration/models/advisor_report.rb', line 28

def result
  @result
end

Class Method Details

.attribute_mapObject

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



51
52
53
54
55
56
57
58
59
60
61
62
# File 'lib/oci/database_migration/models/advisor_report.rb', line 51

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'report_location_details': :'reportLocationDetails',
    'result': :'result',
    'number_of_fatal': :'numberOfFatal',
    'number_of_fatal_blockers': :'numberOfFatalBlockers',
    'number_of_warnings': :'numberOfWarnings',
    'number_of_informational_results': :'numberOfInformationalResults'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/oci/database_migration/models/advisor_report.rb', line 65

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'report_location_details': :'OCI::DatabaseMigration::Models::AdvisorReportLocationDetails',
    'result': :'String',
    'number_of_fatal': :'Integer',
    'number_of_fatal_blockers': :'Integer',
    'number_of_warnings': :'Integer',
    'number_of_informational_results': :'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
158
159
# File 'lib/oci/database_migration/models/advisor_report.rb', line 149

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

  self.class == other.class &&
    report_location_details == other.report_location_details &&
    result == other.result &&
    number_of_fatal == other.number_of_fatal &&
    number_of_fatal_blockers == other.number_of_fatal_blockers &&
    number_of_warnings == other.number_of_warnings &&
    number_of_informational_results == other.number_of_informational_results
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



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

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


164
165
166
# File 'lib/oci/database_migration/models/advisor_report.rb', line 164

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



173
174
175
# File 'lib/oci/database_migration/models/advisor_report.rb', line 173

def hash
  [report_location_details, result, number_of_fatal, number_of_fatal_blockers, number_of_warnings, number_of_informational_results].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



217
218
219
220
221
222
223
224
225
226
# File 'lib/oci/database_migration/models/advisor_report.rb', line 217

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



211
212
213
# File 'lib/oci/database_migration/models/advisor_report.rb', line 211

def to_s
  to_hash.to_s
end